lkml.org 
[lkml]   [2022]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next 2/3] net: ethtool: move checks before rtnl_lock() in ethnl_set_rings
On Fri, 8 Apr 2022 15:12:44 +0800 Guangbin Huang wrote:
> + if (tb[ETHTOOL_A_RINGS_RX_BUF_LEN] &&
> + nla_get_u32(tb[ETHTOOL_A_RINGS_RX_BUF_LEN]) != 0 &&

I think we can drop the value checking. If attribute is present and
drivers doesn't support - reject. I don't think that would require
any changes to existing user space but please double check.

> + !(ops->supported_ring_params & ETHTOOL_RING_USE_RX_BUF_LEN)) {
> + ret = -EOPNOTSUPP;
> + NL_SET_ERR_MSG_ATTR(info->extack,
> + tb[ETHTOOL_A_RINGS_RX_BUF_LEN],
> + "setting rx buf len not supported");
> + goto out_dev;
> + }
> +
> + if (tb[ETHTOOL_A_RINGS_CQE_SIZE] &&
> + nla_get_u32(tb[ETHTOOL_A_RINGS_CQE_SIZE]) &&
> + !(ops->supported_ring_params & ETHTOOL_RING_USE_CQE_SIZE)) {
> + ret = -EOPNOTSUPP;
> + NL_SET_ERR_MSG_ATTR(info->extack,
> + tb[ETHTOOL_A_RINGS_CQE_SIZE],
> + "setting cqe size not supported");
> + goto out_dev;
> + }

\
 
 \ /
  Last update: 2022-04-08 23:59    [W:0.159 / U:1.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site