diff options
author | Jon Cooper <jcooper@solarflare.com> | 2017-02-08 16:51:02 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-02-09 16:47:53 -0500 |
commit | da50ae2eae96e00e0188b24014efc10161e60925 (patch) | |
tree | c42954a9b66dbdbd47e6226dcce73a907a05414a /drivers/net/ethernet/sfc/ef10.c | |
parent | a0ee3541483767e82bf26b8269693eec25c01cba (diff) | |
download | lwn-da50ae2eae96e00e0188b24014efc10161e60925.tar.gz lwn-da50ae2eae96e00e0188b24014efc10161e60925.zip |
sfc: set csum_level for encapsulated packets
Set the csum_level for encapsulated packets where the encapsulation
type, l3 class and l4 class are sets that need it.
Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sfc/ef10.c')
-rw-r--r-- | drivers/net/ethernet/sfc/ef10.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c index fd1008daf1e3..c738b113b0ac 100644 --- a/drivers/net/ethernet/sfc/ef10.c +++ b/drivers/net/ethernet/sfc/ef10.c @@ -3339,9 +3339,26 @@ static int efx_ef10_handle_rx_event(struct efx_channel *channel, rx_l3_class, rx_l4_class, rx_encap_hdr, event); } else { - if (rx_l4_class == ESE_DZ_L4_CLASS_TCP || - rx_l4_class == ESE_DZ_L4_CLASS_UDP) - flags |= EFX_RX_PKT_CSUMMED; + bool tcpudp = rx_l4_class == ESE_DZ_L4_CLASS_TCP || + rx_l4_class == ESE_DZ_L4_CLASS_UDP; + + switch (rx_encap_hdr) { + case ESE_EZ_ENCAP_HDR_VXLAN: /* VxLAN or GENEVE */ + flags |= EFX_RX_PKT_CSUMMED; /* outer UDP csum */ + if (tcpudp) + flags |= EFX_RX_PKT_CSUM_LEVEL; /* inner L4 */ + break; + case ESE_EZ_ENCAP_HDR_GRE: + case ESE_EZ_ENCAP_HDR_NONE: + if (tcpudp) + flags |= EFX_RX_PKT_CSUMMED; + break; + default: + netdev_WARN(efx->net_dev, + "unknown encapsulation type: event=" + EFX_QWORD_FMT "\n", + EFX_QWORD_VAL(*event)); + } } if (rx_l4_class == ESE_DZ_L4_CLASS_TCP) |