netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Andrew Lunn <andrew@lunn.ch>,
	linux-kernel@vger.kernel.org, Guenter Roeck <linux@roeck-us.net>
Subject: [PATCH v3 01/15] net: dsa: Don't set skb->protocol on outgoing tagged packets
Date: Wed, 29 Oct 2014 10:44:53 -0700	[thread overview]
Message-ID: <1414604707-22407-2-git-send-email-linux@roeck-us.net> (raw)
In-Reply-To: <1414604707-22407-1-git-send-email-linux@roeck-us.net>

Setting skb->protocol to a private protocol type may result in warning
messages such as
	e1000e 0000:00:19.0 em1: checksum_partial proto=dada!

This happens if the L3 protocol is IP or IPv6 and skb->ip_summed is set
to CHECKSUM_PARTIAL. Looking through the code, it appears that changing
skb->protocol for transmitted packets is not necessary and may actually
be harmful. For example, it prevents purposely unmodified (from a DSA
perspective) network drivers from properly setting up their transmit
checksum offload pointers since they inspect skb->protocol to set up the
IPv4 header or IPv6 header pointers. So don't unnecessarily change the
protocol field.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
v3:
- Updated description
v2:
- No change

 net/dsa/tag_dsa.c     | 2 --
 net/dsa/tag_edsa.c    | 2 --
 net/dsa/tag_trailer.c | 2 --
 3 files changed, 6 deletions(-)

diff --git a/net/dsa/tag_dsa.c b/net/dsa/tag_dsa.c
index ce90c8b..2dab270 100644
--- a/net/dsa/tag_dsa.c
+++ b/net/dsa/tag_dsa.c
@@ -63,8 +63,6 @@ static netdev_tx_t dsa_xmit(struct sk_buff *skb, struct net_device *dev)
 		dsa_header[3] = 0x00;
 	}
 
-	skb->protocol = htons(ETH_P_DSA);
-
 	skb->dev = p->parent->dst->master_netdev;
 	dev_queue_xmit(skb);
 
diff --git a/net/dsa/tag_edsa.c b/net/dsa/tag_edsa.c
index 94fcce7..9aeda59 100644
--- a/net/dsa/tag_edsa.c
+++ b/net/dsa/tag_edsa.c
@@ -76,8 +76,6 @@ static netdev_tx_t edsa_xmit(struct sk_buff *skb, struct net_device *dev)
 		edsa_header[7] = 0x00;
 	}
 
-	skb->protocol = htons(ETH_P_EDSA);
-
 	skb->dev = p->parent->dst->master_netdev;
 	dev_queue_xmit(skb);
 
diff --git a/net/dsa/tag_trailer.c b/net/dsa/tag_trailer.c
index 115fdca..e268f9d 100644
--- a/net/dsa/tag_trailer.c
+++ b/net/dsa/tag_trailer.c
@@ -57,8 +57,6 @@ static netdev_tx_t trailer_xmit(struct sk_buff *skb, struct net_device *dev)
 	trailer[2] = 0x10;
 	trailer[3] = 0x00;
 
-	nskb->protocol = htons(ETH_P_TRAILER);
-
 	nskb->dev = p->parent->dst->master_netdev;
 	dev_queue_xmit(nskb);
 
-- 
1.9.1

  reply	other threads:[~2014-10-29 17:44 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-29 17:44 [PATCH v3 00/15] net: dsa: Fixes and enhancements Guenter Roeck
2014-10-29 17:44 ` Guenter Roeck [this message]
2014-10-29 17:44 ` [PATCH v3 02/15] net: dsa: Report known silicon revisions for Marvell 88E6060 Guenter Roeck
2014-10-29 17:44 ` [PATCH v3 03/15] net: dsa: Report known silicon revisions for Marvell 88E6131 Guenter Roeck
2014-10-29 17:44 ` [PATCH v3 04/15] net: dsa: Add support for Marvell 88E6352 Guenter Roeck
2014-10-29 17:44 ` [PATCH v3 05/15] net: dsa/mv88e6352: Add support for MV88E6176 Guenter Roeck
2014-10-29 17:44 ` [PATCH v3 06/15] net: dsa: Add support for reporting switch chip temperatures Guenter Roeck
2014-10-29 17:44 ` [PATCH v3 07/15] net: dsa/mv88e6352: Report chip temperature Guenter Roeck
2014-10-29 17:45 ` [PATCH v3 08/15] net: dsa/mv88e6123_61_65: " Guenter Roeck
2014-10-29 17:45 ` [PATCH v3 09/15] net: dsa: Add support for switch EEPROM access Guenter Roeck
2014-10-30 21:11   ` Andrew Lunn
2014-10-30 22:39     ` Guenter Roeck
2014-10-31  1:00       ` Guenter Roeck
2014-10-31  2:40         ` Andrew Lunn
2014-10-31  2:53           ` Guenter Roeck
2014-10-31  3:43             ` David Miller
2014-10-29 17:45 ` [PATCH v3 10/15] dsa: Add new optional devicetree property to describe EEPROM size Guenter Roeck
2014-10-29 17:45 ` [PATCH v3 11/15] net: dsa/mv88e6352: Implement EEPROM access functions Guenter Roeck
2014-10-29 17:45 ` [PATCH v3 12/15] net: dsa: Add support for reading switch registers with ethtool Guenter Roeck
2014-10-29 17:45 ` [PATCH v3 13/15] net: dsa/mv88e6123_61_65: Add support for reading switch registers Guenter Roeck
2014-10-29 17:45 ` [PATCH v3 14/15] net: dsa/mv88e6352: " Guenter Roeck
2014-10-29 17:45 ` [PATCH v3 15/15] net: dsa: Provide additional RMON statistics Guenter Roeck
2014-10-29 18:22 ` [PATCH v3 00/15] net: dsa: Fixes and enhancements Florian Fainelli
2014-10-29 21:39   ` Guenter Roeck
2014-10-30 18:54     ` David Miller

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=1414604707-22407-2-git-send-email-linux@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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).