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: Sun, 02 Jan 2011 18:38:12 -0800 [thread overview]
Message-ID: <4D213694.5050001@intel.com> (raw)
In-Reply-To: <1293984061.29378.101.camel@lb-tlvb-shmulik.il.broadcom.com>
On 1/2/2011 8:01 AM, Shmulik Ravid wrote:
>
>> 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.
>>
>
> I'll send a patch with the improved return values for the the new dcbnl
> routines. While I'm at it, is it safe to fix on the same lines the
> older already established dcbnl routines?
This should be safe I would not expect using more accurate error values could hurt any existing applications. Be sure to make it a separate patch though.
John
prev parent reply other threads:[~2011-01-03 2:38 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
2011-01-02 16:01 ` Shmulik Ravid
2011-01-03 2:38 ` John Fastabend [this message]
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=4D213694.5050001@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 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).