Store the ifnet rather than the port_info in each txq and rxq struct.

MFC after:	1 week
This commit is contained in:
Navdeep Parhar 2011-03-05 03:27:14 +00:00
parent aa2457e17c
commit 29ca78e104
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=219289
3 changed files with 10 additions and 10 deletions

View File

@ -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 */

View File

@ -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);
}

View File

@ -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);