Lines Matching refs:inp

193 alloc_lctx(struct adapter *sc, struct inpcb *inp, struct vi_info *vi)
197 INP_WLOCK_ASSERT(inp);
203 lctx->stid = alloc_stid(sc, lctx, inp->inp_vflag & INP_IPV6);
209 if (inp->inp_vflag & INP_IPV6 &&
210 !IN6_ARE_ADDR_EQUAL(&in6addr_any, &inp->in6p_laddr)) {
211 lctx->ce = t4_hold_lip(sc, &inp->in6p_laddr, NULL);
222 lctx->inp = inp;
223 lctx->vnet = inp->inp_socket->so_vnet;
224 in_pcbref(inp);
233 struct inpcb *inp = lctx->inp;
235 INP_WLOCK_ASSERT(inp);
240 CTR4(KTR_CXGBE, "%s: stid %u, lctx %p, inp %p",
241 __func__, lctx->stid, lctx, lctx->inp);
248 return (in_pcbrele_wlocked(inp));
272 int bucket = listen_hashfn(lctx->inp, td->listen_mask);
284 listen_hash_find(struct adapter *sc, struct inpcb *inp)
287 int bucket = listen_hashfn(inp, td->listen_mask);
292 if (lctx->inp == inp)
301 * Removes the listen_ctx structure for inp from the hash and returns it.
304 listen_hash_del(struct adapter *sc, struct inpcb *inp)
307 int bucket = listen_hashfn(inp, td->listen_mask);
312 if (lctx->inp == inp) {
324 * Releases a hold on the lctx. Must be called with the listening socket's inp
325 * locked. The inp may be freed by this function and it returns NULL to
331 struct inpcb *inp = lctx->inp;
334 INP_WLOCK_ASSERT(inp);
338 return (inp_freed ? NULL : inp);
359 INP_WLOCK_ASSERT(synqe->lctx->inp);
417 struct inpcb *inp = lctx->inp;
428 req->local_port = inp->inp_lport;
430 req->local_ip = inp->inp_laddr.s_addr;
445 struct inpcb *inp = lctx->inp;
456 req->local_port = inp->inp_lport;
458 req->local_ip_hi = *(uint64_t *)&inp->in6p_laddr.s6_addr[0];
459 req->local_ip_lo = *(uint64_t *)&inp->in6p_laddr.s6_addr[8];
505 struct inpcb *inp = tp->t_inpcb;
510 INP_WLOCK_ASSERT(inp);
514 inp);
520 if (inp->inp_vflag & INP_IPV6 && IN6_IS_ADDR_LOOPBACK(&inp->in6p_laddr))
522 if (!(inp->inp_vflag & INP_IPV6) &&
523 IN_LOOPBACK(ntohl(inp->inp_laddr.s_addr)))
557 if (listen_hash_find(sc, inp) != NULL)
560 lctx = alloc_lctx(sc, inp, vi);
569 CTR6(KTR_CXGBE, "%s: stid %u (%s), lctx %p, inp %p vflag 0x%x",
570 __func__, lctx->stid, tcpstates[tp->t_state], lctx, inp,
571 inp->inp_vflag);
573 if (inp->inp_vflag & INP_IPV6)
580 (void) listen_hash_del(sc, inp);
581 inp = release_lctx(sc, lctx);
583 KASSERT(inp != NULL, ("%s: inp freed", __func__));
599 struct inpcb *inp = tp->t_inpcb;
601 INP_WLOCK_ASSERT(inp);
603 lctx = listen_hash_del(sc, inp);
605 return (ENOENT); /* no hardware listener for this inp */
627 INP_WLOCK_ASSERT(lctx->inp);
652 struct inpcb *inp;
657 inp = synqe->lctx->inp;
658 MPASS(inp != NULL);
659 INP_WLOCK_ASSERT(inp);
662 inp = release_lctx(sc, synqe->lctx);
667 return (inp);
683 struct inpcb *inp = synqe->lctx->inp;
688 INP_WLOCK(inp);
689 inp = release_synqe(sc, synqe);
690 if (inp != NULL)
691 INP_WUNLOCK(inp);
731 struct inpcb *inp = lctx->inp;
741 INP_WLOCK(inp);
753 * If the inp has been dropped (listening socket closed) then
754 * listen_stop must have run and taken the inp out of the hash.
756 if (inp->inp_flags & INP_DROPPED) {
757 KASSERT(listen_hash_del(sc, inp) == NULL,
758 ("%s: inp %p still in listen hash", __func__, inp));
762 if (inp->inp_flags & INP_DROPPED && status != CPL_ERR_NONE) {
764 INP_WUNLOCK(inp);
773 if (inp->inp_flags & INP_DROPPED) {
775 INP_WUNLOCK(inp);
780 * Failed to start hardware listener. Take inp out of the hash and
785 listen_hash_del(sc, inp);
787 INP_WUNLOCK(inp);
793 INP_WUNLOCK(inp);
806 struct inpcb *inp = lctx->inp;
824 INP_WLOCK(inp);
825 inp = release_lctx(sc, lctx);
826 if (inp != NULL)
827 INP_WUNLOCK(inp);
836 struct inpcb *inp = lctx->inp;
840 INP_WLOCK_ASSERT(inp);
841 ntids = inp->inp_vflag & INP_IPV6 ? 2 : 1;
846 inp = release_synqe(sc, synqe);
847 if (inp)
848 INP_WUNLOCK(inp);
856 INP_WLOCK(synqe->lctx->inp);
869 struct inpcb *inp = lctx->inp;
886 INP_WLOCK(inp);
896 INP_WUNLOCK(inp);
901 /* inp lock released by done_with_synqe */
916 struct inpcb *inp = lctx->inp;
929 INP_WLOCK(inp);
935 /* inp lock released by done_with_synqe */
946 struct inpcb *inp = sotoinpcb(so);
951 INP_WLOCK_ASSERT(inp);
1243 struct inpcb *inp;
1360 inp = lctx->inp; /* listening socket, not owned by TOE */
1361 INP_WLOCK(inp);
1364 if (__predict_false(inp->inp_flags & INP_DROPPED)) {
1365 INP_WUNLOCK(inp);
1368 so = inp->inp_socket;
1370 settings = *lookup_offload_policy(sc, OPEN_TYPE_PASSIVE, m, 0xffff, inp);
1373 INP_WUNLOCK(inp);
1379 INP_WUNLOCK(inp);
1389 toe_syncache_add(&inc, &to, &th, inp, tod, synqe);
1406 synqe->ulp_mode, CC_ALGO(intotcpcb(inp)), &settings);
1439 inp = synqe->lctx->inp;
1440 INP_WLOCK(inp);
1441 inp = release_synqe(sc, synqe);
1442 if (inp)
1443 INP_WUNLOCK(inp);
1496 struct inpcb *inp = lctx->inp, *new_inp;
1515 INP_WLOCK(inp);
1519 __func__, stid, tid, synqe, synqe->flags, inp->inp_flags);
1526 if (__predict_false(inp->inp_flags & INP_DROPPED)) {
1529 INP_WUNLOCK(inp);
1557 so = inp->inp_socket;
1585 inp = release_synqe(sc, synqe);
1586 if (inp != NULL)
1587 INP_WUNLOCK(inp);