Porting 2 dpdk patches to dpdk 16.04 patches

Change-Id: If298d0ba4941b3c8ccec3b407080661b4a06ac5b
Signed-off-by: Todd Foggoa <tfoggoa@cisco.com>
This commit is contained in:
Todd Foggoa 2016-04-12 14:33:55 -04:00 committed by Gerrit Code Review
parent 370a24e36e
commit 619ac1c84c
2 changed files with 106 additions and 0 deletions

View File

@ -0,0 +1,36 @@
From a1020e16640e3b5d8cf32ef7d2914b788a1e06f6 Mon Sep 17 00:00:00 2001
From: Bud Grise <griseb@cisco.com>
Date: Tue, 2 Feb 2016 12:45:44 -0800
Subject: [PATCH 7/8] Fix a crash in igb_uio driver when the device is removed.
This crash happens because the device still has MSI configured,
the fix is to free the IRQ.
Signed-off-by: Todd Foggoa (tfoggoa) <tfoggoa@cisco.com>
---
lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
index 72b2692..bf12391 100644
--- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
+++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
@@ -506,8 +506,15 @@ static void
igbuio_pci_remove(struct pci_dev *dev)
{
struct rte_uio_pci_dev *udev = pci_get_drvdata(dev);
+ struct uio_info *info = pci_get_drvdata(dev);
sysfs_remove_group(&dev->dev.kobj, &dev_attr_grp);
+
+ if (info->irq && (info->irq != UIO_IRQ_CUSTOM)){
+ free_irq(info->irq, info->uio_dev);
+ info->irq = UIO_IRQ_NONE;
+ }
+
uio_unregister_device(&udev->info);
igbuio_pci_release_iomem(&udev->info);
if (udev->mode == RTE_INTR_MODE_MSIX)
--
2.5.4 (Apple Git-61)

View File

@ -0,0 +1,70 @@
From dfb597dfb4c8e36edb4f1db0162a12f9e0d9e695 Mon Sep 17 00:00:00 2001
From: Bud Grise <griseb@cisco.com>
Date: Mon, 1 Feb 2016 14:28:01 -0500
Subject: [PATCH 8/8] Add missing init of packet_type field.
This can cause packets to be mishandled in systems with more than
one type of driver in use.
Signed-off-by: Todd Foggoa (tfoggoa) <tfoggoa@cisco.com>
---
drivers/net/e1000/em_rxtx.c | 2 ++
drivers/net/virtio/virtio_rxtx.c | 2 ++
drivers/net/vmxnet3/vmxnet3_rxtx.c | 1 +
3 files changed, 5 insertions(+)
diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c
index 441ccad..3bac431 100644
--- a/drivers/net/e1000/em_rxtx.c
+++ b/drivers/net/e1000/em_rxtx.c
@@ -793,6 +793,7 @@ eth_em_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
rxm->ol_flags = rx_desc_status_to_pkt_flags(status);
rxm->ol_flags = rxm->ol_flags |
rx_desc_error_to_pkt_flags(rxd.errors);
+ rxm->packet_type = RTE_PTYPE_UNKNOWN;
/* Only valid if PKT_RX_VLAN_PKT set in pkt_flags */
rxm->vlan_tci = rte_le_to_cpu_16(rxd.special);
@@ -1019,6 +1020,7 @@ eth_em_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
first_seg->ol_flags = rx_desc_status_to_pkt_flags(status);
first_seg->ol_flags = first_seg->ol_flags |
rx_desc_error_to_pkt_flags(rxd.errors);
+ first_seg->packet_type = RTE_PTYPE_UNKNOWN;
/* Only valid if PKT_RX_VLAN_PKT set in pkt_flags */
rxm->vlan_tci = rte_le_to_cpu_16(rxd.special);
diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index 7fe14ad..4959d8f 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -644,6 +644,7 @@ virtio_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
rxm->pkt_len = (uint32_t)(len[i] - hdr_size);
rxm->data_len = (uint16_t)(len[i] - hdr_size);
rxm->ol_flags = 0;
+ rxm->packet_type = RTE_PTYPE_UNKNOWN;
if (hw->vlan_strip)
rte_vlan_strip(rxm);
@@ -762,6 +763,7 @@ virtio_recv_mergeable_pkts(void *rx_queue,
rxm->pkt_len = (uint32_t)(len[0] - hdr_size);
rxm->data_len = (uint16_t)(len[0] - hdr_size);
rxm->ol_flags = 0;
+ rxm->packet_type = RTE_PTYPE_UNKNOWN;
rxm->port = rxvq->port_id;
rx_pkts[nb_rx] = rxm;
diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index 4ac0456..d26d2a0 100644
--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
@@ -701,6 +701,7 @@ vmxnet3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
rxm->data_off = RTE_PKTMBUF_HEADROOM;
rxm->ol_flags = 0;
rxm->vlan_tci = 0;
+ rxm->packet_type = RTE_PTYPE_UNKNOWN;
/*
* If this is the first buffer of the received packet,
--
2.5.4 (Apple Git-61)