diff options
author | Arthur Kiyanovski <akiyano@amazon.com> | 2018-10-11 11:26:21 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-10-11 10:13:51 -0700 |
commit | cb36bb36e1f17d2a7b9a9751e5cfec4235b46c93 (patch) | |
tree | 988231a15aa43ccef1af0d4cc311fb6791ff1649 /drivers/net/ethernet/amazon/ena/ena_netdev.c | |
parent | 38005ca816a7ef5516dc8e59ae95716739aa75b0 (diff) | |
download | linux-cb36bb36e1f17d2a7b9a9751e5cfec4235b46c93.tar.gz linux-cb36bb36e1f17d2a7b9a9751e5cfec4235b46c93.tar.bz2 linux-cb36bb36e1f17d2a7b9a9751e5cfec4235b46c93.zip |
net: ena: use CSUM_CHECKED device indication to report skb's checksum status
Set skb->ip_summed to the correct value as reported by the device.
Add counter for the case where rx csum offload is enabled but
device didn't check it.
Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/amazon/ena/ena_netdev.c')
-rw-r--r-- | drivers/net/ethernet/amazon/ena/ena_netdev.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c index 98314b28a000..eea05847d185 100644 --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c @@ -994,8 +994,19 @@ static inline void ena_rx_checksum(struct ena_ring *rx_ring, return; } - skb->ip_summed = CHECKSUM_UNNECESSARY; + if (likely(ena_rx_ctx->l4_csum_checked)) { + skb->ip_summed = CHECKSUM_UNNECESSARY; + } else { + u64_stats_update_begin(&rx_ring->syncp); + rx_ring->rx_stats.csum_unchecked++; + u64_stats_update_end(&rx_ring->syncp); + skb->ip_summed = CHECKSUM_NONE; + } + } else { + skb->ip_summed = CHECKSUM_NONE; + return; } + } static void ena_set_rx_hash(struct ena_ring *rx_ring, |