From: Petr Machata <petrm-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
To: "linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-stm32-XDFAJ8BFU24N7RejjzZ/Li2xQDfSxrLKVpNB7YpNyf8@public.gmane.org"
<linux-stm32-XDFAJ8BFU24N7RejjzZ/Li2xQDfSxrLKVpNB7YpNyf8@public.gmane.org>,
"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
"devel-tBiZLqfeLfOHmIFyCCdPziST3g8Odh+X@public.gmane.org"
<devel-tBiZLqfeLfOHmIFyCCdPziST3g8Odh+X@public.gmane.org>,
"linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-s390-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-s390-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b@public.gmane.org"
<devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b@public.gmane.org>,
"sparmaintainer-GLv8BlqOqDDQT0dZR+AlfA@public.gmane.org"
<sparmaintainer-GLv8BlqOqDDQT0dZR+AlfA@public.gmane.org>,
"linux-bluetooth-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-bluetooth-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org"
<dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org>,
"linux-kselftest-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-kselftest-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Cc: "shrijeet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"
<shrijeet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
"heiko.carstens-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org"
<heiko.carstens-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>,
"_govind-KK0ffGbhmjU@public.gmane.org"
<_govind-KK0ffGbhmjU@public.gmane.org>,
"dsa-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org"
<dsa-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org>,
"ecree-s/n/eUQHGBpZroRs9YW3xA@public.gmane.org"
<ecree-s/n/eUQHGBpZroRs9YW3xA@public.gmane.org>,
kys <kys-0li6OtcxBFHby3iVrkZq2A@public.gmane.org>,
"shuah-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org"
<shuah-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
"andy-QlMahl40kYEqcZcGjlUOXw@public.gmane.org"
<andy-QlMahl40kYEqcZcGjlUOXw@public.gmane.org>,
"johan.hedberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"
<johan.hedberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
"ioana.ciornei-3arQi8VN3Tc@public.gmane.org"
<ioana.ciornei-3arQi8VN3Tc@public.gmane.org>,
"sthemmin-0li6OtcxBFHby3iVrkZq2A@public.gmane.org"
<sthemmin-0li6OtcxBFHby3iVrkZq2A@public.gmane.org>,
"ruxandra.radulescu-3arQi8VN3Tc@public.gmane.org"
<ruxandra.radulescu-3arQi8VN3Tc@public.gmane.org>,
"jwi-tEXmvtCZX7AybS5Ee8rs3A@public.gmane.org"
<jwi-tEXmvtCZX7AybS5Ee8rs3A@public.gmane.org>,
"jgg-uk2M96/98Pc@public.gmane.org"
<jgg-uk2M96/98Pc@public.gmane.org>,
"dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org"
<dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
"joabreu-HKixBCOQz3hWk0Htik3J/w@public.gmane.org"
<joabreu-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>,
"vfalico-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"
<vfalico-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
"kuznet-v/Mj1YrvjDBInbfyfbPRSQ@public.gmane.org"
<kuznet-v/Mj1YrvjDBInbfyfbPRSQ@public.gmane.org>,
"david.kershner-GLv8BlqOqDDQT0dZR+AlfA@public.gmane.org"
<david.kershner-GLv8BlqOqDDQT0dZR+AlfA@public.gmane.org>,
"marcel@holtma
Subject: [PATCH net-next 0/8] Pass extack to NETDEV_PRE_UP
Date: Wed, 5 Dec 2018 10:51:27 +0000 [thread overview]
Message-ID: <cover.1544006963.git.petrm@mellanox.com> (raw)
Drivers may need to validate configuration of a device that's about to
be upped. An example is mlxsw, which needs to check the configuration of
a VXLAN device attached to an offloaded bridge. Should the validation
fail, there's currently no way to communicate details of the failure to
the user, beyond an error number.
Therefore this patch set extends the NETDEV_PRE_UP event to include
extack, if available.
There are three vectors through which NETDEV_PRE_UP invocation can be
reached. The two major ones are dev_open() and dev_change_flags(), the
last is then __dev_change_flags().
In patch #1, the first access vector, dev_open() is addressed. An extack
parameter is added and all users converted to use it.
Before addressing the second vector, two preparatory patches propagate
extack argument to the proximity of the dev_change_flags() call in VRF
and IPVLAN drivers. That happens in patches #2 and #3. Then in patch #4,
dev_change_flags() is treated similarly to dev_open().
Likewise in patch #5, __dev_change_flags() is extended.
Then in patches #6 and #7, the extack is finally propagated all the way
to the point where the notification is emitted.
This change allows particularly mlxsw (which already has code to
leverage extack if available) to communicate to the user error messages
regarding VXLAN configuration. In patch #8, add a test case that
exercises this code and checks that an error message is propagated.
For example:
# ip link add name br1 up type bridge vlan_filtering 0 mcast_snooping 0
# ip link add name vx1 up type vxlan id 1000 \
local 192.0.2.17 remote 192.0.2.18 \
dstport 4789 nolearning noudpcsum tos inherit ttl 100
# ip link set dev vx1 master br1
# ip link set dev sw1p1 master br1
# ip link add name br2 up type bridge vlan_filtering 0 mcast_snooping 0
# ip link add name vx2 up type vxlan id 2000 \
local 192.0.2.17 remote 192.0.2.18 \
dstport 4789 nolearning noudpcsum tos inherit ttl 100
# ip link set dev vx2 master br2
# ip link set dev sw1p2 master br2
# ip link set dev vx2 down
# ip link set dev vx2 type vxlan ttl 200
# ip link set dev vx2 up
Error: mlxsw_spectrum: Conflicting NVE tunnels configuration.
Petr Machata (8):
net: core: dev: Add extack argument to dev_open()
net: vrf: cycle_netdev(): Add an extack argument
net: ipvlan: ipvlan_set_port_mode(): Add an extack argument
net: core: dev: Add extack argument to dev_change_flags()
net: core: dev: Add extack argument to __dev_change_flags()
net: core: dev: Add call_netdevice_notifiers_extack()
net: core: dev: Attach extack to NETDEV_PRE_UP
selftests: mlxsw: Add a new test extack.sh
drivers/infiniband/ulp/ipoib/ipoib_main.c | 6 +-
drivers/net/bonding/bond_main.c | 2 +-
.../net/ethernet/aquantia/atlantic/aq_ethtool.c | 2 +-
drivers/net/ethernet/cisco/enic/enic_ethtool.c | 2 +-
drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 2 +-
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 2 +-
drivers/net/ethernet/sfc/ethtool.c | 2 +-
drivers/net/ethernet/sfc/falcon/ethtool.c | 2 +-
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +-
drivers/net/hyperv/netvsc_drv.c | 6 +-
drivers/net/ipvlan/ipvlan_main.c | 19 +++--
drivers/net/net_failover.c | 8 +--
drivers/net/team/team.c | 2 +-
drivers/net/vrf.c | 11 +--
drivers/net/wireless/intersil/hostap/hostap_main.c | 2 +-
drivers/s390/net/qeth_l2_main.c | 2 +-
drivers/s390/net/qeth_l3_main.c | 2 +-
drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 2 +-
drivers/staging/unisys/visornic/visornic_main.c | 2 +-
include/linux/netdevice.h | 8 ++-
net/8021q/vlan.c | 4 +-
net/bluetooth/6lowpan.c | 2 +-
net/core/dev.c | 43 +++++++----
net/core/dev_ioctl.c | 2 +-
net/core/net-sysfs.c | 2 +-
net/core/netpoll.c | 2 +-
net/core/rtnetlink.c | 6 +-
net/ipv4/devinet.c | 2 +-
net/ipv4/ipconfig.c | 6 +-
net/ipv4/ipmr.c | 4 +-
net/ipv6/addrconf.c | 2 +-
net/ipv6/ip6mr.c | 2 +-
net/openvswitch/vport-geneve.c | 2 +-
net/openvswitch/vport-gre.c | 2 +-
net/openvswitch/vport-vxlan.c | 2 +-
.../testing/selftests/drivers/net/mlxsw/extack.sh | 84 ++++++++++++++++++++++
36 files changed, 182 insertions(+), 71 deletions(-)
create mode 100755 tools/testing/selftests/drivers/net/mlxsw/extack.sh
--
2.4.11
next reply other threads:[~2018-12-05 10:51 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-05 10:51 Petr Machata [this message]
[not found] ` <cover.1544006963.git.petrm-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2018-12-05 10:51 ` [PATCH net-next 1/8] net: core: dev: Add extack argument to dev_open() Petr Machata
[not found] ` <58aee6a3c1ecba75a780cc303e5fd6e4d92059be.1544006963.git.petrm-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2018-12-05 16:32 ` David Ahern
2018-12-05 10:51 ` [PATCH net-next 2/8] net: vrf: cycle_netdev(): Add an extack argument Petr Machata
[not found] ` <eb87a73c9e3f48abd7ca7b6ad76924af70cecef1.1544006963.git.petrm-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2018-12-05 16:34 ` David Ahern
2018-12-05 10:51 ` [PATCH net-next 3/8] net: ipvlan: ipvlan_set_port_mode(): " Petr Machata
2018-12-05 10:51 ` [PATCH net-next 4/8] net: core: dev: Add extack argument to dev_change_flags() Petr Machata
[not found] ` <a85ca38ac0470f61758d979bcd1b9e3b9e086d1c.1544006963.git.petrm-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2018-12-05 16:35 ` David Ahern
2018-12-05 10:51 ` [PATCH net-next 5/8] net: core: dev: Add extack argument to __dev_change_flags() Petr Machata
2018-12-05 16:38 ` David Ahern
2018-12-05 10:51 ` [PATCH net-next 6/8] net: core: dev: Add call_netdevice_notifiers_extack() Petr Machata
2018-12-05 16:43 ` David Ahern
2018-12-05 10:52 ` [PATCH net-next 7/8] net: core: dev: Attach extack to NETDEV_PRE_UP Petr Machata
2018-12-05 16:44 ` David Ahern
2018-12-05 10:52 ` [PATCH net-next 8/8] selftests: mlxsw: Add a new test extack.sh Petr Machata
2018-12-05 19:38 ` [PATCH net-next 0/8] Pass extack to NETDEV_PRE_UP David Miller
2018-12-06 0:56 ` Petr Machata
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1544006963.git.petrm@mellanox.com \
--to=petrm-vpraknaxozvwk0htik3j/w@public.gmane.org \
--cc=_govind-KK0ffGbhmjU@public.gmane.org \
--cc=andy-QlMahl40kYEqcZcGjlUOXw@public.gmane.org \
--cc=david.kershner-GLv8BlqOqDDQT0dZR+AlfA@public.gmane.org \
--cc=dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org \
--cc=devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b@public.gmane.org \
--cc=devel-tBiZLqfeLfOHmIFyCCdPziST3g8Odh+X@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=dsa-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org \
--cc=ecree-s/n/eUQHGBpZroRs9YW3xA@public.gmane.org \
--cc=heiko.carstens-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org \
--cc=ioana.ciornei-3arQi8VN3Tc@public.gmane.org \
--cc=jgg-uk2M96/98Pc@public.gmane.org \
--cc=joabreu-HKixBCOQz3hWk0Htik3J/w@public.gmane.org \
--cc=johan.hedberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=jwi-tEXmvtCZX7AybS5Ee8rs3A@public.gmane.org \
--cc=kuznet-v/Mj1YrvjDBInbfyfbPRSQ@public.gmane.org \
--cc=kys-0li6OtcxBFHby3iVrkZq2A@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-bluetooth-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kselftest-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-s390-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-stm32-XDFAJ8BFU24N7RejjzZ/Li2xQDfSxrLKVpNB7YpNyf8@public.gmane.org \
--cc=linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=ruxandra.radulescu-3arQi8VN3Tc@public.gmane.org \
--cc=shrijeet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=shuah-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=sparmaintainer-GLv8BlqOqDDQT0dZR+AlfA@public.gmane.org \
--cc=sthemmin-0li6OtcxBFHby3iVrkZq2A@public.gmane.org \
--cc=vfalico-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).