From patchwork Sun Dec 3 16:03:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 10089325 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 2EFBE60595 for ; Sun, 3 Dec 2017 16:47:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2851A288DA for ; Sun, 3 Dec 2017 16:47:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D59628B24; Sun, 3 Dec 2017 16:47: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 9E992288DA for ; Sun, 3 Dec 2017 16:47:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752283AbdLCQrz (ORCPT ); Sun, 3 Dec 2017 11:47:55 -0500 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:35134 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752179AbdLCQry (ORCPT ); Sun, 3 Dec 2017 11:47:54 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from yishaih@mellanox.com) with ESMTPS (AES256-SHA encrypted); 3 Dec 2017 18:03:57 +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 vB3G3vjS014405; Sun, 3 Dec 2017 18:03:57 +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 vB3G3vEZ006299; Sun, 3 Dec 2017 18:03:57 +0200 Received: (from yishaih@localhost) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8/Submit) id vB3G3vHn006297; Sun, 3 Dec 2017 18:03:57 +0200 From: Yishai Hadas To: linux-rdma@vger.kernel.org Cc: yishaih@mellanox.com, maorg@mellanox.com, majd@mellanox.com Subject: [PATCH V1 rdma-core 1/3] verbs: Add support in RSS of the inner packet Date: Sun, 3 Dec 2017 18:03:35 +0200 Message-Id: <1512317017-6223-2-git-send-email-yishaih@mellanox.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1512317017-6223-1-git-send-email-yishaih@mellanox.com> References: <1512317017-6223-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 | 20 ++++++++++++++++++++ libibverbs/verbs.h | 3 ++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/libibverbs/man/ibv_create_qp_ex.3 b/libibverbs/man/ibv_create_qp_ex.3 index 865b5fe..bb2d1b6 100644 --- a/libibverbs/man/ibv_create_qp_ex.3 +++ b/libibverbs/man/ibv_create_qp_ex.3 @@ -72,6 +72,26 @@ 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, +/* When using tunneling protocol, e.g. VXLAN, then we have an inner (encapsulated packet) and outer. + * For applying RSS on the inner packet, then the following field should be set with one of the L3/L4 fields. +*/ +IBV_RX_HASH_INNER = (1UL << 31), +.in -8 +}; +.fi + .PP The function .B ibv_create_qp_ex() diff --git a/libibverbs/verbs.h b/libibverbs/verbs.h index ce18b50..0785c77 100644 --- a/libibverbs/verbs.h +++ b/libibverbs/verbs.h @@ -241,7 +241,8 @@ 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, + IBV_RX_HASH_INNER = (1UL << 31), }; struct ibv_rss_caps {