From: Patrick McHardy <kaber@trash.net>
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 V9 PATCH 1/2] Add netlink support for virtual port management (was iovnl)
Date: Thu, 20 May 2010 16:24:22 +0200 [thread overview]
Message-ID: <4BF54616.1020508@trash.net> (raw)
In-Reply-To: <20100518054833.21787.45456.stgit@savbu-pc100.cisco.com>
Scott Feldman wrote:
> From: Scott Feldman <scofeldm@cisco.com>
>
> Add new netdev ops ndo_{set|get}_vf_port to allow setting of
> port-profile on a netdev interface. Extends netlink socket RTM_SETLINK/
> RTM_GETLINK with two new sub msgs called IFLA_VF_PORTS and IFLA_PORT_SELF
> (added to end of IFLA_cmd list). These are both nested atrtibutes
> using this layout:
>
>...
Appologies for the delay, my mailserver failed me once again :|
This version looks very good to me, just one question:
> +static int rtnl_vf_ports_fill(struct sk_buff *skb, struct net_device *dev)
> +{
> + struct nlattr *vf_ports;
> + struct nlattr *vf_port;
> + int vf;
> + int err;
> +
> + vf_ports = nla_nest_start(skb, IFLA_VF_PORTS);
> + if (!vf_ports)
> + return -EMSGSIZE;
> +
> + for (vf = 0; vf < dev_num_vf(dev->dev.parent); vf++) {
> + vf_port = nla_nest_start(skb, IFLA_VF_PORT);
> + if (!vf_port) {
> + nla_nest_cancel(skb, vf_ports);
> + return -EMSGSIZE;
> + }
> + NLA_PUT_U32(skb, IFLA_PORT_VF, vf);
> + err = dev->netdev_ops->ndo_get_vf_port(dev, vf, skb);
> + if (err) {
> +nla_put_failure:
> + nla_nest_cancel(skb, vf_port);
> + continue;
Are you sure you want to continue here? During a full dump
this means that the last VF port fitting in the skb will most
likely be incomplete since the higher layer code won't
notice that the size was exceeded and the entry should be
dumped into another skb.
> + }
> + nla_nest_end(skb, vf_port);
> + }
> +
> + nla_nest_end(skb, vf_ports);
> +
> + return 0;
> +}
next prev parent reply other threads:[~2010-05-20 14:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-18 5:48 [net-next-2.6 V9 PATCH 0/2] Add virtual port netlink support Scott Feldman
2010-05-18 5:48 ` [net-next-2.6 V9 PATCH 1/2] Add netlink support for virtual port management (was iovnl) Scott Feldman
2010-05-18 5:50 ` [net-next-2.6 V9 PATCH 1/2] Add netlink support for virtual port management David Miller
2010-05-20 14:24 ` Patrick McHardy [this message]
2010-05-28 3:24 ` [net-next-2.6 V9 PATCH 1/2] Add netlink support for virtual port management (was iovnl) Scott Feldman
2010-05-18 5:48 ` [net-next-2.6 V9 PATCH 2/2] Add ndo_{set|get}_vf_port support for enic dynamic vnics Scott Feldman
2010-05-18 5:50 ` 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=4BF54616.1020508@trash.net \
--to=kaber@trash.net \
--cc=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.