From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: "Patryk Małek" <patryk.malek@intel.com>,
netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
jogreene@redhat.com, "Jeff Kirsher" <jeffrey.t.kirsher@intel.com>
Subject: [net-next 02/15] i40e: Fix for adding multiple ethtool filters on the same location
Date: Fri, 26 Jan 2018 13:24:46 -0800 [thread overview]
Message-ID: <20180126212459.4246-3-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <20180126212459.4246-1-jeffrey.t.kirsher@intel.com>
From: Patryk Małek <patryk.malek@intel.com>
This patch reorders i40e_add_del_fdir and i40e_update_ethtool_fdir_entry
calls so that we first remove an already existing filter (inside
i40e_update_ethtool_fdir_entry using i40e_add_del_fdir) and then
we add a new one with i40e_add_del_fdir.
After applying this patch, creating multiple identical filters (with
the same location) one after another doesn't revert their behavior
but behaves correctly.
Signed-off-by: Patryk Małek <patryk.malek@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index 34173f821fd9..2cbd564e437a 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -3939,19 +3939,19 @@ static int i40e_add_fdir_ethtool(struct i40e_vsi *vsi,
input->flex_offset = userdef.flex_offset;
}
- ret = i40e_add_del_fdir(vsi, input, true);
- if (ret)
- goto free_input;
-
/* Add the input filter to the fdir_input_list, possibly replacing
* a previous filter. Do not free the input structure after adding it
* to the list as this would cause a use-after-free bug.
*/
i40e_update_ethtool_fdir_entry(vsi, input, fsp->location, NULL);
-
+ ret = i40e_add_del_fdir(vsi, input, true);
+ if (ret)
+ goto remove_sw_rule;
return 0;
-free_input:
+remove_sw_rule:
+ hlist_del(&input->fdir_node);
+ pf->fdir_pf_active_filters--;
kfree(input);
return ret;
}
--
2.14.3
next prev parent reply other threads:[~2018-01-26 21:24 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-26 21:24 [net-next 00/15][pull request] 40GbE Intel Wired LAN Driver Updates 2018-01-26 Jeff Kirsher
2018-01-26 21:24 ` [net-next 01/15] i40e: Add returning AQ critical error to SW Jeff Kirsher
2018-01-26 21:24 ` Jeff Kirsher [this message]
2018-01-26 21:24 ` [net-next 03/15] i40evf: Allow turning off offloads when the VF has VLAN set Jeff Kirsher
2018-01-26 21:24 ` [net-next 04/15] i40e/i40evf: Use ring pointers to clean up _set_itr_per_queue Jeff Kirsher
2018-01-26 21:24 ` [net-next 05/15] i40e: Display LLDP information on vSphere Web Client Jeff Kirsher
2018-01-26 21:24 ` [net-next 06/15] i40e: change flags to use 64 bits Jeff Kirsher
2018-02-07 15:09 ` [net-next,06/15] " James Hogan
2018-02-07 17:02 ` Shannon Nelson
2018-01-26 21:24 ` [net-next 07/15] i40e: Implement an ethtool private flag to stop LLDP in FW Jeff Kirsher
2018-01-27 20:50 ` Or Gerlitz
2018-01-26 21:24 ` [net-next 08/15] i40e: fix FW_LLDP flag on init Jeff Kirsher
2018-01-26 21:24 ` [net-next 09/15] i40e: cleanup unnecessary parens Jeff Kirsher
2018-01-26 21:24 ` [net-next 10/15] i40e: Fix kdump failure Jeff Kirsher
2018-01-26 21:24 ` [net-next 11/15] i40e: program fragmented IPv4 filter input set Jeff Kirsher
2018-01-26 21:24 ` [net-next 12/15] i40e: disallow programming multiple filters with same criteria Jeff Kirsher
2018-01-26 21:24 ` [net-next 13/15] i40e: fix reported mask for ntuple filters Jeff Kirsher
2018-01-26 21:24 ` [net-next 14/15] i40e/i40evf: Record ITR register location in the q_vector Jeff Kirsher
2018-01-26 21:24 ` [net-next 15/15] i40e: Do not allow use more TC queue pairs than MSI-X vectors exist Jeff Kirsher
2018-01-29 2:27 ` [net-next 00/15][pull request] 40GbE Intel Wired LAN Driver Updates 2018-01-26 David Miller
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=20180126212459.4246-3-jeffrey.t.kirsher@intel.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=davem@davemloft.net \
--cc=jogreene@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=nhorman@redhat.com \
--cc=patryk.malek@intel.com \
--cc=sassmann@redhat.com \
/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).