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 006A0A0093; Fri, 17 Jun 2022 11:36:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 38D7D42B9B; Fri, 17 Jun 2022 11:35:50 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2111.outbound.protection.outlook.com [40.107.94.111]) by mails.dpdk.org (Postfix) with ESMTP id 5216942B7B for ; Fri, 17 Jun 2022 11:35:45 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n0UP3d6AD4qVUy6DtiZFjHO4AJWJfAdf7CQjrAvMOX5pK1BYAOEaiM02a0Yq7N6Hwn4xEJcp53kN81m8Mteb7/arvVmCqDtNuD45BQp/bKptMd91A3GvvCYilnxJhChA0GDbQgTopz0Z6QYI4hefr1O+MfiEclaWayR81Sy1PXNY8ItpSWZG47XJ8mF7ReCT8J8I2+LaH8BBuHBiKq1WwqxYMuurcLcBwfGMF98zy44yqIhikM60EKwrQ0TnWGZ23pXeIa7d/T25f8e0zBs0XtL20mDe5FDFN7TnmjJ6HZHiXoV8hx0YTFdfLSMLkz6Ou3j+zzbHbL4NNCEGdAHmig== 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=bXxPpkmcGgWtM3ZTOods/QDDxBMCIex3iwO50WKQUuBgDgIwAT4Ywyz9qgWjr2opT7MBFee8Q/w8NLg8Sh/nXzu+MwocwGS6rUrmAht2doZKT6X/GWYXaWKZTTIYmpv+Za10AYhGaI0Kv0LgfOplKVGnUUndJHdZtB8EK/3ui7JBA024Ofz8e/NJzy6OsKmZyysT+4qpV1rnIYh2RNuKT2jSM74qwUvqpFLYRw2AL/GeAB9H45cLaFNZevw9TJO3bkk+/nC/wzSky0sqYwcEiJyuPaOq8cWW+SSjWfP1PJkxESWEFqSA5iqflLgDYuex8xV5nlOHWJP2NVjA9fNXZg== 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=AP/On8Falx1xoR3q39WlnKNndqrgl4SEeyX9raos6WET2+xz8KNSlOEozVZztcJohiNNw/zCqP8kIHuWhiZo0yKxuVO0Elt5Km3lP3mYLvmkuQiMYw2kPmtaJD56clte33eH21Iy2KYaeO6EbNeS5q5FguTTZDwPlmkB3wkiZ64= 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 CO3PR13MB5671.namprd13.prod.outlook.com (2603:10b6:303:17a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.9; Fri, 17 Jun 2022 09:35:44 +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.009; Fri, 17 Jun 2022 09:35:44 +0000 From: Jin Liu To: dev@dpdk.org Cc: niklas.soderlund@corigine.com, Jin Liu , Diana Wang , Peng Zhang , Chaoyong He Subject: [PATCH v3 13/13] net/nfp: modify RSS logic Date: Fri, 17 Jun 2022 11:34:44 +0200 Message-Id: <20220617093444.2004000-14-jin.liu@corigine.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220617093444.2004000-1-jin.liu@corigine.com> References: <20220616023939.1798769-1-jin.liu@corigine.com> <20220617093444.2004000-1-jin.liu@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0192.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a4::17) 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: d960afed-6ae2-4d9e-07b3-08da5044c01c X-MS-TrafficTypeDiagnostic: CO3PR13MB5671: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: kTH6+bwjybsJpk8DRYZty759PBrSSa9nOMIk3qlK9fK8tufKDERKPKH74vstx0KoZrb3JMi3ee5ukEk6ghkgC1LgFlUqEFlNOivjgFDKtPAx/SGvthtPu/xAkyLz9MGHRYpu7Mq+swX8PpfzczVftQLy2TTHNDlvf/O7NjRIyS1+K1NXHsX+KF5aDzyCt/sA4B3vMlUXx9LNQkR83Lh9nweOOF/aYoE24g4wOA8ZAnAmIz+C/0jgWFuYpdKMBI9Zkp4i9ioWgvWWeJ8vEflY1pEmJb+tDCMnRAIerC6RIyNGsJl5OQkf+rNUnsK1HMxBpQyuonvvTmKfaWUJivd8u+gcQZl49z5zQ5Es1r+5F3WAsF3qw4iCfmZhUcn6kHFFFwTRQcjQgoPeFJ324sTsTUScTIroz125NesJy/vrmwPFWaKAZ/Wt4jrVW+mG5bCzhbdu6RRTclIp6bGjhHxT94T/bQAfDPUZM4OI3EN3knOsxZxtucPg0UHsjiCbMpLUVn34Ya/ckWT5RI6MWAgZqdhpt07+WBqWWw11CTx9laC7fYmT14b2SNJkkijsAKwKxaF/3NvpQt+TWRB4uja+pOuS1oPT9z+6spYCdBAq3zXAKq0+/xaW8bPWqD9YhG5WXX91rHisfqoLTAk1/oFc1Iy0vISNynpIAvQ+uPsqfo1cgao5QOeDNkZ2f7VktEOZCky4RZSAAzZYIk/l6w3KrkHbRx9JEJvolaXYseng+wELNzWD5Vl5spEmvJu1pGtY 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)(346002)(136003)(366004)(396003)(39840400004)(66476007)(66556008)(26005)(8676002)(66574015)(107886003)(66946007)(6506007)(6916009)(44832011)(2906002)(316002)(4326008)(38350700002)(186003)(508600001)(54906003)(5660300002)(6486002)(6512007)(1076003)(8936002)(2616005)(36756003)(52116002)(83380400001)(86362001)(38100700002)(41300700001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?QWtWL3UxajVhTEtabGpJcTQrSWc1ZUVsS1NZUnpFeTVwa0duWkM3a3RtaHAy?= =?utf-8?B?NXFMK1loR2R2TUwwS1VMaDZSSUMrNU0rc1U0S3cwTFN2OGU1RndMNVdTbDV5?= =?utf-8?B?OUg0YXVFZkV0UExWaXRCRDI0UGg5V3RCVHB0dVl4M2VQREJqeHdUQTkxUHI5?= =?utf-8?B?Vk1vNXFnM3RnSlRYNzBBeDFNek81Y0JVY2xiUHVpVXIvWVRsNnlWaEZzN0hN?= =?utf-8?B?d0x0eTBsV0FTVGtTTFNxM0RoRjY2QzdENXdqYnBJbDdVVlJ6M2xnTHZ6S01M?= =?utf-8?B?WkJyWDBlU2pNeDlaM0oveXQz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1DTFVxcVZPWGFJNGFwWkxnSDZ4Rkt0WW5XWVdZMjltRVV1MXlKWTdmdU1Q?= =?utf-8?B?UEtLZmFOR2JwdVREbzNrMTQwM1ZFdjBZbGJ6dGFFOU9PZHg0R21RY1dHYXRH?= =?utf-8?B?eHpmRXhyWDJTdUlNRUJ2bWwxY05xVUJBU0F0OUZOUWQxSUVwOENvaVJBZ3B4?= =?utf-8?B?Sy9vV0g4dUU0UzVZaXRsUmFhM25mZENlbmVtekRJVk1SamIxeXN0UT09?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: d960afed-6ae2-4d9e-07b3-08da5044c01c X-MS-Exchange-CrossTenant-AuthSource: DM6PR13MB3004.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2022 09:35:43.9906 (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: b4+LfMRaOKT4IHhN9LpQrbGNTmvaApd8h7KoLs3NzcFqB0M67y+rEG5AiIcsQmxgcst3luVc/M0fh9ikYm3P9Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO3PR13MB5671 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