[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 1/2] Fix ixgbe RSS operation


  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: Mitch Williams <mitch.a.williams@xxxxxxxxx>
  • Date: Tue, 10 Feb 2009 15:10:18 -0800
  • Cc: steven.smith@xxxxxxxxxxxxx, joserenato.santos@xxxxxx
  • Delivery-date: Tue, 10 Feb 2009 15:11:55 -0800
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; b=YbRBbxjKdesoG++qS7mbvlZXcs4RJUHH1LWs7A2OP5xcz2IGcwwKE+Ue6OaUGlV1Ij YAAHpnwRHjrvuw+K/h1UtP5vSFQ9xeW8enbhQCQ5chOgCdmHrP1Lo3z/nTdZhC36eydO ghrCI5WdBf0Rci3TP5yE4a1e+i6sDLHONwevc=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

The addition of VMDq support to ixgbe completely broke normal RSS
receive operation.  Since RSS is the default operating mode, the
driver would cause a kernel panic as soon as the interface was opened.
 This patch fixes the problem by correctly checking the VMDQ_ENABLED
flag before attempting any VMDQ-specific call.

Signed-off-by: Mitch Williams <mitch.a.williams@xxxxxxxxx>

diff -r fcc044a90d40 drivers/net/ixgbe/ixgbe_main.c
--- a/drivers/net/ixgbe/ixgbe_main.c    Thu Jan 29 10:46:35 2009 +0000
+++ b/drivers/net/ixgbe/ixgbe_main.c    Tue Feb 10 10:13:32 2009 -0800
@@ -432,15 +432,11 @@
        u16 tag = le16_to_cpu(rx_desc->wb.upper.vlan);

 #ifdef CONFIG_XEN_NETDEV2_BACKEND
-       if(ring->queue_index) {
+       if ((adapter->flags & IXGBE_FLAG_VMDQ_ENABLED) && ring->queue_index) {
                /* This is a VMDq packet destined for a VM. */
                vmq_netif_rx(skb, ring->queue_index);
                return;
        }
-       else {
-               netif_rx(skb);
-               return;
-       }
 #endif
 #ifndef IXGBE_NO_INET_LRO
        if (adapter->netdev->features & NETIF_F_LRO &&
@@ -524,7 +520,8 @@
        adapter->hw_csum_rx_good++;

 #ifdef CONFIG_XEN_NETDEV2_BACKEND
-       skb->proto_data_valid = 1;
+       if (adapter->flags & IXGBE_FLAG_VMDQ_ENABLED)
+               skb->proto_data_valid = 1;
 #endif
 }

@@ -1060,9 +1057,8 @@
                skb = rx_buffer_info->skb;
                rx_buffer_info->skb = NULL;
 #ifdef CONFIG_XEN_NETDEV2_BACKEND
-               if(!rx_ring->queue_index || !skb_shinfo(skb)->nr_frags) {
-                       prefetch(skb->data - NET_IP_ALIGN);
-               } else {
+               if ((adapter->flags & IXGBE_FLAG_VMDQ_ENABLED) &&
+                    rx_ring->queue_index) {
                        /* for Xen VMDq, packet data goes in first page of
                         * skb, instead of data.
                         */
@@ -1071,6 +1067,8 @@
                                       PAGE_SIZE, PCI_DMA_FROMDEVICE);
                        skb->len += len;
                        skb_shinfo(skb)->frags[0].size = len;
+               } else {
+                       prefetch(skb->data - NET_IP_ALIGN);
                }
 #else
                prefetch(skb->data - NET_IP_ALIGN);
@@ -1135,7 +1133,7 @@
                total_rx_bytes += skb->len;
                total_rx_packets++;
 #ifdef CONFIG_XEN_NETDEV2_BACKEND
-               if(!rx_ring->queue_index)
+               if (skb->data)
 #endif
                        skb->protocol = eth_type_trans(skb, adapter->netdev);

@@ -2907,7 +2905,8 @@
                rx_buffer_info = &rx_ring->rx_buffer_info[i];
                if (rx_buffer_info->skb) {
 #ifdef CONFIG_XEN_NETDEV2_BACKEND
-                       if (rx_ring->queue_index) {
+                       if ((adapter->flags & IXGBE_FLAG_VMDQ_ENABLED) &&
+                            rx_ring->queue_index) {
                                pci_unmap_page(pdev, rx_buffer_info->dma,
                                               PAGE_SIZE,
                                               PCI_DMA_FROMDEVICE);
diff -r fcc044a90d40 drivers/net/ixgbe/ixgbe_param.c
--- a/drivers/net/ixgbe/ixgbe_param.c   Thu Jan 29 10:46:35 2009 +0000
+++ b/drivers/net/ixgbe/ixgbe_param.c   Tue Feb 10 10:13:32 2009 -0800
@@ -724,8 +724,9 @@
                }
 #endif
 #ifdef CONFIG_XEN_NETDEV2_BACKEND
-       if (adapter->flags &
-           (IXGBE_FLAG_RX_PS_CAPABLE | IXGBE_FLAG_VMDQ_ENABLED)) {
+       if ((adapter->flags &
+             (IXGBE_FLAG_RX_PS_CAPABLE | IXGBE_FLAG_VMDQ_ENABLED)) ==
+             (IXGBE_FLAG_RX_PS_CAPABLE | IXGBE_FLAG_VMDQ_ENABLED)) {
                printk(KERN_INFO "ixgbe: packet split disabled for Xen VMDQ\n");
                adapter->flags &= ~IXGBE_FLAG_RX_PS_CAPABLE;
        }

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.