From patchwork Wed Mar 15 15:27:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 9625927 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 482346048C for ; Wed, 15 Mar 2017 15:28:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B07B285A1 for ; Wed, 15 Mar 2017 15:28:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2FEED2863E; Wed, 15 Mar 2017 15:28:42 +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 D3687285A1 for ; Wed, 15 Mar 2017 15:28:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753913AbdCOP2b (ORCPT ); Wed, 15 Mar 2017 11:28:31 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:36890 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753718AbdCOP2E (ORCPT ); Wed, 15 Mar 2017 11:28:04 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from yishaih@mellanox.com) with ESMTPS (AES256-SHA encrypted); 15 Mar 2017 17:27:59 +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 v2FFRwdu020181; Wed, 15 Mar 2017 17:27:58 +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 v2FFRwUO014159; Wed, 15 Mar 2017 17:27:58 +0200 Received: (from yishaih@localhost) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8/Submit) id v2FFRwkj014158; Wed, 15 Mar 2017 17:27:58 +0200 From: Yishai Hadas To: dledford@redhat.com Cc: linux-rdma@vger.kernel.org, yishaih@mellanox.com, noaos@mellanox.com, majd@mellanox.com Subject: [PATCH V1 rdma-core 3/6] ibverbs: Allow creation of QP with cvlan stripping offload Date: Wed, 15 Mar 2017 17:27:43 +0200 Message-Id: <1489591666-14062-4-git-send-email-yishaih@mellanox.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1489591666-14062-1-git-send-email-yishaih@mellanox.com> References: <1489591666-14062-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 Allow users to create a QP that uses cvlan stripping capabilities if supported by the hardware. Setting cvlan stripping offload will cause the device to strip the cvlan from incoming raw Ethernet packets and provide its data in the matching work completion. In addition, aligned ibv_create_qp_ex's man page with current code (added ibv_qp_create_flags enum). Signed-off-by: Noa Osherovich Reviewed-by: Maor Gottlieb Reviewed-by: Yishai Hadas --- libibverbs/cmd.c | 3 ++- libibverbs/man/ibv_create_qp_ex.3 | 8 ++++++++ libibverbs/verbs.h | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/libibverbs/cmd.c b/libibverbs/cmd.c index b8fe76d..06ec671 100644 --- a/libibverbs/cmd.c +++ b/libibverbs/cmd.c @@ -926,7 +926,8 @@ static void create_qp_handle_resp_common(struct ibv_context *context, enum { CREATE_QP_EX2_SUP_CREATE_FLAGS = IBV_QP_CREATE_BLOCK_SELF_MCAST_LB | - IBV_QP_CREATE_SCATTER_FCS, + IBV_QP_CREATE_SCATTER_FCS | + IBV_QP_CREATE_CVLAN_STRIPPING, }; 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 c778d15..99ae497 100644 --- a/libibverbs/man/ibv_create_qp_ex.3 +++ b/libibverbs/man/ibv_create_qp_ex.3 @@ -52,6 +52,14 @@ uint32_t max_inline_data;/* Requested max number of data (bytes) .in -8 }; .nf +enum ibv_qp_create_flags { +.in +8 +IBV_QP_CREATE_BLOCK_SELF_MCAST_LB = 1 << 1, /* Prevent self multicast loopback */ +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 */ +.in -8 +}; +.nf struct ibv_rx_hash_conf { .in +8 uint8_t rx_hash_function; /* RX hash function, use enum ibv_rx_hash_function_flags */ diff --git a/libibverbs/verbs.h b/libibverbs/verbs.h index 3398566..c9084ea 100644 --- a/libibverbs/verbs.h +++ b/libibverbs/verbs.h @@ -780,6 +780,7 @@ enum ibv_qp_init_attr_mask { enum ibv_qp_create_flags { IBV_QP_CREATE_BLOCK_SELF_MCAST_LB = 1 << 1, IBV_QP_CREATE_SCATTER_FCS = 1 << 8, + IBV_QP_CREATE_CVLAN_STRIPPING = 1 << 9, }; struct ibv_rx_hash_conf {