netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC net-next v2 0/2] ethtool: Add support for frame preemption
@ 2020-10-12 23:56 Vinicius Costa Gomes
  2020-10-12 23:56 ` [RFC net-next v2 1/2] ethtool: Add support for configuring " Vinicius Costa Gomes
  2020-10-12 23:56 ` [RFC net-next v2 2/2] taprio: Add support for frame preemption offload Vinicius Costa Gomes
  0 siblings, 2 replies; 3+ messages in thread
From: Vinicius Costa Gomes @ 2020-10-12 23:56 UTC (permalink / raw)
  To: netdev
  Cc: Vinicius Costa Gomes, jhs, xiyou.wangcong, jiri, kuba,
	m-karicheri2, vladimir.oltean, Jose.Abreu, po.liu

Hi,

Changes from v1:
 - The per-queue preemptible/express setting is moved to applicable
   qdiscs (Jakub Kicinski and others);
 - "min-frag-size" now follows the 802.3br specification more closely,
   it's expressed as X in '64(1 + X) + 4' (Joergen Andreasen)

This is still an RFC because two main reasons, I want to confirm that
this approach (per-queue settings via qdiscs, device settings via
ethtool) looks good, even though there aren't much more options left ;-)
The other reason is that while testing this I found some weirdness
in the driver that I would need a bit more time to investigate.

(In case these patches are not enough to give an idea of how things
work, I can send the userspace patches, of course.)

The idea of this "hybrid" approach is that applications/users would do
the following steps to configure frame preemption:

$ tc qdisc replace dev $IFACE parent root handle 100 taprio \
      num_tc 3 \
      map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \
      queues 1@0 1@1 2@2 \
      base-time $BASE_TIME \
      sched-entry S 0f 10000000 \
      preempt 1110 \
      flags 0x2 

The "preempt" parameter is the only difference, it configures which
queues are marked as preemptible, in this example, queue 0 is marked
as "not preemptible", so it is express, the rest of the four queues
are preemptible.

The next step, of this example, would be to enable frame preemption in
the device, via ethtool, and set the minimum fragment size to 2:

$ sudo ./ethtool --set-frame-preemption $IFACE fp on min-frag-size 2


Cheers,


Vinicius Costa Gomes (2):
  ethtool: Add support for configuring frame preemption
  taprio: Add support for frame preemption offload

 include/linux/ethtool.h              |  19 ++++
 include/linux/netdevice.h            |   1 +
 include/net/pkt_sched.h              |   4 +
 include/uapi/linux/ethtool_netlink.h |  17 +++
 include/uapi/linux/pkt_sched.h       |   1 +
 net/ethtool/Makefile                 |   2 +-
 net/ethtool/netlink.c                |  19 ++++
 net/ethtool/netlink.h                |   4 +
 net/ethtool/preempt.c                | 151 +++++++++++++++++++++++++++
 net/sched/sch_taprio.c               |  41 +++++++-
 10 files changed, 254 insertions(+), 5 deletions(-)
 create mode 100644 net/ethtool/preempt.c

-- 
2.28.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-10-12 23:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-12 23:56 [RFC net-next v2 0/2] ethtool: Add support for frame preemption Vinicius Costa Gomes
2020-10-12 23:56 ` [RFC net-next v2 1/2] ethtool: Add support for configuring " Vinicius Costa Gomes
2020-10-12 23:56 ` [RFC net-next v2 2/2] taprio: Add support for frame preemption offload Vinicius Costa Gomes

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).