From: Arvid Brodin <arvid.brodin@alten•se>
To: David Miller <davem@davemloft•net>
Cc: <netdev@vger•kernel.org>
Subject: Re: [PATCH net-next 00/10] net/hsr: Use list_head+rcu, better frame dispatch, etc.
Date: Fri, 11 Jul 2014 17:45:28 +0200 [thread overview]
Message-ID: <53C00698.4000901@alten.se> (raw)
In-Reply-To: <20140708.114548.1274719854380242049.davem@davemloft.net>
On 2014-07-08 20:45, David Miller wrote:
>
> Just one question:
>
> @@ -575,6 +579,13 @@ int hsr_dev_finalize(struct net_device *hsr_dev, struct net_device *slave[2],
> }
> }
>
> + for (i = 0; i < HSR_MAX_SLAVE; i++) {
> + res = netdev_rx_handler_register(slave[i], hsr_handle_frame,
> + hsr);
> + if (res)
> + goto fail;
> + }
> +
> /* Make sure we recognize frames from ourselves in hsr_rcv() */
> res = hsr_create_self_node(&hsr->self_node_db, hsr_dev->dev_addr,
> hsr->slave[1]->dev_addr);
>
> If one of the slaves fails to register it's RX handler here, what unregisters
> the slaves which already succeeded?
This looks like it's from "[PATCH net-next 02/10] net/hsr: Switch from dev_add_pack() to
netdev_rx_handler_register()". If so, the code under the fail: label calls restore_slaves(),
which in turn iterates over the slaves. From the same patch:
@@ -402,8 +402,12 @@ static void restore_slaves(struct net_device *hsr_dev)
netdev_info(hsr_dev,
"Cannot restore slave promiscuity (%s, %d)\n",
hsr->slave[i]->name, res);
+
+ if (hsr->slave[i]->rx_handler == hsr_handle_frame)
+ netdev_rx_handler_unregister(hsr->slave[i]);
}
+
rtnl_unlock();
}
--
Arvid Brodin | Consultant (Linux)
ALTEN | Knarrarnäsgatan 7 | SE-164 40 Kista | Sweden
arvid.brodin@alten•se | www.alten.se/en/
prev parent reply other threads:[~2014-07-11 15:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-04 21:33 [PATCH net-next 00/10] net/hsr: Use list_head+rcu, better frame dispatch, etc Arvid Brodin
2014-07-08 18:45 ` David Miller
2014-07-11 15:45 ` Arvid Brodin [this message]
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=53C00698.4000901@alten.se \
--to=arvid.brodin@alten$(echo .)se \
--cc=davem@davemloft$(echo .)net \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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