Lines Matching refs:inp

90 alloc_lctx(struct tom_data *td, struct inpcb *inp, int qset)
94 INP_WLOCK_ASSERT(inp);
106 lctx->inp = inp;
107 in_pcbref(inp);
120 struct inpcb *inp = lctx->inp;
122 INP_WLOCK_ASSERT(inp);
129 CTR4(KTR_CXGB, "%s: stid %u, lctx %p, inp %p",
130 __func__, lctx->stid, lctx, lctx->inp);
135 return in_pcbrele_wlocked(inp);
158 int bucket = listen_hashfn(lctx->inp, td->listen_mask);
170 listen_hash_find(struct tom_data *td, struct inpcb *inp)
172 int bucket = listen_hashfn(inp, td->listen_mask);
177 if (lctx->inp == inp)
186 * Removes the listen_ctx structure for inp from the hash and returns it.
189 listen_hash_del(struct tom_data *td, struct inpcb *inp)
191 int bucket = listen_hashfn(inp, td->listen_mask);
196 if (lctx->inp == inp) {
208 * Releases a hold on the lctx. Must be called with the listening socket's inp
209 * locked. The inp may be freed by this function and it returns NULL to
215 struct inpcb *inp = lctx->inp;
218 INP_WLOCK_ASSERT(inp);
222 return (inp_freed ? NULL : inp);
230 struct inpcb *inp = lctx->inp;
238 req->local_port = inp->inp_lport;
239 memcpy(&req->local_ip, &inp->inp_laddr, 4);
284 struct inpcb *inp = lctx->inp;
292 INP_WLOCK(inp);
293 KASSERT(listen_hash_del(td, lctx->inp) == NULL,
294 ("%s: inp %p still in listen hash", __func__, inp));
296 INP_WUNLOCK(inp);
315 struct inpcb *inp;
325 inp = lctx->inp;
327 INP_WLOCK(inp);
341 * If the inp has been dropped (listening socket closed) then
342 * listen_stop must have run and taken the inp out of the hash.
344 if (inp->inp_flags & INP_DROPPED) {
345 KASSERT(listen_hash_del(td, inp) == NULL,
346 ("%s: inp %p still in listen hash", __func__, inp));
350 if (inp->inp_flags & INP_DROPPED && rpl->status != CPL_ERR_NONE) {
352 INP_WUNLOCK(inp);
361 if (inp->inp_flags & INP_DROPPED) {
363 INP_WUNLOCK(inp);
368 * Failed to start hardware listener. Take inp out of the hash and
373 listen_hash_del(td, inp);
375 INP_WUNLOCK(inp);
381 INP_WUNLOCK(inp);
486 struct inpcb *inp;
547 inp = lctx->inp; /* listening socket (not owned by the TOE) */
548 INP_WLOCK(inp);
549 if (__predict_false(inp->inp_flags & INP_DROPPED)) {
555 INP_WUNLOCK(inp);
559 so = inp->inp_socket;
582 toe_syncache_add(&inc, &to, &th, inp, tod, synqe);
583 INP_UNLOCK_ASSERT(inp);
595 INP_WLOCK(inp);
596 if (__predict_false(inp->inp_flags & INP_DROPPED)) {
600 __func__, inp, synqe));
605 INP_WUNLOCK(inp);
612 __func__, synqe, inp));
616 inp = release_lctx(td, lctx);
617 if (inp)
618 INP_WUNLOCK(inp);
684 struct inpcb *inp = lctx->inp, *new_inp;
693 __func__, stid, tid, lctx, inp->inp_flags);
699 INP_WLOCK(inp);
701 if (__predict_false(inp->inp_flags & INP_DROPPED)) {
711 INP_WUNLOCK(inp);
727 INP_WUNLOCK(inp);
740 so = inp->inp_socket;
759 inp = release_lctx(td, lctx);
760 if (inp)
761 INP_WUNLOCK(inp);
790 struct inpcb *inp = tp->t_inpcb;
794 INP_WLOCK_ASSERT(inp);
796 if ((inp->inp_vflag & INP_IPV4) == 0)
831 if (listen_hash_find(td, inp) != NULL)
834 lctx = alloc_lctx(td, inp, pi->first_qset);
843 CTR5(KTR_CXGB, "%s: stid %u (%s), lctx %p, inp %p", __func__,
844 lctx->stid, tcpstates[tp->t_state], lctx, inp);
849 (void) listen_hash_del(td, inp);
850 inp = release_lctx(td, lctx);
852 KASSERT(inp != NULL, ("%s: inp freed", __func__));
873 struct inpcb *inp = tp->t_inpcb;
876 INP_WLOCK_ASSERT(inp);
878 lctx = listen_hash_del(td, inp);
880 return (ENOENT); /* no hardware listener for this inp */
952 * synqe. Avoid looking at the listening socket (lctx->inp) here.
997 struct inpcb *inp = lctx->inp;
1005 INP_WLOCK(inp);
1010 INP_WUNLOCK(inp);
1022 INP_WUNLOCK(inp);
1025 inp = release_lctx(td, lctx);
1026 if (inp)
1027 INP_WUNLOCK(inp);
1048 struct inpcb *inp = lctx->inp;
1053 INP_WLOCK(inp);
1058 INP_WUNLOCK(inp);
1064 inp = release_lctx(td, lctx);
1065 if (inp)
1066 INP_WUNLOCK(inp);
1086 struct inpcb *inp = lctx->inp;
1089 INP_WLOCK_ASSERT(inp);
1120 struct inpcb *inp = sotoinpcb(so);
1126 INP_WLOCK_ASSERT(inp);