From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4C4D4A0548; Fri, 3 Jun 2022 00:56:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E7C4B40691; Fri, 3 Jun 2022 00:56:53 +0200 (CEST) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2053.outbound.protection.outlook.com [40.107.212.53]) by mails.dpdk.org (Postfix) with ESMTP id 44EFB4021E for ; Fri, 3 Jun 2022 00:56:52 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mn0QHA3jI9p8sEcXMISZkHk3Y+LN01sQH1107LPvsTe/P83sjwKUdVXLspQvWlAHunR/gxbIznDSQPPCOPnRJXt1lXti2jSEkfmkbGRB1l8Pw8hNOBNagXhN+nkBhbP75V28si1wKAr4K9r99mfDgt/2YX1W5HNJFWZRp9OLlnsZw1Ayuna+9HtxbWCfA1uyEsQO1A2Ir/0SH+9dCgC9Qzqgr+EhRp7UhDL9XrT24BSZcECrJLcF0ePdu90lHOE4NxOzI5IN2B3jQpgF+ORxVNJPapOuC/j6xRzZxOiT3jdw6CIBE8t8ihZjThguUUDDMG6H7ZgPLc/exmteCA1r2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cIHfyABhX/13w9GFWy8Qv0gw4lAzSpifh6XEV8J+Ljw=; b=KDX21LC7+d5fXhw6b9PUroHnKw0jaMeVUJMCS+25YHA41VSrpYJOhsazVg0p9bobvpz+a39T/8ZMJuGF9MGltIKajykwd7NB6zTP/QxmTFC9QcLDUOgDopjv756pZlD7ZG3fOdhY671xBDGO2DtDBX6lM3RcEBm9ekTlQNQkXW7+u7Sx4+uO/rXgXl8cQD3IU4Fykcysf+TlECBkYiolPLDApkobNAgB8pWcV7xNN9FULI1j0TIQYAea8w3GOsqKniDZn25v0YLqfYMrXtlfhwgUJUbCyYY/MyVgjVbe/ZMuAsJv909ZRnkoXgMW4ExcdHAtzDjSqt0N4eHp0vu1BA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.80.198) smtp.rcpttodomain=corigine.com smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cIHfyABhX/13w9GFWy8Qv0gw4lAzSpifh6XEV8J+Ljw=; b=JFnbblg4k50mF4VqMrHuKAzBfEqAZjCpTN4eAPEN7PFA8nbFP1t7RY9zYDzG6DnXulfP+jHx3TUqIL+BPgMR11eoUrUhOZHNtMcqo1zVNaT1Jl0F7rsobXhSO8EsHTFCNRC9JcF1MXQD/5PUgiVx3E0clAFkdlKUUyFkbAJeido= Received: from DS7P222CA0009.NAMP222.PROD.OUTLOOK.COM (2603:10b6:8:2e::11) by SJ0PR02MB7712.namprd02.prod.outlook.com (2603:10b6:a03:32c::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.13; Thu, 2 Jun 2022 22:56:49 +0000 Received: from DM3NAM02FT048.eop-nam02.prod.protection.outlook.com (2603:10b6:8:2e:cafe::cd) by DS7P222CA0009.outlook.office365.com (2603:10b6:8:2e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.13 via Frontend Transport; Thu, 2 Jun 2022 22:56:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.80.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.80.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.80.198; helo=xir-pvapexch01.xlnx.xilinx.com; pr=C Received: from xir-pvapexch01.xlnx.xilinx.com (149.199.80.198) by DM3NAM02FT048.mail.protection.outlook.com (10.13.4.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5314.12 via Frontend Transport; Thu, 2 Jun 2022 22:56:49 +0000 Received: from xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) by xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Thu, 2 Jun 2022 23:56:48 +0100 Received: from smtp.xilinx.com (172.21.105.197) by xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Thu, 2 Jun 2022 23:56:47 +0100 Envelope-to: jin.liu@corigine.com, dev@dpdk.org, niklas.soderlund@corigine.com, na.wang@corigine.com, peng.zhang@corigine.com, chaoyong.he@corigine.com Received: from [10.71.116.16] (port=54838) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1nwtkF-0005e8-Iu; Thu, 02 Jun 2022 23:56:47 +0100 Message-ID: <72ca2e65-b419-ad26-a7dc-ac924845128b@xilinx.com> Date: Thu, 2 Jun 2022 23:56:47 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH 14/14] net/nfp: modify RSS logic Content-Language: en-US To: Jin Liu , CC: , Diana Wang , Peng Zhang , Chaoyong He References: <20220602015304.710197-1-jin.liu@corigine.com> <20220602015304.710197-15-jin.liu@corigine.com> From: Ferruh Yigit In-Reply-To: <20220602015304.710197-15-jin.liu@corigine.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5e076e37-09c4-41a3-542e-08da44eb2d3d X-MS-TrafficTypeDiagnostic: SJ0PR02MB7712:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 548neeYETRHa3yKBSUhx3oueSG1ETbxaX5KySfvRG5nHaeGTf83oudDcikiphByZogaO52FYTmuu67iBIjKHLFt3K7Qpw0v4rRqGnUHxDnZLOp+OXboSsP5c17EhPPzVZTpAx+NujTcup5qj5IpY3p77oVXKmF7GVgPO/980ENMc7GkJMqSCeF8RzXAvXwZQPJIGxCb7biqm3sRNKbNAuKRlJx/pyBlnQOO1EoxoLnxDgSviagCd55HkDbsOyeaWiTsadZDNHfugGvHjoATR4WEXFBq1dsIOoMkS3OpNgsaaeaG24fgC+U5ppLbqAElR5GHAlffDzIGb9Xy8i4eCg0wkJWBa+Zp3TStIHl+WxQ/FASmDOTKphvaDzIDTjEk94YopdnTwEnLmR05qg7U77rt+uRGqdadlCtE9I69hG+gw53Mds/O5Js3Tn62Dqp+efz3/S2IYStd9b1NCd5ErQIf4Fz6GXT95TI+7rCLYFes+mIfEyqm/521LcZO8Ds7QKXZ67jNpk9Ykk+FUCOP9j5cDzn81l27tykK/K3XEUth7QDR3Rgk/2oAbFihpazm8F8GgTowJpcCpILRGVPF7i5UNUgJQZ+jouypakIbxdzJiludUivIUE4VR6JT+/1dHohr3yAiCQ6QQ3cKxQeTR2I0W5u9YAb3atkuWIeJbDi8TPyDXQKXgTGQG28okQHmXFqoXazlkRet4Bd00bs51DTC7Us7ZjJoO4xfUAWIiWDc= X-Forefront-Antispam-Report: CIP:149.199.80.198; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:xir-pvapexch01.xlnx.xilinx.com; PTR:unknown-80-198.xilinx.com; CAT:NONE; SFS:(13230001)(4636009)(46966006)(36840700001)(40470700004)(36860700001)(82310400005)(36756003)(31686004)(54906003)(2906002)(70206006)(70586007)(110136005)(83380400001)(8676002)(4326008)(31696002)(426003)(316002)(44832011)(66574015)(47076005)(336012)(40460700003)(356005)(186003)(8936002)(9786002)(5660300002)(7636003)(508600001)(53546011)(26005)(2616005)(50156003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jun 2022 22:56:49.1156 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5e076e37-09c4-41a3-542e-08da44eb2d3d X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.80.198]; Helo=[xir-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT048.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR02MB7712 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 6/2/2022 2:53 AM, Jin Liu wrote: > Modify RSS-related interface functions, as the NFDK firmware support > feature NFP_NET_CFG_CTRL_RSS2 rather than NFP_NET_CFG_CTRL_RSS. > > Signed-off-by: Jin Liu > Signed-off-by: Diana Wang > Signed-off-by: Peng Zhang > Signed-off-by: Chaoyong He > Signed-off-by: Niklas Söderlund <...> > diff --git a/drivers/net/nfp/nfp_ctrl.h b/drivers/net/nfp/nfp_ctrl.h > index e73715e2aa..372d537462 100644 > --- a/drivers/net/nfp/nfp_ctrl.h > +++ b/drivers/net/nfp/nfp_ctrl.h > @@ -119,6 +119,7 @@ > #define NFP_NET_CFG_MACADDR 0x0024 > > #define NFP_NET_CFG_CTRL_LSO_ANY (NFP_NET_CFG_CTRL_LSO | NFP_NET_CFG_CTRL_LSO2) > +#define NFP_NET_CFG_CTRL_RSS_ANY (NFP_NET_CFG_CTRL_RSS | NFP_NET_CFG_CTRL_RSS2) > > /* > * Read-only words (0x0030 - 0x0050): > diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c > index 238b2b5451..bd7dd30f10 100644 > --- a/drivers/net/nfp/nfp_ethdev.c > +++ b/drivers/net/nfp/nfp_ethdev.c > @@ -123,7 +123,17 @@ nfp_net_start(struct rte_eth_dev *dev) > if (rxmode->mq_mode & RTE_ETH_MQ_RX_RSS) { > nfp_net_rss_config_default(dev); > update |= NFP_NET_CFG_UPDATE_RSS; > - new_ctrl |= NFP_NET_CFG_CTRL_RSS; > + switch (NFD_CFG_CLASS_VER_of(hw->ver)) { > + case NFP_NET_CFG_VERSION_DP_NFD3: > + new_ctrl |= NFP_NET_CFG_CTRL_RSS; > + break; > + case NFP_NET_CFG_VERSION_DP_NFDK: > + new_ctrl |= NFP_NET_CFG_CTRL_RSS2; > + break; > + default: > + PMD_INIT_LOG(ERR, "nfp_net: no fw version match"); > + return -ENODEV; > + } > } > > /* Enable device */ > diff --git a/drivers/net/nfp/nfp_ethdev_vf.c b/drivers/net/nfp/nfp_ethdev_vf.c > index bb8206c4f6..8769f07be4 100644 > --- a/drivers/net/nfp/nfp_ethdev_vf.c > +++ b/drivers/net/nfp/nfp_ethdev_vf.c > @@ -95,7 +95,17 @@ nfp_netvf_start(struct rte_eth_dev *dev) > if (rxmode->mq_mode & RTE_ETH_MQ_RX_RSS) { > nfp_net_rss_config_default(dev); > update |= NFP_NET_CFG_UPDATE_RSS; > - new_ctrl |= NFP_NET_CFG_CTRL_RSS; > + switch (NFD_CFG_CLASS_VER_of(hw->ver)) { > + case NFP_NET_CFG_VERSION_DP_NFD3: > + new_ctrl |= NFP_NET_CFG_CTRL_RSS; > + break; > + case NFP_NET_CFG_VERSION_DP_NFDK: > + new_ctrl |= NFP_NET_CFG_CTRL_RSS2; > + break; > + default: > + PMD_INIT_LOG(ERR, "nfp_net: no fw version match"); > + return -ENODEV; > + } As this FW specific changes crept into various locations, it can be harder to maintain the code. I wonder if something like below can help, what do you think: unsigned int nfp_FW_RSS[] = { // common for both PF & VF NFP_NET_CFG_CTRL_RSS, NFP_NET_CFG_CTRL_RSS2, }; new_ctrl = nfp_FW_RSS[NFD_CFG_CLASS_VER_of(hw->ver)];