From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id CFFC3108D for ; Tue, 24 Jan 2017 09:16:32 +0100 (CET) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP; 24 Jan 2017 00:16:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,277,1477983600"; d="scan'208";a="56531824" Received: from rhorton-mobl.ger.corp.intel.com (HELO [163.33.230.192]) ([163.33.230.192]) by orsmga005.jf.intel.com with ESMTP; 24 Jan 2017 00:16:30 -0800 To: Thomas Monjalon References: <1484073764-15001-1-git-send-email-remy.horton@intel.com> <1923485.xZPm2OXYXH@xps13> Cc: dev@dpdk.org From: Remy Horton Organization: Intel Shannon Limited Message-ID: <9128e0fe-23b5-4a9f-31c5-29ee22358909@intel.com> Date: Tue, 24 Jan 2017 08:16:29 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <1923485.xZPm2OXYXH@xps13> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v1] ethdev: fix multi-process NULL dereference crashes 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, 24 Jan 2017 08:16:33 -0000 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.. :) > 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. ..Remy