[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <53C00698.4000901@alten.se>
Date: Fri, 11 Jul 2014 17:45:28 +0200
From: Arvid Brodin <arvid.brodin@...en.se>
To: David Miller <davem@...emloft.net>
CC: <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next 00/10] net/hsr: Use list_head+rcu, better frame
dispatch, etc.
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@...en.se | www.alten.se/en/
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists