From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 91B961BE78 for ; Tue, 3 Jul 2018 14:59:17 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Jul 2018 05:59:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,303,1526367600"; d="scan'208";a="71910479" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga002.jf.intel.com with ESMTP; 03 Jul 2018 05:59:14 -0700 Received: from fmsmsx119.amr.corp.intel.com (10.18.124.207) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 3 Jul 2018 05:59:14 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX119.amr.corp.intel.com (10.18.124.207) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 3 Jul 2018 05:59:13 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.51]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.87]) with mapi id 14.03.0319.002; Tue, 3 Jul 2018 20:59:11 +0800 From: "Zhang, Qi Z" To: Thomas Monjalon CC: "dev@dpdk.org" , "Burakov, Anatoly" , "Ananyev, Konstantin" , "Richardson, Bruce" , "Yigit, Ferruh" , "Shelton, Benjamin H" , "Vangati, Narender" Thread-Topic: [dpdk-dev] [PATCH v8 03/19] ethdev: enable hotplug on multi-process Thread-Index: AQHUEcfCBI2Nb01f+EKoUu5M4S3vPKR8u1QAgAC41gA= Date: Tue, 3 Jul 2018 12:59:10 +0000 Message-ID: <039ED4275CED7440929022BC67E7061153243483@SHSMSX103.ccr.corp.intel.com> References: <20180607123849.14439-1-qi.z.zhang@intel.com> <20180702054450.29269-1-qi.z.zhang@intel.com> <20180702054450.29269-4-qi.z.zhang@intel.com> <2271872.YPHGBAMJzT@xps> In-Reply-To: <2271872.YPHGBAMJzT@xps> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiODg0MjQzY2ItNmUxYi00MjhiLTllYzktNjk3NjliMWIyMWViIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiTkdWRFlCejY1SjFCWmZja1dNSXhZaDcxbDFYanF2SVd1RmxhaDFidUQ5ZmVyV3ZOWXZqd2M5VVhBTEVUOFFxdiJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v8 03/19] ethdev: enable hotplug on multi-process X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 12:59:18 -0000 Hi Thomas: <...> > > +enum eth_dev_req_type { > > + REQ_TYPE_ATTACH, > > + REQ_TYPE_PRE_DETACH, > > + REQ_TYPE_DETACH, > > + REQ_TYPE_ATTACH_ROLLBACK, > > +}; >=20 > These constants are missing an ethdev prefix. OK, will fix. >=20 > > + > > +struct eth_dev_mp_req { > > + enum eth_dev_req_type t; > > + char devargs[MAX_DEV_ARGS_LEN]; > > + uint16_t port_id; > > + int result; > > +}; > > + > > +/** > > + * this is a synchronous wrapper for secondary process send > > + * request to primary process, this is invoked when an attach > > + * or detach request issued from primary. > > + */ > > +int eth_dev_request_to_primary(struct eth_dev_mp_req *req); > > + > > +/** > > + * this is a synchronous wrapper for primary process send > > + * request to secondary process, this is invoked when an attach > > + * or detach request issued from secondary process. > > + */ > > +int eth_dev_request_to_secondary(struct eth_dev_mp_req *req); >=20 >=20 > Why do we need ethdev functions for IPC (mp request/response)? > How this model can reasonnably scale to other device classes (crypto, > compression, bbdev, eventdev, etc)? Yes it will be more generic to more the multi-process device sync mechanism= into eal layer.(rte_eal_hotplug_add/rte_eal_hotplug_remove) I didn't do this is I'm not very sure if all anothers kinds of device type = need this, but if you think this is a good direction and we need to enable = for all devices,=20 I think this could be our next step. BTW, I guess ethdev still need some IP= C to sync port_id which is specific for itself, and other device type may h= ave similar requirement. > > --- /dev/null > > +++ b/lib/librte_ethdev/ethdev_private.h >=20 > What is the purpose of a file ethdev_private.h? >=20 > > @@ -0,0 +1,39 @@ > > +/* SPDX-License-Identifier: BSD-3-Clause > > + * Copyright(c) 2010-2018 Intel Corporation >=20 > Are you sure about the years? NO, will fix:) >=20 > > +/** > > + * Attach a new Ethernet device in current process. > > + * > > + * @param devargs > > + * A pointer to a strings array describing the new device > > + * to be attached. The strings should be a pci address like > > + * '0000:01:00.0' or virtual device name like 'net_pcap0'. >=20 > No, no. The devargs syntax is being changed, so you should not duplicate = its > description here. Better to reference an unique source of doc. OK, will check and replace with more correct description. >=20 > > + * > > + * @param port_id > > + * A pointer to a port identifier actually attached. > > + * > > + * @return > > + * 0 on success and port_id is filled, negative on error */ int > > +do_eth_dev_attach(const char *devargs, uint16_t *port_id); >=20 > So you are duplicating rte_eth_dev_attach which is flawed in its design a= nd > should be deprecated... OK, just to know this, but I guess it will not be the issue, if we move the= dev sync mechanism into eal layer in future right? Regards Qi >=20 > As you may have noticed, rte_eth_dev_attach() is calling > rte_eal_hotplug_add() which manages the EAL device. > It is wrong because the relation between an ethdev port and an EAL device= is > not a 1:1 mapping. > We must manage the ethdev port as one of the possible abstractions of a > device represented by rte_device. >=20