IB/hfi1: Get rid of hot path divide
authorMike Marciniszyn <mike.marciniszyn@cornelisnetworks.com>
Mon, 13 Sep 2021 13:28:31 +0000 (09:28 -0400)
committerJason Gunthorpe <jgg@nvidia.com>
Mon, 27 Sep 2021 23:06:41 +0000 (20:06 -0300)
commit4bf0ca0c9f77b064ece279ff83b6d7eb679551fb
tree72ba48d5cd5abe39f2ad5d84ddc26652613505f9
parentd47dfc2b00e69001c8eeae71f7e25066ccc36144
IB/hfi1: Get rid of hot path divide

The pointer math in this statemet does a divide;
struct hfi1_ipoib_txq *txq = &priv->txqs[napi - priv->tx_napis];

Elminate the divide by embedding the struct napi_strut in the txq and
getting the txq with a container_of() using the newly embedded napi.

Fixes: d99dc602e2a5 ("IB/hfi1: Add functions to transmit datagram ipoib packets")
Link: https://lore.kernel.org/r/20210913132831.131370.3993.stgit@awfm-01.cornelisnetworks.com
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@cornelisnetworks.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/hfi1/ipoib.h
drivers/infiniband/hw/hfi1/ipoib_tx.c