From: John Fastabend <john.r.fastabend@intel.com>
To: Shmulik Ravid <shmulikr@broadcom.com>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
Eilon Greenstein <eilong@broadcom.com>,
"Liu, Lucy" <lucy.liu@intel.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [net-next-2.6 PATCH v2 2/4] dcbnl: adding DCBX feature flags get-set
Date: Thu, 30 Dec 2010 11:05:56 -0800 [thread overview]
Message-ID: <4D1CD814.2010903@intel.com> (raw)
In-Reply-To: <1293726415.29378.93.camel@lb-tlvb-shmulik.il.broadcom.com>
On 12/30/2010 8:26 AM, Shmulik Ravid wrote:
> Adding a pair of set-get routines to dcbnl for setting the negotiation
> flags of the various DCB features. Conforms to the CEE flavor of DCBX
> The user sets these flags (enable, advertise, willing) for each feature
> to be used by the DCBX engine. The 'get' routine returns which of the
> features is enabled after the negotiation.
>
> This patch is dependent on the following patches:
> [net-next-2.6 PATCH 1/3] dcbnl: add support for ieee8021Qaz attributes
> [net-next-2.6 PATCH 2/3] dcbnl: add appliction tlv handlers
> [net-next-2.6 PATCH 3/3] net_dcb: add application notifiers
>
> Signed-off-by: Shmulik Ravid <shmulikr@broadcom.com>
> ---
[...]
One more nit ;)
> +
> + ret = nla_parse_nested(data, DCB_FEATCFG_ATTR_MAX, tb[DCB_ATTR_FEATCFG],
> + dcbnl_featcfg_nest);
> + if (ret) {
> + ret = -EINVAL;
> + goto err_out;
> + }
Why do you set EINVAL here if you use the returned error code from nla_parse_nested you get a more descriptive error. See ./lib/nlattr.c:nla_parse()/validate_nla().
[...]
> +static int dcbnl_setfeatcfg(struct net_device *netdev, struct nlattr **tb,
> + u32 pid, u32 seq, u16 flags)
> +{
> + struct nlattr *data[DCB_FEATCFG_ATTR_MAX + 1];
> + int ret = -EINVAL;
> + u8 value;
> + int i;
> +
> + if (!tb[DCB_ATTR_FEATCFG] || !netdev->dcbnl_ops->setfeatcfg)
> + return ret;
> +
> + ret = nla_parse_nested(data, DCB_FEATCFG_ATTR_MAX, tb[DCB_ATTR_FEATCFG],
> + dcbnl_featcfg_nest);
> +
> + if (ret) {
> + ret = -EINVAL;
> + goto err;
> + }
Same here.
Thanks,
John.
next prev parent reply other threads:[~2010-12-30 19:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-30 16:26 [net-next-2.6 PATCH v2 2/4] dcbnl: adding DCBX feature flags get-set Shmulik Ravid
2010-12-30 19:05 ` John Fastabend [this message]
2011-01-02 16:01 ` Shmulik Ravid
2011-01-03 2:38 ` John Fastabend
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=4D1CD814.2010903@intel.com \
--to=john.r.fastabend@intel.com \
--cc=davem@davemloft.net \
--cc=eilong@broadcom.com \
--cc=lucy.liu@intel.com \
--cc=netdev@vger.kernel.org \
--cc=shmulikr@broadcom.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.