i40iw: Allocate a sdbuf per CQP WQE
authorChien Tin Tung <chien.tin.tung@intel.com>
Tue, 21 Nov 2017 22:18:30 +0000 (16:18 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Feb 2018 10:07:56 +0000 (11:07 +0100)
commitf10f5b89c13635c32ebf6435c7849aef46e2ef4e
treef1aedd40f50da6b4ae4cfc02a975799805d0e47e
parent97ef3a5027b043bcb6a9c4aeefdcbfe4cf6221f7
i40iw: Allocate a sdbuf per CQP WQE

[ Upstream commit 100d6de2ced538c539d923dc14a1b5cbae234503 ]

Currently there is only one sdbuf per Control QP (CQP) for
programming Segment Descriptor (SD). If multiple SD work
requests are posted simultaneously, the sdbuf is reused
by all WQEs and new WQEs can corrupt previous WQEs sdbuf
leading to incorrect SD programming.

Fix this by allocating one sdbuf per CQP SQ WQE. When an
SD command is posted, it will use the corresponding sdbuf
for the WQE.

Fixes: 86dbcd0f12e9 ("i40iw: add file to handle cqp calls")
Signed-off-by: Chien Tin Tung <chien.tin.tung@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/hw/i40iw/i40iw_ctrl.c
drivers/infiniband/hw/i40iw/i40iw_d.h