SHA256
1
0
forked from pool/dpdk

Accepting request 395036 from home:markoschandras:network-fixes

- Create DPDK packages for 32 bit x86(bsc#977639).

- Add upstream patch for the ixgbe driver
  * 0007-ixgbe-fix-VLAN-filter-missing-brackets.patch: Fix VLAN
    filtering logic by adding the missing brackets in the 'if' statement.

- DPDK is most common vhost-user backend, Adding upstream patches to 
  help qemu vm live migration with vhost-user (fate#320713).
  [+ 0004-54f9e32-vhost-handle-dirty-pages-logging-request.patch
   + 0005-d293dac-vhost-claim-support-of-guest-announce.patch
   + 0006-d639996-vhost-enable-log_shmfd-protocol-feature.patch]

OBS-URL: https://build.opensuse.org/request/show/395036
OBS-URL: https://build.opensuse.org/package/show/network/dpdk?expand=0&rev=2
This commit is contained in:
Nirmoy Das 2016-05-12 13:45:14 +00:00 committed by Git OBS Bridge
parent 2d571212a5
commit 07199cc622
7 changed files with 286 additions and 6 deletions

View File

@ -0,0 +1,152 @@
commit 54f9e32305d4a8d30c2a4ae059d310189b312498
Author: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Date: Fri Jan 29 12:57:56 2016 +0800
vhost: handle dirty pages logging request
VHOST_USER_SET_LOG_BASE request is used to tell the backend (dpdk
vhost-user) where we should log dirty pages, and how big the log
buffer is.
This request introduces a new payload:
typedef struct VhostUserLog {
uint64_t mmap_size;
uint64_t mmap_offset;
} VhostUserLog;
Also, a fd is delivered from QEMU by ancillary data.
With those info given, an area of memory is mmaped, assigned
to dev->log_base, for logging dirty pages.
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Victor Kaplansky <victork@redhat.com>
Tested-by: Pavel Fedin <p.fedin@samsung.com>
Index: dpdk-2.2.0/lib/librte_vhost/rte_virtio_net.h
===================================================================
--- dpdk-2.2.0.orig/lib/librte_vhost/rte_virtio_net.h
+++ dpdk-2.2.0/lib/librte_vhost/rte_virtio_net.h
@@ -129,7 +129,9 @@ struct virtio_net {
char ifname[IF_NAME_SZ]; /**< Name of the tap device or socket path. */
uint32_t virt_qp_nb; /**< number of queue pair we have allocated */
void *priv; /**< private context */
- uint64_t reserved[64]; /**< Reserve some spaces for future extension. */
+ uint64_t log_size; /**< Size of log area */
+ uint64_t log_base; /**< Where dirty pages are logged */
+ uint64_t reserved[62]; /**< Reserve some spaces for future extension. */
struct vhost_virtqueue *virtqueue[VHOST_MAX_QUEUE_PAIRS * 2]; /**< Contains all virtqueue information. */
} __rte_cache_aligned;
Index: dpdk-2.2.0/lib/librte_vhost/vhost_user/vhost-net-user.c
===================================================================
--- dpdk-2.2.0.orig/lib/librte_vhost/vhost_user/vhost-net-user.c
+++ dpdk-2.2.0/lib/librte_vhost/vhost_user/vhost-net-user.c
@@ -388,9 +388,12 @@ vserver_message_handler(int connfd, void
break;
case VHOST_USER_SET_LOG_BASE:
- RTE_LOG(INFO, VHOST_CONFIG, "not implemented.\n");
- break;
+ user_set_log_base(ctx, &msg);
+ /* it needs a reply */
+ msg.size = sizeof(msg.payload.u64);
+ send_vhost_message(connfd, &msg);
+ break;
case VHOST_USER_SET_LOG_FD:
close(msg.fds[0]);
RTE_LOG(INFO, VHOST_CONFIG, "not implemented.\n");
Index: dpdk-2.2.0/lib/librte_vhost/vhost_user/vhost-net-user.h
===================================================================
--- dpdk-2.2.0.orig/lib/librte_vhost/vhost_user/vhost-net-user.h
+++ dpdk-2.2.0/lib/librte_vhost/vhost_user/vhost-net-user.h
@@ -83,6 +83,11 @@ typedef struct VhostUserMemory {
VhostUserMemoryRegion regions[VHOST_MEMORY_MAX_NREGIONS];
} VhostUserMemory;
+typedef struct VhostUserLog {
+ uint64_t mmap_size;
+ uint64_t mmap_offset;
+} VhostUserLog;
+
typedef struct VhostUserMsg {
VhostUserRequest request;
@@ -97,6 +102,7 @@ typedef struct VhostUserMsg {
struct vhost_vring_state state;
struct vhost_vring_addr addr;
VhostUserMemory memory;
+ VhostUserLog log;
} payload;
int fds[VHOST_MEMORY_MAX_NREGIONS];
} __attribute((packed)) VhostUserMsg;
Index: dpdk-2.2.0/lib/librte_vhost/vhost_user/virtio-net-user.c
===================================================================
--- dpdk-2.2.0.orig/lib/librte_vhost/vhost_user/virtio-net-user.c
+++ dpdk-2.2.0/lib/librte_vhost/vhost_user/virtio-net-user.c
@@ -365,3 +365,51 @@ user_set_protocol_features(struct vhost_
dev->protocol_features = protocol_features;
}
+
+int
+user_set_log_base(struct vhost_device_ctx ctx,
+ struct VhostUserMsg *msg)
+{
+ struct virtio_net *dev;
+ int fd = msg->fds[0];
+ uint64_t size, off;
+ void *addr;
+
+ dev = get_device(ctx);
+ if (!dev)
+ return -1;
+
+ if (fd < 0) {
+ RTE_LOG(ERR, VHOST_CONFIG, "invalid log fd: %d\n", fd);
+ return -1;
+ }
+
+ if (msg->size != sizeof(VhostUserLog)) {
+ RTE_LOG(ERR, VHOST_CONFIG,
+ "invalid log base msg size: %"PRId32" != %d\n",
+ msg->size, (int)sizeof(VhostUserLog));
+ return -1;
+ }
+
+ size = msg->payload.log.mmap_size;
+ off = msg->payload.log.mmap_offset;
+ RTE_LOG(INFO, VHOST_CONFIG,
+ "log mmap size: %"PRId64", offset: %"PRId64"\n",
+ size, off);
+
+ /*
+ * mmap from 0 to workaround a hugepage mmap bug: mmap will
+ * fail when offset is not page size aligned.
+ */
+ addr = mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+ if (addr == MAP_FAILED) {
+ RTE_LOG(ERR, VHOST_CONFIG, "mmap log base failed!\n");
+ return -1;
+ }
+
+ /* TODO: unmap on stop */
+ dev->log_base = (uint64_t)(uintptr_t)addr + off;
+ dev->log_size = size;
+
+ return 0;
+}
Index: dpdk-2.2.0/lib/librte_vhost/vhost_user/virtio-net-user.h
===================================================================
--- dpdk-2.2.0.orig/lib/librte_vhost/vhost_user/virtio-net-user.h
+++ dpdk-2.2.0/lib/librte_vhost/vhost_user/virtio-net-user.h
@@ -49,6 +49,7 @@ void user_set_vring_kick(struct vhost_de
void user_set_protocol_features(struct vhost_device_ctx ctx,
uint64_t protocol_features);
+int user_set_log_base(struct vhost_device_ctx ctx, struct VhostUserMsg *);
int user_get_vring_base(struct vhost_device_ctx, struct vhost_vring_state *);

View File

@ -0,0 +1,28 @@
commit d293dac8f30e46f0cb66fbcce2977d73d56fe103
Author: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Date: Fri Jan 29 12:58:00 2016 +0800
vhost: claim support of guest announce
It's actually a feature already enabled in Linux kernel (since v3.5).
What we need to do is simply to claim that we support such feature,
and nothing else.
With that, the guest will send an ARP message after live migration
to notify the switches about the new location of migrated VM.
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: Pavel Fedin <p.fedin@samsung.com>
Index: dpdk-2.2.0/lib/librte_vhost/virtio-net.c
===================================================================
--- dpdk-2.2.0.orig/lib/librte_vhost/virtio-net.c
+++ dpdk-2.2.0/lib/librte_vhost/virtio-net.c
@@ -74,6 +74,7 @@ static struct virtio_net_config_ll *ll_r
#define VHOST_SUPPORTED_FEATURES ((1ULL << VIRTIO_NET_F_MRG_RXBUF) | \
(1ULL << VIRTIO_NET_F_CTRL_VQ) | \
(1ULL << VIRTIO_NET_F_CTRL_RX) | \
+ (1ULL << VIRTIO_NET_F_GUEST_ANNOUNCE) | \
(VHOST_SUPPORTS_MQ) | \
(1ULL << VIRTIO_F_VERSION_1) | \
(1ULL << VHOST_F_LOG_ALL) | \

View File

@ -0,0 +1,33 @@
commit d639996a74fa71a9553bcef7cb2b2e9bb0fd5203
Author: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Date: Fri Jan 29 12:58:02 2016 +0800
vhost: enable log_shmfd protocol feature
To claim that we support vhost-user live migration support:
SET_LOG_BASE request will be send only when this feature flag
is set.
Besides this flag, we actually need another feature flag set
to make vhost-user live migration work: VHOST_F_LOG_ALL.
Which, however, has been enabled long time ago.
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: Pavel Fedin <p.fedin@samsung.com>
Index: dpdk-2.2.0/lib/librte_vhost/vhost_user/virtio-net-user.h
===================================================================
--- dpdk-2.2.0.orig/lib/librte_vhost/vhost_user/virtio-net-user.h
+++ dpdk-2.2.0/lib/librte_vhost/vhost_user/virtio-net-user.h
@@ -38,8 +38,10 @@
#include "vhost-net-user.h"
#define VHOST_USER_PROTOCOL_F_MQ 0
+#define VHOST_USER_PROTOCOL_F_LOG_SHMFD 1
-#define VHOST_USER_PROTOCOL_FEATURES (1ULL << VHOST_USER_PROTOCOL_F_MQ)
+#define VHOST_USER_PROTOCOL_FEATURES ((1ULL << VHOST_USER_PROTOCOL_F_MQ) | \
+ (1ULL << VHOST_USER_PROTOCOL_F_LOG_SHMFD))
int user_set_mem_table(struct vhost_device_ctx, struct VhostUserMsg *);

View File

@ -0,0 +1,33 @@
From c0de18e856d8c6b4e98ca198091ec7c3528c38e4 Mon Sep 17 00:00:00 2001
From: Aaron Conole <aconole@redhat.com>
Date: Tue, 22 Mar 2016 17:37:15 -0400
Subject: [PATCH] ixgbe: fix VLAN filter missing brackets
The ixgbe vlan filter code has an if check with an incorrect whitespace.
Fixes: fe3a45fd4104 ("ixgbe: add VMDq support")
Signed-off-by: Aaron Conole <aconole@redhat.com>
Acked-by: Panu Matilainen <pmatilai@redhat.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
---
drivers/net/ixgbe/ixgbe_ethdev.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: dpdk/drivers/net/ixgbe/ixgbe_ethdev.c
===================================================================
--- dpdk.orig/drivers/net/ixgbe/ixgbe_ethdev.c
+++ dpdk/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -4258,10 +4258,11 @@ ixgbe_set_pool_vlan_filter(struct rte_et
if (ixgbe_vmdq_mode_check(hw) < 0)
return (-ENOTSUP);
for (pool_idx = 0; pool_idx < ETH_64_POOLS; pool_idx++) {
- if (pool_mask & ((uint64_t)(1ULL << pool_idx)))
+ if (pool_mask & ((uint64_t)(1ULL << pool_idx))) {
ret = hw->mac.ops.set_vfta(hw,vlan,pool_idx,vlan_on);
if (ret < 0)
return ret;
+ }
}
return ret;

View File

@ -1,4 +1,24 @@
-------------------------------------------------------------------
Thu Apr 28 14:39:36 CEST 2016 - ndas@suse.de
- Create DPDK packages for 32 bit x86(bsc#977639).
-------------------------------------------------------------------
Wed Apr 27 14:55:37 UTC 2016 - mchandras@suse.de
- Add upstream patch for the ixgbe driver
* 0007-ixgbe-fix-VLAN-filter-missing-brackets.patch: Fix VLAN
filtering logic by adding the missing brackets in the 'if' statement.
-------------------------------------------------------------------
Tue Apr 19 10:45:29 CEST 2016 - ndas@suse.de
- DPDK is most common vhost-user backend, Adding upstream patches to
help qemu vm live migration with vhost-user (fate#320713).
[+ 0004-54f9e32-vhost-handle-dirty-pages-logging-request.patch
+ 0005-d293dac-vhost-claim-support-of-guest-announce.patch
+ 0006-d639996-vhost-enable-log_shmfd-protocol-feature.patch]
-------------------------------------------------------------------
Mon Apr 18 08:45:58 UTC 2016 - mchandras@suse.de
- Use fdupes to manage duplicate files

View File

@ -17,7 +17,12 @@
%define machine native
%ifarch x86_64
%define target x86_64-%{machine}-linuxapp-gcc
%else if %ix86
%define target i686-%{machine}-linuxapp-gcc
%endif
%bcond_without shared
# Add option to build without examples
%bcond_without examples
@ -34,10 +39,15 @@ Source: http://dpdk.org/browse/dpdk/snapshot/dpdk-stable-%{version}.tar.
Patch1: 0001-enic-fix-Type-punning-and-strict-aliasing-warning.patch
Patch2: 0002-examples-ip_pipeline-fix-implicit-declaration-of-fun.patch
Patch3: 0003-mk-fix-external-shared-library-dependencies-of-libraries.patch
# PATCH-FIX-UPSTREAM: 0004-mk-fix-gcc-5-version-on-suse.patch
Patch4: 0004-mk-fix-gcc-5-version-on-suse.patch
BuildRequires: fdupes
Patch4: 0004-54f9e32-vhost-handle-dirty-pages-logging-request.patch
Patch5: 0005-d293dac-vhost-claim-support-of-guest-announce.patch
Patch6: 0006-d639996-vhost-enable-log_shmfd-protocol-feature.patch
#PATCH-FIX-UPSTREAM 0007-ixgbe-fix-VLAN-filter-missing-brackets.patch
Patch7: 0007-ixgbe-fix-VLAN-filter-missing-brackets.patch
# PATCH-FIX-UPSTREAM: 0099-mk-fix-gcc-5-version-on-suse.patch
Patch99: 0099-mk-fix-gcc-5-version-on-suse.patch
BuildRequires: doxygen
BuildRequires: fdupes
BuildRequires: libnuma-devel
BuildRequires: libpcap-devel
BuildRequires: zlib-devel
@ -46,7 +56,7 @@ BuildRequires: zlib-devel
# other techniques, carefully crafted x86 assembly instructions. As such it
# currently (and likely never will) run on non-x86 platforms
#
ExclusiveArch: x86_64
ExclusiveArch: x86_64 %ix86
%description
The Data Plane Development Kit is a set of libraries and drivers for
@ -101,7 +111,11 @@ as L2 and L3 forwarding.
%patch1 -p1 -z .enic
%patch2 -p1 -z .examples
%patch3 -p1 -z .dtneeded
%patch4 -p1 -z .rtetoolchain
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch99 -p1 -z .rtetoolchain
%build
# set up a method for modifying the resulting .config file
@ -227,7 +241,7 @@ mkdir %{buildroot}%{_docdir}/
mv %{buildroot}%{_datadir}/doc/dpdk %{buildroot}%{_docdir}/
# Remove duplicates
%fdupes %{buildroot}/%{_prefix}
%fdupes %{buildroot}/%{_prefix}
%post devel -p /sbin/ldconfig
%postun devel -p /sbin/ldconfig