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 D7ED94559A; Fri, 5 Jul 2024 17:05:59 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C6641410D5; Fri, 5 Jul 2024 17:05:59 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by mails.dpdk.org (Postfix) with ESMTP id 37F10410D4 for ; Fri, 5 Jul 2024 17:05:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1720191959; x=1751727959; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=R3tAx9yoyR8xSc8ATj6bLPZ7AQbuAxz8H/hSF0WNS30=; b=lLW0meJ32G3CXIS9W340CqqynVQxfHhC6PrluiY3AdKLsJGVSyF22AB0 I+0LwTT50XZAIeJPdOiFp0AuT14F3X/nYtKEjFZc5FRZZ9YnF5r/DqG6v PLoDhRvw0x4M+md57FyFvz6LmuzLdKOoy1sNQxiO8rqcAtvSttviJ8Fgm +Q2gpwpfWGaOom/ic2076ngCOkOWgnTs6WYrFi3y3kiqXsQPZVCwRfgG4 GofvRgmKQHb3r21Ay+p7yBi1yXe20bQA9apkU4AaWYQ5ha5CMPpvARfUK EOosiwc1KB61NUV+ld5mTLVg/YbrhZEEN4RfdXjpKrmjZW37KsRNUPMYa A==; X-CSE-ConnectionGUID: bMYmw8LYRR6YKjfm062nhQ== X-CSE-MsgGUID: fUtjjYOYQ7Ow/NzHQK6lUA== X-IronPort-AV: E=McAfee;i="6700,10204,11123"; a="17206133" X-IronPort-AV: E=Sophos;i="6.09,185,1716274800"; d="scan'208";a="17206133" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2024 08:05:57 -0700 X-CSE-ConnectionGUID: hcOj6KP9T7ysyB3JJAkr3w== X-CSE-MsgGUID: OsNjgV91QFCJA1aE86q7Cw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,185,1716274800"; d="scan'208";a="46970820" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmviesa010.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 05 Jul 2024 08:05:57 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 5 Jul 2024 08:05:56 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 5 Jul 2024 08:05:56 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Fri, 5 Jul 2024 08:05:56 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.101) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Fri, 5 Jul 2024 08:05:55 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bmFOGdwuY4uHiPspomSUO03FP/wz/Fbhxk3BCstQ/Aqks8FrBNG22Rp7H/3PVL2B3YjUwSywIHe6nLucYPesrf4VmEwLzBgmqgZ5oCHS2O3Cs4Ql8MJM8vxu04pq2FiTI3srjNE8Auyoafgc2aSzaU09+UbtmeQXzvSE0Q/cLw7FsuNGXu3yab9Eq2B7buMKBkD5pRC/hAfeCQmNkpU0apymGgsctwbt8k45IX4aP69gRP1E/zzy8e2A/IL+jcNd4YouY0LLyqZgegbm+ngnzAfR3KGdXLJUjYZY4PKyuxEOiSBhRoDQHAOZjjJqAAAMbDhPI4mJ0lB+HzRJ5Z9clQ== 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=IzEMchDWi/arvlehe9ivKN+SY/n5JZvei7dh1/q9k24=; b=nipSgt8CcwGSdNtFxqVsDR77kQVoGdvzF0b2drMw/xA19UmOvyQ93tIiOCEwFSLh21rMfLPnxvo1mZdkm140L3fpziJnwCddKcXav9ZtC4+8/uGdeKf/RCAQOQ0lnPBio6se9vJg2dfUxzMnGe+nGDGQFRvZ/fgXGyDV9R+scL0y2CReHCugiJLncUHy8AM5e+0+5QqSuyeKqFPzBg5fcyQ/cEYUWYAGA6I5aW+CxJxrOzzNcwIJilMbmYjImLv4xIERsG0i/8+1Hpw66XxNojWB9Cv4rjx+3IdCSuMU48sejYLfHYO9O7vSnJLE+UTHCJUdL2KQH6oEF1o4midntg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by IA1PR11MB7367.namprd11.prod.outlook.com (2603:10b6:208:421::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.32; Fri, 5 Jul 2024 15:05:52 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::f120:cc1f:d78d:ae9b]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::f120:cc1f:d78d:ae9b%7]) with mapi id 15.20.7741.029; Fri, 5 Jul 2024 15:05:52 +0000 Date: Fri, 5 Jul 2024 16:05:47 +0100 From: Bruce Richardson To: Shaiq Wani CC: Subject: Re: [PATCH v5] net/cpfl: get running host ID for CPFL PMD Message-ID: References: <20240530093958.801348-1-shaiq.wani@intel.com> <20240606104422.1230909-1-shaiq.wani@intel.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20240606104422.1230909-1-shaiq.wani@intel.com> X-ClientProxiedBy: DB8P191CA0025.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:130::35) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|IA1PR11MB7367:EE_ X-MS-Office365-Filtering-Correlation-Id: 6ec3f98d-1794-49df-756b-08dc9d03f676 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?hABBTUGqyXKzucAn9Nsx9q/Qv823KFWiu9h62MyK8X6R2BACTOFQ97W+e9SH?= =?us-ascii?Q?LYaKffZ3dAKbktJRe4XJHuMja16RbSIXEZ8LvpIuUPHXcqaLjRvS0FW5A5MQ?= =?us-ascii?Q?3gpEkXkNcHbUIHzyNIgsl5Xiq9LZk/Auj9lAuzdKPjDfNZQBpt9CnDiIlqNL?= =?us-ascii?Q?eT+6B9gyeLXVa2Eja9B/Zf3X+9h93hm1UxoTa/35gAhoxIbGaahRewxtOcRl?= =?us-ascii?Q?+UbcHHhHcV1IPgNA9eRBjhc/0+RP6WP7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xdjWovNvbx6Mdp9WwATcC5O5i1eTgWJCXr+4Vqsj9ig+p+zH7w?= =?us-ascii?Q?IhAal+SgEY2qidwM8JvZXwmvyz/wPlTeUbmmTjDeDMwrshRv9TqG9ZaQ1X0/?= =?us-ascii?Q?9nFfVqB4K9m5DY87jZvHDt2+tHvimxvv0TYSxeAiUppwIJt4yOVcFwQTde8s?= =?us-ascii?Q?f3BvMzQr0AtPBWFgPVe0CwnPMuxM7fNXw/52z/F81hWWhw=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(366016)(1800799024); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?OKxLaHg5FC7QfBTov+Wk0UlrFDml1e1+ozbv0WEHBJdjyJdks+/icTQZw3Nt?= =?us-ascii?Q?GjAvlAxIkYZ3Sd7N97dX4IMaDeocSzrlu3n5KHpWqAPFjBBDqya7VSv9b6/W?= =?us-ascii?Q?BJsp6dML9K2AosqZBOFG444TNJqOvJyGtLPRGgIxkZpigsVl7+yPtUNBEfXl?= =?us-ascii?Q?nsF0WVO3s/zGIdmBBCgrB3JjZ252JGL0fESmpGRbXQS4lgaQ1KrbGdn3pdZm?= =?us-ascii?Q?WSFbgDPUwoBwHJ7N9VwZeLN7xGvot/1ylCm6RY3u6iE5QKi1OQAm5050YzJB?= =?us-ascii?Q?sOS7HO5kZ96kFTv2xvYXwsKI+Hfd2oBnp0SUqS/vhjKlq2krgT5enY0lgvAs?= =?us-ascii?Q?a1ijs+t8DQw+fgDhxgBPiygtZBduRqsEILmPFV/kEXr67V8XJ61GxxHxC5vY?= =?us-ascii?Q?RXSD7yoqR+jSB3Vl8tb7UWUQqFPQ0H8fbAJes+1jpFgkTadiq9b/kAaE32Kb?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uVJlSR/aZPBEyxbtZmuCR8?= =?us-ascii?Q?/po28BgkKZvtXzX6kbpB3EuvAzyVgkrrMTUO3ewXnp/7KDFSwRU1fZO29E+M?= =?us-ascii?Q?ltax6PjkO3v+OziQ1zjJF7fHnw9Fpw1ZJKPpRPDFIp2WmuaiP1r2JmSeH5mL?= =?us-ascii?Q?HwZbQ0wKyYro0wN5enFKmx0GBGkb7EF8HkVDYetH4W/NR95U1BGH9dnz8YLR?= =?us-ascii?Q?2dEmr07/MVuzmdgQo2OtRnP5H8Pg3oMhZ+s/+hh+6pYZWfpUafnQtdtbqhWc?= =?us-ascii?Q?bA=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 6ec3f98d-1794-49df-756b-08dc9d03f676 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2024 15:05:52.7283 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ZKMBtTiGXFd2JQ1sBfMRe+vbTcs968Dl676VFsbL9HSxuerwShY2uYGW5WAqCWnor0FYlWSydAnN0AbDRPgrPCGeqLx8Xc6qdeLSbH32Vmo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR11MB7367 X-OriginatorOrg: intel.com 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 On Thu, Jun 06, 2024 at 10:44:22AM +0000, Shaiq Wani wrote: > Check whether CPFL PMD runs on Host or ACC > > --- > v2 Changes: > -Changed implementation based on review comment. > v3 Changes: > -Fixed indentation. > v4 Changes: > -Fix ipu_imc and ipu_acc to ipu-imc and ipu-acc. > v5 Changes: > -Updated the documentation with the changes implemented > in this patch. > --- > > Signed-off-by: Shaiq Wani > --- > doc/guides/nics/cpfl.rst | 3 +++ > drivers/net/cpfl/cpfl_ethdev.c | 19 +++++++++++++++++++ > drivers/net/cpfl/cpfl_ethdev.h | 5 ++++- > 3 files changed, 26 insertions(+), 1 deletion(-) > > diff --git a/doc/guides/nics/cpfl.rst b/doc/guides/nics/cpfl.rst > index 9b7a99c894..3430ac7398 100644 > --- a/doc/guides/nics/cpfl.rst > +++ b/doc/guides/nics/cpfl.rst > @@ -150,6 +150,9 @@ Runtime Configuration > Then the PMD will load json file for device ``ca:00.0``. > The parameter is optional. > > + As CPFL PMD can run on both XEON host and IPU's ACC, the driver dynamically detects > + which system it is running on using get_running_host_id functionality. > + Lines in rst text follow slightly different wrapping rules to the code - we generally try and wrap them at punctuation breaks. Also, the function name "get_running_host_id" is not meaningful in end-user docs like this, so it should be reworded to "by querying the hostname", which is a description of what the function in question does. Will fix on apply. > Driver compilation and testing > ------------------------------ > > diff --git a/drivers/net/cpfl/cpfl_ethdev.c b/drivers/net/cpfl/cpfl_ethdev.c > index ef19aa1b6a..4e9fea9643 100644 > --- a/drivers/net/cpfl/cpfl_ethdev.c > +++ b/drivers/net/cpfl/cpfl_ethdev.c > @@ -14,6 +14,7 @@ > > #include "cpfl_ethdev.h" > #include > +#include > #include "cpfl_rxtx.h" > #include "cpfl_flow.h" > #include "cpfl_rules.h" > @@ -2270,6 +2271,23 @@ cpfl_repr_allowlist_uninit(struct cpfl_adapter_ext *adapter) > rte_hash_free(adapter->repr_allowlist_hash); > } > > +static uint8_t > +get_running_host_id(void) > +{ > + struct utsname unamedata; > + uint8_t host_id = CPFL_INVALID_HOST_ID; > + > + if (uname(&unamedata) != 0) > + PMD_INIT_LOG(ERR, "Cannot fetch node_name for host\n"); > + else if (strstr(unamedata.nodename, "ipu-imc")) > + PMD_INIT_LOG(ERR, "CPFL PMD cannot be running on IMC."); > + else if (strstr(unamedata.nodename, "ipu-acc")) > + host_id = CPFL_HOST_ID_ACC; > + else > + host_id = CPFL_HOST_ID_HOST; > + > + return host_id; > +} > > static int > cpfl_adapter_ext_init(struct rte_pci_device *pci_dev, struct cpfl_adapter_ext *adapter, > @@ -2289,6 +2307,7 @@ cpfl_adapter_ext_init(struct rte_pci_device *pci_dev, struct cpfl_adapter_ext *a > hw->vendor_id = pci_dev->id.vendor_id; > hw->device_id = pci_dev->id.device_id; > hw->subsystem_vendor_id = pci_dev->id.subsystem_vendor_id; > + adapter->host_id = get_running_host_id(); > > strncpy(adapter->name, pci_dev->device.name, PCI_PRI_STR_SIZE); > > diff --git a/drivers/net/cpfl/cpfl_ethdev.h b/drivers/net/cpfl/cpfl_ethdev.h > index 457db6d6be..3f6f9ca5ea 100644 > --- a/drivers/net/cpfl/cpfl_ethdev.h > +++ b/drivers/net/cpfl/cpfl_ethdev.h > @@ -66,6 +66,7 @@ > #define CPFL_PF_TYPE_NUM 2 > #define CPFL_HOST_ID_HOST 0 > #define CPFL_HOST_ID_ACC 1 > +#define CPFL_INVALID_HOST_ID UINT8_MAX Very minor nit: the indentation here is different to that on the surrounding lines - they use tabs, while the new line uses spaces. Again, I can fix this on apply. Thanks, /Bruce