From patchwork Thu Nov 23 13:53:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 10072855 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 39EC4602DC for ; Thu, 23 Nov 2017 13:54:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D8E929ED5 for ; Thu, 23 Nov 2017 13:54:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 226392A0A9; Thu, 23 Nov 2017 13:54:17 +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 A1F7729ED5 for ; Thu, 23 Nov 2017 13:54:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752769AbdKWNyP (ORCPT ); Thu, 23 Nov 2017 08:54:15 -0500 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:49380 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752805AbdKWNyN (ORCPT ); Thu, 23 Nov 2017 08:54:13 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from yishaih@mellanox.com) with ESMTPS (AES256-SHA encrypted); 23 Nov 2017 15:54:10 +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 vANDsAMc006238; Thu, 23 Nov 2017 15:54:10 +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 vANDs9Xo019237; Thu, 23 Nov 2017 15:54:09 +0200 Received: (from yishaih@localhost) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8/Submit) id vANDs9Tv019231; Thu, 23 Nov 2017 15:54:09 +0200 From: Yishai Hadas To: linux-rdma@vger.kernel.org Cc: yishaih@mellanox.com, maorg@mellanox.com, majd@mellanox.com Subject: [PATCH rdma-core 1/3] verbs: Add support in RSS of the inner packet Date: Thu, 23 Nov 2017 15:53:24 +0200 Message-Id: <1511445206-18951-2-git-send-email-yishaih@mellanox.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1511445206-18951-1-git-send-email-yishaih@mellanox.com> References: <1511445206-18951-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: Maor Gottlieb Some user space application would like to do RSS on the inner packet fields instead of the outer. When user will set the IBV_RX_HASH_INNER bit with one of the other hash fields, then the RSS will be on the inner packet. Signed-off-by: Maor Gottlieb Reviewed-by: Yishai Hadas --- libibverbs/man/ibv_create_qp_ex.3 | 21 +++++++++++++++++++++ libibverbs/verbs.h | 7 ++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/libibverbs/man/ibv_create_qp_ex.3 b/libibverbs/man/ibv_create_qp_ex.3 index 865b5fe..e7f8a49 100644 --- a/libibverbs/man/ibv_create_qp_ex.3 +++ b/libibverbs/man/ibv_create_qp_ex.3 @@ -72,6 +72,27 @@ uint64_t rx_hash_fields_mask; /* RX fields that should particip .in -8 }; .fi + +.nf +enum ibv_rx_hash_fields { +.in +8 +IBV_RX_HASH_SRC_IPV4 = 1 << 0, +IBV_RX_HASH_DST_IPV4 = 1 << 1, +IBV_RX_HASH_SRC_IPV6 = 1 << 2, +IBV_RX_HASH_DST_IPV6 = 1 << 3, +IBV_RX_HASH_SRC_PORT_TCP = 1 << 4, +IBV_RX_HASH_DST_PORT_TCP = 1 << 5, +IBV_RX_HASH_SRC_PORT_UDP = 1 << 6, +IBV_RX_HASH_DST_PORT_UDP = 1 << 7, +.in -8 +}; + +/* When set with one of the L3/L4 fields, + * then the RSS will be applied on the inner packet. */ +#define IBV_RX_HASH_INNER = (1ULL << 31) + +.fi + .PP The function .B ibv_create_qp_ex() diff --git a/libibverbs/verbs.h b/libibverbs/verbs.h index ce18b50..dcfe94e 100644 --- a/libibverbs/verbs.h +++ b/libibverbs/verbs.h @@ -241,9 +241,14 @@ enum ibv_rx_hash_fields { IBV_RX_HASH_SRC_PORT_TCP = 1 << 4, IBV_RX_HASH_DST_PORT_TCP = 1 << 5, IBV_RX_HASH_SRC_PORT_UDP = 1 << 6, - IBV_RX_HASH_DST_PORT_UDP = 1 << 7 + IBV_RX_HASH_DST_PORT_UDP = 1 << 7, }; +/* In some systems/compilers enum range might be limited + * to signed 4 bytes. + */ +#define IBV_RX_HASH_INNER (1ULL << 31) + struct ibv_rss_caps { uint32_t supported_qpts; uint32_t max_rwq_indirection_tables;