Skip to content

Commit b0dc635

Browse files
superna9999davem330
authored andcommitted
net: dsa: cleanup resources upon module removal
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 <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4baee93 commit b0dc635

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

net/dsa/dsa.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -985,6 +985,14 @@ static int dsa_suspend(struct device *d)
985985
struct dsa_switch_tree *dst = platform_get_drvdata(pdev);
986986
int i, ret = 0;
987987

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

0 commit comments

Comments
 (0)