[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1337278445.2496.17.camel@bwh-desktop.uk.solarflarecom.com>
Date: Thu, 17 May 2012 19:14:05 +0100
From: Ben Hutchings <bhutchings@...arflare.com>
To: Neil Horman <nhorman@...driver.com>
CC: <netdev@...r.kernel.org>, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <eric.dumazet@...il.com>
Subject: Re: [PATCH v2] drop_monitor: convert to modular building
On Thu, 2012-05-17 at 13:49 -0400, Neil Horman wrote:
> When I first wrote drop monitor I wrote it to just build monolithically. There
> is no reason it can't be built modularly as well, so lets give it that
> flexibiity.
>
> I've tested this by building it as both a module and monolithically, and it
> seems to work quite well
>
> Change notes:
>
> v2)
> * fixed for_each_present_cpu loops to be more correct as per Eric D.
> * Converted exit path failures to BUG_ON as per Ben H.
Sorry I didn't pick up on this the first time:
[...]
> -late_initcall(init_net_drop_monitor);
> +static void exit_net_drop_monitor(void)
> +{
> + struct per_cpu_dm_data *data;
> + int cpu;
> +
> + BUG_ON(unregister_netdevice_notifier(&dropmon_net_notifier));
> +
> + /*
> + * Because of the module_get/put we do in the trace state change path
> + * we are guarnateed not to have any current users when we get here
> + * all we need to do is make sure that we don't have any running timers
> + * or pending schedule calls
> + */
> +
> + for_each_possible_cpu(cpu) {
> + data = &per_cpu(dm_cpu_data, cpu);
> + del_timer(&data->send_timer);
Doesn't this need to be del_timer_sync()?
Ben.
> + cancel_work_sync(&data->dm_alert_work);
> + /*
> + * At this point, we should have exclusive access
> + * to this struct and can free the skb inside it
> + */
> + kfree_skb(data->skb);
> + }
> +
> + BUG_ON(genl_unregister_family(&net_drop_monitor_family));
> +}
> +
> +module_init(init_net_drop_monitor);
> +module_exit(exit_net_drop_monitor);
> +
> +MODULE_LICENSE("GPL v2");
> +MODULE_AUTHOR("Neil Horman <nhorman@...driver.com>");
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
--
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