Commit a7125869 authored by Mike Marciniszyn's avatar Mike Marciniszyn Committed by Jason Gunthorpe

IB/hfi1: Get rid of tx priv backpointer

The txq has the backpointer, so this is a micro optimization for the tx
path.

Fixes: d99dc602 ("IB/hfi1: Add functions to transmit datagram ipoib packets")
Link: https://lore.kernel.org/r/20210913132836.131370.89704.stgit@awfm-01.cornelisnetworks.comReviewed-by: default avatarDennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
Signed-off-by: default avatarMike Marciniszyn <mike.marciniszyn@cornelisnetworks.com>
Signed-off-by: default avatarDennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
parent 4bf0ca0c
...@@ -133,7 +133,7 @@ static void hfi1_ipoib_check_queue_stopped(struct hfi1_ipoib_txq *txq) ...@@ -133,7 +133,7 @@ static void hfi1_ipoib_check_queue_stopped(struct hfi1_ipoib_txq *txq)
static void hfi1_ipoib_free_tx(struct ipoib_txreq *tx, int budget) static void hfi1_ipoib_free_tx(struct ipoib_txreq *tx, int budget)
{ {
struct hfi1_ipoib_dev_priv *priv = tx->priv; struct hfi1_ipoib_dev_priv *priv = tx->txq->priv;
if (likely(!tx->sdma_status)) { if (likely(!tx->sdma_status)) {
dev_sw_netstats_tx_add(priv->netdev, 1, tx->skb->len); dev_sw_netstats_tx_add(priv->netdev, 1, tx->skb->len);
...@@ -273,7 +273,7 @@ static int hfi1_ipoib_build_tx_desc(struct ipoib_txreq *tx, ...@@ -273,7 +273,7 @@ static int hfi1_ipoib_build_tx_desc(struct ipoib_txreq *tx,
static void hfi1_ipoib_build_ib_tx_headers(struct ipoib_txreq *tx, static void hfi1_ipoib_build_ib_tx_headers(struct ipoib_txreq *tx,
struct ipoib_txparms *txp) struct ipoib_txparms *txp)
{ {
struct hfi1_ipoib_dev_priv *priv = tx->priv; struct hfi1_ipoib_dev_priv *priv = tx->txq->priv;
struct hfi1_sdma_header *sdma_hdr = &tx->sdma_hdr; struct hfi1_sdma_header *sdma_hdr = &tx->sdma_hdr;
struct sk_buff *skb = tx->skb; struct sk_buff *skb = tx->skb;
struct hfi1_pportdata *ppd = ppd_from_ibp(txp->ibp); struct hfi1_pportdata *ppd = ppd_from_ibp(txp->ibp);
...@@ -383,7 +383,6 @@ static struct ipoib_txreq *hfi1_ipoib_send_dma_common(struct net_device *dev, ...@@ -383,7 +383,6 @@ static struct ipoib_txreq *hfi1_ipoib_send_dma_common(struct net_device *dev,
/* so that we can test if the sdma descriptors are there */ /* so that we can test if the sdma descriptors are there */
tx->txreq.num_desc = 0; tx->txreq.num_desc = 0;
tx->priv = priv;
tx->txq = txq; tx->txq = txq;
tx->skb = skb; tx->skb = skb;
INIT_LIST_HEAD(&tx->txreq.list); INIT_LIST_HEAD(&tx->txreq.list);
...@@ -491,7 +490,7 @@ static int hfi1_ipoib_send_dma_single(struct net_device *dev, ...@@ -491,7 +490,7 @@ static int hfi1_ipoib_send_dma_single(struct net_device *dev,
ret = hfi1_ipoib_submit_tx(txq, tx); ret = hfi1_ipoib_submit_tx(txq, tx);
if (likely(!ret)) { if (likely(!ret)) {
tx_ok: tx_ok:
trace_sdma_output_ibhdr(tx->priv->dd, trace_sdma_output_ibhdr(txq->priv->dd,
&tx->sdma_hdr.hdr, &tx->sdma_hdr.hdr,
ib_is_sc5(txp->flow.sc5)); ib_is_sc5(txp->flow.sc5));
hfi1_ipoib_check_queue_depth(txq); hfi1_ipoib_check_queue_depth(txq);
...@@ -554,7 +553,7 @@ static int hfi1_ipoib_send_dma_list(struct net_device *dev, ...@@ -554,7 +553,7 @@ static int hfi1_ipoib_send_dma_list(struct net_device *dev,
hfi1_ipoib_check_queue_depth(txq); hfi1_ipoib_check_queue_depth(txq);
trace_sdma_output_ibhdr(tx->priv->dd, trace_sdma_output_ibhdr(txq->priv->dd,
&tx->sdma_hdr.hdr, &tx->sdma_hdr.hdr,
ib_is_sc5(txp->flow.sc5)); ib_is_sc5(txp->flow.sc5));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment