Skip to content

Commit 07c10cf

Browse files
committed
Merge branch 'ethtool-rss-small-fixes-to-spec-and-get'
Jakub Kicinski says: ==================== ethtool: rss: small fixes to spec and GET Two small fixes to the ethtool RSS_GET over Netlink. Spec is a bit inaccurate and responses miss an identifier. ==================== Link: https://patch.msgid.link/20240724234249.2621109-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents 98ba1d9 + f96aae9 commit 07c10cf

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

Documentation/netlink/specs/ethtool.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1753,6 +1753,7 @@ operations:
17531753
request:
17541754
attributes:
17551755
- header
1756+
- context
17561757
reply:
17571758
attributes:
17581759
- header
@@ -1761,7 +1762,6 @@ operations:
17611762
- indir
17621763
- hkey
17631764
- input_xfrm
1764-
dump: *rss-get-op
17651765
-
17661766
name: plca-get-cfg
17671767
doc: Get PLCA params.

Documentation/networking/ethtool-netlink.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1875,6 +1875,7 @@ Kernel response contents:
18751875

18761876
===================================== ====== ==========================
18771877
``ETHTOOL_A_RSS_HEADER`` nested reply header
1878+
``ETHTOOL_A_RSS_CONTEXT`` u32 context number
18781879
``ETHTOOL_A_RSS_HFUNC`` u32 RSS hash func
18791880
``ETHTOOL_A_RSS_INDIR`` binary Indir table bytes
18801881
``ETHTOOL_A_RSS_HKEY`` binary Hash key bytes

net/ethtool/rss.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ rss_reply_size(const struct ethnl_req_info *req_base,
111111
const struct rss_reply_data *data = RSS_REPDATA(reply_base);
112112
int len;
113113

114-
len = nla_total_size(sizeof(u32)) + /* _RSS_HFUNC */
114+
len = nla_total_size(sizeof(u32)) + /* _RSS_CONTEXT */
115+
nla_total_size(sizeof(u32)) + /* _RSS_HFUNC */
115116
nla_total_size(sizeof(u32)) + /* _RSS_INPUT_XFRM */
116117
nla_total_size(sizeof(u32) * data->indir_size) + /* _RSS_INDIR */
117118
nla_total_size(data->hkey_size); /* _RSS_HKEY */
@@ -124,6 +125,11 @@ rss_fill_reply(struct sk_buff *skb, const struct ethnl_req_info *req_base,
124125
const struct ethnl_reply_data *reply_base)
125126
{
126127
const struct rss_reply_data *data = RSS_REPDATA(reply_base);
128+
struct rss_req_info *request = RSS_REQINFO(req_base);
129+
130+
if (request->rss_context &&
131+
nla_put_u32(skb, ETHTOOL_A_RSS_CONTEXT, request->rss_context))
132+
return -EMSGSIZE;
127133

128134
if ((data->hfunc &&
129135
nla_put_u32(skb, ETHTOOL_A_RSS_HFUNC, data->hfunc)) ||

0 commit comments

Comments
 (0)