From: vyasevich@gmail.com
To: netdev@vger.kernel.org
Cc: Vladislav Yasevich <vyasevic@redhat.com>,
Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Subject: [PATCH 7/8] mvneta: Fix TSO and checksum for non-acceleration vlan traffic
Date: Fri, 22 Aug 2014 22:17:09 -0400 [thread overview]
Message-ID: <1408760230-7457-8-git-send-email-vysevich@gmail.com> (raw)
In-Reply-To: <1408760230-7457-1-git-send-email-vysevich@gmail.com>
From: Vladislav Yasevich <vyasevic@redhat.com>
This driver doesn't appear to support vlan acceleration at
all. However, it does claim to support TSO and IP checksums
for vlan devices. Thus any configured vlan device would
end up passing down partial checksums or TSO frames.
The driver also uses the value from skb->protocol to
determine TSO and checksum offload information, but assumes
that skb->protocol holds the l3 protocol information.
As a result, vlan traffic with partial checksums or TSO
will fail those checks and TSO will not happen.
Fix this by using vlan_get_protocol() helper.
CC: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
---
drivers/net/ethernet/marvell/mvneta.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index c9f1d1b..133f8c6 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -1371,15 +1371,16 @@ static u32 mvneta_skb_tx_csum(struct mvneta_port *pp, struct sk_buff *skb)
{
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 */
@@ -1390,7 +1391,7 @@ static u32 mvneta_skb_tx_csum(struct mvneta_port *pp, struct sk_buff *skb)
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;
--
1.9.3
next prev parent reply other threads:[~2014-08-23 2:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-23 2:17 [PATCH 0/8] Fix TSO and checksum issues with non-accelerated vlan traffic vyasevich
2014-08-23 2:17 ` [PATCH 1/8] e1000e: Fix TSO with non-accelerated vlans vyasevich
2014-08-23 2:17 ` [PATCH 2/8] e1000: Fix TSO for non-accelerated vlan traffic vyasevich
2014-08-23 2:17 ` [PATCH 3/8] bna: Support TSO and partial checksum with non-accelerated vlans vyasevich
2014-08-23 2:17 ` [PATCH 4/8] ehea: Fix TSO and hw checksums with non-accelerated vlan packets vyasevich
2014-08-23 2:17 ` [PATCH 5/8] i40e: Fix TSO and hw checksums for " vyasevich
2014-08-23 18:43 ` David Miller
2014-08-24 1:13 ` Vlad Yasevich
2014-08-23 2:17 ` [PATCH 6/8] i40evf: " vyasevich
2014-08-23 2:17 ` vyasevich [this message]
2014-08-23 2:17 ` [PATCH 8/8] qlge: Fix TSO for non-accelerated vlan traffic vyasevich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1408760230-7457-8-git-send-email-vysevich@gmail.com \
--to=vyasevich@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=thomas.petazzoni@free-electrons.com \
--cc=vyasevic@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).