WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 1/2] Fix ixgbe RSS operation
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
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=+z3Q6EE8s6mhQytFnp6Izy3/QY9GR038NtB9l2woZ7o=; b=KJ9cNdA/VyerdtAZmo3fUv+9ECk1rvqa8JpxABsiA4pk7Ot9PGpeARj+9anmyITxwM JeqyBMMAXCZCRxe626NqA9Yg/ynFz1MvG5KFhjHIjB/R585oUG1S3gja8KdAY1o58Ux5 qe52D063CvEQiDSPqk3rMqw+fwZDYTyevA6BI=
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=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>