OSDN Git Service

net: dsa: sja1105: let deferred packets time out when sent to ports going down
authorVladimir Oltean <vladimir.oltean@nxp.com>
Thu, 9 Dec 2021 23:34:39 +0000 (01:34 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 12 Dec 2021 12:51:33 +0000 (12:51 +0000)
This code is not necessary and complicates the conversion of this driver
to tagger-owned memory. If there is a PTP packet that is sent
concurrently with the port getting disabled, the deferred xmit mechanism
is robust enough to time out when it sees that it hasn't been delivered,
and recovers.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/sja1105/sja1105_main.c

index cefde41..f7c88da 100644 (file)
@@ -2617,18 +2617,6 @@ static int sja1105_prechangeupper(struct dsa_switch *ds, int port,
        return 0;
 }
 
-static void sja1105_port_disable(struct dsa_switch *ds, int port)
-{
-       struct sja1105_private *priv = ds->priv;
-       struct sja1105_port *sp = &priv->ports[port];
-
-       if (!dsa_is_user_port(ds, port))
-               return;
-
-       kthread_cancel_work_sync(&sp->xmit_work);
-       skb_queue_purge(&sp->xmit_queue);
-}
-
 static int sja1105_mgmt_xmit(struct dsa_switch *ds, int port, int slot,
                             struct sk_buff *skb, bool takets)
 {
@@ -3215,7 +3203,6 @@ static const struct dsa_switch_ops sja1105_switch_ops = {
        .get_ethtool_stats      = sja1105_get_ethtool_stats,
        .get_sset_count         = sja1105_get_sset_count,
        .get_ts_info            = sja1105_get_ts_info,
-       .port_disable           = sja1105_port_disable,
        .port_fdb_dump          = sja1105_fdb_dump,
        .port_fdb_add           = sja1105_fdb_add,
        .port_fdb_del           = sja1105_fdb_del,