Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1633888 > unrolled thread

[PATCH 4.9 30/54] net/mlx5e: Fix ETHTOOL_GRXCLSRLALL handling

Started byGreg Kroah-Hartman <gregkh@linuxfoundation.org>
First post2017-05-01 23:40 +0200
Last post2017-05-01 23:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4.9 30/54] net/mlx5e: Fix ETHTOOL_GRXCLSRLALL handling Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-05-01 23:40 +0200

#1633888 — [PATCH 4.9 30/54] net/mlx5e: Fix ETHTOOL_GRXCLSRLALL handling

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-05-01 23:40 +0200
Subject[PATCH 4.9 30/54] net/mlx5e: Fix ETHTOOL_GRXCLSRLALL handling
Message-ID<tCrd0-5UI-19@gated-at.bofh.it>
4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ilan Tayari <ilant@mellanox.com>


[ Upstream commit 5e82c9e4ed60beba83f46a1a5a8307b99a23e982 ]

Handler for ETHTOOL_GRXCLSRLALL must set info->data to the size
of the table, regardless of the amount of entries in it.
Existing code does not do that, and this breaks all usage of ethtool -N
or -n without explicit location, with this error:
rmgr: Invalid RX class rules table size: Success

Set info->data to the table size.

Tested:
ethtool -n ens8
ethtool -N ens8 flow-type ip4 src-ip 1.1.1.1 dst-ip 2.2.2.2 action 1
ethtool -N ens8 flow-type ip4 src-ip 1.1.1.1 dst-ip 2.2.2.2 action 1 loc 55
ethtool -n ens8
ethtool -N ens8 delete 1023
ethtool -N ens8 delete 55

Fixes: f913a72aa008 ("net/mlx5e: Add support to get ethtool flow rules")
Signed-off-by: Ilan Tayari <ilant@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c
@@ -563,6 +563,7 @@ int mlx5e_ethtool_get_all_flows(struct m
 	int idx = 0;
 	int err = 0;
 
+	info->data = MAX_NUM_OF_ETHTOOL_RULES;
 	while ((!err || err == -ENOENT) && idx < info->rule_cnt) {
 		err = mlx5e_ethtool_get_flow(priv, info, location);
 		if (!err)

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web