Commit ce056504 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller

ethtool: make ethtool_ops::cap_rss_ctx_supported optional

cap_rss_ctx_supported was created because the API for creating
and configuring additional contexts is mux'ed with the normal
RSS API. Presence of ops does not imply driver can actually
support rss_context != 0 (in fact drivers mostly ignore that
field). cap_rss_ctx_supported lets core check that the driver
is context-aware before calling it.

Now that we have .create_rxfh_context, there is no such
ambiguity. We can depend on presence of the op.
Make setting the bit optional.
Reviewed-by: default avatarGal Pressman <gal@nvidia.com>
Reviewed-by: default avatarEdward Cree <ecree.xilinx@gmail.com>
Reviewed-by: default avatarJoe Damato <jdamato@fastly.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a7f6f56f
...@@ -727,7 +727,8 @@ struct kernel_ethtool_ts_info { ...@@ -727,7 +727,8 @@ struct kernel_ethtool_ts_info {
* @cap_link_lanes_supported: indicates if the driver supports lanes * @cap_link_lanes_supported: indicates if the driver supports lanes
* parameter. * parameter.
* @cap_rss_ctx_supported: indicates if the driver supports RSS * @cap_rss_ctx_supported: indicates if the driver supports RSS
* contexts. * contexts via legacy API, drivers implementing @create_rxfh_context
* do not have to set this bit.
* @cap_rss_sym_xor_supported: indicates if the driver supports symmetric-xor * @cap_rss_sym_xor_supported: indicates if the driver supports symmetric-xor
* RSS. * RSS.
* @rxfh_indir_space: max size of RSS indirection tables, if indirection table * @rxfh_indir_space: max size of RSS indirection tables, if indirection table
......
...@@ -1227,7 +1227,8 @@ static noinline_for_stack int ethtool_get_rxfh(struct net_device *dev, ...@@ -1227,7 +1227,8 @@ static noinline_for_stack int ethtool_get_rxfh(struct net_device *dev,
if (rxfh.rsvd8[0] || rxfh.rsvd8[1] || rxfh.rsvd32) if (rxfh.rsvd8[0] || rxfh.rsvd8[1] || rxfh.rsvd32)
return -EINVAL; return -EINVAL;
/* Most drivers don't handle rss_context, check it's 0 as well */ /* Most drivers don't handle rss_context, check it's 0 as well */
if (rxfh.rss_context && !ops->cap_rss_ctx_supported) if (rxfh.rss_context && !(ops->cap_rss_ctx_supported ||
ops->create_rxfh_context))
return -EOPNOTSUPP; return -EOPNOTSUPP;
rxfh.indir_size = rxfh_dev.indir_size; rxfh.indir_size = rxfh_dev.indir_size;
...@@ -1357,7 +1358,8 @@ static noinline_for_stack int ethtool_set_rxfh(struct net_device *dev, ...@@ -1357,7 +1358,8 @@ static noinline_for_stack int ethtool_set_rxfh(struct net_device *dev,
if (rxfh.rsvd8[0] || rxfh.rsvd8[1] || rxfh.rsvd32) if (rxfh.rsvd8[0] || rxfh.rsvd8[1] || rxfh.rsvd32)
return -EINVAL; return -EINVAL;
/* Most drivers don't handle rss_context, check it's 0 as well */ /* Most drivers don't handle rss_context, check it's 0 as well */
if (rxfh.rss_context && !ops->cap_rss_ctx_supported) if (rxfh.rss_context && !(ops->cap_rss_ctx_supported ||
ops->create_rxfh_context))
return -EOPNOTSUPP; return -EOPNOTSUPP;
/* Check input data transformation capabilities */ /* Check input data transformation capabilities */
if (rxfh.input_xfrm && rxfh.input_xfrm != RXH_XFRM_SYM_XOR && if (rxfh.input_xfrm && rxfh.input_xfrm != RXH_XFRM_SYM_XOR &&
......
...@@ -60,7 +60,8 @@ rss_prepare_data(const struct ethnl_req_info *req_base, ...@@ -60,7 +60,8 @@ rss_prepare_data(const struct ethnl_req_info *req_base,
return -EOPNOTSUPP; return -EOPNOTSUPP;
/* Some drivers don't handle rss_context */ /* Some drivers don't handle rss_context */
if (request->rss_context && !ops->cap_rss_ctx_supported) if (request->rss_context && !(ops->cap_rss_ctx_supported ||
ops->create_rxfh_context))
return -EOPNOTSUPP; return -EOPNOTSUPP;
ret = ethnl_ops_begin(dev); ret = ethnl_ops_begin(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment