@@ -3337,13 +3337,24 @@ static __le16 bnx2x_csum_fix(unsigned char *t_header, u16 csum, s8 fix)
return bswab16(tsum);
}
+static const struct skb_csum_offl_spec csum_offl_spec = {
+ .ipv4_okay = 1,
+ .ip_options_okay = 1,
+ .ipv6_okay = 1,
+ .encap_okay = 1,
+ .vlan_okay = 1,
+ .tcp_okay = 1,
+ .udp_okay = 1,
+};
+
static u32 bnx2x_xmit_type(struct bnx2x *bp, struct sk_buff *skb)
{
u32 rc;
__u8 prot = 0;
__be16 protocol;
+ bool csum_encapped;
- if (skb->ip_summed != CHECKSUM_PARTIAL)
+ if (!skb_csum_offload_chk(skb, &csum_offl_spec, &csum_encapped, true))
return XMIT_PLAIN;
protocol = vlan_get_protocol(skb);
@@ -3355,7 +3366,7 @@ static u32 bnx2x_xmit_type(struct bnx2x *bp, struct sk_buff *skb)
prot = ip_hdr(skb)->protocol;
}
- if (!CHIP_IS_E1x(bp) && skb->encapsulation) {
+ if (!CHIP_IS_E1x(bp) && csum_encapped) {
if (inner_ip_hdr(skb)->version == 6) {
rc |= XMIT_CSUM_ENC_V6;
if (inner_ipv6_hdr(skb)->nexthdr == IPPROTO_TCP)
@@ -13184,7 +13184,7 @@ static int bnx2x_init_dev(struct bnx2x *bp, struct pci_dev *pdev,
dev->priv_flags |= IFF_UNICAST_FLT;
- dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
+ dev->hw_features = NETIF_F_SG | NETIF_F_HW_CSUM |
NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6 |
NETIF_F_RXCSUM | NETIF_F_LRO | NETIF_F_GRO |
NETIF_F_RXHASH | NETIF_F_HW_VLAN_CTAG_TX;
@@ -13192,14 +13192,14 @@ static int bnx2x_init_dev(struct bnx2x *bp, struct pci_dev *pdev,
dev->hw_features |= NETIF_F_GSO_GRE | NETIF_F_GSO_UDP_TUNNEL |
NETIF_F_GSO_IPIP | NETIF_F_GSO_SIT;
dev->hw_enc_features =
- NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | NETIF_F_SG |
+ NETIF_F_HW_CSUM | NETIF_F_SG |
NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6 |
NETIF_F_GSO_IPIP |
NETIF_F_GSO_SIT |
NETIF_F_GSO_GRE | NETIF_F_GSO_UDP_TUNNEL;
}
- dev->vlan_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
+ dev->vlan_features = NETIF_F_SG | NETIF_F_HW_CSUM |
NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6 | NETIF_F_HIGHDMA;
/* VF with OLD Hypervisor or old PF do not support filtering */
The skb_csum_offload_chk is used to resolve checksums that are unable to be offloaded to the device. Signed-off-by: Tom Herbert <tom@herbertland.com> --- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 15 +++++++++++++-- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 6 +++--- 2 files changed, 16 insertions(+), 5 deletions(-)