On Wed, Aug 03, 2016 at 04:27:36PM -0700, Adit Ranadive wrote:
quoted hunk
This patch enables posting Verb requests and receiving responses to/from
the backend PVRDMA emulation layer.
Changes v2->v3:
- Converted pvrdma_cmd_recv to inline.
- Added a min check in the memcpy to cmd_slot.
- Removed the boolean from pvrdma_cmd_post.
Reviewed-by: Jorgen Hansen <redacted>
Reviewed-by: George Zhang <redacted>
Reviewed-by: Aditya Sarwade <redacted>
Reviewed-by: Bryan Tan <redacted>
Signed-off-by: Adit Ranadive <redacted>
---
drivers/infiniband/hw/pvrdma/pvrdma_cmd.c | 105 ++++++++++++++++++++++++++++++
1 file changed, 105 insertions(+)
create mode 100644 drivers/infiniband/hw/pvrdma/pvrdma_cmd.c
diff --git a/drivers/infiniband/hw/pvrdma/pvrdma_cmd.c b/drivers/infiniband/hw/pvrdma/pvrdma_cmd.c
new file mode 100644
index 0000000..45aa31f
--- /dev/null
+++ b/drivers/infiniband/hw/pvrdma/pvrdma_cmd.c
....
+pvrdma_cmd_post(struct pvrdma_dev *dev, union pvrdma_cmd_req *req,
+ union pvrdma_cmd_resp *resp)
+{
+ int err;
+
+ dev_dbg(&dev->pdev->dev, "post request to device\n");
+
+ /* Serializiation */
+ down(&dev->cmd_sema);
+
+ spin_lock(&dev->cmd_lock);
+ memcpy(dev->cmd_slot, req, min(PAGE_SIZE, sizeof(*req)));
No,
We already had conversation why min(..) in memcpy is wrong.
Please reread and do it properly.
Thanks