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 E799EA0548; Thu, 2 Jun 2022 03:55:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1DB6E42BAC; Thu, 2 Jun 2022 03:55:13 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2131.outbound.protection.outlook.com [40.107.223.131]) by mails.dpdk.org (Postfix) with ESMTP id CD91B42BA7 for ; Thu, 2 Jun 2022 03:55:11 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jLlrba/0/hbI8iJXorRjvTpSffPMYiEnH6oDgZ1LIfXUTJQc5eEHc8sBVMMS3KJ3/PXWYUt9s8gWKFZLV8PK/VByhK0ck2Y1+q1lF5aCUw5wNUGBg+k9qd5i8xKo/MqzXqL1Xp2tQwnYZ3vDRdaA5NVzOo+BtuZorJ0sxOTIILVGP7NuymJiuRbhnduJ+pURaDlQDgLkLEWgUAgYqQ0D4q4icGEHYydxkxqPJMjQkRK1/SQPAQJhcXohvhzLLVIWOSMjcWxJK4vWUxU/evzOfM9h9PUU+4CbfsJwTdqKC/QjsYfNUnvut88evgZzW098Y83ggP602YsS5m08OWecqg== 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=totDLpgkclqp5hRt1FjaRX6T4eRA8X2uUonn91MoJF8=; b=Qo1XChdApy3OJ34yL25AUlR4ZH1wkYsceSvjEeW8cJuHA/7PpzWIMV6SiH3bycGWBa/qwjfppNobyLQ+27iMSqXFZ3/ArIiDP4oEw+L3hiPwljY22RFNnnfjtrsd9x5JUTkHu4v+0WaI3jzxKdlrqVAeiyHzXppvZfOUQ9fEdVOxkud9FNoJlui2H6nb0mdeizH9chrYyX3my+R2OGZ4uwEOr82ratCk9d1saudwq9d8n5ZAdQCnX2Lzu19CiO+25EH9GHuplDMF3TbEYTqaHFr37qEi4heQasWu+WGD7VhVTcS/54qS65ihRVJSVGlKh56ms76Wma1AnIf3fvHSIw== 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=totDLpgkclqp5hRt1FjaRX6T4eRA8X2uUonn91MoJF8=; b=UmG/bkkOlDUseUFoGOJX8FfbZs46QQ78hib2/S/gBKRgFvyjwE//e7vVEgemkTV50tVf+yVdZW1JH34y9OEWMPmqKKD4GXp09dHK4kYHQd2+TbT+SkplzKfr7zvBGQ5pds+2Mct2jbJd2ujSfR9s3bBWHYqrv/4zgNyQhuRAL3M= 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 DM4PR13MB5858.namprd13.prod.outlook.com (2603:10b6:8:46::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.11; Thu, 2 Jun 2022 01:55:10 +0000 Received: from DM6PR13MB3004.namprd13.prod.outlook.com ([fe80::d902:ed7d:82bb:c753]) by DM6PR13MB3004.namprd13.prod.outlook.com ([fe80::d902:ed7d:82bb:c753%4]) with mapi id 15.20.5314.013; Thu, 2 Jun 2022 01:55:10 +0000 From: Jin Liu To: dev@dpdk.org Cc: niklas.soderlund@corigine.com, Jin Liu , Diana Wang , Peng Zhang , Chaoyong He Subject: [PATCH 14/14] net/nfp: modify RSS logic Date: Thu, 2 Jun 2022 03:53:04 +0200 Message-Id: <20220602015304.710197-15-jin.liu@corigine.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220602015304.710197-1-jin.liu@corigine.com> References: <20220602015304.710197-1-jin.liu@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0457.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1aa::12) 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: 0fab5eeb-78e9-4168-429e-08da443aed3b X-MS-TrafficTypeDiagnostic: DM4PR13MB5858: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: fpjQuch1R32jeO2dbqsYC6IjDEY5pdjzF84sVgrgUo+RDlfFL9xmvq7vpvZXPjAnZ0HN+Jw3l68HqB7GHYDXKSlptmkpTI6qpHb5G+TwIoV4No8ijB9lyGpSOePMPTh2BCw7IYpi7rtw97vL1s0utvmLwAYAxuQEtyWwgz3LX0mLU+K4KVeC0JckON6J6yUeFBq6oGjiyrSiWGQDqWta7xenyXoHd4X7hQf1oziqXUoBTCXFXcwDO7KWk2nHjaY/ZHOXU4GziGeckuKV/rQRE5pTy7oazBmKruz5zKZW0RQ/cAOAs5yEMjpVnjsPwe8VwogXAotP3iOLXJxPIIzTwRiGCz2DbOUpwF6bzGn8KIywxTfmvVyaOLo4vLHX/SzwzAy5U3D6bXTon22Q8I7+ReEe2U8O7UtnrJvTnQSopNl7Yl++cZzpP/6fYkBwBsStCX01sTHV/76XySHomsHH+xrLK0kIhd51rXovqUSLzRIUCQT5bWWuykS1HwzHD+6Ej0os7rlCXq+vSUb0Ii0Ed3+LllVDqPZBIEc7KSFHLjcPzurQDv1Nsqx/xItta7jHiyqGQDHOrSG3/nvcZlnMM10j8xLxiMVC6ec7rbJwfnVSx6+s0E610SieqYds1vxc/Icq7w2MmJmRt0mDM/xwQfgmFUU10E5W9DMSg2KwSzbc1VE7o3GXZFmUOjjJIJhG8txseBo73qfYwjhlPDtb9A== 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:(13230001)(4636009)(346002)(366004)(396003)(136003)(376002)(39840400004)(36756003)(186003)(66574015)(83380400001)(5660300002)(4326008)(44832011)(8936002)(2906002)(6916009)(54906003)(1076003)(107886003)(6506007)(316002)(2616005)(41300700001)(8676002)(66946007)(66476007)(6666004)(66556008)(26005)(6512007)(52116002)(38100700002)(38350700002)(86362001)(6486002)(508600001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RGl5aFBtcU83Z1VDbkpybWpsZzd2SGpCWEtjTjYrRWNrOE00a2pnSlFhS2NM?= =?utf-8?B?amNzL3VPL256cFNINWVkbkFRTHhXTk9wdHlLMUpFbm52WWhYMWNPWHppOCtH?= =?utf-8?B?ZzFlN1NXWGNRcVVBbmVVc1dXVVBqUXVjNDhoNE8wOVU3d0F3UVA1Y3h6WlJV?= =?utf-8?B?WndkMmYrd1BINTV5cFZWN3NCMS95YmZlK25nRHBQdm0ra3QrMU5QSkoybFQr?= =?utf-8?B?SlBvemIyRHBzNkhOQk1Nb2F2T2piV1BER2N6NWcwL2RwY2RNZmh1MVJhVklx?= =?utf-8?B?YXlEbWxQcDlGeVY1Z1NWY1ZVOEtiQ2pMNnlhZnVxMlpLNU42V2FuZjNKUmpS?= =?utf-8?B?S1QyNldZRUlFdDcvdWJMSV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N2R3KzZQU01P?= =?utf-8?B?Tmd5THE1YnBGdEFoaTBxMCtFQ1RsM1BFQ0hLa3VmMnlKQmg4eEVmNDdzRzJN?= =?utf-8?B?U1BodnJRZUhWQ0w5M1gzTVc4b2o5L3cwanRaMk9scHNzd0FHcWcwZ1RCZDlJ?= =?utf-8?B?UFBXMDB4L0M0UE5ZZGZaWjJTTlpWa0FMemQ1WENEcEF6QTlWRCtyQT09?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0fab5eeb-78e9-4168-429e-08da443aed3b X-MS-Exchange-CrossTenant-AuthSource: DM6PR13MB3004.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jun 2022 01:55:10.7722 (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: C1Uc4kOVYxKQAtwjzjLySB7kaO7UAex+20NxahMdCMHvyi+b5Q7O0qt758IGA5HZdrJCela+eec33zZdfs2ciQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR13MB5858 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 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 --- drivers/net/nfp/nfp_common.c | 12 ++++++------ drivers/net/nfp/nfp_ctrl.h | 1 + drivers/net/nfp/nfp_ethdev.c | 12 +++++++++++- drivers/net/nfp/nfp_ethdev_vf.c | 12 +++++++++++- drivers/net/nfp/nfp_rxtx.c | 2 +- 5 files changed, 30 insertions(+), 9 deletions(-) diff --git a/drivers/net/nfp/nfp_common.c b/drivers/net/nfp/nfp_common.c index 58e20081fc..c2515cf413 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; } @@ -752,7 +752,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 | @@ -1053,7 +1053,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); @@ -1081,7 +1081,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) { @@ -1179,7 +1179,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; @@ -1214,7 +1214,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 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; + } } /* Enable device */ diff --git a/drivers/net/nfp/nfp_rxtx.c b/drivers/net/nfp/nfp_rxtx.c index fd3ee40aa5..43db8db7c3 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