From 29ca78e1040b8e248b965984064ffc920d49c984 Mon Sep 17 00:00:00 2001 From: Navdeep Parhar Date: Sat, 5 Mar 2011 03:27:14 +0000 Subject: [PATCH] Store the ifnet rather than the port_info in each txq and rxq struct. MFC after: 1 week --- sys/dev/cxgbe/adapter.h | 4 ++-- sys/dev/cxgbe/t4_main.c | 3 +-- sys/dev/cxgbe/t4_sge.c | 13 +++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index 283fd12b4865..b25b2a43771a 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -314,7 +314,7 @@ struct sge_txq { struct mbuf *m; /* held up due to temporary resource shortage */ struct task resume_tx; - struct port_info *port; /* the port this txq belongs to */ + struct ifnet *ifp; /* the interface this txq belongs to */ /* stats for common events first */ @@ -343,7 +343,7 @@ struct sge_rxq { struct sge_fl fl; unsigned int flags; - struct port_info *port; /* the port this rxq belongs to */ + struct ifnet *ifp; /* the interface this rxq belongs to */ struct lro_ctrl lro; /* LRO state */ /* stats for common events first */ diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index b5b1c65880cd..430ce087e735 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -2649,10 +2649,9 @@ void cxgbe_txq_start(void *arg, int count) { struct sge_txq *txq = arg; - struct ifnet *ifp = txq->port->ifp; TXQ_LOCK(txq); - txq_start(ifp, txq); + txq_start(txq->ifp, txq); TXQ_UNLOCK(txq); } diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index fc74215469b7..e9647685b114 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -531,11 +531,10 @@ t4_intr_data(void *arg) { struct sge_rxq *rxq = arg; struct sge_iq *iq = arg; + struct adapter *sc = iq->adapter; struct rsp_ctrl *ctrl; struct sge_fl *fl = &rxq->fl; - struct port_info *pi = rxq->port; - struct ifnet *ifp = pi->ifp; - struct adapter *sc = pi->adapter; + struct ifnet *ifp = rxq->ifp; const struct rss_header *rss; const struct cpl_rx_pkt *cpl; int ndescs = 0, rsp_type; @@ -1193,7 +1192,7 @@ alloc_rxq(struct port_info *pi, struct sge_rxq *rxq, int intr_idx, int idx) if (pi->ifp->if_capenable & IFCAP_LRO) rxq->flags |= RXQ_LRO_ENABLED; #endif - rxq->port = pi; + rxq->ifp = pi->ifp; children = SYSCTL_CHILDREN(pi->oid_rxq); @@ -1246,7 +1245,7 @@ alloc_txq(struct port_info *pi, struct sge_txq *txq, int idx) struct sysctl_oid *oid; struct sysctl_oid_list *children; - txq->port = pi; + txq->ifp = pi->ifp; TASK_INIT(&txq->resume_tx, 0, cxgbe_txq_start, txq); mtx_init(&eq->eq_lock, eq->lockname, NULL, MTX_DEF); @@ -2393,9 +2392,11 @@ handle_sge_egr_update(struct adapter *sc, const struct cpl_sge_egr_update *cpl) unsigned int qid = G_EGR_QID(ntohl(cpl->opcode_qid)); struct sge *s = &sc->sge; struct sge_txq *txq; + struct port_info *pi; txq = (void *)s->eqmap[qid - s->eq_start]; - taskqueue_enqueue(txq->port->tq, &txq->resume_tx); + pi = txq->ifp->if_softc; + taskqueue_enqueue(pi->tq, &txq->resume_tx); txq->egr_update++; return (0);