DPDK patches and discussions
 help / color / mirror / Atom feed
From: Yuanhan Liu <yuanhan.liu@linux.intel.com>
To: dev@dpdk.org
Cc: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Subject: [dpdk-dev] [PATCH v3 0/6] net/virtio: fix several multiple process issues
Date: Fri,  6 Jan 2017 18:16:14 +0800	[thread overview]
Message-ID: <1483697780-12088-1-git-send-email-yuanhan.liu@linux.intel.com> (raw)
In-Reply-To: <1482922962-21036-1-git-send-email-yuanhan.liu@linux.intel.com>

v3: - fixed several comments from Thomas regarding to eth_dev
    - updated the release note and nic features matrix

v2: - fixed virtio 1.0 multiple process support
    - fixed the case when few virtio net devices are managed by DPDK
      while few others are handled by Linux kernel.

This patch series fixes few crash issues regarding to multiple process
model. In my limited fuzzy test, now it works for both virtio 0.95 and
1.0, as well as for the case some virtio-net devices are managed by
kernel device while some others are managed by DPDK.

---
Maintaining the multiple process support is not an easy task -- you
have to be very mindful while coding -- what kind of stuff should
and should not be in shared memory. Otherwise, it's very likely the
multiple process model will be broken.

A typical example is the ops pointer, a pointer to a set of function
pointers.  Normally, it's a pointer stored in a read-only data section
of the application:

    static const struct virtio_pci_ops legacy_ops = {
            ...,
    }

The pointer, of course, may vary in different process space. If,
however, we store the pointer into shared memory, we could only
have one value for it.  Setting it from process A and accessing
it from process B would likely lead to an illegal memory access.
As a result, crash happens.

The fix is to keep those addresses locally, in a new struct,
virtio_hw_internal. By that, each process maintains it's own
version of the pointer (from its own process space). Thus,
everything would work as expected.


---
Yuanhan Liu (6):
  ethdev: fix port data mismatched in multiple process model
  net/virtio: fix wrong Rx/Tx method for secondary process
  net/virtio: store PCI operators pointer locally
  net/virtio: store IO port info locally
  net/virtio: fix multiple process support
  net/virtio: remove dead structure field

 doc/guides/nics/features/virtio.ini     |  1 +
 doc/guides/rel_notes/release_17_02.rst  |  5 ++
 drivers/net/virtio/virtio_ethdev.c      | 69 +++++++++++++++++++++++++---
 drivers/net/virtio/virtio_pci.c         | 81 +++++++++++++++++----------------
 drivers/net/virtio/virtio_pci.h         | 25 ++++++++--
 drivers/net/virtio/virtio_user_ethdev.c |  5 +-
 drivers/net/virtio/virtqueue.h          |  2 +-
 lib/librte_ether/rte_ethdev.c           | 77 +++++++++++++++++++++++++++----
 8 files changed, 204 insertions(+), 61 deletions(-)

-- 
1.9.0

  parent reply	other threads:[~2017-01-06 10:14 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-22  7:18 [dpdk-dev] [PATCH 0/3] net/virtio: a temp to fix few " Yuanhan Liu
2016-12-22  7:18 ` [dpdk-dev] [PATCH 1/3] net/virtio: fix crash for secondary process Yuanhan Liu
2016-12-22  7:18 ` [dpdk-dev] [PATCH 2/3] net/virtio: fix multiple process support Yuanhan Liu
2016-12-22  7:18 ` [dpdk-dev] [PATCH 3/3] net/virtio: fix wrong Rx/Tx method for secondary process Yuanhan Liu
2016-12-22  7:23 ` [dpdk-dev] [PATCH 0/3] net/virtio: a temp to fix few multiple process issues Yuanhan Liu
2016-12-22  8:29 ` Xu, Qian Q
2016-12-28 11:02 ` [dpdk-dev] [PATCH v2 0/6] net/virtio: fix several " Yuanhan Liu
2016-12-28 11:02   ` [dpdk-dev] [PATCH v2 1/6] ethdev: fix port data mismatched in multiple process model Yuanhan Liu
2017-01-04 17:34     ` Thomas Monjalon
2017-01-05  6:25       ` Yuanhan Liu
2016-12-28 11:02   ` [dpdk-dev] [PATCH v2 2/6] net/virtio: fix wrong Rx/Tx method for secondary process Yuanhan Liu
2016-12-28 11:02   ` [dpdk-dev] [PATCH v2 3/6] net/virtio: store PCI operators pointer locally Yuanhan Liu
2016-12-28 11:02   ` [dpdk-dev] [PATCH v2 4/6] net/virtio: store IO port info locally Yuanhan Liu
2016-12-28 11:02   ` [dpdk-dev] [PATCH v2 5/6] net/virtio: fix multiple process support Yuanhan Liu
2016-12-28 11:14     ` Yuanhan Liu
2016-12-28 11:02   ` [dpdk-dev] [PATCH v2 6/6] net/virtio: remove dead structure field Yuanhan Liu
2017-01-06 10:16   ` Yuanhan Liu [this message]
2017-01-06 10:16     ` [dpdk-dev] [PATCH v3 1/6] ethdev: fix port data mismatched in multiple process model Yuanhan Liu
2017-01-06 13:12       ` Thomas Monjalon
2017-01-06 14:19         ` Yuanhan Liu
2017-01-09  7:50       ` [dpdk-dev] [PATCH v4] " Yuanhan Liu
2017-01-09 17:08         ` Thomas Monjalon
2017-01-10 14:33           ` Yuanhan Liu
2017-01-11 13:32             ` Thomas Monjalon
2017-01-12  3:10               ` Yuanhan Liu
2017-01-19 18:39         ` Ferruh Yigit
2017-01-20  7:58           ` Yuanhan Liu
2017-01-06 10:16     ` [dpdk-dev] [PATCH v3 2/6] net/virtio: fix wrong Rx/Tx method for secondary process Yuanhan Liu
2017-01-08 23:15       ` Stephen Hemminger
2017-01-09  5:19         ` Yuanhan Liu
2017-01-09  8:02           ` Xu, Qian Q
2017-01-09  8:05             ` Wei, FangfangX
2017-01-06 10:16     ` [dpdk-dev] [PATCH v3 3/6] net/virtio: store PCI operators pointer locally Yuanhan Liu
2017-01-06 10:16     ` [dpdk-dev] [PATCH v3 4/6] net/virtio: store IO port info locally Yuanhan Liu
2017-01-06 10:16     ` [dpdk-dev] [PATCH v3 5/6] net/virtio: fix multiple process support Yuanhan Liu
2017-01-06 10:16     ` [dpdk-dev] [PATCH v3 6/6] net/virtio: remove dead structure field Yuanhan Liu
2017-01-12  6:02       ` Yuanhan Liu

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=1483697780-12088-1-git-send-email-yuanhan.liu@linux.intel.com \
    --to=yuanhan.liu@linux.intel.com \
    --cc=dev@dpdk.org \
    /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).