From: Jiri Pirko <jiri@resnulli.us>
To: Jon Mason <jon.mason@intel.com>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
linux-pci@vger.kernel.org, Dave Jiang <dave.jiang@intel.com>
Subject: Re: [RFC 2/2] net: Add support for NTB virtual ethernet device
Date: Sat, 14 Jul 2012 10:30:33 +0200 [thread overview]
Message-ID: <20120714083033.GA1676@minipsycho.orion> (raw)
In-Reply-To: <20120714055034.GB4808@jonmason-lab>
Sat, Jul 14, 2012 at 07:50:35AM CEST, jon.mason@intel.com wrote:
>On Sat, Jul 14, 2012 at 01:14:03AM +0200, Jiri Pirko wrote:
>> Fri, Jul 13, 2012 at 11:45:00PM CEST, jon.mason@intel.com wrote:
>> >A virtual ethernet device that uses the NTB transport API to send/receive data.
>> >
>> >Signed-off-by: Jon Mason <jon.mason@intel.com>
>> >---
>> > drivers/net/Kconfig | 4 +
>> > drivers/net/Makefile | 1 +
>> > drivers/net/ntb_netdev.c | 411 ++++++++++++++++++++++++++++++++++++++++++++++
>> > 3 files changed, 416 insertions(+), 0 deletions(-)
>> > create mode 100644 drivers/net/ntb_netdev.c
<snip>
>> >+
>> >+static const struct net_device_ops ntb_netdev_ops = {
>> >+ .ndo_open = ntb_netdev_open,
>> >+ .ndo_stop = ntb_netdev_close,
>> >+ .ndo_start_xmit = ntb_netdev_start_xmit,
>> >+ .ndo_change_mtu = ntb_netdev_change_mtu,
>> >+ .ndo_tx_timeout = ntb_netdev_tx_timeout,
>> >+ .ndo_set_mac_address = eth_mac_addr,
>>
>> Does your device support mac change while it's up and running?
>
>It's virtual ethernet, so there is no hardware limitation, only what is acceptable for the remote side to receive.
In that case, it would be good to do:
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
This enables mac change in eth_mac_addr() when iface is running.
<snip>
>> >+
>> >+static int __init ntb_netdev_init_module(void)
>> >+{
>> >+ struct ntb_netdev *dev;
>> >+ int rc;
>> >+
>> >+ pr_info("%s: Probe\n", KBUILD_MODNAME);
>> >+
>> >+ netdev = alloc_etherdev(sizeof(struct ntb_netdev));
>>
>> I might be missing something but this place (module init) does not seems
>> like a good place to do alloc_etherdev(). Do you want to support only
>> one netdevice instance?
>>
>> Anyway, I think that using "static netdev" should be avoided in any case.
>>
>
>It would fail the probe if there is no underlying ntb hardware, but it would make sense to check for that before allocing the etherdev.
But isn't there possible to have multiple ntb hardware devices? It would make
sense to register ntb device here with ntb core and let the core call
probe which would actually create new netdev.
Is there a limitation that one underlying ntb hardware ~ one ntb netdevice?
Thanks,
Jiri
next prev parent reply other threads:[~2012-07-14 8:38 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-13 21:44 [RFC 1/2] PCI-Express Non-Transparent Bridge Support Jon Mason
2012-07-13 21:45 ` [RFC 2/2] net: Add support for NTB virtual ethernet device Jon Mason
2012-07-13 23:14 ` Jiri Pirko
2012-07-14 5:50 ` Jon Mason
2012-07-14 8:30 ` Jiri Pirko [this message]
2012-07-14 0:08 ` Stephen Hemminger
2012-07-14 5:55 ` Jon Mason
2012-07-14 0:00 ` [RFC 1/2] PCI-Express Non-Transparent Bridge Support Stephen Hemminger
2012-07-14 0:13 ` Stephen Hemminger
2012-07-14 6:19 ` Jon Mason
2012-07-15 12:37 ` David Hagood
2012-07-14 17:04 ` Greg KH
2012-07-15 23:50 ` Jon Mason
2012-07-15 23:53 ` Greg KH
2012-07-14 17:10 ` Greg KH
2012-07-15 23:55 ` Jon Mason
2012-07-16 0:19 ` Greg KH
2012-07-16 17:55 ` Jon Mason
2012-07-16 18:30 ` Greg KH
2012-07-16 16:49 ` chetan loke
2012-07-16 18:38 ` Jon Mason
2012-07-16 19:27 ` chetan loke
2012-07-17 0:23 ` Jon Mason
2012-07-16 18:26 ` chetan loke
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=20120714083033.GA1676@minipsycho.orion \
--to=jiri@resnulli.us \
--cc=dave.jiang@intel.com \
--cc=jon.mason@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--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
Powered by JetHome