On 16/03/2016 06:12, "Ilya Maximets" <i.maxim...@samsung.com> wrote:
>On 16.03.2016 01:30, Daniele Di Proietto wrote: >> A netdev provider, especially a PMD provider (like netdev DPDK) might >> not be able to change some of its parameters (such as MTU, or number of >> queues) without stopping everything and restarting. >> >> This commit introduces a mechanism that allows a netdev provider to >> request a restart (netdev_request_reconfigure()). The upper layer can >> be notified via netdev_wait_reconf_required() and >> netdev_is_reconf_required(). After closing all the rxqs the upper layer >> can finally call netdev_reconfigure(), to make sure that the new >> configuration is in place. >> >> This will be used by next commit to reconfigure rx and tx queues in >> netdev-dpdk. >> >> Signed-off-by: Daniele Di Proietto <diproiet...@vmware.com> [...] >> >> >> @@ -1854,3 +1857,38 @@ netdev_get_change_seq(const struct netdev >>*netdev) >> { >> return netdev->change_seq; >> } >> + >> +void >> +netdev_wait_reconf_required(struct netdev *netdev) >> +{ >> + seq_wait(netdev->reconfigure_seq, netdev->last_reconfigure_seq); >> +} >> + >> +bool >> +netdev_is_reconf_required(struct netdev *netdev) >> +{ >> + return seq_read(netdev->reconfigure_seq) != >>netdev->last_reconfigure_seq; >> +} >> + >> +/* Give a chance to 'netdev' to reconfigure some of its parameters. >> + * >> + * If a module uses netdev_send() and netdev_rxq_recv(), it must call >>this >> + * function when netdev_is_reconf_required() returns true. >> + * >> + * Return 0 if successful, otherwise a positive errno value. If the >> + * reconfiguration fails the netdev will not be able to send or receive >> + * packets. >> + * >> + * When this function is called, no concurrent call to >>netdev_rxq_recv() or >> + * netdev_send() must be issued. */ > >Not only concurrent. There must be no calls at all. By "concurrent" I meant concurrent to netdev_reconfigure(). Since, as you point out, this is confusing, I've changed the comment to: * When this function is called, no call to netdev_rxq_recv() or netdev_send() * must be issued. */ _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev