All of lore.kernel.org
 help / color / mirror / Atom feed
* [next-queue RFC 0/4] ethtool: Add support for frame preemption
@ 2020-05-16  1:29 ` Vinicius Costa Gomes
  0 siblings, 0 replies; 78+ messages in thread
From: Vinicius Costa Gomes @ 2020-05-16  1:29 UTC (permalink / raw)
  To: intel-wired-lan
  Cc: Vinicius Costa Gomes, jeffrey.t.kirsher, netdev, vladimir.oltean,
	po.liu, m-karicheri2, Jose.Abreu

Hi,

This series adds support for configuring frame preemption, as defined
by IEEE 802.1Q-2018 (previously IEEE 802.1Qbu) and IEEE 802.3br.

Frame preemption allows a packet from a higher priority queue marked
as "express" to preempt a packet from lower priority queue marked as
"preemptible". The idea is that this can help reduce the latency for
higher priority traffic.

Previously, the proposed interface for configuring these features was
using the qdisc layer. But as this is very hardware dependent and all
that qdisc did was pass the information to the driver, it makes sense
to have this in ethtool.

One example, for retrieving and setting the configuration:

$ ethtool $ sudo ./ethtool --show-frame-preemption enp3s0
Frame preemption settings for enp3s0:
	support: supported
	active: active
	supported queues: 0xf
	supported queues: 0xe
	minimum fragment size: 68


$ ethtool --set-frame-preemption enp3s0 fp on min-frag-size 68 preemptible-queues-mask 0xe

This is a RFC because I wanted to have feedback on some points:

  - The parameters added are enough for the hardware I have, is it
    enough in general?

  - even with the ethtool via netlink effort, I chose to keep the
    ioctl() way, in case someone wants to backport this to an older
    kernel, is there a problem with this?

  - Some space for bikeshedding the names and location (for example,
    does it make sense for these settings to be per-queue?), as I am
    not quite happy with them, one example, is the use of preemptible
    vs. preemptable;


About the patches, should be quite straightforward:

Patch 1, adds the ETHTOOL_GFP and ETHOOL_SFP commands and the
associated data structures;

Patch 2, adds the ETHTOOL_MSG_PREEMPT_GET and ETHTOOL_MSG_PREEMPT_SET
netlink messages and the associated attributes;

Patch 3, is the example implementation for the igc driver, the catch
here is that frame preemption in igc is dependent on the TSN "mode"
being enabled;

Patch 4, adds some registers that helped during implementation.

Another thing is that because igc is still under development, to avoid
conflicts, I think it might be easier for the PATCH version of this
series to go through Jeff Kirsher's tree.

Vinicius Costa Gomes (4):
  ethtool: Add support for configuring frame preemption
  ethtool: Add support for configuring frame preemption via netlink
  igc: Add support for configuring frame preemption
  igc: Add support for exposing frame preemption stats registers

 drivers/net/ethernet/intel/igc/igc.h         |   3 +
 drivers/net/ethernet/intel/igc/igc_defines.h |   6 +
 drivers/net/ethernet/intel/igc/igc_ethtool.c |  77 ++++++++
 drivers/net/ethernet/intel/igc/igc_regs.h    |  10 +
 drivers/net/ethernet/intel/igc/igc_tsn.c     |  46 ++++-
 include/linux/ethtool.h                      |   6 +
 include/uapi/linux/ethtool.h                 |  25 +++
 include/uapi/linux/ethtool_netlink.h         |  19 ++
 net/ethtool/Makefile                         |   3 +-
 net/ethtool/ioctl.c                          |  36 ++++
 net/ethtool/netlink.c                        |  15 ++
 net/ethtool/netlink.h                        |   2 +
 net/ethtool/preempt.c                        | 181 +++++++++++++++++++
 13 files changed, 423 insertions(+), 6 deletions(-)
 create mode 100644 net/ethtool/preempt.c

-- 
2.26.2


^ permalink raw reply	[flat|nested] 78+ messages in thread
* Re: [next-queue RFC 2/4] ethtool: Add support for configuring frame preemption via netlink
@ 2020-05-16  5:06 kbuild test robot
  0 siblings, 0 replies; 78+ messages in thread
From: kbuild test robot @ 2020-05-16  5:06 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 4477 bytes --]

CC: kbuild-all(a)lists.01.org
In-Reply-To: <20200516012948.3173993-3-vinicius.gomes@intel.com>
References: <20200516012948.3173993-3-vinicius.gomes@intel.com>
TO: Vinicius Costa Gomes <vinicius.gomes@intel.com>

Hi Vinicius,

[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on jkirsher-next-queue/dev-queue]
[also build test WARNING on net-next/master next-20200515]
[cannot apply to net/master linus/master ipvs/master v5.7-rc5]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Vinicius-Costa-Gomes/ethtool-Add-support-for-frame-preemption/20200516-093235
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue.git dev-queue
:::::: branch date: 4 hours ago
:::::: commit date: 4 hours ago

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
net/ethtool/preempt.c:152 ethnl_set_preempt() warn: variable dereferenced before check 'info' (see line 127)

# https://github.com/0day-ci/linux/commit/5d130ebd7a21741d4fda1c8829a32353e10d49d5
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 5d130ebd7a21741d4fda1c8829a32353e10d49d5
vim +/info +152 net/ethtool/preempt.c

5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15  117  
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15  118  int ethnl_set_preempt(struct sk_buff *skb, struct genl_info *info)
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15  119  {
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15  120  	struct nlattr *tb[ETHTOOL_A_LINKINFO_MAX + 1];
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15  121  	struct ethtool_fp preempt = {};
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15  122  	struct ethnl_req_info req_info = {};
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15  123  	struct net_device *dev;
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15  124  	bool mod = false;
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15  125  	int ret;
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15  126  
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 @127  	ret = nlmsg_parse(info->nlhdr, GENL_HDRLEN, tb,
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15  128  			  ETHTOOL_A_PREEMPT_MAX, preempt_set_policy,
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15  129  			  info->extack);
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15  130  	if (ret < 0)
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15  131  		return ret;
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15  132  
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15  133  	ret = ethnl_parse_header_dev_get(&req_info,
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15  134  					 tb[ETHTOOL_A_PREEMPT_HEADER],
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15  135  					 genl_info_net(info), info->extack,
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15  136  					 true);
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15  137  	if (ret < 0)
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15  138  		return ret;
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15  139  	dev = req_info.dev;
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15  140  	ret = -EOPNOTSUPP;
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15  141  	if (!dev->ethtool_ops->get_preempt ||
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15  142  	    !dev->ethtool_ops->set_preempt)
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15  143  		goto out_dev;
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15  144  
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15  145  	rtnl_lock();
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15  146  	ret = ethnl_ops_begin(dev);
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15  147  	if (ret < 0)
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15  148  		goto out_rtnl;
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15  149  
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15  150  	ret = dev->ethtool_ops->get_preempt(dev, &preempt);
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15  151  	if (ret < 0) {
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 @152  		if (info)

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

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

end of thread, other threads:[~2020-05-20 22:35 UTC | newest]

Thread overview: 78+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-16  1:29 [next-queue RFC 0/4] ethtool: Add support for frame preemption Vinicius Costa Gomes
2020-05-16  1:29 ` [Intel-wired-lan] " Vinicius Costa Gomes
2020-05-16  1:29 ` [next-queue RFC 1/4] ethtool: Add support for configuring " Vinicius Costa Gomes
2020-05-16  1:29   ` [Intel-wired-lan] " Vinicius Costa Gomes
2020-05-19 15:27   ` Murali Karicheri
2020-05-19 15:27     ` [Intel-wired-lan] " Murali Karicheri
2020-05-16  1:29 ` [next-queue RFC 2/4] ethtool: Add support for configuring frame preemption via netlink Vinicius Costa Gomes
2020-05-16  1:29   ` [Intel-wired-lan] " Vinicius Costa Gomes
2020-05-18 12:27   ` Dan Carpenter
2020-05-18 12:27     ` Dan Carpenter
2020-05-16  1:29 ` [next-queue RFC 3/4] igc: Add support for configuring frame preemption Vinicius Costa Gomes
2020-05-16  1:29   ` [Intel-wired-lan] " Vinicius Costa Gomes
2020-05-19 16:36   ` Murali Karicheri
2020-05-19 16:36     ` [Intel-wired-lan] " Murali Karicheri
2020-05-16  1:29 ` [next-queue RFC 4/4] igc: Add support for exposing frame preemption stats registers Vinicius Costa Gomes
2020-05-16  1:29   ` [Intel-wired-lan] " Vinicius Costa Gomes
2020-05-20 12:50   ` Murali Karicheri
2020-05-20 12:50     ` [Intel-wired-lan] " Murali Karicheri
2020-05-16  9:33 ` [next-queue RFC 0/4] ethtool: Add support for frame preemption Michal Kubecek
2020-05-16  9:33   ` [Intel-wired-lan] " Michal Kubecek
2020-05-18 19:34   ` Vinicius Costa Gomes
2020-05-18 19:34     ` [Intel-wired-lan] " Vinicius Costa Gomes
2020-05-19 22:40     ` Andre Guedes
2020-05-19 22:40       ` [Intel-wired-lan] " Andre Guedes
2020-05-19 22:53       ` Vinicius Costa Gomes
2020-05-19 22:53         ` [Intel-wired-lan] " Vinicius Costa Gomes
2020-05-16 20:37 ` David Miller
2020-05-16 20:37   ` [Intel-wired-lan] " David Miller
2020-05-16 21:03   ` Vladimir Oltean
2020-05-16 21:03     ` [Intel-wired-lan] " Vladimir Oltean
2020-05-16 22:19     ` David Miller
2020-05-16 22:19       ` [Intel-wired-lan] " David Miller
2020-05-17 10:51       ` Vladimir Oltean
2020-05-17 10:51         ` [Intel-wired-lan] " Vladimir Oltean
2020-05-17 18:45         ` Andrew Lunn
2020-05-17 18:45           ` [Intel-wired-lan] " Andrew Lunn
2020-05-17 19:04           ` Vladimir Oltean
2020-05-17 19:04             ` [Intel-wired-lan] " Vladimir Oltean
2020-05-18 19:05       ` Vinicius Costa Gomes
2020-05-18 19:05         ` [Intel-wired-lan] " Vinicius Costa Gomes
2020-05-18 20:56         ` Jakub Kicinski
2020-05-18 20:56           ` [Intel-wired-lan] " Jakub Kicinski
2020-05-18 22:06           ` Vinicius Costa Gomes
2020-05-18 22:06             ` [Intel-wired-lan] " Vinicius Costa Gomes
2020-05-18 22:22             ` Jakub Kicinski
2020-05-18 22:22               ` [Intel-wired-lan] " Jakub Kicinski
2020-05-18 23:05               ` Vinicius Costa Gomes
2020-05-18 23:05                 ` [Intel-wired-lan] " Vinicius Costa Gomes
2020-05-18 23:09                 ` Jakub Kicinski
2020-05-18 23:09                   ` [Intel-wired-lan] " Jakub Kicinski
2020-05-20 21:42                   ` Andre Guedes
2020-05-20 21:42                     ` Andre Guedes
2020-05-20 22:35                     ` Vinicius Costa Gomes
2020-05-20 22:35                       ` Vinicius Costa Gomes
2020-05-19 16:34             ` Murali Karicheri
2020-05-19 16:34               ` [Intel-wired-lan] " Murali Karicheri
2020-05-19 17:49               ` Vinicius Costa Gomes
2020-05-19 17:49                 ` [Intel-wired-lan] " Vinicius Costa Gomes
2020-05-17 15:06 ` Michael Walle
2020-05-18 13:36   ` Murali Karicheri
2020-05-19 20:41     ` Michael Walle
2020-05-19 14:53 ` Murali Karicheri
2020-05-19 14:53   ` [Intel-wired-lan] " Murali Karicheri
2020-05-19 15:32   ` Vinicius Costa Gomes
2020-05-19 15:32     ` [Intel-wired-lan] " Vinicius Costa Gomes
2020-05-19 16:11     ` Murali Karicheri
2020-05-19 16:11       ` [Intel-wired-lan] " Murali Karicheri
2020-05-19 22:39 ` Andre Guedes
2020-05-19 22:39   ` [Intel-wired-lan] " Andre Guedes
2020-05-19 23:37   ` Vinicius Costa Gomes
2020-05-19 23:37     ` [Intel-wired-lan] " Vinicius Costa Gomes
2020-05-20 12:47     ` Murali Karicheri
2020-05-20 12:47       ` [Intel-wired-lan] " Murali Karicheri
2020-05-20 12:52     ` Joergen Andreasen
2020-05-20 12:52       ` [Intel-wired-lan] " Joergen Andreasen
2020-05-20 21:32       ` Vinicius Costa Gomes
2020-05-20 21:32         ` [Intel-wired-lan] " Vinicius Costa Gomes
2020-05-16  5:06 [next-queue RFC 2/4] ethtool: Add support for configuring frame preemption via netlink kbuild test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.