From: Julian Wiedmann <jwi@linux.ibm.com>
To: David Miller <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-s390@vger.kernel.org>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
Stefan Raspl <raspl@linux.ibm.com>,
Ursula Braun <ubraun@linux.ibm.com>,
Julian Wiedmann <jwi@linux.ibm.com>
Subject: [PATCH net-next 09/11] s390/qeth: remove VLAN tracking for L3 devices
Date: Thu, 14 Nov 2019 11:19:22 +0100 [thread overview]
Message-ID: <20191114101924.29558-10-jwi@linux.ibm.com> (raw)
In-Reply-To: <20191114101924.29558-1-jwi@linux.ibm.com>
Use vlan_for_each() instead of tracking each registered VID internally.
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
---
drivers/s390/net/qeth_core.h | 1 -
drivers/s390/net/qeth_l3_main.c | 42 +++++++++------------------------
2 files changed, 11 insertions(+), 32 deletions(-)
diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h
index 52fd3c4bb132..f81f1523d528 100644
--- a/drivers/s390/net/qeth_core.h
+++ b/drivers/s390/net/qeth_core.h
@@ -824,7 +824,6 @@ struct qeth_card {
struct workqueue_struct *event_wq;
struct workqueue_struct *cmd_wq;
wait_queue_head_t wait_q;
- unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)];
DECLARE_HASHTABLE(mac_htable, 4);
DECLARE_HASHTABLE(ip_htable, 4);
struct mutex ip_lock;
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
index 1e060331a8cc..f4c65971321a 100644
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -1113,10 +1113,10 @@ qeth_diags_trace(struct qeth_card *card, enum qeth_diags_trace_cmds diags_cmd)
return qeth_send_ipa_cmd(card, iob, qeth_diags_trace_cb, NULL);
}
-static void qeth_l3_add_mcast_rcu(struct net_device *dev,
- struct qeth_card *card)
+static int qeth_l3_add_mcast_rtnl(struct net_device *dev, int vid, void *arg)
{
struct qeth_ipaddr *tmp = NULL;
+ struct qeth_card *card = arg;
struct inet6_dev *in6_dev;
struct in_device *in4_dev;
struct qeth_ipaddr *ipm;
@@ -1132,12 +1132,12 @@ static void qeth_l3_add_mcast_rcu(struct net_device *dev,
if (!tmp)
goto out;
- in4_dev = __in_dev_get_rcu(dev);
+ in4_dev = __in_dev_get_rtnl(dev);
if (!in4_dev)
goto walk_ipv6;
- for (im4 = rcu_dereference(in4_dev->mc_list); im4 != NULL;
- im4 = rcu_dereference(im4->next_rcu)) {
+ for (im4 = rtnl_dereference(in4_dev->mc_list); im4 != NULL;
+ im4 = rtnl_dereference(im4->next_rcu)) {
tmp->u.a4.addr = im4->multiaddr;
tmp->is_multicast = 1;
@@ -1195,25 +1195,7 @@ static void qeth_l3_add_mcast_rcu(struct net_device *dev,
out:
kfree(tmp);
-}
-
-/* called with rcu_read_lock */
-static void qeth_l3_add_vlan_mc(struct qeth_card *card)
-{
- u16 vid;
-
- QETH_CARD_TEXT(card, 4, "admc6vl");
-
- if (!qeth_is_supported(card, IPA_FULL_VLAN))
- return;
-
- for_each_set_bit(vid, card->active_vlans, VLAN_N_VID) {
- struct net_device *netdev;
-
- netdev = __vlan_find_dev_deep_rcu(card->dev, htons(ETH_P_8021Q),
- vid);
- qeth_l3_add_mcast_rcu(netdev, card);
- }
+ return 0;
}
static int qeth_l3_vlan_rx_add_vid(struct net_device *dev,
@@ -1221,7 +1203,7 @@ static int qeth_l3_vlan_rx_add_vid(struct net_device *dev,
{
struct qeth_card *card = dev->ml_priv;
- set_bit(vid, card->active_vlans);
+ QETH_CARD_TEXT_(card, 4, "aid:%d", vid);
return 0;
}
@@ -1231,8 +1213,6 @@ static int qeth_l3_vlan_rx_kill_vid(struct net_device *dev,
struct qeth_card *card = dev->ml_priv;
QETH_CARD_TEXT_(card, 4, "kid:%d", vid);
-
- clear_bit(vid, card->active_vlans);
return 0;
}
@@ -1387,11 +1367,11 @@ static void qeth_l3_rx_mode_work(struct work_struct *work)
QETH_CARD_TEXT(card, 3, "setmulti");
if (!card->options.sniffer) {
- rcu_read_lock();
- qeth_l3_add_mcast_rcu(card->dev, card);
+ rtnl_lock();
+ qeth_l3_add_mcast_rtnl(card->dev, 0, card);
if (qeth_is_supported(card, IPA_FULL_VLAN))
- qeth_l3_add_vlan_mc(card);
- rcu_read_unlock();
+ vlan_for_each(card->dev, qeth_l3_add_mcast_rtnl, card);
+ rtnl_unlock();
hash_for_each_safe(card->ip_mc_htable, i, tmp, addr, hnode) {
switch (addr->disp_flag) {
--
2.17.1
next prev parent reply other threads:[~2019-11-14 10:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-14 10:19 [PATCH net-next 00/11] s390/qeth: updates 2019-11-14 Julian Wiedmann
2019-11-14 10:19 ` [PATCH net-next 01/11] s390/qeth: gather more detailed RX dropped/error statistics Julian Wiedmann
2019-11-14 10:19 ` [PATCH net-next 02/11] s390/qeth: support per-frame invalidation Julian Wiedmann
2019-11-14 10:19 ` [PATCH net-next 03/11] s390/qeth: drop unwanted packets earlier in RX path Julian Wiedmann
2019-11-14 10:19 ` [PATCH net-next 04/11] s390/qeth: handle skb allocation error gracefully Julian Wiedmann
2019-11-14 10:19 ` [PATCH net-next 05/11] s390/qeth: clean up error path in qeth_core_probe_device() Julian Wiedmann
2019-11-14 10:19 ` [PATCH net-next 06/11] s390/qeth: fine-tune L3 mcast locking Julian Wiedmann
2019-11-14 10:19 ` [PATCH net-next 07/11] s390/qeth: remove gratuitious RX modeset Julian Wiedmann
2019-11-14 10:19 ` [PATCH net-next 08/11] s390/qeth: consolidate L3 mcast registration code Julian Wiedmann
2019-11-14 10:19 ` Julian Wiedmann [this message]
2019-11-14 10:19 ` [PATCH net-next 10/11] s390/qeth: replace qeth_l3_get_addr_buffer() Julian Wiedmann
2019-11-14 10:19 ` [PATCH net-next 11/11] s390/qeth: don't check drvdata in sysfs code Julian Wiedmann
2019-11-15 2:17 ` [PATCH net-next 00/11] s390/qeth: updates 2019-11-14 David Miller
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=20191114101924.29558-10-jwi@linux.ibm.com \
--to=jwi@linux.ibm.com \
--cc=davem@davemloft.net \
--cc=heiko.carstens@de.ibm.com \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=raspl@linux.ibm.com \
--cc=ubraun@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 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).