From: Dimitris Michailidis <dm@chelsio.com>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: netdev <netdev@vger.kernel.org>,
linux-net-drivers@solarflare.com,
Alexander Duyck <alexander.h.duyck@intel.com>,
Vladislav Zolotarov <vladz@broadcom.com>
Subject: Re: [RFC][PATCH net-next] ethtool: Allow drivers to select RX NFC rule locations
Date: Fri, 16 Dec 2011 18:44:45 -0800 [thread overview]
Message-ID: <4EEC021D.1050804@chelsio.com> (raw)
In-Reply-To: <1324084683.2798.45.camel@bwh-desktop>
On 12/16/2011 05:18 PM, Ben Hutchings wrote:
> Define special location values for RX NFC that request the driver to
> select the actual rule location. This allows for implementation on
> devices that use hash-based filter lookup, whereas currently the API is
> more suited to devices with TCAM lookup or linear search.
>
> In ethtool_set_rxnfc() and the compat wrapper ethtool_ioctl(), copy
> the structure back to user-space after insertion so that the actual
> location is returned.
>
> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
I like this change. One concern below.
> - return dev->ethtool_ops->set_rxnfc(dev, &info);
> + rc = dev->ethtool_ops->set_rxnfc(dev, &info);
> + if (rc)
> + return rc;
> +
> + if (cmd == ETHTOOL_SRXCLSRLINS &&
> + copy_to_user(useraddr, &info, info_size))
> + return -EFAULT;
Here we return failure but the rule has been added successfully and is in
effect. It may be better to return 0 and let user-space tell this last step
failed by the fact that the location field is still special.
next prev parent reply other threads:[~2011-12-17 2:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-17 1:18 [RFC][PATCH net-next] ethtool: Allow drivers to select RX NFC rule locations Ben Hutchings
2011-12-17 2:44 ` Dimitris Michailidis [this message]
2011-12-17 4:15 ` Ben Hutchings
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=4EEC021D.1050804@chelsio.com \
--to=dm@chelsio.com \
--cc=alexander.h.duyck@intel.com \
--cc=bhutchings@solarflare.com \
--cc=linux-net-drivers@solarflare.com \
--cc=netdev@vger.kernel.org \
--cc=vladz@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).