From patchwork Tue Nov 14 13:47:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 10057697 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B03A16023A for ; Tue, 14 Nov 2017 13:57:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9316C297BF for ; Tue, 14 Nov 2017 13:57:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 87F6A297C2; Tue, 14 Nov 2017 13:57:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ECAFF297C6 for ; Tue, 14 Nov 2017 13:57:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755411AbdKNN5u (ORCPT ); Tue, 14 Nov 2017 08:57:50 -0500 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:52340 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754802AbdKNN5p (ORCPT ); Tue, 14 Nov 2017 08:57:45 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from yishaih@mellanox.com) with ESMTPS (AES256-SHA encrypted); 14 Nov 2017 15:47:40 +0200 Received: from vnc17.mtl.labs.mlnx (vnc17.mtl.labs.mlnx [10.7.2.17]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id vAEDleFt011433; Tue, 14 Nov 2017 15:47:40 +0200 Received: from vnc17.mtl.labs.mlnx (vnc17.mtl.labs.mlnx [127.0.0.1]) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8) with ESMTP id vAEDlejr018774; Tue, 14 Nov 2017 15:47:40 +0200 Received: (from yishaih@localhost) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8/Submit) id vAEDleB6018773; Tue, 14 Nov 2017 15:47:40 +0200 From: Yishai Hadas To: linux-rdma@vger.kernel.org Cc: yishaih@mellanox.com, noaos@mellanox.com, majd@mellanox.com, dledford@redhat.com Subject: [PATCH rdma-core 2/2] verbs: Enable QP and WQ creation with PCI write end padding option Date: Tue, 14 Nov 2017 15:47:08 +0200 Message-Id: <1510667228-18579-3-git-send-email-yishaih@mellanox.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1510667228-18579-1-git-send-email-yishaih@mellanox.com> References: <1510667228-18579-1-git-send-email-yishaih@mellanox.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Noa Osherovich Update QP and WQ creation flags to allow setting the PCI write end padding capability during QP/WQ creation. Man pages were updated accordingly. Signed-off-by: Noa Osherovich Reviewed-by: Yishai Hadas --- libibverbs/cmd.c | 3 ++- libibverbs/man/ibv_create_qp_ex.3 | 1 + libibverbs/man/ibv_create_wq.3 | 3 ++- libibverbs/verbs.h | 4 +++- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/libibverbs/cmd.c b/libibverbs/cmd.c index eb5f263..62fcd0e 100644 --- a/libibverbs/cmd.c +++ b/libibverbs/cmd.c @@ -966,7 +966,8 @@ enum { CREATE_QP_EX2_SUP_CREATE_FLAGS = IBV_QP_CREATE_BLOCK_SELF_MCAST_LB | IBV_QP_CREATE_SCATTER_FCS | IBV_QP_CREATE_CVLAN_STRIPPING | - IBV_QP_CREATE_SOURCE_QPN, + IBV_QP_CREATE_SOURCE_QPN | + IBV_QP_CREATE_PCI_WRITE_END_PADDING, }; int ibv_cmd_create_qp_ex2(struct ibv_context *context, diff --git a/libibverbs/man/ibv_create_qp_ex.3 b/libibverbs/man/ibv_create_qp_ex.3 index fac0e03..865b5fe 100644 --- a/libibverbs/man/ibv_create_qp_ex.3 +++ b/libibverbs/man/ibv_create_qp_ex.3 @@ -59,6 +59,7 @@ IBV_QP_CREATE_BLOCK_SELF_MCAST_LB = 1 << 1, /* Prevent self multicast loop IBV_QP_CREATE_SCATTER_FCS = 1 << 8, /* FCS field will be scattered to host memory */ IBV_QP_CREATE_CVLAN_STRIPPING = 1 << 9, /* CVLAN field will be stripped from incoming packets */ IBV_QP_CREATE_SOURCE_QPN = 1 << 10, /* The created QP will use the source_qpn as its wire QP number */ +IBV_QP_CREATE_PCI_WRITE_END_PADDING = 1 << 11, /* Incoming packets will be padded to cacheline size */ .in -8 }; .nf diff --git a/libibverbs/man/ibv_create_wq.3 b/libibverbs/man/ibv_create_wq.3 index a540130..10fe965 100644 --- a/libibverbs/man/ibv_create_wq.3 +++ b/libibverbs/man/ibv_create_wq.3 @@ -42,7 +42,8 @@ enum ibv_wq_flags { IBV_WQ_FLAGS_CVLAN_STRIPPING = 1 << 0, /* CVLAN field will be stripped from incoming packets */ IBV_WQ_FLAGS_SCATTER_FCS = 1 << 1, /* FCS field will be scattered to host memory */ IBV_WQ_FLAGS_DELAY_DROP = 1 << 2, /* Packets won't be dropped immediately if no receive WQEs */ -IBV_WQ_FLAGS_RESERVED = 1 << 3, +IBV_WQ_FLAGS_PCI_WRITE_END_PADDING = 1 << 3, /* Incoming packets will be padded to cacheline size */ +IBV_WQ_FLAGS_RESERVED = 1 << 4, .in -8 }; .nf diff --git a/libibverbs/verbs.h b/libibverbs/verbs.h index 025e321..b39dc30 100644 --- a/libibverbs/verbs.h +++ b/libibverbs/verbs.h @@ -739,7 +739,8 @@ enum ibv_wq_flags { IBV_WQ_FLAGS_CVLAN_STRIPPING = 1 << 0, IBV_WQ_FLAGS_SCATTER_FCS = 1 << 1, IBV_WQ_FLAGS_DELAY_DROP = 1 << 2, - IBV_WQ_FLAGS_RESERVED = 1 << 3, + IBV_WQ_FLAGS_PCI_WRITE_END_PADDING = 1 << 3, + IBV_WQ_FLAGS_RESERVED = 1 << 4, }; struct ibv_wq_init_attr { @@ -848,6 +849,7 @@ enum ibv_qp_create_flags { IBV_QP_CREATE_SCATTER_FCS = 1 << 8, IBV_QP_CREATE_CVLAN_STRIPPING = 1 << 9, IBV_QP_CREATE_SOURCE_QPN = 1 << 10, + IBV_QP_CREATE_PCI_WRITE_END_PADDING = 1 << 11, }; struct ibv_rx_hash_conf {