linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Ilan Tayari <ilant@mellanox.com>,
	Saeed Mahameed <saeedm@mellanox.com>
Subject: [PATCH 4.9 30/54] net/mlx5e: Fix ETHTOOL_GRXCLSRLALL handling
Date: Mon,  1 May 2017 14:31:37 -0700	[thread overview]
Message-ID: <20170501212632.959857124@linuxfoundation.org> (raw)
In-Reply-To: <20170501212631.798128131@linuxfoundation.org>

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)

  parent reply	other threads:[~2017-05-01 21:32 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-01 21:31 [PATCH 4.9 00/54] 4.9.26-stable review Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 01/54] [PATCH] Revert "mmc: sdhci-msm: Enable few quirks" Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 02/54] ping: implement proper locking Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 03/54] sparc64: kern_addr_valid regression Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 04/54] sparc64: Fix kernel panic due to erroneous #ifdef surrounding pmd_write() Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 05/54] net: neigh: guard against NULL solicit() method Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 06/54] net: phy: handle state correctly in phy_stop_machine Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 07/54] kcm: return immediately after copy_from_user() failure Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 08/54] bpf: improve verifier packet range checks Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 09/54] net/mlx5: Avoid dereferencing uninitialized pointer Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 10/54] l2tp: hold tunnel socket when handling control frames in l2tp_ip and l2tp_ip6 Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 11/54] l2tp: purge socket queues in the .destruct() callback Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 12/54] net/packet: fix overflow in check for tp_frame_nr Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 13/54] net/packet: fix overflow in check for tp_reserve Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 14/54] l2tp: take reference on sessions being dumped Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 15/54] l2tp: fix PPP pseudo-wire auto-loading Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 16/54] net: ipv4: fix multipath RTM_GETROUTE behavior when iif is given Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 17/54] sctp: listen on the sock only when its state is listening or closed Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 18/54] tcp: clear saved_syn in tcp_disconnect() Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 19/54] ipv6: Fix idev->addr_list corruption Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 20/54] net-timestamp: avoid use-after-free in ip_recv_error Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 21/54] net: vrf: Fix setting NLM_F_EXCL flag when adding l3mdev rule Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 22/54] sh_eth: unmap DMA buffers when freeing rings Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 24/54] gso: Validate assumption of frag_list segementation Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 25/54] net: ipv6: RTF_PCPU should not be settable from userspace Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 26/54] netpoll: Check for skb->queue_mapping Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 27/54] ip6mr: fix notification device destruction Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 28/54] net/mlx5: Fix driver load bad flow when having fw initializing timeout Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 29/54] net/mlx5e: Fix small packet threshold Greg Kroah-Hartman
2017-05-01 21:31 ` Greg Kroah-Hartman [this message]
2017-05-01 21:31 ` [PATCH 4.9 31/54] macvlan: Fix device ref leak when purging bc_queue Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 32/54] net: ipv6: regenerate host route if moved to gc list Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 33/54] net: phy: fix auto-negotiation stall due to unavailable interrupt Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 34/54] ipv6: check skb->protocol before lookup for nexthop Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 35/54] tcp: memset ca_priv data to 0 properly Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 36/54] ipv6: check raw payload size correctly in ioctl Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 37/54] ALSA: oxfw: fix regression to handle Stanton SCS.1m/1d Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 38/54] ALSA: firewire-lib: fix inappropriate assignment between signed/unsigned type Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 39/54] ALSA: seq: Dont break snd_use_lock_sync() loop by timeout Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 40/54] ARC: [plat-eznps] Fix build error Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 41/54] MIPS: KGDB: Use kernel context for sleeping threads Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 42/54] MIPS: cevt-r4k: Fix out-of-bounds array access Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 43/54] MIPS: Avoid BUG warning in arch_check_elf Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 44/54] p9_client_readdir() fix Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 45/54] ASoC: intel: Fix PM and non-atomic crash in bytcr drivers Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 48/54] nfsd4: minor NFSv2/v3 write decoding cleanup Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 50/54] ceph: fix recursion between ceph_set_acl() and __ceph_setattr() Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 51/54] macsec: avoid heap overflow in skb_to_sgvec Greg Kroah-Hartman
2017-05-01 21:31 ` [PATCH 4.9 52/54] net: can: usb: gs_usb: Fix buffer on stack Greg Kroah-Hartman
2017-05-01 21:32 ` [PATCH 4.9 53/54] ARCv2: save r30 on kernel entry as gcc uses it for code-gen Greg Kroah-Hartman
2017-05-01 21:32 ` [PATCH 4.9 54/54] ftrace/x86: Fix triple fault with graph tracing and suspend-to-ram Greg Kroah-Hartman
     [not found] ` <590808bb.a121ed0a.b040f.045c@mx.google.com>
2017-05-02 13:53   ` [PATCH 4.9 00/54] 4.9.26-stable review Shuah Khan
2017-05-02 17:36 ` Guenter Roeck

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=20170501212632.959857124@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=ilant@mellanox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=saeedm@mellanox.com \
    --cc=stable@vger.kernel.org \
    /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).