aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/marvell/mvneta.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/marvell/mvneta.c')
-rw-r--r--drivers/net/ethernet/marvell/mvneta.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index c9f1d1b7ef37..ade067de1689 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -20,6 +20,7 @@
20#include <linux/mbus.h> 20#include <linux/mbus.h>
21#include <linux/module.h> 21#include <linux/module.h>
22#include <linux/interrupt.h> 22#include <linux/interrupt.h>
23#include <linux/if_vlan.h>
23#include <net/ip.h> 24#include <net/ip.h>
24#include <net/ipv6.h> 25#include <net/ipv6.h>
25#include <linux/io.h> 26#include <linux/io.h>
@@ -1371,15 +1372,16 @@ static u32 mvneta_skb_tx_csum(struct mvneta_port *pp, struct sk_buff *skb)
1371{ 1372{
1372 if (skb->ip_summed == CHECKSUM_PARTIAL) { 1373 if (skb->ip_summed == CHECKSUM_PARTIAL) {
1373 int ip_hdr_len = 0; 1374 int ip_hdr_len = 0;
1375 __be16 l3_proto = vlan_get_protocol(skb);
1374 u8 l4_proto; 1376 u8 l4_proto;
1375 1377
1376 if (skb->protocol == htons(ETH_P_IP)) { 1378 if (l3_proto == htons(ETH_P_IP)) {
1377 struct iphdr *ip4h = ip_hdr(skb); 1379 struct iphdr *ip4h = ip_hdr(skb);
1378 1380
1379 /* Calculate IPv4 checksum and L4 checksum */ 1381 /* Calculate IPv4 checksum and L4 checksum */
1380 ip_hdr_len = ip4h->ihl; 1382 ip_hdr_len = ip4h->ihl;
1381 l4_proto = ip4h->protocol; 1383 l4_proto = ip4h->protocol;
1382 } else if (skb->protocol == htons(ETH_P_IPV6)) { 1384 } else if (l3_proto == htons(ETH_P_IPV6)) {
1383 struct ipv6hdr *ip6h = ipv6_hdr(skb); 1385 struct ipv6hdr *ip6h = ipv6_hdr(skb);
1384 1386
1385 /* Read l4_protocol from one of IPv6 extra headers */ 1387 /* Read l4_protocol from one of IPv6 extra headers */
@@ -1390,7 +1392,7 @@ static u32 mvneta_skb_tx_csum(struct mvneta_port *pp, struct sk_buff *skb)
1390 return MVNETA_TX_L4_CSUM_NOT; 1392 return MVNETA_TX_L4_CSUM_NOT;
1391 1393
1392 return mvneta_txq_desc_csum(skb_network_offset(skb), 1394 return mvneta_txq_desc_csum(skb_network_offset(skb),
1393 skb->protocol, ip_hdr_len, l4_proto); 1395 l3_proto, ip_hdr_len, l4_proto);
1394 } 1396 }
1395 1397
1396 return MVNETA_TX_L4_CSUM_NOT; 1398 return MVNETA_TX_L4_CSUM_NOT;