From: Julian Wiedmann <jwi@linux.ibm.com>
To: David Miller <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>
Cc: linux-netdev <netdev@vger.kernel.org>,
linux-s390 <linux-s390@vger.kernel.org>,
Heiko Carstens <hca@linux.ibm.com>,
Karsten Graul <kgraul@linux.ibm.com>,
Julian Wiedmann <jwi@linux.ibm.com>,
Alexandra Winter <wintera@linux.ibm.com>
Subject: [PATCH net-next 9/9] s390/qeth: Consider dependency on SWITCHDEV module
Date: Fri, 11 Jun 2021 09:33:41 +0200 [thread overview]
Message-ID: <20210611073341.1634501-10-jwi@linux.ibm.com> (raw)
In-Reply-To: <20210611073341.1634501-1-jwi@linux.ibm.com>
From: Alexandra Winter <wintera@linux.ibm.com>
Without the SWITCHDEV module, the bridgeport attribute LEARNING_SYNC
of the physical device (self) does not provide any functionality.
Instead of calling the no-op stub version of the switchdev functions,
fail the setting of the attribute with an appropriate message.
While at it, also add an error message for the 'not supported by HW'
case.
Signed-off-by: Alexandra Winter <wintera@linux.ibm.com>
Reviewed-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
---
drivers/s390/net/qeth_l2_main.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c
index ca44421a6d6e..2abf86c104d5 100644
--- a/drivers/s390/net/qeth_l2_main.c
+++ b/drivers/s390/net/qeth_l2_main.c
@@ -805,8 +805,6 @@ static int qeth_l2_bridge_setlink(struct net_device *dev, struct nlmsghdr *nlh,
if (!netif_device_present(dev))
return -ENODEV;
- if (!(priv->brport_hw_features))
- return -EOPNOTSUPP;
nlmsg_for_each_attr(attr, nlh, sizeof(struct ifinfomsg), rem1) {
if (nla_type(attr) == IFLA_PROTINFO) {
@@ -832,6 +830,16 @@ static int qeth_l2_bridge_setlink(struct net_device *dev, struct nlmsghdr *nlh,
return 0;
if (!bp_tb[IFLA_BRPORT_LEARNING_SYNC])
return -EINVAL;
+ if (!(priv->brport_hw_features & BR_LEARNING_SYNC)) {
+ NL_SET_ERR_MSG_ATTR(extack, bp_tb[IFLA_BRPORT_LEARNING_SYNC],
+ "Operation not supported by HW");
+ return -EOPNOTSUPP;
+ }
+ if (!IS_ENABLED(CONFIG_NET_SWITCHDEV)) {
+ NL_SET_ERR_MSG_ATTR(extack, bp_tb[IFLA_BRPORT_LEARNING_SYNC],
+ "Requires NET_SWITCHDEV");
+ return -EOPNOTSUPP;
+ }
enable = !!nla_get_u8(bp_tb[IFLA_BRPORT_LEARNING_SYNC]);
if (enable == !!(priv->brport_features & BR_LEARNING_SYNC))
--
2.25.1
next prev parent reply other threads:[~2021-06-11 7:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-11 7:33 [PATCH net-next 0/9] s390/qeth: updates 2021-06-11 Julian Wiedmann
2021-06-11 7:33 ` [PATCH net-next 1/9] s390/qeth: count TX completion interrupts Julian Wiedmann
2021-06-11 7:33 ` [PATCH net-next 2/9] s390/qeth: also use TX NAPI for non-IQD devices Julian Wiedmann
2021-06-11 7:33 ` [PATCH net-next 3/9] s390/qeth: unify the tracking of active cmds on ccw device Julian Wiedmann
2021-06-11 7:33 ` [PATCH net-next 4/9] s390/qeth: use ethtool_sprintf() Julian Wiedmann
2021-06-11 7:33 ` [PATCH net-next 5/9] s390/qeth: consolidate completion of pending TX buffers Julian Wiedmann
2021-06-11 7:33 ` [PATCH net-next 6/9] s390/qeth: remove QAOB's pointer to its TX buffer Julian Wiedmann
2021-06-11 7:33 ` [PATCH net-next 7/9] s390/qeth: remove TX buffer's pointer to its queue Julian Wiedmann
2021-06-11 7:33 ` [PATCH net-next 8/9] s390/qeth: shrink TX buffer struct Julian Wiedmann
2021-06-11 7:33 ` Julian Wiedmann [this message]
2021-06-11 20:00 ` [PATCH net-next 0/9] s390/qeth: updates 2021-06-11 patchwork-bot+netdevbpf
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=20210611073341.1634501-10-jwi@linux.ibm.com \
--to=jwi@linux.ibm.com \
--cc=davem@davemloft.net \
--cc=hca@linux.ibm.com \
--cc=kgraul@linux.ibm.com \
--cc=kuba@kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=wintera@linux.ibm.com \
/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 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.