RPM: Apex: Backport patch to dpdk to fix PCI walk to fix segfault to 61/15961/5
authorThomas F Herbert <therbert@redhat.com>
Thu, 23 Jun 2016 08:01:17 +0000 (04:01 -0400)
committerThomas F Herbert <therbert@redhat.com>
Thu, 30 Jun 2016 15:39:30 +0000 (11:39 -0400)
ovs-vswitch. Rebased to latest.

Change-Id: Ic7788c4a479378866eda95473bd0c0d398dc33fd
Signed-off-by: Thomas F Herbert <therbert@redhat.com>
build/build_dpdk_rpm.sh
build/patches/dpdk-16.04-virtio-devargs.patch [new file with mode: 0644]
build/patches/spec_file_add_virtio_patch.patch [new file with mode: 0644]

index 91a7fdf..5da0e86 100755 (executable)
@@ -91,6 +91,14 @@ cd copr
 git clone https://github.com/tfherbert/dpdk-snap.git
 cd dpdk-snap
 git checkout $COPR_DPDK_VERSION
+echo "---------------------"
+echo "Apply dpdk dpdk spec file patch"
+echo
+git apply $HOME/patches/spec_file_add_virtio_patch.patch
+echo "---------------------"
+echo "Copy in local dpdk patches"
+echo
+cp $HOME/patches/dpdk-16.04-virtio-devargs.patch $TMPDIR/copr/dpdk-snap
 
 echo "---------------------"
 echo "Build DPDK RPM version $DPDK_VERSION"
diff --git a/build/patches/dpdk-16.04-virtio-devargs.patch b/build/patches/dpdk-16.04-virtio-devargs.patch
new file mode 100644 (file)
index 0000000..f5a3bc4
--- /dev/null
@@ -0,0 +1,22 @@
+diff --git a/drivers/net/virtio/virtio_pci.c b/drivers/net/virtio/virtio_pci.c
+index c007959..3a25f82 100644
+--- a/drivers/net/virtio/virtio_pci.c
++++ b/drivers/net/virtio/virtio_pci.c
+@@ -626,6 +626,7 @@ next:
+  * Return -1:
+  *   if there is error mapping with VFIO/UIO.
+  *   if port map error when driver type is KDRV_NONE.
++ *   if whitelisted but driver type is KDRV_UNKNOWN.
+  * Return 1 if kernel driver is managing the device.
+  * Return 0 on success.
+  */
+@@ -650,7 +651,8 @@ vtpci_init(struct rte_pci_device *dev, struct virtio_hw *hw)
+       PMD_INIT_LOG(INFO, "trying with legacy virtio pci.");
+       if (legacy_virtio_resource_init(dev, hw) < 0) {
+               if (dev->kdrv == RTE_KDRV_UNKNOWN &&
+-                  dev->devargs->type != RTE_DEVTYPE_WHITELISTED_PCI) {
++                    (!dev->devargs ||
++                   dev->devargs->type != RTE_DEVTYPE_WHITELISTED_PCI)) {
+                       PMD_INIT_LOG(INFO,
+                               "skip kernel managed virtio device.");
+                       return 1;
diff --git a/build/patches/spec_file_add_virtio_patch.patch b/build/patches/spec_file_add_virtio_patch.patch
new file mode 100644 (file)
index 0000000..65465f1
--- /dev/null
@@ -0,0 +1,22 @@
+diff --git a/dpdk.spec b/dpdk.spec
+index 2ee5bdd..af2dede 100644
+--- a/dpdk.spec
++++ b/dpdk.spec
+@@ -24,6 +24,9 @@ Source100: dpdk-snapshot.sh
+ # Some tweaking and tuning needed due to Fedora %%optflags
+ Patch2: dpdk-2.2-warningflags.patch
++# Before checking if the virtio device is whitelisted, check if devargs
++# is specified.
++Patch4: dpdk-16.04-virtio-devargs.patch
+ Summary: Set of libraries and drivers for fast packet processing
+@@ -106,6 +109,7 @@ as L2 and L3 forwarding.
+ %prep
+ %setup -q -n %{name}-%{srcver}
+ %patch2 -p1 -z .warningflags
++%patch4 -p1 -z .virtiofix
+ %build
+ function setconf()