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 EAED6A0351; Thu, 3 Mar 2022 13:57:16 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 82B1940687; Thu, 3 Mar 2022 13:57:16 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 35B3C40141 for ; Thu, 3 Mar 2022 13:57:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646312235; x=1677848235; h=message-id:date:to:cc:references:from:subject: in-reply-to:content-transfer-encoding:mime-version; bh=n0mVLNyXqstmHsClpmNQfh/dIz5WtpFKe8WSRSlkL2M=; b=H+V/OGpW5btUj740IYEidC1A1IcfAwhAoQsfmbdXhcn+vqq+moiC4NVQ eHTI0W/y1bJsj91qZNCmVgEOBUA8dwDg9wVtdZKQwU4Ufqr5GTu96peDO O2vyUQ7cHqli3/JQ2uSZ5Tmr+Qa6IIzrlhgZETnnWnnsidXr15JVlECVo bckP0DAH2P6vxkWega92k0K2Igwgbvh7tJnRYYRNTa+B0zXs0b9d+Hkrl 9Mq9h8jEl3dK5l2q4A+TImdLhqsu5z/gb4hw+voEtFmS23VM0zZv38UFj fWy8D6Kl2FqB48Zng/v3/uP9nnPWY+C47PXS6jgPDBRd/BcGAajtd/XsJ A==; X-IronPort-AV: E=McAfee;i="6200,9189,10274"; a="253595362" X-IronPort-AV: E=Sophos;i="5.90,151,1643702400"; d="scan'208";a="253595362" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2022 04:57:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,151,1643702400"; d="scan'208";a="551737964" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga008.jf.intel.com with ESMTP; 03 Mar 2022 04:57:13 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) 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.2308.21; Thu, 3 Mar 2022 04:57:13 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) 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.2308.21 via Frontend Transport; Thu, 3 Mar 2022 04:57:13 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.106) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.21; Thu, 3 Mar 2022 04:57:13 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HiGU1iVUJY6sTOAJsm/K7HD/u1H2LIe4W8IRDyy0wR9osrsw+AiUQikbTznhvvxKes8JZAVkLSS+rfOLSWBmIP3jSsCVvf797UYQgdGmec7uyOMm7HBlUWaTqtWWWkVca8WLgG4AkG94Z9HrPGgwUCvRBgFzd00BLrWAB8WKjuEYDeOhP/LNOav0QE0fxPmIv3aKXTCzdeUcGctqn3n3a6XymJvv9L9wbckbnUijtZA5ZGqIl+D1904lFciy1O5pM62OXxtHdWQ0bLJX2NQXhLELc/VnmHr1voeMrDj6kC7VTlT6LYa8CWUIxnUuyG45SNNPYjAaFCfejt3kJ3jsPQ== 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=4fpzbO5rZI/Md7hsTEHNsExF1yTDSWaIspjeOVxhUqI=; b=ivDSU/XT/WwDrdY7ih3dmabjwwB6nYmj57lDdegI0zY/d0mHNRoIqZfr/HaaJXXuQUT7Plds4+zwSuIVxQEmnUOmjguYP9AZKITjGpzzQSIGY+Bjwnkatnf6x8O2ZmohZp25meDwRB/dmI0Lv7pjuKXMkWk6VZMojVbJVkMU3k/Tase6YYIFw6f8LY9G5KkVzkXitfz/pBwQt7DlsuN3swtmPXKfPciBXmm3hcY1RwMz9oEMECGZEkPYXuH92QOpjnJ6eKV0PGckSjyxQYgS8PFq0wJROKA+RP3SO2F2PIqt/CfeqIgEDJXN2nTz+/JkDBxbmVPt1sjYZyT1hIA2jg== 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 PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by MN2PR11MB4398.namprd11.prod.outlook.com (2603:10b6:208:18b::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.15; Thu, 3 Mar 2022 12:57:11 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd21:6fbe:8308:2ecf]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd21:6fbe:8308:2ecf%7]) with mapi id 15.20.5038.015; Thu, 3 Mar 2022 12:57:11 +0000 Message-ID: <6d96be71-a21f-5413-36b8-e9771bf6fe9f@intel.com> Date: Thu, 3 Mar 2022 12:57:05 +0000 Content-Language: en-US To: Michael Baum , CC: Xiaoyun Li , Aman Singh , Yuying Zhang , Matan Azrad References: <20220301202615.4103972-1-michaelba@nvidia.com> <20220301202615.4103972-2-michaelba@nvidia.com> From: Ferruh Yigit Subject: Re: [PATCH 1/2] app/testpmd: add test for remote PD and CTX X-User: ferruhy In-Reply-To: <20220301202615.4103972-2-michaelba@nvidia.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0198.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9e::18) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3dd46d1d-89eb-4b5f-b87c-08d9fd1554ec X-MS-TrafficTypeDiagnostic: MN2PR11MB4398: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: SXar6rA0iUptpjAPzwZLFPEb6f4cw1P+rO8xb5cWs+URLkQVorYFYkKDfEwO94WUtkYeV38F2/1cw1U2l8GjaDZKhw+RKJleMFhF4arv3qz5spdNRSWerHsHxmXDjeMiM3NUqGWfd0/jUOkirzP5Ltvsk0rjQIKgwLwiTgWL15TufOWOlXPwlTvFwxHD3sb9m+Yz4Duleo8Yq6lple/KSOD4ezORWN63U3i+5vKhNJlCfCdIoTpGYk3Ehncm1DUNbgdcZFItDgjFjD2x9q4uIRDhy36mXeWJqHNJgFY2oYa1DFz4ZIOESEjdO/tUAP0KdKUweYyBHzvgrMJ6+S1FL4Fqy5wj0EZB684dVKiin7u84HcFWVgar6AilEmGAggrgpyfs1UFAPTjAqx1ss0b5GlMi8KlinbLcTSWc8S47ONY9hpe9ORE+AJfzqC36dy6svq+9wr3LolFyg/X0yynbz1VMsTsPpU1sYjLPSK3b18hkpXtWwz+1RVPSyZcby29m5t5GeInlRtGuaWg1KOx9Vo0v//821yKAq8Dwd1N9VBxBMg/4mpr3FDK7WpAB2/nxUHBNwX7fiA59dyTq0kxlDa8h54tNoywrATxeRFrGXsFxsngnn5rRvQHQKDYHqdH0rX5w7OhQje/ORjUpWpHcwRmXW2sLHTVmyug36zbVG9h596firERvRPNHjQsrL/LhP7zjW1okYRtJHIam1TtHA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(508600001)(6486002)(316002)(66556008)(66476007)(66946007)(31696002)(86362001)(4326008)(8676002)(82960400001)(2906002)(38100700002)(54906003)(83380400001)(36756003)(5660300002)(44832011)(6666004)(6512007)(31686004)(6506007)(8936002)(186003)(26005)(2616005)(53546011)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?THBNWENNV2ZRMkZFU2wxeXhwOG9rdElSUWhGTkYvbFZsbGovVEpaaEVJV1JS?= =?utf-8?B?cHVKamoya0hFR1lhWTdhMjR2ZDZVb1l1UVV1aG5yQU9ubE5QSmVmRnlyaEVO?= =?utf-8?B?aTlyWG83bjdkS3ZTRmVFTlloc0ZyYkRGTXVTM2owL3RtV2dUNTJlb2VqMWFF?= =?utf-8?B?TXBJSElkQ0U2OWxUODBqSUk3NE9Nb3gydE43SVNOdjArRldHbXRIVVZXbEt4?= =?utf-8?B?MDJvMFFGd1FmOFd2dzdLUFgxOUttVmkxUHBkOW14NXArK1BzMm1WUWJ5dkU2?= =?utf-8?B?ejJhTTZhcnNBcHhWYXNMOWhhMjlqUzdmQVVjcFBRbzRFTnhzakJMRXgwTkJF?= =?utf-8?B?bGhyc2ljSlJpL1N5QmtHVHU0aGNNaFJuVmtsM0JibjRYK2VmYnlNMTlEVW9W?= =?utf-8?B?ekszVVFaYlh3RmxlbUhQYndkNmY3VDVHaWtsWGNIM2JKVkpsS1FkT0EvZCtr?= =?utf-8?B?M1pNT2src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11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2022 12:57:11.3074 (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: upfZhMKt/uD0UrDwdGC0RY82aNnOGpm8tx92jIqavhnRj1iW7vipPv0xbrxPR4qOT5BmIkkK3r6TEtHBzHh94A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4398 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 3/1/2022 8:26 PM, Michael Baum wrote: > Add mlx5 internal option in testpmd run-time function "port attach" to > add another parameter named "mlx5_socket" for attaching port and add 2 > devargs before. > > The arguments are "cmd_fd" and "pd_handle" using to import device > created out of PMD. Testpmd application import it using IPC, and updates > the devargs list before attaching. > > The syntax is: > > testpmd > port attach (identifier) mlx5_socket=(path) > > Where "path" is the IPC socket path agreed on the remote process. > > Signed-off-by: Michael Baum > Acked-by: Matan Azrad <...> > diff --git a/app/test-pmd/meson.build b/app/test-pmd/meson.build > index 43130c8856..c4fd379e67 100644 > --- a/app/test-pmd/meson.build > +++ b/app/test-pmd/meson.build > @@ -73,3 +73,6 @@ endif > if dpdk_conf.has('RTE_NET_DPAA') > deps += ['bus_dpaa', 'mempool_dpaa', 'net_dpaa'] > endif > +if dpdk_conf.has('RTE_NET_MLX5') > + deps += 'net_mlx5' > +endif Is this patch introduce any build time dependency to mlx5 driver? If not this chunk should go to next patch, which uses mlx5 PMD specific API. <...> > diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > index 1083c6d538..d6490947c4 100644 > --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > @@ -2127,6 +2127,46 @@ the mode and slave parameters must be given. > Done > > > +port attach with mlx5 socket path > +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > + > +MLX5 internal option to attach a port specified by pci address or virtual device > +args and add extra devargs to it, which is imported from external process:: > + > + testpmd> port attach (identifier) mlx5_socket=(path) > + > +where: > + > +* ``identifier``: pci address or virtual device args. > +* ``path``: socket path to import arguments agreed by the external process. > + > +The mlx5 PMD enables to import CTX and PD created outside the PMD. > +It gets as devargs the device's ``cmd_fd`` and ``pd_handle``, > +then using those arguments to import objects. > +See :ref:`mlx5 driver options ` for more information. > + > +When ``cmd_fd`` and ``pd_handle`` arguments are coming from another process, > +the FD must be dup'd before being passed. > +In this function, testpmd initializes IPC socket to get FD using SCM_RIGHTS. > +It gets the external process socket path, then import the ``cmd_fd`` and > +``pd_handle`` arguments and add them to devargs list. > +After updating this, it calls the regular ``port attach`` function > +with extended idevtifier. > + > +For example, to attach a port whose pci address is ``0000:0a:00.0`` and its > +socket path is ``/var/run/import_ipc_socket``. > + > +.. code-block:: console > + > + testpmd> port attach 0000:0a:00.0 mlx5_socket=/var/run/import_ipc_socket > + Attaching a new port... > + testpmd: MLX5 socket path is /var/run/import_ipc_socket > + testpmd: Attach port with extra devargs 0000:0a:00.0,cmd_fd=40,pd_handle=1 > + EAL: Probe PCI driver: mlx5_pci (15b3:101d) device: 0000:03:00.0 (socket 0) > + Port 0 is attached. Now total ports is 1 > + Done > + > + Hi Michael, This is too much mlx5 specific addition, and I don't think it is good to extend testpmd with PMD specific code. If we enable it, sure there will be other vendors willing to do the same, making testpmd even messier. I don't know what those ``cmd_fd`` and ``pd_handle`` (that read from provided socket), but can they be read from some other script and feed to testpmd, like a python wrapper etc...