From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10061.outbound.protection.outlook.com [40.107.1.61]) by dpdk.org (Postfix) with ESMTP id F234EE5D for ; Tue, 6 Mar 2018 07:07:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=JQo2UQKbJKr41ggtJAZpOmSjwsBciU6LVYJz7qHO9u0=; b=i9U/mSrGJhM18ENLcilPR0z4u7x/sg/reIVr1DQn0ldsQ6md86HBRGhQLxxH146ecMS9G5lgsTehxsem4ITBZ4aXDKQpWGIHyg5N0Ox95Gkil1gyx9bTdChQbiIv+0UFWE7a1LOvJ3hpNVgsEf4nU+suBL/IJZhi2i0zwXos/Q0= Received: from AM4PR0501MB2657.eurprd05.prod.outlook.com (10.172.215.19) by AM4PR0501MB2658.eurprd05.prod.outlook.com (10.172.215.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.548.13; Tue, 6 Mar 2018 06:07:40 +0000 Received: from AM4PR0501MB2657.eurprd05.prod.outlook.com ([fe80::79a1:db23:42bd:25e2]) by AM4PR0501MB2657.eurprd05.prod.outlook.com ([fe80::79a1:db23:42bd:25e2%11]) with mapi id 15.20.0567.012; Tue, 6 Mar 2018 06:07:40 +0000 From: Matan Azrad To: Jianfeng Tan , "ferruh.yigit@intel.com" CC: "bruce.richardson@intel.com" , "konstantin.ananyev@intel.com" , "Thomas Monjalon" , "maxime.coquelin@redhat.com" , "anatoly.burakov@intel.com" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH 3/4] drivers/net: do not allocate rte_eth_dev_data privately Thread-Index: AQHTs82FdkxSJ5ATaEq3udX6FuwTJqPCtKJw Date: Tue, 6 Mar 2018 06:07:39 +0000 Message-ID: References: <1520177405-59091-1-git-send-email-jianfeng.tan@intel.com> <1520177405-59091-4-git-send-email-jianfeng.tan@intel.com> In-Reply-To: <1520177405-59091-4-git-send-email-jianfeng.tan@intel.com> Accept-Language: en-US, he-IL Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM4PR0501MB2658; 6:vy4sHmXaaZvwYG829YRwFed3RYI0WvJeUMNlWMOzLOjuz3hFsQK8r5OfzCFZdJ6dv8qNxtTz/rI/9PyqbBnoJoyNmSmYJKBVEmXder2IJyBmBBsVh3h4jwpVN5wnN9X96yalr1jy/Xs8UUY95sIqgGLnJmuGzzgumKS5cML5xrOT/QPYJ8sMi0wikalz2QTRqkRaY+W/9Vcma3O2GlRUnCYECcWsECgfi/eHKWpE9ZU/ejpoVbgKFQ9UtVpPZ0fyz+kamNmi09ehwibyS9tvTxAgiE97vANiAogz8sSaY0YFBHnCDTf02Zqnxo8/iuQQ0hF0PaHIlJcwSQcfcFS10sQxk12hKPG7TVU8nUAOQH+HXmjHe3XOU6HJIKRdZz1z; 5:cu40WChze5eHf9TdPc62cId/U5zWPn/XQFo6fX8cU9K1vnRpYtz4tVIHuaFL6WhBvNhVKbcpXOzBjf08kOwCo4CLrNPd4ZZcUvy8DTdZlRKM52vQIpqjwGhvE/+sL9TAQAbc3WacBIaexdS5zOzq0S4AgRtl8QaZGU3vyA8SOhQ=; 24:IfuHeYhNNP4vxtsktNmByeuaWUPXSXUF1eA+WN4JsHKfK7WNVLVznaTLrVHHsPGT5pwVSPlVxfY5TgYVbwPlZLQAvXwm4TxFdaNIBkUe1io=; 7:Go3pJJthif6XsFZw6iD2cOC4O1YOOxnJl53CSHpPbOBbw7hmU23Bss5xb1pjtvmh3OQoJj+hq/7m0yDEffq8KfGnrUo4d+J3wZgThJbxxks5exMIpQLRC2Xs9dkdNI5M2J7jKyzpqLyMHi7zia7E8JfpDiaVTzKFOiNgTiYqW9L9wZQf9sl/6JupseIz4I5E+XqHYOwpr5eEQA+oodEX2CP5fucxkg4PS/ODMexCmt0eaub8FVm3GTZyy4AIKW08 x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 87528c80-0c2d-4f6c-01b0-08d58328912e x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(3008032)(2017052603328)(7153060)(7193020); SRVR:AM4PR0501MB2658; x-ms-traffictypediagnostic: AM4PR0501MB2658: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(788757137089)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040501)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(3231220)(944501244)(52105095)(10201501046)(6055026)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011); SRVR:AM4PR0501MB2658; BCL:0; PCL:0; RULEID:; SRVR:AM4PR0501MB2658; x-forefront-prvs: 06036BD506 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(39380400002)(346002)(39860400002)(366004)(396003)(189003)(199004)(575784001)(54906003)(478600001)(110136005)(25786009)(33656002)(7736002)(14454004)(6506007)(26005)(102836004)(3280700002)(305945005)(66066001)(4326008)(316002)(106356001)(5660300001)(74316002)(5250100002)(86362001)(966005)(2906002)(3660700001)(6306002)(6436002)(2900100001)(2950100002)(81156014)(2501003)(9686003)(7696005)(99286004)(53936002)(3846002)(186003)(68736007)(229853002)(59450400001)(97736004)(76176011)(105586002)(6116002)(8936002)(55016002)(6246003)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR0501MB2658; H:AM4PR0501MB2657.eurprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: LWM22y8WdkFEWgCcrIVP2rEyydQAxI8+T/W1AZIuayRrgKymV7o89I2HZc1aokbiIN8cU3ZxVoKpR7WXP2EHopCa60z8hsop1TsuTquuodie3+JkGv5cKfpqIj/+izUjv/rvXgx4GTt0I5c0OTCckcIMqhGlAMrbqSIOe/1XpaR/tw1Pqs+btzoGlOMfxq8O5gh8rar/sOwhcrLeQF9bvUy2TSTcSSD8aoFa5J+LqT662eQ0H0HcgXsGBC9aHPkZmOdA2Xd1/8qeT6rK7ZzW9e0rnB5eo1mpeoR9OEkbG7O2IgDB7NSwjUgS8YvGsySyrXxoKM+XQuhUoJUsBVBdMA== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 87528c80-0c2d-4f6c-01b0-08d58328912e X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Mar 2018 06:07:39.9644 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0501MB2658 Subject: Re: [dpdk-dev] [PATCH 3/4] drivers/net: do not allocate rte_eth_dev_data privately 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, 06 Mar 2018 06:07:42 -0000 Hi Jianfeng Please see a comment below. > From: Jianfeng Tan, Sent: Sunday, March 4, 2018 5:30 PM > We introduced private rte_eth_dev_data to allow vdev to be created both i= n > primary process and secondary process(es). This is not friendly to multi- > process model, for example, it leads to port id contention issue if two > processes both find the data entry is free. >=20 > And to get stats of primary vdev in secondary, we must allocate from the > pre-defined array so that we can find it. >=20 > Suggested-by: Bruce Richardson > Signed-off-by: Jianfeng Tan > --- > drivers/net/af_packet/rte_eth_af_packet.c | 25 +++++++------------------ > drivers/net/kni/rte_eth_kni.c | 13 ++----------- > drivers/net/null/rte_eth_null.c | 17 +++-------------- > drivers/net/octeontx/octeontx_ethdev.c | 14 ++------------ > drivers/net/pcap/rte_eth_pcap.c | 18 +++--------------- > drivers/net/tap/rte_eth_tap.c | 9 +-------- > drivers/net/vhost/rte_eth_vhost.c | 17 ++--------------- > 7 files changed, 20 insertions(+), 93 deletions(-) >=20 > diff --git a/drivers/net/af_packet/rte_eth_af_packet.c > b/drivers/net/af_packet/rte_eth_af_packet.c > index 57eccfd..2db692f 100644 > --- a/drivers/net/af_packet/rte_eth_af_packet.c > +++ b/drivers/net/af_packet/rte_eth_af_packet.c > @@ -564,25 +564,17 @@ rte_pmd_init_internals(struct rte_vdev_device > *dev, > RTE_LOG(ERR, PMD, > "%s: no interface specified for AF_PACKET > ethdev\n", > name); > - goto error_early; > + return -1; > } >=20 > RTE_LOG(INFO, PMD, > "%s: creating AF_PACKET-backed ethdev on numa socket > %u\n", > name, numa_node); >=20 > - /* > - * now do all data allocation - for eth_dev structure, dummy pci > driver > - * and internal (private) data > - */ > - data =3D rte_zmalloc_socket(name, sizeof(*data), 0, numa_node); > - if (data =3D=3D NULL) > - goto error_early; > - > *internals =3D rte_zmalloc_socket(name, sizeof(**internals), > 0, numa_node); > if (*internals =3D=3D NULL) > - goto error_early; > + return -1; >=20 > for (q =3D 0; q < nb_queues; q++) { > (*internals)->rx_queue[q].map =3D MAP_FAILED; @@ -604,24 > +596,24 @@ rte_pmd_init_internals(struct rte_vdev_device *dev, > RTE_LOG(ERR, PMD, > "%s: I/F name too long (%s)\n", > name, pair->value); > - goto error_early; > + return -1; > } > if (ioctl(sockfd, SIOCGIFINDEX, &ifr) =3D=3D -1) { > RTE_LOG(ERR, PMD, > "%s: ioctl failed (SIOCGIFINDEX)\n", > name); > - goto error_early; > + return -1; > } > (*internals)->if_name =3D strdup(pair->value); > if ((*internals)->if_name =3D=3D NULL) > - goto error_early; > + return -1; > (*internals)->if_index =3D ifr.ifr_ifindex; >=20 > if (ioctl(sockfd, SIOCGIFHWADDR, &ifr) =3D=3D -1) { > RTE_LOG(ERR, PMD, > "%s: ioctl failed (SIOCGIFHWADDR)\n", > name); > - goto error_early; > + return -1; > } > memcpy(&(*internals)->eth_addr, ifr.ifr_hwaddr.sa_data, > ETH_ALEN); >=20 > @@ -775,14 +767,13 @@ rte_pmd_init_internals(struct rte_vdev_device > *dev, >=20 > (*internals)->nb_queues =3D nb_queues; >=20 > - rte_memcpy(data, (*eth_dev)->data, sizeof(*data)); > + data =3D (*eth_dev)->data; > data->dev_private =3D *internals; > data->nb_rx_queues =3D (uint16_t)nb_queues; > data->nb_tx_queues =3D (uint16_t)nb_queues; > data->dev_link =3D pmd_link; > data->mac_addrs =3D &(*internals)->eth_addr; >=20 > - (*eth_dev)->data =3D data; > (*eth_dev)->dev_ops =3D &ops; >=20 > return 0; > @@ -802,8 +793,6 @@ rte_pmd_init_internals(struct rte_vdev_device *dev, > } > free((*internals)->if_name); > rte_free(*internals); > -error_early: > - rte_free(data); > return -1; > } >=20 I think you should remove the private rte_eth_dev_data freeing in rte_pmd_= af_packet_remove(). This is relevant to all the vdevs here. Question: Does the patch include all the vdevs which allocated private rte_eth_dev_da= ta? If so, it may solve also part of the issue discussed here: https://dpdk.org/dev/patchwork/patch/34047/ Matan. > diff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.= c > index dc4e65f..1a07089 100644 > --- a/drivers/net/kni/rte_eth_kni.c > +++ b/drivers/net/kni/rte_eth_kni.c > @@ -337,25 +337,17 @@ eth_kni_create(struct rte_vdev_device *vdev, > struct pmd_internals *internals; > struct rte_eth_dev_data *data; > struct rte_eth_dev *eth_dev; > - const char *name; >=20 > RTE_LOG(INFO, PMD, "Creating kni ethdev on numa socket %u\n", > numa_node); >=20 > - name =3D rte_vdev_device_name(vdev); > - data =3D rte_zmalloc_socket(name, sizeof(*data), 0, numa_node); > - if (data =3D=3D NULL) > - return NULL; > - > /* reserve an ethdev entry */ > eth_dev =3D rte_eth_vdev_allocate(vdev, sizeof(*internals)); > - if (eth_dev =3D=3D NULL) { > - rte_free(data); > + if (eth_dev =3D=3D NULL) > return NULL; > - } >=20 > internals =3D eth_dev->data->dev_private; > - rte_memcpy(data, eth_dev->data, sizeof(*data)); > + data =3D eth_dev->data; > data->nb_rx_queues =3D 1; > data->nb_tx_queues =3D 1; > data->dev_link =3D pmd_link; > @@ -363,7 +355,6 @@ eth_kni_create(struct rte_vdev_device *vdev, >=20 > eth_random_addr(internals->eth_addr.addr_bytes); >=20 > - eth_dev->data =3D data; > eth_dev->dev_ops =3D ð_kni_ops; >=20 > internals->no_request_thread =3D args->no_request_thread; diff --git > a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c index > d003b28..98fc60c 100644 > --- a/drivers/net/null/rte_eth_null.c > +++ b/drivers/net/null/rte_eth_null.c > @@ -496,7 +496,7 @@ eth_dev_null_create(struct rte_vdev_device *dev, { > const unsigned nb_rx_queues =3D 1; > const unsigned nb_tx_queues =3D 1; > - struct rte_eth_dev_data *data =3D NULL; > + struct rte_eth_dev_data *data; > struct pmd_internals *internals =3D NULL; > struct rte_eth_dev *eth_dev =3D NULL; >=20 > @@ -513,19 +513,9 @@ eth_dev_null_create(struct rte_vdev_device *dev, > RTE_LOG(INFO, PMD, "Creating null ethdev on numa socket %u\n", > dev->device.numa_node); >=20 > - /* now do all data allocation - for eth_dev structure, dummy pci > driver > - * and internal (private) data > - */ > - data =3D rte_zmalloc_socket(rte_vdev_device_name(dev), > sizeof(*data), 0, > - dev->device.numa_node); > - if (!data) > - return -ENOMEM; > - > eth_dev =3D rte_eth_vdev_allocate(dev, sizeof(*internals)); > - if (!eth_dev) { > - rte_free(data); > + if (!eth_dev) > return -ENOMEM; > - } >=20 > /* now put it all together > * - store queue data in internals, > @@ -546,13 +536,12 @@ eth_dev_null_create(struct rte_vdev_device *dev, >=20 > rte_memcpy(internals->rss_key, default_rss_key, 40); >=20 > - rte_memcpy(data, eth_dev->data, sizeof(*data)); > + data =3D eth_dev->data; > data->nb_rx_queues =3D (uint16_t)nb_rx_queues; > data->nb_tx_queues =3D (uint16_t)nb_tx_queues; > data->dev_link =3D pmd_link; > data->mac_addrs =3D ð_addr; >=20 > - eth_dev->data =3D data; > eth_dev->dev_ops =3D &ops; >=20 > /* finally assign rx and tx ops */ > diff --git a/drivers/net/octeontx/octeontx_ethdev.c > b/drivers/net/octeontx/octeontx_ethdev.c > index b739c0b..f58f6af 100644 > --- a/drivers/net/octeontx/octeontx_ethdev.c > +++ b/drivers/net/octeontx/octeontx_ethdev.c > @@ -1039,7 +1039,7 @@ octeontx_create(struct rte_vdev_device *dev, int > port, uint8_t evdev, > char octtx_name[OCTEONTX_MAX_NAME_LEN]; > struct octeontx_nic *nic =3D NULL; > struct rte_eth_dev *eth_dev =3D NULL; > - struct rte_eth_dev_data *data =3D NULL; > + struct rte_eth_dev_data *data; > const char *name =3D rte_vdev_device_name(dev); >=20 > PMD_INIT_FUNC_TRACE(); > @@ -1055,13 +1055,6 @@ octeontx_create(struct rte_vdev_device *dev, int > port, uint8_t evdev, > return 0; > } >=20 > - data =3D rte_zmalloc_socket(octtx_name, sizeof(*data), 0, socket_id); > - if (data =3D=3D NULL) { > - octeontx_log_err("failed to allocate devdata"); > - res =3D -ENOMEM; > - goto err; > - } > - > nic =3D rte_zmalloc_socket(octtx_name, sizeof(*nic), 0, socket_id); > if (nic =3D=3D NULL) { > octeontx_log_err("failed to allocate nic structure"); @@ - > 1097,11 +1090,9 @@ octeontx_create(struct rte_vdev_device *dev, int port, > uint8_t evdev, > eth_dev->data->kdrv =3D RTE_KDRV_NONE; > eth_dev->data->numa_node =3D dev->device.numa_node; >=20 > - rte_memcpy(data, (eth_dev)->data, sizeof(*data)); > + data =3D eth_dev->data; > data->dev_private =3D nic; > - > data->port_id =3D eth_dev->data->port_id; > - snprintf(data->name, sizeof(data->name), "%s", eth_dev->data- > >name); >=20 > nic->ev_queues =3D 1; > nic->ev_ports =3D 1; > @@ -1120,7 +1111,6 @@ octeontx_create(struct rte_vdev_device *dev, int > port, uint8_t evdev, > goto err; > } >=20 > - eth_dev->data =3D data; > eth_dev->dev_ops =3D &octeontx_dev_ops; >=20 > /* Finally save ethdev pointer to the NIC structure */ diff --git > a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c > index c1571e1..f9f53ff 100644 > --- a/drivers/net/pcap/rte_eth_pcap.c > +++ b/drivers/net/pcap/rte_eth_pcap.c > @@ -773,27 +773,16 @@ pmd_init_internals(struct rte_vdev_device *vdev, > struct pmd_internals **internals, > struct rte_eth_dev **eth_dev) > { > - struct rte_eth_dev_data *data =3D NULL; > + struct rte_eth_dev_data *data; > unsigned int numa_node =3D vdev->device.numa_node; > - const char *name; >=20 > - name =3D rte_vdev_device_name(vdev); > RTE_LOG(INFO, PMD, "Creating pcap-backed ethdev on numa socket > %d\n", > numa_node); >=20 > - /* now do all data allocation - for eth_dev structure > - * and internal (private) data > - */ > - data =3D rte_zmalloc_socket(name, sizeof(*data), 0, numa_node); > - if (data =3D=3D NULL) > - return -1; > - > /* reserve an ethdev entry */ > *eth_dev =3D rte_eth_vdev_allocate(vdev, sizeof(**internals)); > - if (*eth_dev =3D=3D NULL) { > - rte_free(data); > + if (*eth_dev =3D=3D NULL) > return -1; > - } >=20 > /* now put it all together > * - store queue data in internals, > @@ -802,7 +791,7 @@ pmd_init_internals(struct rte_vdev_device *vdev, > * - and point eth_dev structure to new eth_dev_data structure > */ > *internals =3D (*eth_dev)->data->dev_private; > - rte_memcpy(data, (*eth_dev)->data, sizeof(*data)); > + data =3D (*eth_dev)->data; > data->nb_rx_queues =3D (uint16_t)nb_rx_queues; > data->nb_tx_queues =3D (uint16_t)nb_tx_queues; > data->dev_link =3D pmd_link; > @@ -812,7 +801,6 @@ pmd_init_internals(struct rte_vdev_device *vdev, > * NOTE: we'll replace the data element, of originally allocated > * eth_dev so the rings are local per-process > */ > - (*eth_dev)->data =3D data; > (*eth_dev)->dev_ops =3D &ops; >=20 > return 0; > diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.= c > index f09db0e..0fb8be5 100644 > --- a/drivers/net/tap/rte_eth_tap.c > +++ b/drivers/net/tap/rte_eth_tap.c > @@ -1348,12 +1348,6 @@ eth_dev_tap_create(struct rte_vdev_device > *vdev, char *tap_name, >=20 > RTE_LOG(DEBUG, PMD, " TAP device on numa %u\n", > rte_socket_id()); >=20 > - data =3D rte_zmalloc_socket(tap_name, sizeof(*data), 0, numa_node); > - if (!data) { > - RTE_LOG(ERR, PMD, "TAP Failed to allocate data\n"); > - goto error_exit_nodev; > - } > - > dev =3D rte_eth_vdev_allocate(vdev, sizeof(*pmd)); > if (!dev) { > RTE_LOG(ERR, PMD, "TAP Unable to allocate device > struct\n"); @@ -1373,7 +1367,7 @@ eth_dev_tap_create(struct > rte_vdev_device *vdev, char *tap_name, > } >=20 > /* Setup some default values */ > - rte_memcpy(data, dev->data, sizeof(*data)); > + data =3D dev->data; > data->dev_private =3D pmd; > data->dev_flags =3D RTE_ETH_DEV_INTR_LSC; > data->numa_node =3D numa_node; > @@ -1384,7 +1378,6 @@ eth_dev_tap_create(struct rte_vdev_device > *vdev, char *tap_name, > data->nb_rx_queues =3D 0; > data->nb_tx_queues =3D 0; >=20 > - dev->data =3D data; > dev->dev_ops =3D &ops; > dev->rx_pkt_burst =3D pmd_rx_burst; > dev->tx_pkt_burst =3D pmd_tx_burst; > diff --git a/drivers/net/vhost/rte_eth_vhost.c > b/drivers/net/vhost/rte_eth_vhost.c > index 3aae01c..aa06ab5 100644 > --- a/drivers/net/vhost/rte_eth_vhost.c > +++ b/drivers/net/vhost/rte_eth_vhost.c > @@ -1016,7 +1016,7 @@ eth_dev_vhost_create(struct rte_vdev_device > *dev, char *iface_name, > int16_t queues, const unsigned int numa_node, uint64_t flags) { > const char *name =3D rte_vdev_device_name(dev); > - struct rte_eth_dev_data *data =3D NULL; > + struct rte_eth_dev_data *data; > struct pmd_internal *internal =3D NULL; > struct rte_eth_dev *eth_dev =3D NULL; > struct ether_addr *eth_addr =3D NULL; > @@ -1026,13 +1026,6 @@ eth_dev_vhost_create(struct rte_vdev_device > *dev, char *iface_name, > RTE_LOG(INFO, PMD, "Creating VHOST-USER backend on numa > socket %u\n", > numa_node); >=20 > - /* now do all data allocation - for eth_dev structure and internal > - * (private) data > - */ > - data =3D rte_zmalloc_socket(name, sizeof(*data), 0, numa_node); > - if (data =3D=3D NULL) > - goto error; > - > list =3D rte_zmalloc_socket(name, sizeof(*list), 0, numa_node); > if (list =3D=3D NULL) > goto error; > @@ -1074,12 +1067,7 @@ eth_dev_vhost_create(struct rte_vdev_device > *dev, char *iface_name, > rte_spinlock_init(&vring_state->lock); > vring_states[eth_dev->data->port_id] =3D vring_state; >=20 > - /* We'll replace the 'data' originally allocated by eth_dev. So the > - * vhost PMD resources won't be shared between multi processes. > - */ > - rte_memcpy(data, eth_dev->data, sizeof(*data)); > - eth_dev->data =3D data; > - > + data =3D eth_dev->data; > data->nb_rx_queues =3D queues; > data->nb_tx_queues =3D queues; > internal->max_queues =3D queues; > @@ -1120,7 +1108,6 @@ eth_dev_vhost_create(struct rte_vdev_device > *dev, char *iface_name, > rte_eth_dev_release_port(eth_dev); > rte_free(internal); > rte_free(list); > - rte_free(data); >=20 > return -1; > } > -- > 2.7.4