From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 37A432B91 for ; Fri, 6 Jan 2017 11:14:34 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP; 06 Jan 2017 02:14:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,323,1477983600"; d="scan'208";a="919564002" Received: from yliu-dev.sh.intel.com ([10.239.67.162]) by orsmga003.jf.intel.com with ESMTP; 06 Jan 2017 02:14:32 -0800 From: Yuanhan Liu To: dev@dpdk.org Cc: Yuanhan Liu Date: Fri, 6 Jan 2017 18:16:14 +0800 Message-Id: <1483697780-12088-1-git-send-email-yuanhan.liu@linux.intel.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1482922962-21036-1-git-send-email-yuanhan.liu@linux.intel.com> References: <1482922962-21036-1-git-send-email-yuanhan.liu@linux.intel.com> Subject: [dpdk-dev] [PATCH v3 0/6] net/virtio: fix several multiple process issues 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, 06 Jan 2017 10:14:34 -0000 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