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 C55CFA0545; Thu, 23 Jun 2022 04:28:17 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5380842B98; Thu, 23 Jun 2022 04:27:32 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2124.outbound.protection.outlook.com [40.107.94.124]) by mails.dpdk.org (Postfix) with ESMTP id BCDA542B92 for ; Thu, 23 Jun 2022 04:27:28 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S8x17Ca8Kue+uMScjIAzd02PcGSx8g6YYhjjYPFYr359SIC/tSy5bprgRl56lycHDdVt5khEtGjCp7XqdL+NO64abTA2YgJ9Tk2ATaRxTuB7C/Q625r/j7+zbwqxHlEa88h5WzL7JqP3SHBkYllLxe2lJUY8XiqT2AI53WNUj9OwbIZbAnwZwUGrMaLQi6z0/KaSa8n85K7NJQwwZSGBVhXbD3o9Yr3/mRF1jOMc709mXfR8xKAA2EhS23hz6yxe5Vron9MxJrRmF48gh/D9lzt2OelDrJ7xs6C43kasOhvkiSAAXN3OtvCa5iZbGZmKJu1+uniAt/k8DoUfbfqB+Q== 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=kbiIdy9GYlaYOdYqzFu+5Gi4H8XtelBFlrwwvfmoFxw=; b=EGwn5ioElSdjOPNx+JHhEQq4P1gKmcNNjmq7QALUeEgnkkC/RP42EkZR/TYdOJ4eoJ+7e/16UNLQGpq/FNcUTptodeV66X7ST4CfXBg8F5Vm6EYyIwZCWpQua3EPF0p/k7ZyWgfy7tjBdle0nme0w9dBpaN0F7WTm7dDpJcIB8cqsAc9yswJStz2OjHajrjNSNLCccjLq/Vr/P9lqVM+dY0+Lu5DYli+qG9so9mU2/ap/bCciAW5EPFsO+IJXySEXun5qV8YCtDm+tXp0TUSW8gRJuCF2DXj85ghLFuH2iENYNKkKnNpHLVMlNECqIxSsDitqaOfn/eUU1R0pYtOrQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kbiIdy9GYlaYOdYqzFu+5Gi4H8XtelBFlrwwvfmoFxw=; b=n1bIA06knDdr7MWfWSvy01bouBXTtcR7H8KcxXNjEuWcImYtqPEzpmJIb2p4+F2lMimVHHfHWCn1A1isRBYaprl2I7KvOcZe5r1kRNqzKcEgrzCosLFHMyrOZzGJ69iU6NNZ6sb1eVxEpUWfTiri3lBncDMTJ1oq24CRYV1no/E= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from DM6PR13MB3004.namprd13.prod.outlook.com (2603:10b6:5:191::21) by MN2PR13MB3535.namprd13.prod.outlook.com (2603:10b6:208:169::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.15; Thu, 23 Jun 2022 02:27:27 +0000 Received: from DM6PR13MB3004.namprd13.prod.outlook.com ([fe80::ac31:a36a:cc15:cd35]) by DM6PR13MB3004.namprd13.prod.outlook.com ([fe80::ac31:a36a:cc15:cd35%7]) with mapi id 15.20.5373.015; Thu, 23 Jun 2022 02:27:27 +0000 From: Jin Liu To: dev@dpdk.org Cc: niklas.soderlund@corigine.com, Jin Liu , Diana Wang , Peng Zhang , Chaoyong He Subject: [PATCH v4 13/13] net/nfp: modify RSS logic Date: Thu, 23 Jun 2022 04:26:15 +0200 Message-Id: <20220623022615.3628093-14-jin.liu@corigine.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220623022615.3628093-1-jin.liu@corigine.com> References: <20220617093444.2004000-1-jin.liu@corigine.com> <20220623022615.3628093-1-jin.liu@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P265CA0222.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:33a::10) To DM6PR13MB3004.namprd13.prod.outlook.com (2603:10b6:5:191::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b097e502-50a1-45f3-83fe-08da54bfea1f X-MS-TrafficTypeDiagnostic: MN2PR13MB3535: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: h8ij3cyE6rhe8l2iv9eB8nN1NG49paTOOEGR7k1ATWdbLNpRnorpSX8beDjHI9zlE3ea6+DFDyeXpEnPkjZHZrGpwNs2mM2xBCvhAMHJflkAxixZJ3rY8b6afH/ViBNweK7ZuDKPZSQVcw1YkhX6/GKBvNt+aSJqeE+5zukQmg2eH23zhCi9ZP1BCSYcfs2jTgM06TnSCGEIPIlhLCuKivmFT9edGoX7mwia+vKtqVgLTt/GDZwEJWcrJ7ZSB/2ydfTOcKjUuQxsaxc6lhMCOXKBzv9Q2ASLogAieg/2rU5QKPNnBQItGcCDln4RtinnniV9k3/IliNU0gfQjo2GSVKpT0dWqCQUIJtMpTf90opJFnpd7qATKlrvN0+cGsA+zEK/be6hF9m1WcRqSh6E9CpZjn6RCNPBN40Jxd9KGl4PX5FnkfBc493kPnx1PzqKxsvwDN3ZhD5kIwuQ0+0sQNWBjXqR3w2W6/6QZC14PWM+D8GLG8kxC64wx4KrXAv95Op7LRyPVInZG+bsw20WpfcKPOsyq63ZAekeB2M7ow0ax0UrrMGi78hMIpMrbHWhb7SsgQSUGJsKcOYXMri4hz5UJr9R6rPdctVjmMXliEZRUlGa6FkqMEn/TusiAO0OpHgjThpTUdrI0v+JjtYuXck1T316JYF5cfIqAZWhyFgn0pSWMtvx4E3sJxk2ydrkaz8lzU7B8Bziz49nyyMkJmXV3ZzltCQshyTqu30MxQ1/qQYq0y+yclYvIgeWRwEOivzsqpoes+JtYHN/yW9mMUX+F1hXySKNO13XmkvCHoXl8rOrE8pviEtO8rDGB34F X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR13MB3004.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(4636009)(376002)(366004)(346002)(136003)(396003)(39830400003)(6666004)(107886003)(1076003)(38100700002)(38350700002)(6486002)(36756003)(66574015)(8936002)(54906003)(2616005)(6916009)(5660300002)(316002)(66556008)(52116002)(6506007)(186003)(66946007)(8676002)(4326008)(66476007)(41300700001)(86362001)(6512007)(26005)(83380400001)(478600001)(2906002)(44832011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SmhLWjdXU1U0bi83RmVkTmhDVmdHYnJXUlBuTzU0bmFCSXRHU1VlOTk5ZE1Y?= =?utf-8?B?eDA1UkN3b3pvODRTM0ZiZExEUXg3WE5YZ20yRjY0ckFXbG01b1c3T05nMXY5?= =?utf-8?B?Q3Bnenp6YnZPNWppUTZ2aGM1REJjdE4rVmI0eWxWdjlMNWU4K3QrR0kvZGRo?= =?utf-8?B?SWZncTBFYXE1dkdPanVVdmxuLzVDYjNaVm9KVEJmeGEvVmNYbnM4a2c0cGhH?= =?utf-8?B?ajc4UFNIQzdHNXMybVMyZU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-8?B?WDBSUTJibHkweUxjOGNzYW52ZytFUENQODRQbkMwTE1zelczYWNyU3R5YVMy?= =?utf-8?Q?xuUB2ULfwBYm7UdnxdfJP9fUX?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: b097e502-50a1-45f3-83fe-08da54bfea1f X-MS-Exchange-CrossTenant-AuthSource: DM6PR13MB3004.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jun 2022 02:27:27.2266 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: td+oD3YDLAju26BKLaCI9/TIdRGXqEc7Cqflje1+bdm2tzQSmGXAWHO3LDIixi4TtyDtGIyKcgWxR6Yx2jqQng== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR13MB3535 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 Now NFP NIC support two type of RSS logic, NFP_NET_CFG_CTRL_RSS and NFP_NET_CFG_CTRL_RSS2, use NFP_NET_CFG_CTRL_RSS2 if NIC capability support, otherwise use 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 --- drivers/net/nfp/nfp_common.c | 12 ++++++------ drivers/net/nfp/nfp_ctrl.h | 1 + drivers/net/nfp/nfp_ethdev.c | 5 ++++- drivers/net/nfp/nfp_ethdev_vf.c | 5 ++++- drivers/net/nfp/nfp_rxtx.c | 2 +- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/drivers/net/nfp/nfp_common.c b/drivers/net/nfp/nfp_common.c index 755c5ec4d9..0e55f0c792 100644 --- a/drivers/net/nfp/nfp_common.c +++ b/drivers/net/nfp/nfp_common.c @@ -171,7 +171,7 @@ nfp_net_configure(struct rte_eth_dev *dev) /* Checking RX mode */ if (rxmode->mq_mode & RTE_ETH_MQ_RX_RSS && - !(hw->cap & NFP_NET_CFG_CTRL_RSS)) { + !(hw->cap & NFP_NET_CFG_CTRL_RSS_ANY)) { PMD_INIT_LOG(INFO, "RSS not supported"); return -EINVAL; } @@ -769,7 +769,7 @@ nfp_net_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) .nb_mtu_seg_max = NFP_TX_MAX_MTU_SEG, }; - if (hw->cap & NFP_NET_CFG_CTRL_RSS) { + if (hw->cap & NFP_NET_CFG_CTRL_RSS_ANY) { dev_info->rx_offload_capa |= RTE_ETH_RX_OFFLOAD_RSS_HASH; dev_info->flow_type_rss_offloads = RTE_ETH_RSS_IPV4 | @@ -1080,7 +1080,7 @@ nfp_net_reta_update(struct rte_eth_dev *dev, uint32_t update; int ret; - if (!(hw->ctrl & NFP_NET_CFG_CTRL_RSS)) + if (!(hw->ctrl & NFP_NET_CFG_CTRL_RSS_ANY)) return -EINVAL; ret = nfp_net_rss_reta_write(dev, reta_conf, reta_size); @@ -1108,7 +1108,7 @@ nfp_net_reta_query(struct rte_eth_dev *dev, hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); - if (!(hw->ctrl & NFP_NET_CFG_CTRL_RSS)) + if (!(hw->ctrl & NFP_NET_CFG_CTRL_RSS_ANY)) return -EINVAL; if (reta_size != NFP_NET_CFG_RSS_ITBL_SZ) { @@ -1206,7 +1206,7 @@ nfp_net_rss_hash_update(struct rte_eth_dev *dev, rss_hf = rss_conf->rss_hf; /* Checking if RSS is enabled */ - if (!(hw->ctrl & NFP_NET_CFG_CTRL_RSS)) { + if (!(hw->ctrl & NFP_NET_CFG_CTRL_RSS_ANY)) { if (rss_hf != 0) { /* Enable RSS? */ PMD_DRV_LOG(ERR, "RSS unsupported"); return -EINVAL; @@ -1241,7 +1241,7 @@ nfp_net_rss_hash_conf_get(struct rte_eth_dev *dev, hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); - if (!(hw->ctrl & NFP_NET_CFG_CTRL_RSS)) + if (!(hw->ctrl & NFP_NET_CFG_CTRL_RSS_ANY)) return -EINVAL; rss_hf = rss_conf->rss_hf; 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 b6817c10da..673a17c26c 100644 --- a/drivers/net/nfp/nfp_ethdev.c +++ b/drivers/net/nfp/nfp_ethdev.c @@ -123,7 +123,10 @@ 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; + if (hw->cap & NFP_NET_CFG_CTRL_RSS2) + new_ctrl |= NFP_NET_CFG_CTRL_RSS2; + else + new_ctrl |= NFP_NET_CFG_CTRL_RSS; } /* Enable device */ diff --git a/drivers/net/nfp/nfp_ethdev_vf.c b/drivers/net/nfp/nfp_ethdev_vf.c index 66a1c0a36b..3f4ad3e7ab 100644 --- a/drivers/net/nfp/nfp_ethdev_vf.c +++ b/drivers/net/nfp/nfp_ethdev_vf.c @@ -95,7 +95,10 @@ 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; + if (hw->cap & NFP_NET_CFG_CTRL_RSS2) + new_ctrl |= NFP_NET_CFG_CTRL_RSS2; + else + new_ctrl |= NFP_NET_CFG_CTRL_RSS; } /* Enable device */ diff --git a/drivers/net/nfp/nfp_rxtx.c b/drivers/net/nfp/nfp_rxtx.c index 63729261c8..8429b44de0 100644 --- a/drivers/net/nfp/nfp_rxtx.c +++ b/drivers/net/nfp/nfp_rxtx.c @@ -138,7 +138,7 @@ nfp_net_set_hash(struct nfp_net_rxq *rxq, struct nfp_net_rx_desc *rxd, uint32_t hash = 0; uint32_t hash_type = 0; - if (!(hw->ctrl & NFP_NET_CFG_CTRL_RSS)) + if (!(hw->ctrl & NFP_NET_CFG_CTRL_RSS_ANY)) return; /* this is true for new firmwares */ -- 2.27.0