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 6CF242BA9 for ; Thu, 28 Sep 2017 15:54:42 +0200 (CEST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Sep 2017 06:54:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,450,1500966000"; d="scan'208";a="157117653" Received: from dpdk06.sh.intel.com ([10.67.110.196]) by fmsmga006.fm.intel.com with ESMTP; 28 Sep 2017 06:54:39 -0700 From: Jianfeng Tan To: dev@dpdk.org Cc: bruce.richardson@intel.com, konstantin.ananyev@intel.com, pablo.de.lara.guarch@intel.com, thomas@monjalon.net, yliu@fridaylinux.org, maxime.coquelin@redhat.com, mtetsuyah@gmail.com, ferruh.yigit@intel.com, Jianfeng Tan Date: Thu, 28 Sep 2017 13:55:47 +0000 Message-Id: <1506606959-76230-1-git-send-email-jianfeng.tan@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503654052-84730-1-git-send-email-jianfeng.tan@intel.com> References: <1503654052-84730-1-git-send-email-jianfeng.tan@intel.com> Subject: [dpdk-dev] [PATCH v2 00/12] support to run vdev in the secondary process 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: Thu, 28 Sep 2017 13:54:43 -0000 v2: - Address Gaetan's comment in patch 2. - Add RTE_LOGTYPE_BUS suggested by Gaetan. - Don't moving crypto vdev into drivers/bus/vdev, instead we use a new way (details in patch 3) which may break the ABI (the validate_abi.sh report a low warning of "Problems with Symbols"). - Rename CONFIG_RTE_LIBRTE_VDEV to CONFIG_RTE_LIBRTE_VDEV_BUS. - Return error if there's an existing action for an action name. - Redefine rte_eal_primary_secondary_t as func pointer, and change the first parameter type to avoid explicit type casting. - Handle the case for vhost "primary - VM - secondary" sequence. - Fix a bug in recv multiple messages as one message. - Fix a bug of get vid of -1 in secondary process. - Remove the modification on helloworld example, instead we use symmetric_mp as the test case. - Address yuanhan's comment on code refactor on mp channel. Patch 1~6: move vdev bus into drivers/bus. Patch 7: add unix socket channel for primary/secondary communication. Patch 8~9: make use of the channel to discover and probe virtual devices the primary process. Patch 10~12: support to run vhost-pmd in the secondary process. How to test: Step 1: run symmetric_mp as the primary process. $ ./symmetric_mp -c 2 --proc-type=auto ... \ --vdev 'net_vhost0,iface=/tmp/sock1,queues=2' \ --vdev 'net_vhost1,iface=/tmp/sock2,queues=2' \ -- -p 3 --num-procs=2 --proc-id=0 Step 2: run testpmd as the secondary process. $ ./symmetric_mp -c 4 --proc-type=auto -- -p 3 --num-procs=2 --proc-id=1 Step 3: start VM1. $ ./qemu-system-x86_64 ... -chardev socket,id=chr1,path=/tmp/sock1 \ -netdev type=vhost-user,id=net1,chardev=chr1,vhostforce,queues=2 \ -device virtio-net-pci,netdev=net1,mq=on,vectors=6 ... Step 4: start VM2. $ ./qemu-system-x86_64 ... -chardev socket,id=chr1,path=/tmp/sock2 \ -netdev type=vhost-user,id=net1,chardev=chr1,vhostforce,queues=2 \ -device virtio-net-pci,netdev=net1,mq=on,vectors=6 ... Step 5: enable multi queue in VM1 and VM2. $ ethtool -L ethX combined 2 Note in this test case, only queue 1, i.e., secondary process can process packets. To use queue 1, basically, we can run command like: $ taskset -c 1 Jianfeng Tan (12): cryptodev: remove crypto vdev init API eal: avoid calling rte_vdev_init() cryptodev: avoid dependency on rte_vdev.h bus/fslmc: introduce RTE_LOGTYPE_BUS for bus drivers bus/vdev: move to vdev bus to drivers/bus bus/vdev: normalize log type eal: add channel for primary/secondary communication bus/vdev: scan and probe vdev in secondary processes ethdev: support attach vdev in secondary process vhost: allocate virtio_net in memzone vhost: support to kick in secondary process net/vhost: support to run in the secondary process config/common_base | 5 + doc/guides/rel_notes/deprecation.rst | 5 - drivers/bus/Makefile | 2 + drivers/bus/fslmc/fslmc_bus.c | 5 +- drivers/bus/fslmc/fslmc_logs.h | 42 +- drivers/bus/fslmc/fslmc_vfio.c | 4 +- drivers/bus/vdev/Makefile | 55 +++ drivers/bus/vdev/rte_bus_vdev_version.map | 10 + drivers/bus/vdev/rte_vdev.h | 153 ++++++++ drivers/bus/vdev/vdev.c | 440 +++++++++++++++++++++ drivers/bus/vdev/vdev_logs.h | 40 ++ drivers/net/vhost/rte_eth_vhost.c | 200 +++++++++- lib/librte_cryptodev/rte_cryptodev.c | 6 - lib/librte_cryptodev/rte_cryptodev.h | 18 - lib/librte_cryptodev/rte_cryptodev_pmd.c | 9 +- lib/librte_cryptodev/rte_cryptodev_vdev.c | 161 ++++++++ lib/librte_cryptodev/rte_cryptodev_vdev.h | 3 +- lib/librte_cryptodev/rte_cryptodev_version.map | 1 - lib/librte_eal/bsdapp/eal/Makefile | 1 - lib/librte_eal/bsdapp/eal/rte_eal_version.map | 8 + lib/librte_eal/common/Makefile | 2 +- lib/librte_eal/common/eal_common_dev.c | 21 +- lib/librte_eal/common/eal_common_log.c | 1 + lib/librte_eal/common/eal_common_proc.c | 498 ++++++++++++++++++++++++ lib/librte_eal/common/eal_common_vdev.c | 342 ---------------- lib/librte_eal/common/eal_filesystem.h | 18 + lib/librte_eal/common/eal_private.h | 10 + lib/librte_eal/common/include/rte_dev.h | 24 +- lib/librte_eal/common/include/rte_eal.h | 68 ++++ lib/librte_eal/common/include/rte_log.h | 1 + lib/librte_eal/common/include/rte_vdev.h | 131 ------- lib/librte_eal/linuxapp/eal/Makefile | 1 - lib/librte_eal/linuxapp/eal/eal.c | 6 + lib/librte_eal/linuxapp/eal/rte_eal_version.map | 8 + lib/librte_ether/rte_ethdev_vdev.h | 26 +- lib/librte_vhost/rte_vhost.h | 3 + lib/librte_vhost/rte_vhost_version.map | 7 + lib/librte_vhost/socket.c | 2 + lib/librte_vhost/vhost.c | 71 +++- lib/librte_vhost/vhost.h | 7 +- lib/librte_vhost/vhost_user.c | 17 +- mk/rte.app.mk | 1 + 42 files changed, 1799 insertions(+), 634 deletions(-) create mode 100644 drivers/bus/vdev/Makefile create mode 100644 drivers/bus/vdev/rte_bus_vdev_version.map create mode 100644 drivers/bus/vdev/rte_vdev.h create mode 100644 drivers/bus/vdev/vdev.c create mode 100644 drivers/bus/vdev/vdev_logs.h create mode 100644 lib/librte_cryptodev/rte_cryptodev_vdev.c delete mode 100644 lib/librte_eal/common/eal_common_vdev.c delete mode 100644 lib/librte_eal/common/include/rte_vdev.h -- 2.7.4