net: get rid of SET_ETHTOOL_OPS
[deliverable/linux.git] / drivers / net / ethernet / intel / i40e / i40e_ethtool.c
index 03d99cbc5c251bcbb0120667ff1d53e304da00a9..f62929419a093110dba114791b73f9b40fb80d0f 100644 (file)
@@ -649,7 +649,7 @@ static void i40e_get_ethtool_stats(struct net_device *netdev,
                        sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
        }
        rcu_read_lock();
-       for (j = 0; j < vsi->num_queue_pairs; j++, i += 4) {
+       for (j = 0; j < vsi->num_queue_pairs; j++) {
                struct i40e_ring *tx_ring = ACCESS_ONCE(vsi->tx_rings[j]);
                struct i40e_ring *rx_ring;
 
@@ -662,14 +662,16 @@ static void i40e_get_ethtool_stats(struct net_device *netdev,
                        data[i] = tx_ring->stats.packets;
                        data[i + 1] = tx_ring->stats.bytes;
                } while (u64_stats_fetch_retry_irq(&tx_ring->syncp, start));
+               i += 2;
 
                /* Rx ring is the 2nd half of the queue pair */
                rx_ring = &tx_ring[1];
                do {
                        start = u64_stats_fetch_begin_irq(&rx_ring->syncp);
-                       data[i + 2] = rx_ring->stats.packets;
-                       data[i + 3] = rx_ring->stats.bytes;
+                       data[i] = rx_ring->stats.packets;
+                       data[i + 1] = rx_ring->stats.bytes;
                } while (u64_stats_fetch_retry_irq(&rx_ring->syncp, start));
+               i += 2;
        }
        rcu_read_unlock();
        if (vsi == pf->vsi[pf->lan_vsi]) {
@@ -1189,6 +1191,12 @@ static int i40e_get_ethtool_fdir_entry(struct i40e_pf *pf,
                return -EINVAL;
 
        fsp->flow_type = rule->flow_type;
+       if (fsp->flow_type == IP_USER_FLOW) {
+               fsp->h_u.usr_ip4_spec.ip_ver = ETH_RX_NFC_IP4;
+               fsp->h_u.usr_ip4_spec.proto = 0;
+               fsp->m_u.usr_ip4_spec.proto = 0;
+       }
+
        fsp->h_u.tcp_ip4_spec.psrc = rule->src_port;
        fsp->h_u.tcp_ip4_spec.pdst = rule->dst_port;
        fsp->h_u.tcp_ip4_spec.ip4src = rule->src_ip[0];
@@ -1692,5 +1700,5 @@ static const struct ethtool_ops i40e_ethtool_ops = {
 
 void i40e_set_ethtool_ops(struct net_device *netdev)
 {
-       SET_ETHTOOL_OPS(netdev, &i40e_ethtool_ops);
+       netdev->ethtool_ops = &i40e_ethtool_ops;
 }
This page took 0.025405 seconds and 5 git commands to generate.