public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Neil Armstrong <narmstrong@baylibre•com>
To: "David S. Miller" <davem@davemloft•net>
Cc: Andrew Lunn <andrew@lunn•ch>,
	Florian Fainelli <f.fainelli@gmail•com>,
	Guenter Roeck <linux@roeck-us•net>,
	vivien.didelot@savoirfairelinux•com,
	Fabian Frederick <fabf@skynet•be>,
	Pavel Nakonechny <pavel.nakonechny@skitlab•ru>,
	Joe Perches <joe@perches•com>,
	netdev@vger•kernel.org, linux-kernel@vger•kernel.org,
	Frode Isaksen <fisaksen@baylibre•com>
Subject: [PATCH 3/6] net: dsa: cleanup resources upon module removal
Date: Tue, 27 Oct 2015 15:49:03 +0100	[thread overview]
Message-ID: <562F8EDF.9080604@baylibre.com> (raw)

Make sure that we unassign the master_netdev dsa_ptr to make the packet
processing go through the regular Ethernet receive path.

Suggested-by: Florian Fainelli <f.fainelli@gmail•com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre•com>
---
 net/dsa/dsa.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index 7c9914b..acbf854 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -951,6 +951,14 @@ static void dsa_remove_dst(struct dsa_switch_tree *dst)
 		flush_delayed_work(&dst->link_poll_work);
 	}

+	dst->master_netdev->dsa_ptr = NULL;
+
+	/* If we used a tagging format that doesn't have an ethertype
+	 * field, make sure that all packets from this point get sent
+	 * without the tag and go through the regular receive path.
+	 */
+	wmb();
+
 	for (i = 0; i < dst->pd->nr_chips; i++) {
 		struct dsa_switch *ds = dst->ds[i];

-- 
1.9.1

                 reply	other threads:[~2015-10-27 14:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=562F8EDF.9080604@baylibre.com \
    --to=narmstrong@baylibre$(echo .)com \
    --cc=andrew@lunn$(echo .)ch \
    --cc=davem@davemloft$(echo .)net \
    --cc=f.fainelli@gmail$(echo .)com \
    --cc=fabf@skynet$(echo .)be \
    --cc=fisaksen@baylibre$(echo .)com \
    --cc=joe@perches$(echo .)com \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux@roeck-us$(echo .)net \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=pavel.nakonechny@skitlab$(echo .)ru \
    --cc=vivien.didelot@savoirfairelinux$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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