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 705D443AE5; Sat, 10 Feb 2024 11:43:02 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7CA2642EC2; Sat, 10 Feb 2024 11:42:45 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2112.outbound.protection.outlook.com [40.107.223.112]) by mails.dpdk.org (Postfix) with ESMTP id 77DCB42EB9 for ; Sat, 10 Feb 2024 11:42:43 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R2/m2Jl/IoUjFsu+ax8aTp+3noeVW2Ekyo8VvUMQcTbXGzkmzgfY7Su0JPUTN4EADriUMd9gvMBeKVSr6r01/eBCvEfF1ZOp07KdDNY87K1s1UFS9BPd4PcpiOOmPqY9T9mzRPN3n9O0jdduSX66rD1iT3LRtTxj+WjuZlEdNYtlgS9cFvWDUwm1eCJPa9zGthJ+dQT2JDb/ZRMl7DrPXUkYOkVALVqOyUeRjhWO8tPW3iZJASOt3iN7m8E5FXtIY6DarDNZFyN6YPVJv065gjJS5wyAYPiqvEQabS2qm74Zzv5ph9d2qZ1UNYf8liBAQ/aax6xpEh+9hAWyOhKXYg== 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=W8ROtbaRH0cL2dezx1gB4EvmpFdIVHDOKPsRp7vIeI4=; b=eJKM4Z4Eyp3X60m35iPfx+1lY9XfZwTTm5a+iHoONBy6Dfy8aU2XYjcwzxfakHLlqNqWug66+0trDN8noRgAmVsid5/nnnDA1nsaxQlZGJW8LRqoyVhLhS2gNAe5q1QROu9AnQ+KzwUo7cJsWFKW09tbgcBMYXUXf9yY8baoUcL+DISUAB8sdXagkdlm2sN/6c4oxYXH+/4H56IsWXA5UCKxBhJ9iaezYACoViRNSb9WZwI69wjKewRp1dXdldDkg7wFjHjRo2aDv7z3mZk3Ga7QvvwO8HzRwbsrF8GbVKjJxj6dSD3wXU5rAJgEIUWK9Mq+XmX8+AI4QXTxrWvB0A== 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=W8ROtbaRH0cL2dezx1gB4EvmpFdIVHDOKPsRp7vIeI4=; b=Oa0IkwC7/5cZRVvbXMcAnZiYidEe4fxYQKKujJZPd5h8l0X2OQ57sgSo7RlAvh9DjECXoRaF7+1+4g9dcPowD5xenGpuLSsYwv5beq4E0Pb3ETQH4OmOTLIL0ZdcUjt1EOjptaFJ4iwv9IElzjsIouVd6+aTKEyCtYLRU4nfYq8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by PH0PR13MB5421.namprd13.prod.outlook.com (2603:10b6:510:142::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.24; Sat, 10 Feb 2024 10:42:42 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::8e02:f738:570a:f8aa]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::8e02:f738:570a:f8aa%7]) with mapi id 15.20.7270.031; Sat, 10 Feb 2024 10:42:42 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , Chaoyong He , Peng Zhang Subject: [PATCH 3/4] net/nfp: representor adds RSS configuration Date: Sat, 10 Feb 2024 18:42:12 +0800 Message-Id: <20240210104214.1248772-4-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240210104214.1248772-1-chaoyong.he@corigine.com> References: <20240210104214.1248772-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR02CA0129.apcprd02.prod.outlook.com (2603:1096:4:188::19) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|PH0PR13MB5421:EE_ X-MS-Office365-Filtering-Correlation-Id: 1f06633d-a50b-4912-d40c-08dc2a250246 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: On3waEaaDQYWQfRRxlNvYbxbbgNBVosmi4pdL1VGJl0NoN+/CSdXNS6MoAxlRpNtkacyDw70re19bIYMaO9mr88McDaDO8DdEEq09b6RN+L6S1swmBaBhfYJfASGsgPFJkTeUxlXMDdWMSNtitcZ2B1D5z/dYJsEIeWtELPckPCK+jFB4NqAWyOgpN3xE3CrNPL9IzKCrXEgeuI9QQJL3ttfvRFyBDUhUeNwozSA7Y1gFWZzT3rdt15KezOtHJKYlq/AUvkEK4WQNrzaD/lSaNGM1etiyX32uwqplJo171phiUS+BHjvvkK8S7dSxzseiQkh5YyvvDe67c24934t9CuJ6k7+IURgbhHAShHpDOlUnphcc2OsZBLfjmzQXuNalnDEcLE/vQQyCF+WKxS4uRuC0CCJGrPO5+gEnrZ4iKerXwt8ifXAWTtcryNQSy85nDPspYKkgEF/YjiBXcQDE+fhsvFVxGNeUHcCfmDCAD0FwkqksopD0OvvVYSDMcREmvtTbbuu7c8U9GUqOMlP2fIMjFuLHlYMC7Wvfy0DVPQOlMkQ1ED74Vf7K14+T5AluzW6cB0obvsEbbbvYn+8YTVCKxCC5M2grNpax3KA8PCPXh95L63C/RTWtF0wGew/ X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(346002)(366004)(39830400003)(396003)(136003)(376002)(230922051799003)(1800799012)(451199024)(64100799003)(186009)(38100700002)(66556008)(6666004)(52116002)(478600001)(316002)(86362001)(6512007)(6486002)(5660300002)(6506007)(4326008)(66946007)(44832011)(66476007)(2906002)(6916009)(2616005)(8676002)(1076003)(107886003)(83380400001)(26005)(41300700001)(54906003)(8936002)(36756003)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?EYSfzWzXcUWSe01CBVm4lmKItpLxlhFu1WtsUZMDWdVz8LUBcta+WYk3SM7C?= =?us-ascii?Q?I1+YYoDVsy9OazoLfNfwTiMS+JLXQX1Muw9wjf4sRdzcOv1l55Si9JHTT7hy?= =?us-ascii?Q?+JnTTsU74+eqpW7bSBXJYt9v5Y0F8bLGguJchpQ+3wb7pWd2LuP/YVIVVVWI?= =?us-ascii?Q?CxUxN2yUxtkjglxhUFFRPXkeoEL0ZOejMQiQLWUB3itahkXWtC6lhLiEPazq?= =?us-ascii?Q?2iFN5I8I45w/xGjYg1Fc8XDy73TVhJ2qGODCjWrAxKMtHp0QXCFmQRjsoJSA?= =?us-ascii?Q?j5phszvqXiIKjUhtMHr1xSUxokWV8LQZeBz0rjt6zZFfhF/6L/P8QFznfyNV?= =?us-ascii?Q?T+FDLNDolxvK9j6lJI7+31uErHogPuUcVID54CCpPoW3uKDYYFoIZuICalIx?= =?us-ascii?Q?O9qmsWEZko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7wstxJJxGREtUwKX3o?= =?us-ascii?Q?Zlb2G60Te+jt8kiNZaPQiEYF2EiVjXwEkgZdTO3ptVshYZ5jeSDC7DjxlyDN?= =?us-ascii?Q?jqJLPXk+I/bN/IVpTraK4NqfDjZQ3JbdfSI+j/3iM2xvVQ7AVgmw5dI3LlAO?= =?us-ascii?Q?y9NrwAWTGCod6SefsIenYD6M03GOht20gwFJ5caJATrmOVCCg7up04ajObWh?= =?us-ascii?Q?6koI7dE0awGljjOt+yBJTkh1dN2FupDLK4kB3VaQRSxX4MfR4YwxemAEKydP?= =?us-ascii?Q?zUJN0YyepBMBAN5BMmkTGE9sG0qVxkxFrZTQo/pCR5u9i40pFx7MvXA3mHp5?= =?us-ascii?Q?aQ=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1f06633d-a50b-4912-d40c-08dc2a250246 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2024 10:42:42.0778 (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: 7aU1pPmeMcuOeyQRN2peiUQbsl/z3GJP5GvvKi2KU8ewgWTyg7ZlhuZuWCAKyWInJrjupzgL4RWapra82OcvoQhvtSb2saIf73OUBQT+kpA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR13MB5421 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 From: Long Wu Add RSS configuration in representor initializaion. Signed-off-by: Long Wu Reviewed-by: Chaoyong He Reviewed-by: Peng Zhang --- drivers/common/nfp/nfp_common_ctrl.h | 1 + drivers/net/nfp/flower/nfp_flower.c | 12 ++++++++++-- drivers/net/nfp/flower/nfp_flower_representor.c | 13 +++++++++++++ drivers/net/nfp/nfp_net_common.c | 17 ++++++----------- drivers/net/nfp/nfp_net_common.h | 9 +++++++++ 5 files changed, 39 insertions(+), 13 deletions(-) diff --git a/drivers/common/nfp/nfp_common_ctrl.h b/drivers/common/nfp/nfp_common_ctrl.h index d65fcd17cb..d0a3fc696c 100644 --- a/drivers/common/nfp/nfp_common_ctrl.h +++ b/drivers/common/nfp/nfp_common_ctrl.h @@ -253,6 +253,7 @@ struct nfp_net_fw_ver { #define NFP_NET_CFG_RSS_IPV4_SCTP (1 << 14) /* RSS for IPv4/SCTP */ #define NFP_NET_CFG_RSS_IPV6_SCTP (1 << 15) /* RSS for IPv6/SCTP */ #define NFP_NET_CFG_RSS_TOEPLITZ (1 << 24) /* Use Toeplitz hash */ +#define NFP_NET_CFG_RSS_CRC32 (1 << 26) /* Use CRC32 hash */ #define NFP_NET_CFG_RSS_KEY (NFP_NET_CFG_RSS_BASE + 0x4) #define NFP_NET_CFG_RSS_KEY_SZ 0x28 #define NFP_NET_CFG_RSS_ITBL (NFP_NET_CFG_RSS_BASE + 0x4 + \ diff --git a/drivers/net/nfp/flower/nfp_flower.c b/drivers/net/nfp/flower/nfp_flower.c index e84e6ebbff..c6a744e868 100644 --- a/drivers/net/nfp/flower/nfp_flower.c +++ b/drivers/net/nfp/flower/nfp_flower.c @@ -31,6 +31,8 @@ nfp_flower_pf_start(struct rte_eth_dev *dev) uint32_t new_ctrl; uint32_t update = 0; struct nfp_net_hw *net_hw; + struct rte_eth_conf *dev_conf; + struct rte_eth_rxmode *rxmode; struct nfp_flower_representor *repr; repr = dev->data->dev_private; @@ -48,8 +50,14 @@ nfp_flower_pf_start(struct rte_eth_dev *dev) /* Writing configuration parameters in the device */ nfp_net_params_setup(net_hw); - update |= NFP_NET_CFG_UPDATE_RSS; - new_ctrl |= nfp_net_cfg_ctrl_rss(hw->cap); + dev_conf = &dev->data->dev_conf; + rxmode = &dev_conf->rxmode; + + if ((rxmode->mq_mode & RTE_ETH_MQ_RX_RSS_FLAG) != 0) { + nfp_net_rss_config_default(dev); + update |= NFP_NET_CFG_UPDATE_RSS; + new_ctrl |= nfp_net_cfg_ctrl_rss(hw->cap); + } /* Enable device */ new_ctrl |= NFP_NET_CFG_CTRL_ENABLE; diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c index 4f4df0cd2e..7284a1e84d 100644 --- a/drivers/net/nfp/flower/nfp_flower_representor.c +++ b/drivers/net/nfp/flower/nfp_flower_representor.c @@ -44,6 +44,12 @@ static int nfp_flower_repr_dev_infos_get(__rte_unused struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { + struct nfp_net_hw *pf_hw; + struct nfp_flower_representor *repr; + + repr = dev->data->dev_private; + pf_hw = repr->app_fw_flower->pf_hw; + /* Hardcoded pktlen and queues for now */ dev_info->max_rx_queues = 1; dev_info->max_tx_queues = 1; @@ -64,6 +70,13 @@ nfp_flower_repr_dev_infos_get(__rte_unused struct rte_eth_dev *dev, dev_info->max_mac_addrs = 1; + if ((pf_hw->super.cap & NFP_NET_CFG_CTRL_RSS_ANY) != 0) { + dev_info->rx_offload_capa |= RTE_ETH_RX_OFFLOAD_RSS_HASH; + dev_info->flow_type_rss_offloads = NFP_NET_RSS_CAP; + dev_info->reta_size = NFP_NET_CFG_RSS_ITBL_SZ; + dev_info->hash_key_size = NFP_NET_CFG_RSS_KEY_SZ; + } + return 0; } diff --git a/drivers/net/nfp/nfp_net_common.c b/drivers/net/nfp/nfp_net_common.c index 7a0b0c9973..66aaf7ab09 100644 --- a/drivers/net/nfp/nfp_net_common.c +++ b/drivers/net/nfp/nfp_net_common.c @@ -1269,16 +1269,7 @@ nfp_net_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) if ((cap & NFP_NET_CFG_CTRL_RSS_ANY) != 0) { dev_info->rx_offload_capa |= RTE_ETH_RX_OFFLOAD_RSS_HASH; - - dev_info->flow_type_rss_offloads = RTE_ETH_RSS_IPV4 | - RTE_ETH_RSS_NONFRAG_IPV4_TCP | - RTE_ETH_RSS_NONFRAG_IPV4_UDP | - RTE_ETH_RSS_NONFRAG_IPV4_SCTP | - RTE_ETH_RSS_IPV6 | - RTE_ETH_RSS_NONFRAG_IPV6_TCP | - RTE_ETH_RSS_NONFRAG_IPV6_UDP | - RTE_ETH_RSS_NONFRAG_IPV6_SCTP; - + dev_info->flow_type_rss_offloads = NFP_NET_RSS_CAP; dev_info->reta_size = NFP_NET_CFG_RSS_ITBL_SZ; dev_info->hash_key_size = NFP_NET_CFG_RSS_KEY_SZ; } @@ -1794,7 +1785,11 @@ nfp_net_rss_hash_write(struct rte_eth_dev *dev, cfg_rss_ctrl |= NFP_NET_CFG_RSS_IPV6_SCTP; cfg_rss_ctrl |= NFP_NET_CFG_RSS_MASK; - cfg_rss_ctrl |= NFP_NET_CFG_RSS_TOEPLITZ; + + if (nfp_net_dev_is_repr(dev)) + cfg_rss_ctrl |= NFP_NET_CFG_RSS_CRC32; + else + cfg_rss_ctrl |= NFP_NET_CFG_RSS_TOEPLITZ; /* Configuring where to apply the RSS hash */ nn_cfg_writel(hw, NFP_NET_CFG_RSS_CTRL, cfg_rss_ctrl); diff --git a/drivers/net/nfp/nfp_net_common.h b/drivers/net/nfp/nfp_net_common.h index 1d96b0e9d1..04482455d2 100644 --- a/drivers/net/nfp/nfp_net_common.h +++ b/drivers/net/nfp/nfp_net_common.h @@ -41,6 +41,15 @@ #define NFP_BEAT_LENGTH 8 +/* RSS capability*/ +#define NFP_NET_RSS_CAP (RTE_ETH_RSS_IPV4 | RTE_ETH_RSS_IPV6 | \ + RTE_ETH_RSS_NONFRAG_IPV4_TCP | \ + RTE_ETH_RSS_NONFRAG_IPV4_UDP | \ + RTE_ETH_RSS_NONFRAG_IPV4_SCTP | \ + RTE_ETH_RSS_NONFRAG_IPV6_TCP | \ + RTE_ETH_RSS_NONFRAG_IPV6_UDP | \ + RTE_ETH_RSS_NONFRAG_IPV6_SCTP) + /* * Each PF has corresponding word to beat: * Offset | Usage -- 2.39.1