From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: Re: [PATCH v4] ethdev: fix port data mismatched in multiple process model Date: Fri, 20 Jan 2017 15:58:50 +0800 Message-ID: <20170120075850.GU10293@yliu-dev.sh.intel.com> References: <1483697780-12088-2-git-send-email-yuanhan.liu@linux.intel.com> <1483948259-8652-1-git-send-email-yuanhan.liu@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org, stable@dpdk.org, Thomas Monjalon , Bruce Richardson , Jan Blunck To: Ferruh Yigit Return-path: Content-Disposition: inline In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Jan 19, 2017 at 06:39:13PM +0000, Ferruh Yigit wrote: > > struct rte_eth_dev * > > rte_eth_dev_allocate(const char *name) > > { > > @@ -210,13 +223,41 @@ struct rte_eth_dev * > > return NULL; > > } > > > > - eth_dev = &rte_eth_devices[port_id]; > > - eth_dev->data = &rte_eth_dev_data[port_id]; > > + eth_dev = eth_dev_get(port_id); > > There can be a merge issue here, please help me understand. > > In repo, different from seen here, this patch does this here: > - eth_dev = &rte_eth_devices[port_id]; > - eth_dev->data = &rte_eth_dev_data[port_id]; > - memset(eth_dev->data, 0, sizeof(*eth_dev->data)); > + memset(&rte_eth_devices[port_id], 0, sizeof(*eth_dev->data)); > + eth_dev = eth_dev_get(port_id); > > Which no more resets the eth_dev->data, but rte_eth_devices[port_id] > (with sizeof(*eth_dev->data)) Nice catch! Sorry, it's a silly error by auto-complete :/ As you said, it should be: memset(&rte_eth_dev_data[port_id], 0, sizeof(struct rte_eth_dev_data)); Will make a patch soon. Thanks. --yliu > > memset(eth_dev->data) added by Jan Blunck on comment: > 7f95f78a8aea ("ethdev: clear data when allocating device") > > most probably it should stay as "memset(eth_dev->data)", but if not, > please aware that commit 7f95f78a8aea removed some assignment from > drivers relying this memset, they needs to be added back.