From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 664C9A49C; Fri, 19 Jan 2018 13:38:35 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jan 2018 04:38:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,381,1511856000"; d="scan'208";a="11501558" Received: from irsmsx151.ger.corp.intel.com ([163.33.192.59]) by fmsmga007.fm.intel.com with ESMTP; 19 Jan 2018 04:38:32 -0800 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.236]) by IRSMSX151.ger.corp.intel.com ([169.254.4.108]) with mapi id 14.03.0319.002; Fri, 19 Jan 2018 12:38:31 +0000 From: "Ananyev, Konstantin" To: Matan Azrad , Thomas Monjalon , Gaetan Rivet , "Wu, Jingjing" CC: "dev@dpdk.org" , Neil Horman , "Richardson, Bruce" , "stable@dpdk.org" Thread-Topic: [PATCH v3 1/7] ethdev: fix port data reset timing Thread-Index: AQHTkHpnqFX8gq/bpUCPYMM0nh6n7KN7I7Pw Date: Fri, 19 Jan 2018 12:38:31 +0000 Message-ID: <2601191342CEEE43887BDE71AB97725886280A79@irsmsx105.ger.corp.intel.com> References: <1515318351-4756-1-git-send-email-matan@mellanox.com> <1516293317-30748-1-git-send-email-matan@mellanox.com> <1516293317-30748-2-git-send-email-matan@mellanox.com> In-Reply-To: <1516293317-30748-2-git-send-email-matan@mellanox.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNGFhYzEwYjMtZWZmNi00NTgzLWFjMjUtMWQ3YjAwMjBmOWMwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IjlSV1BqOVdsbGFJZElLeEYyM0ZEanBld2VtRXM3UzJoamtwVXlOUEhIVlE9In0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v3 1/7] ethdev: fix port data reset timing 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: Fri, 19 Jan 2018 12:38:36 -0000 > -----Original Message----- > From: Matan Azrad [mailto:matan@mellanox.com] > Sent: Thursday, January 18, 2018 4:35 PM > To: Thomas Monjalon ; Gaetan Rivet ; Wu, Jingjing > Cc: dev@dpdk.org; Neil Horman ; Richardson, Bruce = ; Ananyev, Konstantin > ; stable@dpdk.org > Subject: [PATCH v3 1/7] ethdev: fix port data reset timing >=20 > rte_eth_dev_data structure is allocated per ethdev port and can be > used to get a data of the port internally. >=20 > rte_eth_dev_attach_secondary tries to find the port identifier using > rte_eth_dev_data name field comparison and may get an identifier of > invalid port in case of this port was released by the primary process > because the port release API doesn't reset the port data. >=20 > So, it will be better to reset the port data in release time instead of > allocation time. >=20 > Move the port data reset to the port release API. >=20 > Fixes: d948f596fee2 ("ethdev: fix port data mismatched in multiple proces= s model") > Cc: stable@dpdk.org >=20 > Signed-off-by: Matan Azrad > --- > lib/librte_ether/rte_ethdev.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.= c > index 7044159..156231c 100644 > --- a/lib/librte_ether/rte_ethdev.c > +++ b/lib/librte_ether/rte_ethdev.c > @@ -204,7 +204,6 @@ struct rte_eth_dev * > return NULL; > } >=20 > - memset(&rte_eth_dev_data[port_id], 0, sizeof(struct rte_eth_dev_data)); > eth_dev =3D eth_dev_get(port_id); > snprintf(eth_dev->data->name, sizeof(eth_dev->data->name), "%s", name); > eth_dev->data->port_id =3D port_id; > @@ -252,6 +251,7 @@ struct rte_eth_dev * > if (eth_dev =3D=3D NULL) > return -EINVAL; >=20 > + memset(eth_dev->data, 0, sizeof(struct rte_eth_dev_data)); > eth_dev->state =3D RTE_ETH_DEV_UNUSED; >=20 > _rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_DESTROY, NULL); > -- > 1.8.3.1 Acked-by: Konstantin Ananyev