From: David Miller <davem@davemloft.net>
To: meravs@broadcom.com
Cc: netdev@vger.kernel.org, eilong@broadcom.com, dmitry@broadcom.com
Subject: Re: [net-next patch] bnx2x: Add run-time CNIC support
Date: Sun, 08 Jul 2012 03:31:22 -0700 (PDT) [thread overview]
Message-ID: <20120708.033122.2108511545126626834.davem@davemloft.net> (raw)
In-Reply-To: <1341740914-3181-1-git-send-email-meravs@broadcom.com>
From: "Merav Sicron" <meravs@broadcom.com>
Date: Sun, 8 Jul 2012 12:48:34 +0300
> This patch replaces the BCM_CNIC compilation flag with a run-time flag.
> This is mainly important for the SR-IOV driver, as this driver will share the
> same code with the PF/hypervisor driver. Since storage is not supported in
> SR-IOV (while is usually enabled in the non-SR-IOV driver), we don't want to
> waste resources on it.
> In addition this change makes the code prettier.
...
> -static const struct net_device_ops bnx2x_netdev_ops = {
> +static struct net_device_ops bnx2x_netdev_ops = {
...
>
> + if (CNIC_ENABLED(bp))
> + bnx2x_netdev_ops.ndo_select_queue = bnx2x_select_queue;
> +#if defined(NETDEV_FCOE_WWNN)
> + if (CNIC_ENABLED(bp))
> + bnx2x_netdev_ops.ndo_fcoe_get_wwn = bnx2x_fcoe_get_wwn;
> +#endif
...
+static int set_is_cnic_enabled(void)
+{
+#if defined(CONFIG_CNIC) || defined(CONFIG_CNIC_MODULE)
+ return 1;
+#else
+ return 0;
+#endif
+}
This is basically a joke.
You're losing const'ness of net_device_ops and other nice things for
what is still, in the end, set by kconfig options.
I'm not applying crap like this, sorry.
next prev parent reply other threads:[~2012-07-08 10:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-08 9:48 [net-next patch] bnx2x: Add run-time CNIC support Merav Sicron
2012-07-08 10:31 ` David Miller [this message]
2012-07-08 11:00 ` Merav Sicron
2012-07-08 11:14 ` Eric Dumazet
2012-07-08 12:15 ` David Miller
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=20120708.033122.2108511545126626834.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=dmitry@broadcom.com \
--cc=eilong@broadcom.com \
--cc=meravs@broadcom.com \
--cc=netdev@vger.kernel.org \
/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