DPDK patches and discussions
 help / color / mirror / Atom feed
From: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
To: Marcin Kerlin <marcinx.kerlin@intel.com>, dev@dpdk.org
Cc: pablo.de.lara.guarch@intel.com, thomas.monjalon@6wind.com
Subject: Re: [dpdk-dev] [PATCH v5 0/2] app/testpmd: improve multiprocess support
Date: Tue, 18 Oct 2016 08:57:20 +0100	[thread overview]
Message-ID: <3ae82ec8-03bf-9a37-b81c-b8fc1fc30624@intel.com> (raw)
In-Reply-To: <1475244055-6309-1-git-send-email-marcinx.kerlin@intel.com>

On 30/09/2016 15:00, Marcin Kerlin wrote:
> This patch ensure not overwrite device data in the multiprocess application.
>
> 1)Changes in the library introduces continuity in array rte_eth_dev_data[]
> shared between all processes. Secondary process adds new entries in free
> space instead of overwriting existing entries.
>
> 2)Changes in application testpmd allow secondary process to attach the
> mempool created by primary process rather than create new and in the case of
> quit or force quit to free devices data from shared array rte_eth_dev_data[].
>
> -------------------------
> How to reproduce the bug:
>
> 1) Run primary process:
> ./testpmd -c 0xf -n 4 --socket-mem='512,0' -w 03:00.1 -w 03:00.0
> --proc-type=primary --file-prefix=xz1 -- -i
>
> (gdb) print rte_eth_devices[0].data.name
> $52 = "3:0.1"
> (gdb) print rte_eth_devices[1].data.name
> $53 = "3:0.0"
>
> 2) Run secondary process:
> ./testpmd -c 0xf0 --socket-mem='512,0' -n 4 -v -b 03:00.1 -b 03:00.0
> --vdev 'eth_pcap0,rx_pcap=/var/log/device1.pcap, tx_pcap=/var/log/device2.pcap'
> --proc-type=secondary --file-prefix=xz1 -- -i
>
> (gdb) print rte_eth_devices[0].data.name
> $52 = "eth_pcap0"
> (gdb) print rte_eth_devices[1].data.name
> $53 = "eth_pcap1"
>
> 3) Go back to the primary and re-check:
> (gdb) print rte_eth_devices[0].data.name
> $54 = "eth_pcap0"
> (gdb) print rte_eth_devices[1].data.name
> $55 = "eth_pcap1"
>
> It means that secondary process overwrite data of primary process.
>
> This patch fix it and now if we go back to the primary and re-check then
> everything is fine:
> (gdb) print rte_eth_devices[0].data.name
> $56 = "3:0.1"
> (gdb) print rte_eth_devices[1].data.name
> $57 = "3:0.0"
>
> So after this fix structure rte_eth_dev_data[] will keep all data one after
> the other instead of overwriting:
> (gdb) print rte_eth_dev_data[0].name
> $52 = "3:0.1"
> (gdb) print rte_eth_dev_data[1].name
> $53 = "3:0.0"
> (gdb) print rte_eth_dev_data[2].name
> $54 = "eth_pcap0"
> (gdb) print rte_eth_dev_data[3].name
> $55 = "eth_pcap1"
> and so on will be append in the next indexes
>
> If secondary process will be turned off then also will be deleted from array:
> (gdb) print rte_eth_dev_data[0].name
> $52 = "3:0.1"
> (gdb) print rte_eth_dev_data[1].name
> $53 = "3:0.0"
> (gdb) print rte_eth_dev_data[2].name
> $54 = ""
> (gdb) print rte_eth_dev_data[3].name
> $55 = ""
> this also allows re-use index 2 and 3 for next another process
> -------------------------
>
> Breaking ABI:
> Changes in the library librte_ether causes extending existing structure
> rte_eth_dev_data with a new field lock. The reason is that this structure
> is sharing between all the processes so it should be protected against
> attempting to write from two different processes.
>
> Tomasz Kulasek sent announce ABI change in librte_ether on 21 July 2016.
> I would like to join to this breaking ABI, if it is possible.
>
> v2:
> * fix syntax error in version script
> v3:
> * changed scope of function
> * improved description
> v4:
> * fix syntax error in version script
> v5:
> * fix header file
>
> Marcin Kerlin (2):
>    librte_ether: add protection against overwrite device data
>    app/testpmd: improve handling of multiprocess
>
>   app/test-pmd/testpmd.c                 | 37 +++++++++++++-
>   app/test-pmd/testpmd.h                 |  1 +
>   lib/librte_ether/rte_ethdev.c          | 90 +++++++++++++++++++++++++++++++---
>   lib/librte_ether/rte_ethdev.h          | 12 +++++
>   lib/librte_ether/rte_ether_version.map |  6 +++
>   5 files changed, 136 insertions(+), 10 deletions(-)
>

NACK series for 16.11

The patch would break the use case where primary and secondary share 
same PCI device.

Overall, I think Thomas has already mentioned it, we need further 
discussion on the use cases
and scope of DPDK multi-process.
This could be a good topic for the upcoming DPDK Userspace event.

Sergio

  parent reply	other threads:[~2016-10-18  7:57 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-02  8:58 [dpdk-dev] [PATCH " Marcin Kerlin
2016-09-02  8:58 ` [dpdk-dev] [PATCH 1/2] librte_ether: ensure not overwrite device data in mp app Marcin Kerlin
2016-09-11 12:23   ` Yuanhan Liu
2016-09-20 14:06   ` [dpdk-dev] [PATCH v2 0/2] app/testpmd: improve multiprocess support Marcin Kerlin
2016-09-20 14:31   ` Marcin Kerlin
2016-09-20 14:31     ` [dpdk-dev] [PATCH v2 1/2] librte_ether: ensure not overwrite device data in mp app Marcin Kerlin
2016-09-20 16:14       ` Pattan, Reshma
2016-09-22 14:11         ` Kerlin, MarcinX
2016-09-23 14:12           ` Thomas Monjalon
2016-09-26 15:07             ` Kerlin, MarcinX
2016-09-20 16:48       ` Pattan, Reshma
2016-09-22 14:21         ` Kerlin, MarcinX
2016-09-26 14:53       ` [dpdk-dev] [PATCH v3 0/2] app/testpmd: improve multiprocess support Marcin Kerlin
2016-09-26 14:53         ` [dpdk-dev] [PATCH v3 1/2] librte_ether: ensure not overwrite device data in mp app Marcin Kerlin
2016-09-27  3:06           ` Yuanhan Liu
2016-09-27 10:01             ` Kerlin, MarcinX
2016-09-27 10:29           ` [dpdk-dev] [PATCH v4 0/2] app/testpmd: improve multiprocess support Marcin Kerlin
2016-09-27 11:13           ` Marcin Kerlin
2016-09-27 11:13             ` [dpdk-dev] [PATCH v4 1/2] librte_ether: add protection against overwrite device data Marcin Kerlin
2016-09-28 11:00               ` Pattan, Reshma
2016-09-28 14:03               ` Pattan, Reshma
2016-09-29 13:41                 ` Kerlin, MarcinX
2016-09-30 14:00               ` [dpdk-dev] [PATCH v5 0/2] app/testpmd: improve multiprocess support Marcin Kerlin
2016-09-30 14:00                 ` [dpdk-dev] [PATCH v5 1/2] librte_ether: add protection against overwrite device data Marcin Kerlin
2016-09-30 15:00                   ` Pattan, Reshma
2016-10-06  9:41                   ` Thomas Monjalon
2016-10-06 13:57                     ` Kerlin, MarcinX
2016-10-06 14:20                       ` Thomas Monjalon
2016-10-06 14:52                   ` Thomas Monjalon
2016-10-07 12:23                     ` Kerlin, MarcinX
2016-10-11  8:52                       ` Thomas Monjalon
2016-09-30 14:24                 ` [dpdk-dev] [PATCH v5 2/2] app/testpmd: improve handling of multiprocess Marcin Kerlin
2016-09-30 15:02                   ` Pattan, Reshma
2016-09-30 15:03                 ` [dpdk-dev] [PATCH v5 0/2] app/testpmd: improve multiprocess support Pattan, Reshma
2016-10-18  7:57                 ` Sergio Gonzalez Monroy [this message]
2016-09-27 11:13             ` [dpdk-dev] [PATCH v4 2/2] app/testpmd: improve handling of multiprocess Marcin Kerlin
2016-09-28 10:57               ` Pattan, Reshma
2016-09-28 11:34                 ` Kerlin, MarcinX
2016-09-28 12:08                   ` Pattan, Reshma
2016-09-26 14:53         ` [dpdk-dev] [PATCH v3 " Marcin Kerlin
2016-09-20 14:31     ` [dpdk-dev] [PATCH v2 " Marcin Kerlin
2016-09-02  8:58 ` [dpdk-dev] [PATCH " Marcin Kerlin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3ae82ec8-03bf-9a37-b81c-b8fc1fc30624@intel.com \
    --to=sergio.gonzalez.monroy@intel.com \
    --cc=dev@dpdk.org \
    --cc=marcinx.kerlin@intel.com \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=thomas.monjalon@6wind.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).