From: Maxime Chevallier <maxime.chevallier@bootlin.com> Date: 2018-10-04 08:03:27
When offloading the L3 and L4 csum computation on TX, we need to extract
the l3_proto from the ethtype, independently of the presence of a vlan
tag.
The actual driver uses skb->protocol as-is, resulting in packets with
the wrong L4 checksum being sent when there's a vlan tag in the packet
header and checksum offloading is enabled.
This commit makes use of vlan_protocol_get() to get the correct ethtype
regardless the presence of a vlan tag.
Fixes: 3f51850 ("ethernet: Add new driver for Marvell Armada 375 network unit")
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
---
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
From: Yan Markman <hidden> Date: 2018-10-04 08:08:38
I'm not sure that kind of ntohs() using is good for the Performance.
htons(ETH_P_IP) is CONSTANT swapped Big/LittleEndian by COMPILER whilst the
ntohs(vlan_get_protocol(skb)) is run-time short/byte-swap for every packet.
Yan Markman
-----Original Message-----
From: Maxime Chevallier [mailto:maxime.chevallier@bootlin.com]
Sent: Thursday, October 04, 2018 11:03 AM
To: davem@davemloft.net
Cc: Maxime Chevallier <maxime.chevallier@bootlin.com>; netdev@vger.kernel.org; linux-kernel@vger.kernel.org; Antoine Tenart <redacted>; thomas.petazzoni@bootlin.com; gregory.clement@bootlin.com; miquel.raynal@bootlin.com; Nadav Haklai <redacted>; Stefan Chulski <redacted>; Yan Markman <redacted>; mw@semihalf.com
Subject: [EXT] [PATCH net] net: mvpp2: Extract the correct ethtype from the skb for tx csum offload
External Email
----------------------------------------------------------------------
When offloading the L3 and L4 csum computation on TX, we need to extract the l3_proto from the ethtype, independently of the presence of a vlan tag.
The actual driver uses skb->protocol as-is, resulting in packets with the wrong L4 checksum being sent when there's a vlan tag in the packet header and checksum offloading is enabled.
This commit makes use of vlan_protocol_get() to get the correct ethtype regardless the presence of a vlan tag.
Fixes: 3f51850 ("ethernet: Add new driver for Marvell Armada 375 network unit")
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
---
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
From: Sergei Shtylyov <hidden> Date: 2018-10-04 09:50:23
Hello!
On 10/4/2018 11:03 AM, Maxime Chevallier wrote:
When offloading the L3 and L4 csum computation on TX, we need to extract
the l3_proto from the ethtype, independently of the presence of a vlan
tag.
The actual driver uses skb->protocol as-is, resulting in packets with
the wrong L4 checksum being sent when there's a vlan tag in the packet
header and checksum offloading is enabled.
This commit makes use of vlan_protocol_get() to get the correct ethtype
regardless the presence of a vlan tag.
^ of?
Fixes: 3f51850 ("ethernet: Add new driver for Marvell Armada 375 network unit")
12 hex digits needed here.
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
From: Maxime Chevallier <maxime.chevallier@bootlin.com> Date: 2018-10-04 13:14:05
Hello Sergei,
On Thu, 4 Oct 2018 12:50:17 +0300
Sergei Shtylyov [off-list ref] wrote:
Hello!
On 10/4/2018 11:03 AM, Maxime Chevallier wrote:
quoted
When offloading the L3 and L4 csum computation on TX, we need to extract
the l3_proto from the ethtype, independently of the presence of a vlan
tag.
The actual driver uses skb->protocol as-is, resulting in packets with
the wrong L4 checksum being sent when there's a vlan tag in the packet
header and checksum offloading is enabled.
This commit makes use of vlan_protocol_get() to get the correct ethtype
regardless the presence of a vlan tag.
^ of?
quoted
Fixes: 3f51850 ("ethernet: Add new driver for Marvell Armada 375 network unit")
12 hex digits needed here.
Sorry about that, I'll resend with a proper Fixes tag.
Thanks,
Maxime