From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 9A5DA1B4E0 for ; Tue, 3 Jul 2018 11:45:00 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 7D2A521DC1; Tue, 3 Jul 2018 05:44:59 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 03 Jul 2018 05:44:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=kd4AeZ4g1H/i+LrrhOxVlp/FG+ DZ8UV1FD4GNlHzIYY=; b=G2l3+/OFaj+tP7Rh8GpxjfPxp6PXwKoC64CkDUJjVJ okLFO+/uyXlPOsY9j+BezSzqsmcNsybusLzkRX1J1vhbJ1suhGgV/WOmJWUgwQEY tzepm85WznJ/jE6eJ15jyPUjngPC4fZ8g4F3yvMNwHJlcJL7cRtvjDOrzy7Xpgiu 4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=kd4AeZ 4g1H/i+LrrhOxVlp/FG+DZ8UV1FD4GNlHzIYY=; b=l/FeQnhh5zilfIBNer5IVw GIeDIVxZjQjVt1DMrdWJJDbV7dE4buEyLRVjRmlI3o5SwlOgB74bz9n0IyoiLueH kreqlQM52VXTz44JH4k/qScnZ5iBeLXpWNDPm2PeBxLg0Pv4nLDz8IxOs/wTnSWa 2pjOE5mA1L0L8kE5AFWLepnahsqRQW7Lc1aQv1LB9L8fOLuEqm+7CNgQ6u7rDAl0 BcUlhfuJsKs5gZNqFy42PYXMehKVAgs8RD1j6fAqKzMmkupslKXixjjQivBstJ5w tTop1fjDpkFpFzhuYAfVcxKmc7D57/cTmYCBXefwc4pyUTmNtqYbslspgOrpMhsw == X-ME-Proxy: X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 10CCA10289; Tue, 3 Jul 2018 05:44:57 -0400 (EDT) From: Thomas Monjalon To: Qi Zhang Cc: dev@dpdk.org, anatoly.burakov@intel.com, konstantin.ananyev@intel.com, bruce.richardson@intel.com, ferruh.yigit@intel.com, benjamin.h.shelton@intel.com, narender.vangati@intel.com Date: Tue, 03 Jul 2018 11:44:56 +0200 Message-ID: <2271872.YPHGBAMJzT@xps> In-Reply-To: <20180702054450.29269-4-qi.z.zhang@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> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 09:45:00 -0000 Hi, 02/07/2018 07:44, Qi Zhang: > --- /dev/null > +++ b/lib/librte_ethdev/ethdev_mp.h > @@ -0,0 +1,41 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(c) 2018 Intel Corporation > + */ > + > +#ifndef _RTE_ETHDEV_MP_H_ > +#define _RTE_ETHDEV_MP_H_ > + > +#define MAX_DEV_ARGS_LEN 0x80 > + > +#define ETH_DEV_MP_ACTION_REQUEST "eth_dev_mp_request" > +#define ETH_DEV_MP_ACTION_RESPONSE "eth_dev_mp_response" > + > +enum eth_dev_req_type { > + REQ_TYPE_ATTACH, > + REQ_TYPE_PRE_DETACH, > + REQ_TYPE_DETACH, > + REQ_TYPE_ATTACH_ROLLBACK, > +}; These constants are missing an ethdev prefix. > + > +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); 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)? > --- /dev/null > +++ b/lib/librte_ethdev/ethdev_private.h What is the purpose of a file ethdev_private.h? > @@ -0,0 +1,39 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(c) 2010-2018 Intel Corporation Are you sure about the years? > +/** > + * 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'. No, no. The devargs syntax is being changed, so you should not duplicate its description here. Better to reference an unique source of doc. > + * > + * @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); So you are duplicating rte_eth_dev_attach which is flawed in its design and should be deprecated... 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.