]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ixgbe: fix ring assignment issues for SR-IOV and drop cases
authorAlexander Duyck <alexander.h.duyck@intel.com>
Sat, 14 May 2011 01:16:02 +0000 (01:16 +0000)
committerJoe Jin <joe.jin@oracle.com>
Fri, 3 Feb 2012 01:15:53 +0000 (09:15 +0800)
This change fixes the fact that we would trigger a null pointer dereference
or specify the wrong ring if the rings were restored.  This change makes
certain that the DROP queue is a static value, and all other rings are
based on the ring offsets for the PF.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 1f4d51836f5e49f2e5201f1daf90239c04b3faf2)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/ixgbe/ixgbe_ethtool.c
drivers/net/ixgbe/ixgbe_main.c

index fa1afe147319a19afe2a416d2f879a8887f8d456..d46ceb48a5cf5977dc6dff26c5bfd4bcd4d16fe0 100644 (file)
@@ -2681,6 +2681,8 @@ static int ixgbe_add_ethtool_fdir_entry(struct ixgbe_adapter *adapter,
        /* program filters to filter memory */
        err = ixgbe_fdir_write_perfect_filter_82599(hw,
                                &input->filter, input->sw_idx,
+                               (input->action == IXGBE_FDIR_DROP_QUEUE) ?
+                               IXGBE_FDIR_DROP_QUEUE :
                                adapter->rx_ring[input->action]->reg_idx);
        if (err)
                goto err_out_w_lock;
index 044dbd01c0b38073353f8d1892b49fade0d4a7fc..f50a08afa4f2d97a17e396b645cc29d07c736249 100644 (file)
@@ -3811,9 +3811,11 @@ static void ixgbe_fdir_filter_restore(struct ixgbe_adapter *adapter)
        hlist_for_each_entry_safe(filter, node, node2,
                                  &adapter->fdir_filter_list, fdir_node) {
                ixgbe_fdir_write_perfect_filter_82599(hw,
-                                                     &filter->filter,
-                                                     filter->sw_idx,
-                                                     filter->action);
+                               &filter->filter,
+                               filter->sw_idx,
+                               (filter->action == IXGBE_FDIR_DROP_QUEUE) ?
+                               IXGBE_FDIR_DROP_QUEUE :
+                               adapter->rx_ring[filter->action]->reg_idx);
        }
 
        spin_unlock(&adapter->fdir_perfect_lock);