From: Arnd Bergmann <arnd@arndb.de>
To: Scott Feldman <scofeldm@cisco.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org, chrisw@redhat.com
Subject: Re: [net-next-2.6 PATCH 2/2] add ndo_set_port_profile op support for enic dynamic vnics
Date: Wed, 28 Apr 2010 15:32:47 +0200 [thread overview]
Message-ID: <201004281532.47875.arnd@arndb.de> (raw)
In-Reply-To: <20100428044240.8646.27412.stgit@savbu-pc100.cisco.com>
On Wednesday 28 April 2010, Scott Feldman wrote:
> +static int enic_set_port_profile(struct net_device *netdev,
> + struct ifla_port_profile *ipp)
> +{
> + struct enic *enic = netdev_priv(netdev);
> + struct vic_provinfo *vp;
> + u8 oui[3] = VIC_PROVINFO_CISCO_OUI;
> + u8 *mac = ipp->mac;
> + int err;
> +
> + memset(&enic->port_profile, 0, sizeof(enic->port_profile));
> +
> + if (!enic_is_dynamic(enic))
> + return -EOPNOTSUPP;
Not sure I understand how this fits together. You said in an earlier mail:
> > Anything that ties port profiles to VFs seems fundamentally flawed AFAICT,
> > at least when we want to extend this to adapters that don't do it in firmware.
>
> Ya, I tend I agree. Let's just make port-profile a setting of any netdev,
> an eth, macvtap, eth.x, bond, etc. That's probably what I should have done
> in the first place. Something like:
I thought you had meant that we can do the association of attached interfaces
through any interface, rather than tying it to the slave interface. While I'm
not sure I read your code correctly, it seems like you now only talk to the
slave interface, not to the master at all!
At least the check above should be 'if (enic_is_dynamic(enic)) return -EOPNOTSUPP',
not the other way round.
Moreover, if the netdev is the master here, you only allow a single slave, which
is not enough for larger setups (n > 1), though that could be a limitation of your
first version.
Passing just the slave device however would not work in the general case, as I
tried to point out in the mail you replied to. If the slave interface is owned
by a guest using PCI passthrough, or it sits below a stack of nested interfaces
(vlan, bridge, tap, vhost, ...), it's impossible to know what interface is
responsible for setting up the slave. Note that you cannot perform the association
through the slave interface itself because the remote switch would discard any
traffic originating from an unassociated interface.
> +static int enic_get_port_profile(struct net_device *netdev,
> + struct ifla_port_profile *ipp)
> +{
> + struct enic *enic = netdev_priv(netdev);
> + int done, err, error;
> +
> + enic->port_profile.status = IFLA_PORT_PROFILE_STATUS_UNKNOWN;
> +
> + spin_lock(&enic->devcmd_lock);
> + err = vnic_dev_init_done(enic->vdev, &done, &error);
> + spin_unlock(&enic->devcmd_lock);
> +
> + if (err || error)
> + enic->port_profile.status = IFLA_PORT_PROFILE_STATUS_ERROR;
> +
> + if (!done)
> + enic->port_profile.status = IFLA_PORT_PROFILE_STATUS_INPROGRESS;
> +
> + if (!error)
> + enic->port_profile.status = IFLA_PORT_PROFILE_STATUS_SUCCESS;
> +
> + memcpy(ipp, &enic->port_profile, sizeof(enic->port_profile));
> +
> + return 0;
> +}
> +
Similarly, this interface only passes back a single port profile association,
where it should have a way to return all of the slave ports.
Arnd
next prev parent reply other threads:[~2010-04-28 13:33 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-28 4:42 [net-next-2.6 PATCH 1/2] Add netdev port-profile support (take III, was iovnl) Scott Feldman
2010-04-28 4:42 ` [net-next-2.6 PATCH 2/2] add ndo_set_port_profile op support for enic dynamic vnics Scott Feldman
2010-04-28 13:32 ` Arnd Bergmann [this message]
2010-04-28 18:39 ` Scott Feldman
2010-04-28 19:16 ` Arnd Bergmann
2010-04-28 22:38 ` Scott Feldman
2010-04-29 12:27 ` Arnd Bergmann
2010-04-29 14:32 ` Scott Feldman
2010-04-29 15:48 ` Arnd Bergmann
2010-04-29 16:31 ` Scott Feldman
2010-04-30 20:34 ` Scott Feldman
2010-05-01 12:36 ` Arnd Bergmann
2010-05-03 4:29 ` Vivek Kashyap
2010-05-03 11:32 ` Arnd Bergmann
2010-05-03 16:18 ` Vivek Kashyap
2010-04-28 13:13 ` [net-next-2.6 PATCH 1/2] Add netdev port-profile support (take III, was iovnl) Arnd Bergmann
2010-04-28 17:51 ` Scott Feldman
2010-04-28 19:33 ` Arnd Bergmann
2010-04-28 18:54 ` Scott Feldman
2010-04-28 19:37 ` Arnd Bergmann
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=201004281532.47875.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=chrisw@redhat.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=scofeldm@cisco.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.