aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/cxgbe
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/cxgbe')
-rw-r--r--sys/dev/cxgbe/tom/t4_connect.c2
-rw-r--r--sys/dev/cxgbe/tom/t4_listen.c14
-rw-r--r--sys/dev/cxgbe/tom/t4_tom.c10
-rw-r--r--sys/dev/cxgbe/tom/t4_tom.h4
4 files changed, 18 insertions, 12 deletions
diff --git a/sys/dev/cxgbe/tom/t4_connect.c b/sys/dev/cxgbe/tom/t4_connect.c
index 4db64102c314..f2e4ad456ef4 100644
--- a/sys/dev/cxgbe/tom/t4_connect.c
+++ b/sys/dev/cxgbe/tom/t4_connect.c
@@ -128,7 +128,7 @@ do_act_establish(struct sge_iq *iq, const struct rss_header *rss,
INP_WLOCK(inp);
toep->tid = tid;
- insert_tid(sc, tid, toep);
+ insert_tid(sc, tid, toep, inp->inp_vflag & INP_IPV6 ? 2 : 1);
if (inp->inp_flags & INP_DROPPED) {
/* socket closed by the kernel before hw told us it connected */
diff --git a/sys/dev/cxgbe/tom/t4_listen.c b/sys/dev/cxgbe/tom/t4_listen.c
index 472c9a5a9e4b..bdb93ac9a427 100644
--- a/sys/dev/cxgbe/tom/t4_listen.c
+++ b/sys/dev/cxgbe/tom/t4_listen.c
@@ -824,14 +824,16 @@ done_with_synqe(struct adapter *sc, struct synq_entry *synqe)
struct inpcb *inp = lctx->inp;
struct vi_info *vi = synqe->syn->m_pkthdr.rcvif->if_softc;
struct l2t_entry *e = &sc->l2t->l2tab[synqe->l2e_idx];
+ int ntids;
INP_WLOCK_ASSERT(inp);
+ ntids = inp->inp_vflag & INP_IPV6 ? 2 : 1;
TAILQ_REMOVE(&lctx->synq, synqe, link);
inp = release_lctx(sc, lctx);
if (inp)
INP_WUNLOCK(inp);
- remove_tid(sc, synqe->tid);
+ remove_tid(sc, synqe->tid, ntids);
release_tid(sc, synqe->tid, &sc->sge.ctrlq[vi->pi->port_id]);
t4_l2t_release(e);
release_synqe(synqe); /* removed from synq list */
@@ -1180,7 +1182,7 @@ do_pass_accept_req(struct sge_iq *iq, const struct rss_header *rss,
struct l2t_entry *e = NULL;
int rscale, mtu_idx, rx_credits, rxqid, ulp_mode;
struct synq_entry *synqe = NULL;
- int reject_reason, v;
+ int reject_reason, v, ntids;
uint16_t vid;
#ifdef INVARIANTS
unsigned int opcode = G_CPL_OPCODE(be32toh(OPCODE_TID(cpl)));
@@ -1254,6 +1256,8 @@ found:
*/
if (!in6_ifhasaddr(ifp, &inc.inc6_laddr))
REJECT_PASS_ACCEPT();
+
+ ntids = 2;
} else {
/* Don't offload if the ifcap isn't enabled */
@@ -1266,6 +1270,8 @@ found:
*/
if (!in_ifhasaddr(ifp, inc.inc_laddr))
REJECT_PASS_ACCEPT();
+
+ ntids = 1;
}
e = get_l2te_for_nexthop(pi, ifp, &inc);
@@ -1343,7 +1349,7 @@ found:
synqe->rcv_bufsize = rx_credits;
atomic_store_rel_ptr(&synqe->wr, (uintptr_t)wr);
- insert_tid(sc, tid, synqe);
+ insert_tid(sc, tid, synqe, ntids);
TAILQ_INSERT_TAIL(&lctx->synq, synqe, link);
hold_synqe(synqe); /* hold for the duration it's in the synq */
hold_lctx(lctx); /* A synqe on the list has a ref on its lctx */
@@ -1372,7 +1378,7 @@ found:
if (m)
m->m_pkthdr.rcvif = hw_ifp;
- remove_tid(sc, synqe->tid);
+ remove_tid(sc, synqe->tid, ntids);
free(wr, M_CXGBE);
/* Yank the synqe out of the lctx synq. */
diff --git a/sys/dev/cxgbe/tom/t4_tom.c b/sys/dev/cxgbe/tom/t4_tom.c
index 3df2313fa998..5445e265f7dc 100644
--- a/sys/dev/cxgbe/tom/t4_tom.c
+++ b/sys/dev/cxgbe/tom/t4_tom.c
@@ -307,7 +307,7 @@ release_offload_resources(struct toepcb *toep)
t4_l2t_release(toep->l2te);
if (tid >= 0) {
- remove_tid(sc, tid);
+ remove_tid(sc, tid, toep->ce ? 2 : 1);
release_tid(sc, tid, toep->ctrlq);
}
@@ -420,12 +420,12 @@ final_cpl_received(struct toepcb *toep)
}
void
-insert_tid(struct adapter *sc, int tid, void *ctx)
+insert_tid(struct adapter *sc, int tid, void *ctx, int ntids)
{
struct tid_info *t = &sc->tids;
t->tid_tab[tid] = ctx;
- atomic_add_int(&t->tids_in_use, 1);
+ atomic_add_int(&t->tids_in_use, ntids);
}
void *
@@ -445,12 +445,12 @@ update_tid(struct adapter *sc, int tid, void *ctx)
}
void
-remove_tid(struct adapter *sc, int tid)
+remove_tid(struct adapter *sc, int tid, int ntids)
{
struct tid_info *t = &sc->tids;
t->tid_tab[tid] = NULL;
- atomic_subtract_int(&t->tids_in_use, 1);
+ atomic_subtract_int(&t->tids_in_use, ntids);
}
void
diff --git a/sys/dev/cxgbe/tom/t4_tom.h b/sys/dev/cxgbe/tom/t4_tom.h
index 48223b0d95d4..c0a5288e9ad8 100644
--- a/sys/dev/cxgbe/tom/t4_tom.h
+++ b/sys/dev/cxgbe/tom/t4_tom.h
@@ -306,10 +306,10 @@ void free_toepcb(struct toepcb *);
void offload_socket(struct socket *, struct toepcb *);
void undo_offload_socket(struct socket *);
void final_cpl_received(struct toepcb *);
-void insert_tid(struct adapter *, int, void *);
+void insert_tid(struct adapter *, int, void *, int);
void *lookup_tid(struct adapter *, int);
void update_tid(struct adapter *, int, void *);
-void remove_tid(struct adapter *, int);
+void remove_tid(struct adapter *, int, int);
void release_tid(struct adapter *, int, struct sge_wrq *);
int find_best_mtu_idx(struct adapter *, struct in_conninfo *, int);
u_long select_rcv_wnd(struct socket *);