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 66D93A034C; Wed, 21 Dec 2022 11:30:45 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 602D142D10; Wed, 21 Dec 2022 11:30:42 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2045.outbound.protection.outlook.com [40.107.94.45]) by mails.dpdk.org (Postfix) with ESMTP id 74A4B41141 for ; Wed, 21 Dec 2022 11:30:40 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jnGENrZ0nqYAnBKA88SyTY9znOMBkuBW4b5JTwfh7v1Fta9vNgMAb2kRc1JRDdK8zw7a+5tLCsTtVV7mfeE005iXwxRGXUR2EK0jwEFZq+Ns6z0IXHNKihbr2hjPubY2CfJLPFCmzI2ZMF3TfGCfd5AGRhzpPngX6IU7PQ84DJ+VSiWXYv0r+BwTxyhjprdvWiDm8icGI7lgCBbgAzkjODCaW2Yta9loZ3t3ykKmOT40Itap6MEY3ZgczExU6/r6dz2aDjwr6mayKIg1YnD9JnfzzFPYvvfFXXnuPv3kLm6PRJXR3evuMLnxLAFoa2u7e2nf8SyorsKrb0hp4J7itA== 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=Nt8WtVCINpGgRWdo0ZL7ptGYuHpII4YR0D4CeH0uo4Y=; b=bv6yRxTyliSYBQk/d1emOegwUg3cl/91vQypq+hycPCV3vLhk+m/ocErxZ8zADYzRZoWQczyYOD3tbHencPa1lvaWn6Y2wqeZjEo9+AJWZZE/IzRwQn15s4+KY0s1yYuzf53HIIKR1IGjwcgU3NsUb3w4SJILdBCEc+3uNt9ZFFoFpwToGzpivbea4XvBD9MG18FwvWiqkw3GfKw//mREQhDFlKmZbnWJTcR4E7FXIAkMoyW7/VzguSuNe5hUx6R1RBd78NnMLOhqIaZiMUXqBjA5YSW/FlfdzB04an7IU7mlLMucMBZXINLdcS1/XStVj6jdm5ri72IQwm33NjVHw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=monjalon.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Nt8WtVCINpGgRWdo0ZL7ptGYuHpII4YR0D4CeH0uo4Y=; b=XlCRSMHp50GK6nW1k6TvusqeiJklZnQdMRTrU/ACS3RAa2CfxAW5jiRKrb9a0Y013hEq5xpDVfDZUEP5hF9maAXQSrDvIF3j7O+yM1c9CROq3CYyeNKLBuMEv2wVhcG+qTlfZNv4Ndgaod/7+9sHBp6/xlsEpEkpb9cZMLSnv5bvtTqC2/VMZsNPylVhUiMs9P5h5zV/eISaX2/g/oYwAgGjvUALLwuvWu4p4JrgZkjw+omdzjyO8m8DsYrnIjpQEcK3nunM/2XLkXkPyHw0qBW8vRSI6L31cZ1mZir1f8oDj6+sc7YDcaS2/B4Mbbr2NeI2um0+MIMLmO9brVT7+g== Received: from MW4PR04CA0134.namprd04.prod.outlook.com (2603:10b6:303:84::19) by SA0PR12MB4480.namprd12.prod.outlook.com (2603:10b6:806:99::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.16; Wed, 21 Dec 2022 10:30:38 +0000 Received: from CO1NAM11FT107.eop-nam11.prod.protection.outlook.com (2603:10b6:303:84:cafe::86) by MW4PR04CA0134.outlook.office365.com (2603:10b6:303:84::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.21 via Frontend Transport; Wed, 21 Dec 2022 10:30:38 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CO1NAM11FT107.mail.protection.outlook.com (10.13.175.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.10 via Frontend Transport; Wed, 21 Dec 2022 10:30:37 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Wed, 21 Dec 2022 02:30:20 -0800 Received: from nvidia.com (10.126.231.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Wed, 21 Dec 2022 02:30:18 -0800 From: Jiawei Wang To: , , , "Matan Azrad" CC: , Subject: [RFC 3/5] drivers: add lag Rx port affinity in PRM Date: Wed, 21 Dec 2022 12:29:32 +0200 Message-ID: <20221221102934.13822-4-jiaweiw@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20221221102934.13822-1-jiaweiw@nvidia.com> References: <20221221102934.13822-1-jiaweiw@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.231.37] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT107:EE_|SA0PR12MB4480:EE_ X-MS-Office365-Filtering-Correlation-Id: 2776175d-a7b8-4b79-6b21-08dae33e66ee X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6m/xPqBLYPAu6PQAToSpS8rodimsJG6m7W83GJqZglF7TCPu20IgdtCiFcKNe2EgRwYRckokCSpnmUo2UbN+ikoJ+jOK6cDzau9sj2QclO8Nbu2cuiJFE5P7j5HXeomAkKEBwKzq0Y7pFJe7wgi8E+rGRYvoHQnS45vEZ/n/vnJfHwhxUW+Zy0MtV95wIhSHhNRFvJNdfl2G1eZC4jcS1nz6ciliTCdZSMBi3jWIo1hWBNYsKyZikazy4LdlWWoAh2qshFX0FjRQBVUxAwJFXThxLTB8RUXHe8Fg+Xjx4Cg1zdCi1d9sf4JLEMHn3Rsl6REYrs0JKNjCw16YAe7KetOVUU0qMpGy0lpNjo/EwpuQX0lW8QBKUJbquxjE2gu5Ii2ICGUYZRNkcslEonM6w5d5aLt3f5aPjh8sTq9XnlA6vCg9flH/ECOlxZaXTW7hZletZ6qDGpf/FsrzuxBt136ygWU7OCfKQGPD20Tg+2oMV6XfXloPLiW2AmnZHE3SBurXgWVWWq+rgMiboAXkqQyEeGERvyROxVHDLEsqFd9vIB3fW+rwpbEvUxk4zMrPaeoxXA0qRlkCf9bI4dUyTFxMdbhhPOFWZrhYpn3rjSpPSyDpHNgiPwlbgBfslBfefLafpGr9VOWS7Yf2SEEIw4tIJLs2Y3q2+sd8ltnn0i6CjYLia+pP0uFKiFwkto6OKr8MZAqyhPSkSajRuOH2RvoXXlQUBc9q1dAmnVOUWNCBIo2tiHfuV1Z9/+DhKHdj X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230022)(4636009)(136003)(346002)(396003)(39860400002)(376002)(451199015)(46966006)(36840700001)(40470700004)(107886003)(6666004)(186003)(478600001)(26005)(6286002)(16526019)(82310400005)(7696005)(47076005)(316002)(86362001)(2616005)(83380400001)(6636002)(4326008)(1076003)(426003)(70586007)(36756003)(36860700001)(54906003)(70206006)(336012)(8676002)(110136005)(41300700001)(82740400003)(40460700003)(7636003)(356005)(2906002)(8936002)(40480700001)(55016003)(5660300002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2022 10:30:37.9162 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2776175d-a7b8-4b79-6b21-08dae33e66ee X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT107.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4480 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 This patch adds function to query hca capability via Devx for lag_rx_port_affinity. Signed-off-by: Jiawei Wang --- drivers/common/mlx5/mlx5_devx_cmds.c | 3 +++ drivers/common/mlx5/mlx5_devx_cmds.h | 1 + drivers/common/mlx5/mlx5_prm.h | 7 +++++-- drivers/net/mlx5/linux/mlx5_os.c | 4 ++++ drivers/net/mlx5/mlx5.h | 2 ++ 5 files changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c index 9e0b26fa11..16e9e38b0b 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.c +++ b/drivers/common/mlx5/mlx5_devx_cmds.c @@ -1244,6 +1244,9 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, attr->outer_ipv4_ihl = MLX5_GET (flow_table_nic_cap, hcattr, ft_field_support_2_nic_receive.outer_ipv4_ihl); + attr->lag_rx_port_affinity = MLX5_GET + (flow_table_nic_cap, hcattr, + ft_field_support_2_nic_receive.lag_rx_port_affinity); /* Query HCA offloads for Ethernet protocol. */ hcattr = mlx5_devx_get_hca_cap(ctx, in, out, &rc, MLX5_GET_HCA_CAP_OP_MOD_ETHERNET_OFFLOAD_CAPS | diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h index 1c86426e71..4fe0915a65 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.h +++ b/drivers/common/mlx5/mlx5_devx_cmds.h @@ -318,6 +318,7 @@ struct mlx5_hca_attr { uint32_t flow_counter_access_aso:1; uint32_t flow_access_aso_opc_mod:8; uint32_t cross_vhca:1; + uint32_t lag_rx_port_affinity:1; }; /* LAG Context. */ diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h index 5b84657e08..9098b0fe0b 100644 --- a/drivers/common/mlx5/mlx5_prm.h +++ b/drivers/common/mlx5/mlx5_prm.h @@ -905,7 +905,8 @@ struct mlx5_ifc_fte_match_set_misc_bits { u8 vxlan_vni[0x18]; u8 reserved_at_b8[0x8]; u8 geneve_vni[0x18]; - u8 reserved_at_e4[0x6]; + u8 lag_rx_port_affinity[0x4]; + u8 reserved_at_e8[0x2]; u8 geneve_tlv_option_0_exist[0x1]; u8 geneve_oam[0x1]; u8 reserved_at_e0[0xc]; @@ -2055,7 +2056,9 @@ struct mlx5_ifc_ft_fields_support_bits { * Table 1872 - Flow Table Fields Supported 2 Format */ struct mlx5_ifc_ft_fields_support_2_bits { - u8 reserved_at_0[0xd]; + u8 reserved_at_0[0xa]; + u8 lag_rx_port_affinity[0x1]; + u8 reserved_at_c[0x2]; u8 hash_result[0x1]; u8 reserved_at_e[0x1]; u8 tunnel_header_2_3[0x1]; diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c index d48b9b68ac..3fea72013f 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -1402,6 +1402,10 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, DRV_LOG(DEBUG, "DV flow is not supported!"); } #endif + if (hca_attr->lag_rx_port_affinity) { + sh->lag_rx_port_affinity_en = 1; + DRV_LOG(DEBUG, "LAG Rx Port Affinity enabled"); + } } /* Process parameters and store port configuration on priv structure. */ err = mlx5_port_args_config(priv, mkvlist, &priv->config); diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index 761b5ac572..dc4d1a8686 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -1399,6 +1399,8 @@ struct mlx5_dev_ctx_shared { uint32_t hws_tags:1; /* Check if tags info for HWS initialized. */ uint32_t shared_mark_enabled:1; /* If mark action is enabled on Rxqs (shared E-Switch domain). */ + uint32_t lag_rx_port_affinity_en:1; + /* lag_rx_port_affinity is supported. */ uint32_t hws_max_log_bulk_sz:5; /* Log of minimal HWS counters created hard coded. */ uint32_t hws_max_nb_counters; /* Maximal number for HWS counters. */ -- 2.18.1