]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ixgbe: fix select_queue management
authorStephen Hemminger <shemminger@vyatta.com>
Sat, 21 Mar 2009 20:40:01 +0000 (13:40 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 21 Mar 2009 20:40:01 +0000 (13:40 -0700)
Convert ixgbe to use net_device_ops properly.
Rather than changing the select_queue function pointer
just check the flag.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ixgbe/ixgbe_dcb_nl.c
drivers/net/ixgbe/ixgbe_main.c

index 087cf886f2af080fbc15d31bfce479a9907b3796..8a9939ee2927893f2c594d71d246eb6a20c3ec51 100644 (file)
@@ -102,12 +102,6 @@ static u8 ixgbe_dcbnl_get_state(struct net_device *netdev)
        return !!(adapter->flags & IXGBE_FLAG_DCB_ENABLED);
 }
 
-static u16 ixgbe_dcb_select_queue(struct net_device *dev, struct sk_buff *skb)
-{
-       /* All traffic should default to class 0 */
-       return 0;
-}
-
 static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
 {
        u8 err = 0;
@@ -135,7 +129,6 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
                kfree(adapter->rx_ring);
                adapter->tx_ring = NULL;
                adapter->rx_ring = NULL;
-               netdev->select_queue = &ixgbe_dcb_select_queue;
 
                adapter->flags &= ~IXGBE_FLAG_RSS_ENABLED;
                adapter->flags |= IXGBE_FLAG_DCB_ENABLED;
@@ -154,7 +147,6 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
                        kfree(adapter->rx_ring);
                        adapter->tx_ring = NULL;
                        adapter->rx_ring = NULL;
-                       netdev->select_queue = NULL;
 
                        adapter->flags &= ~IXGBE_FLAG_DCB_ENABLED;
                        adapter->flags |= IXGBE_FLAG_RSS_ENABLED;
index 0956be7c74889c22322486477bf020dbb4e2dc95..79aa811c403c5c2d5dcd3bfff6939ae067ccc1e5 100644 (file)
@@ -4321,6 +4321,16 @@ static int ixgbe_maybe_stop_tx(struct net_device *netdev,
        return __ixgbe_maybe_stop_tx(netdev, tx_ring, size);
 }
 
+static u16 ixgbe_select_queue(struct net_device *dev, struct sk_buff *skb)
+{
+       struct ixgbe_adapter *adapter = netdev_priv(dev);
+
+       if (adapter->flags & IXGBE_FLAG_DCB_ENABLED)
+               return 0;  /* All traffic should default to class 0 */
+
+       return skb_tx_hash(dev, skb);
+}
+
 static int ixgbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
 {
        struct ixgbe_adapter *adapter = netdev_priv(netdev);
@@ -4450,6 +4460,7 @@ static const struct net_device_ops ixgbe_netdev_ops = {
        .ndo_open               = ixgbe_open,
        .ndo_stop               = ixgbe_close,
        .ndo_start_xmit         = ixgbe_xmit_frame,
+       .ndo_select_queue       = ixgbe_select_queue,
        .ndo_get_stats          = ixgbe_get_stats,
        .ndo_set_rx_mode        = ixgbe_set_rx_mode,
        .ndo_set_multicast_list = ixgbe_set_rx_mode,