netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Jacob Keller <jacob.e.keller@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 13/15] i40e: fix reported mask for ntuple filters
Date: Fri, 26 Jan 2018 13:24:57 -0800	[thread overview]
Message-ID: <20180126212459.4246-14-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <20180126212459.4246-1-jeffrey.t.kirsher@intel.com>

From: Jacob Keller <jacob.e.keller@intel.com>

In commit 36777d9fa24c ("i40e: check current configured input set when
adding ntuple filters") some code was added to report the input set
mask for a given filter when reporting it to the user.

This code is necessary so that the reported filter correctly displays
that it is or is not masking certain fields.

Unfortunately the code was incorrect. Development error accidentally
swapped the mask values for the IPv4 addresses with the L4 port numbers.
The port numbers are only 16bits wide while IPv4 addresses are 32 bits.
Unfortunately we assigned only 16 bits to the IPv4 address masks.
Additionally we assigned 32bit value 0xFFFFFFF to the TCP port numbers.
This second part does not matter as the value would be truncated to
16bits regardless, but it is unnecessary.

Fix the reported masks to properly report that the entire field is
masked.

Fixes: 36777d9fa24c ("i40e: check current configured input set when adding ntuple filters")
Signed-off-by: Jacob Keller <jacob.e.keller@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 | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index b35c61ccc64a..2f5bee713fef 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -2749,16 +2749,16 @@ static int i40e_get_ethtool_fdir_entry(struct i40e_pf *pf,
 
 no_input_set:
 	if (input_set & I40E_L3_SRC_MASK)
-		fsp->m_u.tcp_ip4_spec.ip4src = htonl(0xFFFF);
+		fsp->m_u.tcp_ip4_spec.ip4src = htonl(0xFFFFFFFF);
 
 	if (input_set & I40E_L3_DST_MASK)
-		fsp->m_u.tcp_ip4_spec.ip4dst = htonl(0xFFFF);
+		fsp->m_u.tcp_ip4_spec.ip4dst = htonl(0xFFFFFFFF);
 
 	if (input_set & I40E_L4_SRC_MASK)
-		fsp->m_u.tcp_ip4_spec.psrc = htons(0xFFFFFFFF);
+		fsp->m_u.tcp_ip4_spec.psrc = htons(0xFFFF);
 
 	if (input_set & I40E_L4_DST_MASK)
-		fsp->m_u.tcp_ip4_spec.pdst = htons(0xFFFFFFFF);
+		fsp->m_u.tcp_ip4_spec.pdst = htons(0xFFFF);
 
 	if (rule->dest_ctl == I40E_FILTER_PROGRAM_DESC_DEST_DROP_PACKET)
 		fsp->ring_cookie = RX_CLS_FLOW_DISC;
-- 
2.14.3

  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 ` [net-next 02/15] i40e: Fix for adding multiple ethtool filters on the same location Jeff Kirsher
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 ` Jeff Kirsher [this message]
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-14-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=davem@davemloft.net \
    --cc=jacob.e.keller@intel.com \
    --cc=jogreene@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@redhat.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).