Commit 294e7d78 authored by Alexander Duyck's avatar Alexander Duyck Committed by Jeff Kirsher

igb: retire the RX_CSUM flag and use the netdev flag instead

Since the netdev now has its' own checksum flag to indicate if Rx checksum
is enabled we might as well use that instead of using the ring flag.
Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
Tested-by: default avatarAaron Brown  <aaron.f.brown@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 4be000c8
...@@ -245,7 +245,6 @@ struct igb_ring { ...@@ -245,7 +245,6 @@ struct igb_ring {
}; };
enum e1000_ring_flags_t { enum e1000_ring_flags_t {
IGB_RING_FLAG_RX_CSUM,
IGB_RING_FLAG_RX_SCTP_CSUM, IGB_RING_FLAG_RX_SCTP_CSUM,
IGB_RING_FLAG_TX_CTX_IDX, IGB_RING_FLAG_TX_CTX_IDX,
IGB_RING_FLAG_TX_DETECT_HANG IGB_RING_FLAG_TX_DETECT_HANG
......
...@@ -732,8 +732,6 @@ static int igb_alloc_queues(struct igb_adapter *adapter) ...@@ -732,8 +732,6 @@ static int igb_alloc_queues(struct igb_adapter *adapter)
ring->dev = &adapter->pdev->dev; ring->dev = &adapter->pdev->dev;
ring->netdev = adapter->netdev; ring->netdev = adapter->netdev;
ring->numa_node = adapter->node; ring->numa_node = adapter->node;
/* enable rx checksum */
set_bit(IGB_RING_FLAG_RX_CSUM, &ring->flags);
/* set flag indicating ring supports SCTP checksum offload */ /* set flag indicating ring supports SCTP checksum offload */
if (adapter->hw.mac.type >= e1000_82576) if (adapter->hw.mac.type >= e1000_82576)
set_bit(IGB_RING_FLAG_RX_SCTP_CSUM, &ring->flags); set_bit(IGB_RING_FLAG_RX_SCTP_CSUM, &ring->flags);
...@@ -1811,19 +1809,8 @@ static u32 igb_fix_features(struct net_device *netdev, u32 features) ...@@ -1811,19 +1809,8 @@ static u32 igb_fix_features(struct net_device *netdev, u32 features)
static int igb_set_features(struct net_device *netdev, u32 features) static int igb_set_features(struct net_device *netdev, u32 features)
{ {
struct igb_adapter *adapter = netdev_priv(netdev);
int i;
u32 changed = netdev->features ^ features; u32 changed = netdev->features ^ features;
for (i = 0; i < adapter->num_rx_queues; i++) {
if (features & NETIF_F_RXCSUM)
set_bit(IGB_RING_FLAG_RX_CSUM,
&adapter->rx_ring[i]->flags);
else
clear_bit(IGB_RING_FLAG_RX_CSUM,
&adapter->rx_ring[i]->flags);
}
if (changed & NETIF_F_HW_VLAN_RX) if (changed & NETIF_F_HW_VLAN_RX)
igb_vlan_mode(netdev, features); igb_vlan_mode(netdev, features);
...@@ -5807,9 +5794,12 @@ static inline void igb_rx_checksum(struct igb_ring *ring, ...@@ -5807,9 +5794,12 @@ static inline void igb_rx_checksum(struct igb_ring *ring,
{ {
skb_checksum_none_assert(skb); skb_checksum_none_assert(skb);
/* Ignore Checksum bit is set or checksum is disabled through ethtool */ /* Ignore Checksum bit is set */
if (!test_bit(IGB_RING_FLAG_RX_CSUM, &ring->flags) || if (status_err & E1000_RXD_STAT_IXSM)
(status_err & E1000_RXD_STAT_IXSM)) return;
/* Rx checksum disabled via ethtool */
if (!(ring->netdev->features & NETIF_F_RXCSUM))
return; return;
/* TCP/UDP checksum error bit is set */ /* TCP/UDP checksum error bit is set */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment