netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: jiri@resnulli.us
Cc: netdev@vger.kernel.org, edumazet@google.com,
	bhutchings@solarflare.com, faisal.latif@intel.com,
	shemminger@vyatta.com, fbl@redhat.com, roland@kernel.org,
	sean.hefty@intel.com, hal.rosenstock@gmail.com, fubar@us.ibm.com,
	andy@greyhouse.net, divy@chelsio.com,
	jitendra.kalsaria@qlogic.com, sony.chacko@qlogic.com,
	linux-driver@qlogic.com, kaber@trash.net,
	ursula.braun@de.ibm.com, blaschka@linux.vnet.ibm.com,
	schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com,
	ebiederm@xmission.com, joe@perches.com, amwang@redhat.com,
	nhorman@tuxdriver.com, john.r.fastabend@intel.com,
	pablo@netfilter.org
Subject: Re: [patch net-next 01/15] net: introduce upper device lists
Date: Sat, 29 Dec 2012 15:31:01 -0800 (PST)	[thread overview]
Message-ID: <20121229.153101.676681277388952344.davem@davemloft.net> (raw)
In-Reply-To: <1356777522-19652-2-git-send-email-jiri@resnulli.us>

From: Jiri Pirko <jiri@resnulli.us>
Date: Sat, 29 Dec 2012 11:38:28 +0100

> +	/*
> +	 * To prevent loops, check if dev is not upper device to upper_dev.
> +	 */

Please use:

	/* To prevent loops, check if dev is not upper device to upper_dev.  */

> +/**
> + * netdev_upper_free_rcu - Frees a upper device list item via the RCU pointer
> + * @entry: the entry's RCU field
> + *
> + * This function is designed to be used as a callback to the call_rcu()
> + * function so that the memory allocated to the netdev upper device list item
> + * can be released safely.
> + */
> +static void netdev_upper_free_rcu(struct rcu_head *entry)
> +{
> +	struct netdev_upper *upper;
> +
> +	upper = container_of(entry, struct netdev_upper, rcu);
> +	kfree(upper);
> +}

Please use kfree_rcu().

Also, since __netdev_has_upper_dev() modifies &search_list inside
of the list traversal loop, I think you really need to use
list_for_each_entry_safe() even though you always append to the
tail of &search_list.

  reply	other threads:[~2012-12-29 23:31 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-29 10:38 [patch net-next V3 00/15] net: introduce upper device lists and remove dev->master Jiri Pirko
2012-12-29 10:38 ` [patch net-next 01/15] net: introduce upper device lists Jiri Pirko
2012-12-29 23:31   ` David Miller [this message]
2012-12-30  9:53     ` Jiri Pirko
2012-12-29 10:38 ` [patch net-next 02/15] macvlan: add link to upper device Jiri Pirko
2012-12-29 10:38 ` [patch net-next 03/15] vlan: " Jiri Pirko
2012-12-29 10:38 ` [patch net-next 04/15] rtnetlink: remove usage of dev->master Jiri Pirko
2012-12-29 10:38 ` [patch net-next 05/15] team: remove usage of netdev_set_master() Jiri Pirko
2012-12-29 10:38 ` [patch net-next 06/15] bridge: " Jiri Pirko
2012-12-29 10:38 ` [patch net-next 07/15] netpoll: remove usage of dev->master Jiri Pirko
2012-12-29 10:38 ` [patch net-next 08/15] cxgb3: " Jiri Pirko
2012-12-29 10:38 ` [patch net-next 09/15] qlcnic: guard __vlan_find_dev_deep() by rcu_read_lock Jiri Pirko
2012-12-29 10:38 ` [patch net-next 10/15] qeth: ensure that __vlan_find_dev_deep() is called with rcu_read_lock Jiri Pirko
2012-12-29 10:38 ` [patch net-next 11/15] vlan: remove usage of dev->master in __vlan_find_dev_deep() Jiri Pirko
2012-12-29 10:38 ` [patch net-next 12/15] nes: remove usage of dev->master Jiri Pirko
2012-12-29 10:38 ` [patch net-next 13/15] bonding: " Jiri Pirko
2012-12-29 10:38 ` [patch net-next 14/15] net: remove no longer used netdev_set_bond_master() and netdev_set_master() Jiri Pirko
2012-12-29 10:38 ` [patch net-next 15/15] net: kill dev->master Jiri Pirko
  -- strict thread matches above, loose matches on Subject: below --
2012-12-30 11:58 [patch net-next V4 00/15] net: introduce upper device lists and remove dev->master Jiri Pirko
2012-12-30 11:58 ` [patch net-next 01/15] net: introduce upper device lists Jiri Pirko
2012-12-30 18:00   ` Ben Greear
2012-12-30 22:08     ` Jiri Pirko
2012-12-31  4:56   ` Stephen Hemminger
2012-12-31  9:55     ` Jiri Pirko
2012-12-31 19:22   ` Stephen Hemminger
2013-01-01  1:04     ` Jiri Pirko

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=20121229.153101.676681277388952344.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=amwang@redhat.com \
    --cc=andy@greyhouse.net \
    --cc=bhutchings@solarflare.com \
    --cc=blaschka@linux.vnet.ibm.com \
    --cc=divy@chelsio.com \
    --cc=ebiederm@xmission.com \
    --cc=edumazet@google.com \
    --cc=faisal.latif@intel.com \
    --cc=fbl@redhat.com \
    --cc=fubar@us.ibm.com \
    --cc=hal.rosenstock@gmail.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=jiri@resnulli.us \
    --cc=jitendra.kalsaria@qlogic.com \
    --cc=joe@perches.com \
    --cc=john.r.fastabend@intel.com \
    --cc=kaber@trash.net \
    --cc=linux-driver@qlogic.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=pablo@netfilter.org \
    --cc=roland@kernel.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=sean.hefty@intel.com \
    --cc=shemminger@vyatta.com \
    --cc=sony.chacko@qlogic.com \
    --cc=ursula.braun@de.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).