From: Chris Wright <chrisw@redhat.com>
To: Scott Feldman <scofeldm@cisco.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org, chrisw@redhat.com,
arnd@arndb.de
Subject: Re: [net-next-2.6 PATCH 2/2] add enic ndo_vf_set_port_profile op support for dynamic vnics
Date: Fri, 23 Apr 2010 19:21:21 -0700 [thread overview]
Message-ID: <20100424022121.GE3843@x200.localdomain> (raw)
In-Reply-To: <20100424003546.12745.83769.stgit@savbu-pc100.cisco.com>
* Scott Feldman (scofeldm@cisco.com) wrote:
> -#define DRV_VERSION "1.3.1.1"
> +#define DRV_VERSION "1.3.1.1-iov"
not a version bump?
> @@ -810,14 +819,24 @@ static void enic_reset_mcaddrs(struct enic *enic)
>
> static int enic_set_mac_addr(struct net_device *netdev, char *addr)
> {
> - if (!is_valid_ether_addr(addr))
> - return -EADDRNOTAVAIL;
> + struct enic *enic = netdev_priv(netdev);
>
> - memcpy(netdev->dev_addr, addr, netdev->addr_len);
> + if (enic_is_dynamic(enic)) {
> + random_ether_addr(netdev->dev_addr);
Would it make more sense to just ignore this? Then the default (not
port profile configured yet) mac is still a useful identifier.
> + } else {
> + if (!is_valid_ether_addr(addr))
> + return -EADDRNOTAVAIL;
> + memcpy(netdev->dev_addr, addr, netdev->addr_len);
> + }
>
> return 0;
> }
>
> +static int enic_set_mac_address(struct net_device *netdev, void *p)
> +{
> + return -EOPNOTSUPP;
> +}
> +
Ever? Even on non-dynamic enic? Oh, I see, this was just a lie before ;-)
> +static int enic_set_vf_port_profile(struct net_device *netdev, int vf,
> + u8 *port_profile, u8 *mac, u8 *host_uuid, u8 *client_uuid,
> + u8 *client_name)
> +{
> + struct enic *enic = netdev_priv(netdev);
> + struct vic_provinfo *vp;
> + u8 oui[3] = VIC_PROVINFO_CISCO_OUI;
> + int err;
> +
> + if (!enic_is_dynamic(enic))
> + return -EOPNOTSUPP;
Do you want to validate vf (like require it to be 0) or something?
How should userspace know to talk directly to the VF (dynamic enic) in
this device, but a PF + VF_index for another device?
> + if (strlen(port_profile) == 0)
> + return enic_vnic_dev_deinit(enic);
> +
> + vp = vic_provinfo_alloc(GFP_KERNEL, oui, VIC_PROVINFO_LINUX_TYPE);
> + if (!vp)
> + return -ENOMEM;
> +
> + enic_provinfo_add_tlv_str(vp, VIC_LINUX_PROV_TLV_PORT_PROFILE_NAME_STR,
> + port_profile);
> + vic_provinfo_add_tlv(vp, VIC_LINUX_PROV_TLV_CLIENT_MAC_ADDR,
> + ETH_ALEN, mac);
> + enic_provinfo_add_tlv_str(vp, VIC_LINUX_PROV_TLV_HOST_UUID_STR,
> + host_uuid);
> + enic_provinfo_add_tlv_str(vp, VIC_LINUX_PROV_TLV_CLIENT_UUID_STR,
> + client_uuid);
> + enic_provinfo_add_tlv_str(vp, VIC_LINUX_PROV_TLV_CLIENT_NAME_STR,
> + client_name);
> +
> + err = enic_vnic_dev_deinit(enic);
> + if (err)
> + goto err_out;
> +
> + err = enic_dev_init_prov(enic, vp);
> +
> +err_out:
> + vic_provinfo_free(vp);
> +
> + enic_set_multicast_list(netdev);
Should that happen in error case (and is the locking correct)?
next prev parent reply other threads:[~2010-04-24 3:00 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-24 0:35 [net-next-2.6 PATCH 1/2] Add ndo_set_vf_port_profile (was iovnl) Scott Feldman
2010-04-24 0:35 ` [net-next-2.6 PATCH 2/2] add enic ndo_vf_set_port_profile op support for dynamic vnics Scott Feldman
2010-04-24 2:21 ` Chris Wright [this message]
2010-04-24 14:30 ` Scott Feldman
2010-04-24 2:22 ` [net-next-2.6 PATCH 1/2] Add ndo_set_vf_port_profile (was iovnl) Chris Wright
2010-04-24 14:37 ` Scott Feldman
2010-04-24 7:19 ` [net-next-2.6 PATCH 1/2] Add ndo_set_vf_port_profile David Miller
2010-04-26 19:27 ` Scott Feldman
2010-04-26 19:57 ` Scott Feldman
2010-04-26 20:25 ` David Miller
2010-04-26 22:38 ` Rose, Gregory V
2010-04-26 23:21 ` Scott Feldman
2010-04-27 0:03 ` Scott Feldman
2010-04-27 0:15 ` Chris Wright
2010-04-27 12:35 ` Arnd Bergmann
2010-04-27 17:33 ` Anirban Chakraborty
2010-04-27 19:38 ` Arnd Bergmann
2010-04-27 20:57 ` Scott Feldman
2010-04-26 20:24 ` 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=20100424022121.GE3843@x200.localdomain \
--to=chrisw@redhat.com \
--cc=arnd@arndb.de \
--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 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).