diff mbox

[OpenWrt-Devel,mvebu] WRT1900AC mvneta fix vlan tagging

Message ID 1419394053-15519-1-git-send-email-mark.a.milburn@gmail.com
State Accepted
Headers show

Commit Message

Mark Milburn Dec. 24, 2014, 4:07 a.m. UTC
This is a 3.14.x backport of:
"mvneta: Fix TSO and checksum for non-acceleration vlan traffic"

Fixes vlan tagging on SoC interfaces for the WRT1900AC.  Useful
when using mvsw6171 driver.

Here's hoping I didn't foul up the patch format this time.

Signed-off-by: Mark Milburn <mark.a.milburn@gmail.com>
---
 .../110-mvneta_fix_tso_and_chksum.patch            | 38 ++++++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 target/linux/mvebu/patches-3.14/110-mvneta_fix_tso_and_chksum.patch

Comments

Imre Kaloz Dec. 24, 2014, 9:02 a.m. UTC | #1
On Wed, 24 Dec 2014 05:07:33 +0100, Mark Milburn <mark.a.milburn@gmail.com> wrote:

> This is a 3.14.x backport of:
> "mvneta: Fix TSO and checksum for non-acceleration vlan traffic"
>
> Fixes vlan tagging on SoC interfaces for the WRT1900AC.  Useful
> when using mvsw6171 driver.
>
> Here's hoping I didn't foul up the patch format this time.
>
> Signed-off-by: Mark Milburn <mark.a.milburn@gmail.com>

Mark,

Merged it locally, I'll push it later. Next time please mention the upstream commit(s), too :)

For the record, this is 817dbfa5d1bc276a72c1a577310382008e8aca0a + 2d39d120781a5770573dc6ed672a5a562f541aea.


Imre
diff mbox

Patch

diff --git a/target/linux/mvebu/patches-3.14/110-mvneta_fix_tso_and_chksum.patch b/target/linux/mvebu/patches-3.14/110-mvneta_fix_tso_and_chksum.patch
new file mode 100644
index 0000000..7115468
--- /dev/null
+++ b/target/linux/mvebu/patches-3.14/110-mvneta_fix_tso_and_chksum.patch
@@ -0,0 +1,38 @@ 
+--- a/drivers/net/ethernet/marvell/mvneta.c
++++ b/drivers/net/ethernet/marvell/mvneta.c
+@@ -20,6 +20,7 @@
+ #include <linux/mbus.h>
+ #include <linux/module.h>
+ #include <linux/interrupt.h>
++#include <linux/if_vlan.h>
+ #include <net/ip.h>
+ #include <net/ipv6.h>
+ #include <linux/io.h>
+@@ -1380,15 +1381,16 @@ static u32 mvneta_skb_tx_csum(struct mvn
+ {
+ 	if (skb->ip_summed == CHECKSUM_PARTIAL) {
+ 		int ip_hdr_len = 0;
++		__be16 l3_proto = vlan_get_protocol(skb);
+ 		u8 l4_proto;
+ 
+-		if (skb->protocol == htons(ETH_P_IP)) {
++		if (l3_proto == htons(ETH_P_IP)) {
+ 			struct iphdr *ip4h = ip_hdr(skb);
+ 
+ 			/* Calculate IPv4 checksum and L4 checksum */
+ 			ip_hdr_len = ip4h->ihl;
+ 			l4_proto = ip4h->protocol;
+-		} else if (skb->protocol == htons(ETH_P_IPV6)) {
++		} else if (l3_proto == htons(ETH_P_IPV6)) {
+ 			struct ipv6hdr *ip6h = ipv6_hdr(skb);
+ 
+ 			/* Read l4_protocol from one of IPv6 extra headers */
+@@ -1399,7 +1401,7 @@ static u32 mvneta_skb_tx_csum(struct mvn
+ 			return MVNETA_TX_L4_CSUM_NOT;
+ 
+ 		return mvneta_txq_desc_csum(skb_network_offset(skb),
+-				skb->protocol, ip_hdr_len, l4_proto);
++					l3_proto, ip_hdr_len, l4_proto);
+ 	}
+ 
+ 	return MVNETA_TX_L4_CSUM_NOT;