netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: mkubecek@suse.cz
Cc: vyasevich@gmail.com, netdev@vger.kernel.org, kaber@trash.net,
	john.r.fastabend@intel.com
Subject: Re: [PATCH net v2 1/2] macvlan: introduce macvlan_dev_real_dev() helper function
Date: Thu, 14 Nov 2013 17:03:58 -0500 (EST)	[thread overview]
Message-ID: <20131114.170358.941846928393883945.davem@davemloft.net> (raw)
In-Reply-To: <20131114155756.GA4161@lion.mk-sys.cz>

From: Michal Kubecek <mkubecek@suse.cz>
Date: Thu, 14 Nov 2013 16:57:57 +0100

> On Thu, Nov 14, 2013 at 10:03:19AM -0500, Vlad Yasevich wrote:
>> On 11/14/2013 09:00 AM, Michal Kubecek wrote:
>> >+#if IS_ENABLED(CONFIG_MACVLAN)
>> >+static inline struct net_device *
>> >+macvlan_dev_real_dev(const struct net_device *dev)
>> >+{
>> >+	struct macvlan_dev *macvlan = netdev_priv(dev);
>> >+
>> >+	return macvlan->lowerdev;
>> >+}
>> >+#else
>> >+static inline struct net_device *
>> >+macvlan_dev_real_dev(const struct net_device *dev)
>> >+{
>> >+	return NULL;
>> >+}
>> >+#endif
>> >+
>> 
>> You may want to do the same here as was done for
>> vlan_dev_real_dev(). This function is not intended to be called
>> blindly and should always
>> be called after netif_is_macvlan().
> 
> I'm not sure. It makes sense from the developer point of view: if we
> find an inconsistency which must be caused by a bug in kernel code, do
> panic so that the bug is found and fixed as soon as possible. However,
> I remember a discussion where the point was that BUG() and BUG_ON()
> should only be used if there is no way to recover. From this point of
> view, WARN or WARN_ONCE might be better choice - but I'm not strictly
> opposed to BUG().

At least for the time being use BUG(), to be consistent with the same
way how VLAN handles this situation.

Thanks.

  reply	other threads:[~2013-11-14 22:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-14 14:00 [PATCH net v2 0/2] macvlan: disable LRO on lowerdev instead of a macvlan Michal Kubecek
2013-11-14 14:00 ` [PATCH net v2 1/2] macvlan: introduce macvlan_dev_real_dev() helper function Michal Kubecek
2013-11-14 15:03   ` Vlad Yasevich
2013-11-14 15:57     ` Michal Kubecek
2013-11-14 22:03       ` David Miller [this message]
2013-11-15  5:26         ` Michal Kubecek
2013-11-15  2:43       ` Vlad Yasevich
2013-11-14 14:00 ` [PATCH net v2 2/2] macvlan: disable LRO on lower device instead of macvlan Michal Kubecek

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=20131114.170358.941846928393883945.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=john.r.fastabend@intel.com \
    --cc=kaber@trash.net \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    --cc=vyasevich@gmail.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).