linux-stable/include/linux/dsa
Vladimir Oltean d38049bbe7 net: dsa: sja1105: bring deferred xmit implementation in line with ocelot-8021q
When the ocelot-8021q driver was converted to deferred xmit as part of
commit 8d5f7954b7 ("net: dsa: felix: break at first CPU port during
init and teardown"), the deferred implementation was deliberately made
subtly different from what sja1105 has.

The implementation differences lied on the following observations:

- There might be a race between these two lines in tag_sja1105.c:

       skb_queue_tail(&sp->xmit_queue, skb_get(skb));
       kthread_queue_work(sp->xmit_worker, &sp->xmit_work);

  and the skb dequeue logic in sja1105_port_deferred_xmit(). For
  example, the xmit_work might be already queued, however the work item
  has just finished walking through the skb queue. Because we don't
  check the return code from kthread_queue_work, we don't do anything if
  the work item is already queued.

  However, nobody will take that skb and send it, at least until the
  next timestampable skb is sent. This creates additional (and
  avoidable) TX timestamping latency.

  To close that race, what the ocelot-8021q driver does is it doesn't
  keep a single work item per port, and a skb timestamping queue, but
  rather dynamically allocates a work item per packet.

- It is also unnecessary to have more than one kthread that does the
  work. So delete the per-port kthread allocations and replace them with
  a single kthread which is global to the switch.

This change brings the two implementations in line by applying those
observations to the sja1105 driver as well.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-12-12 12:51:33 +00:00
..
8021q.h net: dsa: keep the bridge_dev and bridge_num as part of the same structure 2021-12-08 14:31:16 -08:00
brcm.h net: dsa: move the Broadcom tag information in a separate header file 2021-01-07 15:42:07 -08:00
lan9303.h
loop.h net: dsa: loop: Wire-up MTU callbacks 2020-08-03 18:19:23 -07:00
mv88e6xxx.h net: dsa: mv88e6xxx: isolate the ATU databases of standalone and bridged ports 2021-10-08 15:47:46 -07:00
ocelot.h net: dsa: tag_ocelot: convert to tagger-owned data 2021-12-12 12:51:33 +00:00
sja1105.h net: dsa: sja1105: bring deferred xmit implementation in line with ocelot-8021q 2021-12-12 12:51:33 +00:00