cxgbe/t4_tom: Fix tid accounting. An offloaded IPv6 connection uses 2
tids, not 1, in the hardware. MFC after: 3 days Sponsored by: Chelsio Communications
This commit is contained in:
parent
40d3e536c5
commit
d663d5ca23
@ -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 */
|
||||
|
@ -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 @@ do_pass_accept_req(struct sge_iq *iq, const struct rss_header *rss,
|
||||
*/
|
||||
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 @@ do_pass_accept_req(struct sge_iq *iq, const struct rss_header *rss,
|
||||
*/
|
||||
if (!in_ifhasaddr(ifp, inc.inc_laddr))
|
||||
REJECT_PASS_ACCEPT();
|
||||
|
||||
ntids = 1;
|
||||
}
|
||||
|
||||
e = get_l2te_for_nexthop(pi, ifp, &inc);
|
||||
@ -1343,7 +1349,7 @@ do_pass_accept_req(struct sge_iq *iq, const struct rss_header *rss,
|
||||
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 @@ do_pass_accept_req(struct sge_iq *iq, const struct rss_header *rss,
|
||||
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. */
|
||||
|
@ -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
|
||||
|
@ -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 *);
|
||||
|
Loading…
Reference in New Issue
Block a user