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 CD82645909; Thu, 5 Sep 2024 08:26:16 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B6A7A42DD1; Thu, 5 Sep 2024 08:25:48 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2093.outbound.protection.outlook.com [40.107.92.93]) by mails.dpdk.org (Postfix) with ESMTP id 4FC9B42DD5 for ; Thu, 5 Sep 2024 08:25:46 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GhwUUL7zMgxN+zoqJLqBZNJcmFSUqCFqPk4I1y00hTNviNlKNfQrQdyt/9n2L5pOAcRiJK3a+ZLEMgA/PS+1+UwgB0NpfmBiIjxIGBNx8YiZb069sABSPsfCj3+0pmf/walAvIWvict3pcHNyvRYW4OfIqWBFwzhfZmVH+Wj768UBKQ9RX279YQNa+ZJcVRhbCOnS1fQXOwpYhPxaoPkejhTf6KMPpSFEDevwvw6PgK32kVcApdyHMl1lD6V2bODOMSAeuSM2XGsojn92Ml41w+v/kO9vRTG/JcFTh4Ry52naAqfkS7l7P0U5PDdDBvUoFrwTMbdhOIPd5rTkwYHpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=uaKETpVKYeb/ohnKnAvlH5aKdTfoGrMXzBbaE2P5o9U=; b=G4v4XjmOf3uQDtp9l13MUaLKYI7REWObja3/Qne8zO+MApN2cs01Sl7kIFIFCb0CsRCMPPYZE7r3Tj+WlgEx/s4bkoTf+JtGsGlvNnUAGbacuEzzlDbJGOOvQR7Z8xAq5CDg8DjeQ+e8Lnq6zPbsP3I5i6tQw4uwhbKnLMn2EcstVyTKRwxUuvKJ9u7b+z7sDMAu1iIrWS5dKlawXCrQXLudNiQX6/1mzD5wO5T1NIhLV5imO713TZnWdPNHipIMHLUNiG0VYU1rqNwCmXr3IgsBfpv6AjSoQOXl1uD2Rnivta0Uyy15m4/hnEnLtzJ04h07+uM6AZl6GSLXx3zjSA== 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=uaKETpVKYeb/ohnKnAvlH5aKdTfoGrMXzBbaE2P5o9U=; b=cLGAUFgo+Svmy3qE/mMDG6cyWif7CztSWWkzZNb689A+oRwLbuvDniw6xgnf33riPmzPnwNPQVD+bBya7rDBpFOioR/QdKwS2CNbdk3SF7bd3zeOQfRUFRccwOJvL2WBamcv8v2g+bZhuBCHH38NfpjDABf38CfPr5hVTNABIbI= 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 DM6PR13MB4147.namprd13.prod.outlook.com (2603:10b6:5:2a0::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.27; Thu, 5 Sep 2024 06:25:45 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%4]) with mapi id 15.20.7918.024; Thu, 5 Sep 2024 06:25:45 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Qin Ke , Chaoyong He , Long Wu , Peng Zhang Subject: [PATCH 5/8] net/nfp: add new data field into representor port structure Date: Thu, 5 Sep 2024 14:25:08 +0800 Message-Id: <20240905062511.2710102-6-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240905062511.2710102-1-chaoyong.he@corigine.com> References: <20240905062511.2710102-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SGAP274CA0017.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::29) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|DM6PR13MB4147:EE_ X-MS-Office365-Filtering-Correlation-Id: c43fa248-16f3-4a51-a894-08dccd7392d8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|366016|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?hnC0batPCJsRUaRmmZ5xYaXoNwZ0QOQGb2l5GpCGd61+MNBgRwNGDvakY/de?= =?us-ascii?Q?sWrCyXsAbvXs+ZBxMKGmtq8c6U/ZZVs94TIpmHdNtll9JETnOa0zHX5k3hCu?= =?us-ascii?Q?DfF0/loua6EZMri73Q5l4VmnTHb8zq/bTDqfingXj53wHp6AJltH+i8b4+lw?= =?us-ascii?Q?63qC7ahE8RPc/UNypK7Sdgr/ER5K1QJAALHu77noC15WceI8maEgCTQqUDxb?= =?us-ascii?Q?C77eUo1WTxyD9bXykNRWnK/HLJHflQJ6SNGh2ZtlBmSCA0EPhIvoRMGH9RXf?= =?us-ascii?Q?jlPPD/BuZgManCStSshMcLsmlr/FQeucAhe1duVdzQJorN8/vd8GInLHmaRs?= =?us-ascii?Q?GFR9+OqEou0cL0mxaOFbt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-ascii?Q?1a4z1UYJFpG19VjUT1b7VQmwJRFNdZmBhLSRCHsc2DFLaj7cLIemx2bA2kVp?= =?us-ascii?Q?/mGr/JcHx5t9vu2sjxZsM0CzJCkFTjEB5FycbAIvlfdU4myko9qETRwqyUJU?= =?us-ascii?Q?NPy5QK5DKMMJ9AWfxHYq/pZKsnq33nr0LHCLhIa7oAm+mgM3fQ=3D=3D?= 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:(13230040)(1800799024)(376014)(366016)(52116014)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?HrWB7MtyXCq7435aMYYnoz8fb4YmpJJcvMK3LQp1SM+br4tWEdzTOqafWLa+?= =?us-ascii?Q?FwtiGOgbrBj7EfNdt/S5YjFlN7Q/81/e5wfOWDiLzboAsdkTp+Oi+QYt4fnW?= =?us-ascii?Q?2qe1nO0jlVmwL0IhpzPhuJGHrivC7f+U0Um4pKVK96ANngQr3ubNhddF/M5i?= =?us-ascii?Q?v0C0HipPhcayP3bnL2Urn+IcDgXLJRITV6HMXogN8XTRuVrbauzSt91kRJtV?= =?us-ascii?Q?kTYJDcmrAR56hzn8fcrCVs7mUZtGRbw5B0yNqusKavrGcMsZUA8JdyWoKDpA?= =?us-ascii?Q?d+EUG2/ylZVbUECqhisGsZQGPo4CJVHdEfYD3+lwLS5+cu1vkHJrG6DT+LLS?= =?us-ascii?Q?jpqy2uER0yTe5jh6hgvGBeISXPxBRvmGrLO5Qi0oaumhBAZkSB/7cWfpXMvS?= =?us-ascii?Q?/H7dOEooAL94wz1oKk8fin6WqaxNUo8RQ9PL4ppVky3bKIQOcPBParr+iXYk?= =?us-ascii?Q?VDgOEL3X9walFVu1kzy+LIfQcDMkWayIsGdDih5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QtR5zA/6zdH8wwN1nV37BOFFIKut8sT1kPCgN86EVJlP6eM1+9kVhnj?= =?us-ascii?Q?ZnOUP3ymirb4PTSk/pl7YR5VWuPJ8VefwnXMPFOn8Wm2+BtDtmzGmMJva7aa?= =?us-ascii?Q?LsHoyTGKGUvMqtSqkHegQk85nTOnRgwJsGSYoggDucVZTg2tSVM8/EbL1phK?= =?us-ascii?Q?i9DaTtffC75gzLtH4uyztEQVuf5mnMSw5MWHnziDm41V/9SmiDM+R2va8SLP?= =?us-ascii?Q?sQ=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: c43fa248-16f3-4a51-a894-08dccd7392d8 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2024 06:25:44.9982 (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: QauxP7COhxpgnwxHkuMzdx9s6XGRi+h5+a82hkmelkQ3oajqRVd2k1lrFJ94esCbduAjftNRWrkuX2OmF7Krp+6bpYGd48pAE5jgax8qNdo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR13MB4147 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: Qin Ke Add a new data field 'idx' into 'nfp_flower_representor' structure to indicate the sequential physical port number of representor devices, also initialize it for all representor ports. Signed-off-by: Qin Ke Reviewed-by: Chaoyong He Reviewed-by: Long Wu Reviewed-by: Peng Zhang --- drivers/net/nfp/flower/nfp_flower_representor.c | 4 ++++ drivers/net/nfp/flower/nfp_flower_representor.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c index 872b8a6db4..e7593313e2 100644 --- a/drivers/net/nfp/flower/nfp_flower_representor.c +++ b/drivers/net/nfp/flower/nfp_flower_representor.c @@ -649,6 +649,7 @@ nfp_flower_repr_init(struct rte_eth_dev *eth_dev, } /* Copy data here from the input representor template */ + repr->idx = init_repr_data->idx; repr->vf_id = init_repr_data->vf_id; repr->switch_domain_id = init_repr_data->switch_domain_id; repr->port_id = init_repr_data->port_id; @@ -822,6 +823,7 @@ nfp_flower_repr_alloc(struct nfp_app_fw_flower *app_fw_flower, /* Create a rte_eth_dev for PF vNIC representor */ flower_repr.repr_type = NFP_REPR_TYPE_PF; + flower_repr.idx = 0; /* PF vNIC reprs get a random MAC address */ rte_eth_random_addr(flower_repr.mac_addr.addr_bytes); @@ -854,6 +856,7 @@ nfp_flower_repr_alloc(struct nfp_app_fw_flower *app_fw_flower, flower_repr.port_id = nfp_flower_get_phys_port_id(eth_port->index); flower_repr.nfp_idx = eth_port->index; flower_repr.vf_id = i + 1; + flower_repr.idx = id; /* Copy the real mac of the interface to the representor struct */ rte_ether_addr_copy(ð_port->mac_addr, &flower_repr.mac_addr); @@ -887,6 +890,7 @@ nfp_flower_repr_alloc(struct nfp_app_fw_flower *app_fw_flower, NFP_FLOWER_CMSG_PORT_VNIC_TYPE_VF, i + pf_dev->vf_base_id, 0); flower_repr.nfp_idx = 0; flower_repr.vf_id = i; + flower_repr.idx = 0; /* VF reprs get a random MAC address */ rte_eth_random_addr(flower_repr.mac_addr.addr_bytes); diff --git a/drivers/net/nfp/flower/nfp_flower_representor.h b/drivers/net/nfp/flower/nfp_flower_representor.h index 70ca7b97db..4211ddf798 100644 --- a/drivers/net/nfp/flower/nfp_flower_representor.h +++ b/drivers/net/nfp/flower/nfp_flower_representor.h @@ -23,6 +23,8 @@ struct nfp_flower_representor { struct rte_eth_xstat *repr_xstats_base; uint8_t *mac_stats; + /** Sequential physical port number, only valid for repr of physical port */ + uint8_t idx; }; int nfp_flower_repr_create(struct nfp_app_fw_flower *app_fw_flower, -- 2.39.1