From patchwork Tue Jul 25 20:56:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Damato X-Patchwork-Id: 12607 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a985:0:b0:3e4:2afc:c1 with SMTP id t5csp19349vqo; Tue, 25 Jul 2023 14:26:16 -0700 (PDT) X-Google-Smtp-Source: APBJJlFcvqnMoqQERxeKUpkmPZcJ+m81BGyfeZAylY5pzC1q5YZvtxzqNRCM3d9dW/8wjBb4sMpB X-Received: by 2002:a05:6a20:8c:b0:138:60e:9c4 with SMTP id 12-20020a056a20008c00b00138060e09c4mr162921pzg.23.1690320375769; Tue, 25 Jul 2023 14:26:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690320375; cv=none; d=google.com; s=arc-20160816; b=FhUuB0ogKs9QhTvWrZexDFyHQwzhEwtzx1VxFyDT3AcUK/3DC1FmL3LwoFtEX64oGS EiDKADuleF3hT6b5rN7Zwp4gqDc/vF4yQ7LqmRIBoUuvuV7Zq4O6cRlocUuqXzi1Sy2/ z6r4EFMn0qyPJWjl2jeqSgiRj4h6GTn9uNIW+ES0s0f6eELlZ/bMEuBxb9k05aoVWbJZ z3PfVykuvLyyJUTDuYbljmmbwOQvCOs9dGblYYkyMzRPHwgkcjX5gix7nuT34xAWZ+NU /iqxJHx+HYetYUYMeeZl5eoef6/CeImg5LMkT7//MUfvpIj3SAruv+3Oyxb1R6k8Ppvu PSLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=0e2cyChRqGI3tRbPoTL2xt8a8S3w5QsHlIz9nls3pyY=; fh=YmNHRqTz/ynt2W3UBid+/UPDXJ3nchQQDPQ9jC/HTiM=; b=GyimL8upZspMh3R99pOnqy7z+xAvfC9tNwPh9gVg/nTSS/4bOyRlnBOA97Vgt/+6vQ RXYqJJCut7G0tgkeyj7c+Vod0sHC5pbWV0ydsjtoOZ3USs1V1GNbYeA9jLPBOgd4Ht2m bjFmpuRu77vWmWuEL+xZmPEzF9fzI41NCMisGsk7oM0t4+ujpV5QoBOVGllpnRUiksKw BUswzDVIFv0LKcniUTGNoGsLXXet/vCx+9rb7dFaPMfoioClN+oTH1auYisWb7TDzekW 3pc3jCQYULmX1I3IscmUpBaG3YoMKum/Yyy7cCpvIPz9sRba8QaqCMaEPQjFwJFQnkL6 tIxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fastly.com header.s=google header.b=jqTc+EfX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fastly.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b26-20020a6567da000000b00541cfaad532si8755838pgs.613.2023.07.25.14.25.37; Tue, 25 Jul 2023 14:26:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@fastly.com header.s=google header.b=jqTc+EfX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fastly.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231190AbjGYU5U (ORCPT + 99 others); Tue, 25 Jul 2023 16:57:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229689AbjGYU5S (ORCPT ); Tue, 25 Jul 2023 16:57:18 -0400 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C12099 for ; Tue, 25 Jul 2023 13:57:17 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-98e011f45ffso873711566b.3 for ; Tue, 25 Jul 2023 13:57:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; t=1690318636; x=1690923436; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=0e2cyChRqGI3tRbPoTL2xt8a8S3w5QsHlIz9nls3pyY=; b=jqTc+EfXLmgZjGC5kaOFEqmUgycSNXUK+9S9FdyQ0cMymNN2iWk/hArhhAgo9rTNHF H9QrAzXDh2icbAEwLauwyV9rLpcyupXjv1T+/GLSt6se8WoJTJ4MILxmmeuDD6l4brg0 eWxMj2P1BZkN/Xh0xXyWejzikAoGhzT5BgZro= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690318636; x=1690923436; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0e2cyChRqGI3tRbPoTL2xt8a8S3w5QsHlIz9nls3pyY=; b=ExnNE5//KBHrjz70qhHLnqjoqTOOCtoHSZQAyu0/1QrIc/uMsAEb/fnahtTgpr9CIr 7VnrqSlF2j5WycRg2Y+rgOg24BXXF6ZvLnDJxzUpr4cwizguu/NuS+HHL1Jg66eFKNXm RSbmRg56KfzbDIIlUaQsumeWP0P/QGOKzvPCraCqR6Ss6QZ2F9vM+gLB6CEw9ZjUpZwY 2wNBDL0lPil60kdCHoZEZmfsvSlGVkekupA3cqv3N037nSkSAVV//G5lUCR0+fXPhQxW +jy7xIZRNmxKI0KhgyHJN2m7bgNjspq5O7Cck/874KvS2Lb6raZ+81FtoggK12Hxr/L/ J93g== X-Gm-Message-State: ABy/qLZljxA1MBLNlYrh+zLECfjns0ALdO6G+2/YFrVGat7eMHU0/T19 e6mORfGVFNiQFH4CVY+PJFfoLg== X-Received: by 2002:a17:906:5594:b0:957:1df0:9cbf with SMTP id y20-20020a170906559400b009571df09cbfmr13487ejp.19.1690318636028; Tue, 25 Jul 2023 13:57:16 -0700 (PDT) Received: from localhost.localdomain ([2620:11a:c019:0:65e:3115:2f58:c5fd]) by smtp.gmail.com with ESMTPSA id h19-20020a1709062dd300b0097073f1ed84sm8704186eji.4.2023.07.25.13.57.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jul 2023 13:57:15 -0700 (PDT) From: Joe Damato To: netdev@vger.kernel.org, saeedm@nvidia.com, tariqt@nvidia.com, ecree@solarflare.com, andrew@lunn.ch, kuba@kernel.org, davem@davemloft.net, leon@kernel.org, pabeni@redhat.com, arnd@arndb.de Cc: linux-kernel@vger.kernel.org, Joe Damato Subject: [net-next v2 0/2] rxfh with custom RSS fixes Date: Tue, 25 Jul 2023 20:56:53 +0000 Message-Id: <20230725205655.310165-1-jdamato@fastly.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772429378251972192 X-GMAIL-MSGID: 1772429378251972192 Greetings: Welcome to v2, now via net-next. No functional changes; only style changes (see the summary below). While attempting to get the RX flow hash key for a custom RSS context on my mlx5 NIC, I got an error: $ sudo ethtool -u eth1 rx-flow-hash tcp4 context 1 Cannot get RX network flow hashing options: Invalid argument I dug into this a bit and noticed two things: 1. ETHTOOL_GRXFH supports custom RSS contexts, but ETHTOOL_SRXFH does not. I moved the copy logic out of ETHTOOL_GRXFH and into a helper so that both ETHTOOL_{G,S}RXFH now call it, which fixes ETHTOOL_SRXFH. This is patch 1/2. 2. mlx5 defaulted to RSS context 0 for both ETHTOOL_{G,S}RXFH paths. I have modified the driver to support custom contexts for both paths. It is now possible to get and set the flow hash key for custom RSS contexts with mlx5. This is patch 2/2. See commit messages for more details. Thanks. v2: - Rebased on net-next - Adjusted arguments of mlx5e_rx_res_rss_get_hash_fields and mlx5e_rx_res_rss_set_hash_fields to move rss_idx next to the rss argument - Changed return value of both mlx5e_rx_res_rss_get_hash_fields and mlx5e_rx_res_rss_set_hash_fields to -ENOENT when the rss entry is NULL - Changed order of local variables in mlx5e_get_rss_hash_opt and mlx5e_set_rss_hash_opt Joe Damato (2): net: ethtool: Unify ETHTOOL_{G,S}RXFH rxnfc copy net/mlx5: Fix flowhash key set/get for custom RSS .../ethernet/mellanox/mlx5/core/en/rx_res.c | 25 +++++-- .../ethernet/mellanox/mlx5/core/en/rx_res.h | 7 +- .../mellanox/mlx5/core/en_fs_ethtool.c | 33 +++++--- net/ethtool/ioctl.c | 75 ++++++++++--------- 4 files changed, 86 insertions(+), 54 deletions(-)