Commit f8a952cb authored by Jesse Brandeburg's avatar Jesse Brandeburg Committed by Jeff Kirsher

i40e/i40evf: Refactor tunnel interpretation

Refactor the interpretation of a tunnel.  This removes
some code and lets us start using the hardware's parsing.
Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 035cd6ba
...@@ -1392,7 +1392,7 @@ static inline void i40e_rx_checksum(struct i40e_vsi *vsi, ...@@ -1392,7 +1392,7 @@ static inline void i40e_rx_checksum(struct i40e_vsi *vsi,
u16 rx_ptype) u16 rx_ptype)
{ {
struct i40e_rx_ptype_decoded decoded = decode_rx_desc_ptype(rx_ptype); struct i40e_rx_ptype_decoded decoded = decode_rx_desc_ptype(rx_ptype);
bool ipv4, ipv6, ipv4_tunnel, ipv6_tunnel; bool ipv4, ipv6, tunnel = false;
skb->ip_summed = CHECKSUM_NONE; skb->ip_summed = CHECKSUM_NONE;
...@@ -1441,14 +1441,13 @@ static inline void i40e_rx_checksum(struct i40e_vsi *vsi, ...@@ -1441,14 +1441,13 @@ static inline void i40e_rx_checksum(struct i40e_vsi *vsi,
* doesn't make it a hard requirement so if we have validated the * doesn't make it a hard requirement so if we have validated the
* inner checksum report CHECKSUM_UNNECESSARY. * inner checksum report CHECKSUM_UNNECESSARY.
*/ */
if (decoded.inner_prot & (I40E_RX_PTYPE_INNER_PROT_TCP |
ipv4_tunnel = (rx_ptype >= I40E_RX_PTYPE_GRENAT4_MAC_PAY3) && I40E_RX_PTYPE_INNER_PROT_UDP |
(rx_ptype <= I40E_RX_PTYPE_GRENAT4_MACVLAN_IPV6_ICMP_PAY4); I40E_RX_PTYPE_INNER_PROT_SCTP))
ipv6_tunnel = (rx_ptype >= I40E_RX_PTYPE_GRENAT6_MAC_PAY3) && tunnel = true;
(rx_ptype <= I40E_RX_PTYPE_GRENAT6_MACVLAN_IPV6_ICMP_PAY4);
skb->ip_summed = CHECKSUM_UNNECESSARY; skb->ip_summed = CHECKSUM_UNNECESSARY;
skb->csum_level = ipv4_tunnel || ipv6_tunnel; skb->csum_level = tunnel ? 1 : 0;
return; return;
......
...@@ -864,7 +864,7 @@ static inline void i40e_rx_checksum(struct i40e_vsi *vsi, ...@@ -864,7 +864,7 @@ static inline void i40e_rx_checksum(struct i40e_vsi *vsi,
u16 rx_ptype) u16 rx_ptype)
{ {
struct i40e_rx_ptype_decoded decoded = decode_rx_desc_ptype(rx_ptype); struct i40e_rx_ptype_decoded decoded = decode_rx_desc_ptype(rx_ptype);
bool ipv4, ipv6, ipv4_tunnel, ipv6_tunnel; bool ipv4, ipv6, tunnel = false;
skb->ip_summed = CHECKSUM_NONE; skb->ip_summed = CHECKSUM_NONE;
...@@ -913,14 +913,13 @@ static inline void i40e_rx_checksum(struct i40e_vsi *vsi, ...@@ -913,14 +913,13 @@ static inline void i40e_rx_checksum(struct i40e_vsi *vsi,
* doesn't make it a hard requirement so if we have validated the * doesn't make it a hard requirement so if we have validated the
* inner checksum report CHECKSUM_UNNECESSARY. * inner checksum report CHECKSUM_UNNECESSARY.
*/ */
if (decoded.inner_prot & (I40E_RX_PTYPE_INNER_PROT_TCP |
ipv4_tunnel = (rx_ptype >= I40E_RX_PTYPE_GRENAT4_MAC_PAY3) && I40E_RX_PTYPE_INNER_PROT_UDP |
(rx_ptype <= I40E_RX_PTYPE_GRENAT4_MACVLAN_IPV6_ICMP_PAY4); I40E_RX_PTYPE_INNER_PROT_SCTP))
ipv6_tunnel = (rx_ptype >= I40E_RX_PTYPE_GRENAT6_MAC_PAY3) && tunnel = true;
(rx_ptype <= I40E_RX_PTYPE_GRENAT6_MACVLAN_IPV6_ICMP_PAY4);
skb->ip_summed = CHECKSUM_UNNECESSARY; skb->ip_summed = CHECKSUM_UNNECESSARY;
skb->csum_level = ipv4_tunnel || ipv6_tunnel; skb->csum_level = tunnel ? 1 : 0;
return; return;
......
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