From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v1] ethdev: fix multi-process NULL dereference crashes Date: Tue, 24 Jan 2017 11:49:14 +0100 Message-ID: <15501893.0xUg90OPpe@xps13> References: <1484073764-15001-1-git-send-email-remy.horton@intel.com> <1923485.xZPm2OXYXH@xps13> <9128e0fe-23b5-4a9f-31c5-29ee22358909@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: Remy Horton Return-path: Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by dpdk.org (Postfix) with ESMTP id 4F94458CB for ; Tue, 24 Jan 2017 11:49:16 +0100 (CET) Received: by mail-wm0-f47.google.com with SMTP id r126so175359219wmr.0 for ; Tue, 24 Jan 2017 02:49:16 -0800 (PST) In-Reply-To: <9128e0fe-23b5-4a9f-31c5-29ee22358909@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2017-01-24 08:16, Remy Horton: > > On 20/01/2017 18:37, Thomas Monjalon wrote: > [..] > > 3 comments here: > > - it is in the wrong section (EAL instead of Drivers) > > - secondary processes can setup a vdev PMD > > - before Yuanhan's patch, even PCI PMD were blanking primary process data > > Since the code being changed is in rte_ether rather than drivers/net it > seemed the logical place to me.. :) The change is in ethdev, and you put the release note in EAL. So no, it is not logical, because ethdev is not EAL. > > I propose this rebase: > > > > - memset(&rte_eth_dev_data[port_id], 0, sizeof(struct rte_eth_dev_data)); > > eth_dev = eth_dev_get(port_id); > > + if (rte_eal_process_type() == RTE_PROC_PRIMARY) > > + memset(eth_dev->data, 0, sizeof(*eth_dev->data)); > > snprintf(eth_dev->data->name, sizeof(eth_dev->data->name), "%s", name); > > eth_dev->data->port_id = port_id; > > eth_dev->data->mtu = ETHER_MTU; > > Seems OK to me, assuming Yuanhan's patch is going in as-is. Yuanhan's patch is already part of RC1.