diff options
author | Mike Marciniszyn <mike.marciniszyn@cornelisnetworks.com> | 2021-09-13 16:28:26 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2021-09-28 02:06:41 +0300 |
commit | d47dfc2b00e69001c8eeae71f7e25066ccc36144 (patch) | |
tree | 0bca7a5e3b00910361b7f2e3ff98e5fc5f273024 /drivers/infiniband/hw/hfi1/ipoib.h | |
parent | 450f4f6aa1a369cc3ffadc1c7e27dfab3e90199f (diff) | |
download | linux-d47dfc2b00e69001c8eeae71f7e25066ccc36144.tar.xz |
IB/hfi1: Remove cache and embed txreq in ring
This patch removes kmem cache allocation and deallocation in favor of
having the ipoib_txreq in the ring.
The consumer is now the packet sending side allocating tx descriptors from
ring and the producer is the napi interrupt handling freeing tx
descriptors.
The locks are now eliminated because the napi tx lock insures a single
consumer and the napi handling insures a single producer.
The napi poll is converted to memory poll looking for items that have been
marked completed.
Fixes: d99dc602e2a5 ("IB/hfi1: Add functions to transmit datagram ipoib packets")
Link: https://lore.kernel.org/r/20210913132826.131370.4397.stgit@awfm-01.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>
Diffstat (limited to 'drivers/infiniband/hw/hfi1/ipoib.h')
-rw-r--r-- | drivers/infiniband/hw/hfi1/ipoib.h | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/infiniband/hw/hfi1/ipoib.h b/drivers/infiniband/hw/hfi1/ipoib.h index 2cff38b105ac..4e91b7039293 100644 --- a/drivers/infiniband/hw/hfi1/ipoib.h +++ b/drivers/infiniband/hw/hfi1/ipoib.h @@ -45,21 +45,19 @@ union hfi1_ipoib_flow { /** * struct hfi1_ipoib_circ_buf - List of items to be processed - * @items: ring of items + * @items: ring of items each a power of two size * @head: ring head * @tail: ring tail * @max_items: max items + 1 that the ring can contain - * @producer_lock: producer sync lock - * @consumer_lock: consumer sync lock + * @shift: log2 of size for getting txreq */ struct ipoib_txreq; struct hfi1_ipoib_circ_buf { - struct ipoib_txreq **items; - unsigned long head; - unsigned long tail; - unsigned long max_items; - spinlock_t producer_lock; /* head sync lock */ - spinlock_t consumer_lock; /* tail sync lock */ + void *items; + u32 head; + u32 tail; + u32 max_items; + u32 shift; }; /** @@ -102,7 +100,6 @@ struct hfi1_ipoib_dev_priv { struct net_device *netdev; struct ib_device *device; struct hfi1_ipoib_txq *txqs; - struct kmem_cache *txreq_cache; struct napi_struct *tx_napis; u16 pkey; u16 pkey_index; |