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 87854A0547; Thu, 16 Jun 2022 04:42:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7844A42C19; Thu, 16 Jun 2022 04:41:32 +0200 (CEST) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2119.outbound.protection.outlook.com [40.107.100.119]) by mails.dpdk.org (Postfix) with ESMTP id 797EC4114F for ; Thu, 16 Jun 2022 04:41:30 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iFG+FttV3iEJmDuA0drih5GnwbMjn5xumV+mGNbh1a/si2tbHDz7GTCuWRMAlLdr1mMUmE0FCUttRUBznlYztyOzDrNOvwXEfXNgZvahjfoJfWljGH43pRWzkHgq55yz6sqZB9qCE9yTaRNISscA7OR/aCLUAqw6MaGEoTRWeKInhUxayekwnixKEx0JVx9+PcSvd1Yuxl1aw7pJvPq7bSZTjYyCSammb2tKzYn4WoMFCjXQa5/7YOlr8qIWAD+JYvPuj/zDfyaUST8RULRxsJjUFkB2+AQBF5WlY5rDxBxFEg/LczdHitL/ALjebkm6uTOE3YPPvcXhRLcx3rFDkg== 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=Ps59K+CJlDJqAX7otwPhxoxid5aN04pVRStJxmDA0CI=; b=DsjJIXTr0qLsBMHdb9ILHmK6IgREonVVeMBKAfdkipj0zhB/687JIbT5C717IUmNfqVvsNd2aO5Ry/r28pqSXv507//JNRheG27/JA6fIP/zvBnYDmqO1O0mV1rq98OH3mboJsysKEK6fmNG5ovqI8eqvpXuSMPLEhSuoGMq3IJr0ApDU9qz5GNgOiOh4DgIYhbPak06GknOHMBlGErqCoqK+UI7RrATaSnADRtuQhDDAE/CwYuPcucguPU8KIh/2rP0ZgUMt2ySN+/8HocLNqOkVNtQUNLX7AoYR0ByVC5HeFvYiUg5vEkgoQvMtoXsAFCDu1+VIB+xG9K0V+brtQ== 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=Ps59K+CJlDJqAX7otwPhxoxid5aN04pVRStJxmDA0CI=; b=Dgd+G5bF8H1u9OaTQbzsIOSPVT+EL+Ia2xiXU7gW9cxwIf2Efw1zu6MdihIRwhHK5WCaq3ZWRBLVrv3ZSj3y7cadAArl8dwXMzGQJ1nVE98h5CtoWDbwz3fRaLhi6IOnzT5o9B7X/vrwm+n7IF/zBIS2scft8/ZieeKD0KgFfa4= 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 CY4PR1301MB1912.namprd13.prod.outlook.com (2603:10b6:910:46::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.11; Thu, 16 Jun 2022 02:41:29 +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.5353.011; Thu, 16 Jun 2022 02:41:29 +0000 From: Jin Liu To: dev@dpdk.org Cc: niklas.soderlund@corigine.com, Jin Liu , Diana Wang , Peng Zhang , Chaoyong He Subject: [PATCH v2 15/15] net/nfp: modify RSS logic Date: Thu, 16 Jun 2022 04:39:39 +0200 Message-Id: <20220616023939.1798769-16-jin.liu@corigine.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220616023939.1798769-1-jin.liu@corigine.com> References: <20220602015304.710197-1-jin.liu@corigine.com> <20220616023939.1798769-1-jin.liu@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0087.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:190::20) 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: bac7c1dd-6d3c-4709-cf9e-08da4f41b720 X-MS-TrafficTypeDiagnostic: CY4PR1301MB1912: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: PPlIikwd/K2LGzNOOfzygGhZ2q0RPWOasi2DBbxsGInzcEvBRjfqkfwFDY25Q3W9oEHQBqG4PmOZqE8ZHgryz2RQ1v8wtLdxblVt6CO6CXv7LmYzUiE7NKscm7oRbJGZUAEweGizAvndAU9FhzhrnVy9nD19eh0079EBXewX2k3TbN6ikiGu1CYWXhCBXaRx/+slkoKe3PUsPUUIvdO8vwiMVIr3fCXgzIYxguuB34GFXfCidHcnRTC+DrdjhrRExHDJ4XhKZNwdpGjdKq7XNsnOE6fgklWXNwR4GLP0KPlHnd2GMWLA9p40+i09y2TBKjc71Gk9c97Kl2oqe+A5bTv60E1FgzGhMq8XHUdWisOXck/XxeXusEOJofGjDQXFtyt9TMDvSkzat52IpGFqYTj8Y/d8/8oI7BKw5NAVEyyuD65QuOosuuy2AGzcmDXx0uiX+9ZK+NBAoKU4gOzgdhR4ZEaFo8/CXJui6jK2i+OSO2QAaS43DJofjOyCJLermyWUmjmrshLUIF0IJl4mwwYQeGrN1B0ia8ISL3K45ybtevX4tlgHFShmJ1PVScnydVezsd14ia7cEorCwF+Z8G1bSqm+emylJb27z1kYv1yDcgvjDTohf9AeUQrLc9p9xJZOC82R99Axp8KuekV9PcGr5imCyfeUZ7UddocmcmEUEep8pa0Eh7XQn8ghI1AhevkAzNPP3NZDXA0kQybBnA== 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)(136003)(346002)(39830400003)(396003)(366004)(41300700001)(1076003)(107886003)(2616005)(5660300002)(8936002)(6666004)(86362001)(6486002)(508600001)(26005)(6512007)(44832011)(52116002)(6506007)(66574015)(38100700002)(2906002)(38350700002)(4326008)(36756003)(6916009)(83380400001)(316002)(66946007)(8676002)(66476007)(66556008)(54906003)(186003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UkNGS3VQSjFuZExNVFZ5TE9Fb1NlOHhkaUpXYVB4NHcrOVgxNkh1Y1p3K0Er?= =?utf-8?B?NXpnR1VWcmRIZnFLQlc5STIxSVZBRzFnaHVuNVpEaCtONXJMRXMydWhsMDl2?= =?utf-8?B?Skd5MnpUeTZVNUtmelF6TWxzN3ltcjVnWG1qcW1VTVJJMDIvTVNuOHpsM0pK?= =?utf-8?B?Nks0anhtV3U4SVk5L2F1YldOVlAwYk9XcnNCbTlRZ3ZOWTdCeVVFdFV5Q0I0?= =?utf-8?B?ZU5nYTlvd3hwL2VKalVEaDVYUXdBMElNeGR2clE1OXk5dmdyU1FRU0R2SVRk?= =?utf-8?B?WnZJM04zTE0vZkplMFU2MEluNEIwTjRYZ2lnT2tTQndqREJUQmJDR3JrMjVN?= =?utf-8?B?RU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5UXlNUzdMWWw0UTF4?= =?utf-8?B?OUJBM2pHeUhiZmFMQ0xheVRpSzFKR0ZSOWZjWGppWWsvMy9YeGZTYmNDZ2dQ?= =?utf-8?B?S1NxWFc0WThwRDVSMlEzdXpTaVNLcE1pNVRObUJaU0ZMamhyejZDU3Jxc3hI?= =?utf-8?B?ZVU5Y2w4QTRtcEJTUlpFUFhJMzV4MC92WUZHelo1SUlIVlNJQmhndz09?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: bac7c1dd-6d3c-4709-cf9e-08da4f41b720 X-MS-Exchange-CrossTenant-AuthSource: DM6PR13MB3004.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2022 02:41:29.2851 (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: TC0XiZwt6WtM35mdGlNu3SVD7cxMpyifyJW9wJOrf9npJ8RmjF2Qa0IzYP5TFyUvbqWYIGtRuGrGQKEbEHUJ9w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1301MB1912 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 1b00f96ed3..7414c5167d 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