netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Anjali Singhai Jain <anjali.singhai@intel.com>,
	netdev@vger.kernel.org, gospo@redhat.com, sassmann@redhat.com,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 13/15] i40e: Fix a bug in ethtool for FD drop packet filter action
Date: Wed, 11 Jun 2014 09:33:22 -0700	[thread overview]
Message-ID: <1402504404-8954-14-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1402504404-8954-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Anjali Singhai Jain <anjali.singhai@intel.com>

A drop action comes down as a ring_cookie value, so allow it as
a special value that can be used to configure destination control.

Also fix the output to filter read command accordingly.

Change-ID: I9956723cee42f3194885403317dd21ed4a151144
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index e330166..4a488ff 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -1259,7 +1259,11 @@ static int i40e_get_ethtool_fdir_entry(struct i40e_pf *pf,
 	fsp->h_u.tcp_ip4_spec.pdst = rule->src_port;
 	fsp->h_u.tcp_ip4_spec.ip4src = rule->dst_ip[0];
 	fsp->h_u.tcp_ip4_spec.ip4dst = rule->src_ip[0];
-	fsp->ring_cookie = rule->q_index;
+
+	if (rule->dest_ctl == I40E_FILTER_PROGRAM_DESC_DEST_DROP_PACKET)
+		fsp->ring_cookie = RX_CLS_FLOW_DISC;
+	else
+		fsp->ring_cookie = rule->q_index;
 
 	return 0;
 }
@@ -1563,7 +1567,8 @@ static int i40e_add_fdir_ethtool(struct i40e_vsi *vsi,
 		return -EINVAL;
 	}
 
-	if (fsp->ring_cookie >= vsi->num_queue_pairs)
+	if ((fsp->ring_cookie != RX_CLS_FLOW_DISC) &&
+	    (fsp->ring_cookie >= vsi->num_queue_pairs))
 		return -EINVAL;
 
 	input = kzalloc(sizeof(*input), GFP_KERNEL);
-- 
1.9.3

  parent reply	other threads:[~2014-06-11 16:33 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-11 16:33 [net-next 00/15][pull request] Intel Wired LAN Driver Updates 2014-06-11 Jeff Kirsher
2014-06-11 16:33 ` [net-next 01/15] igb: unhide invariant returns Jeff Kirsher
2014-06-11 16:33 ` [net-next 02/15] igb: separate hardware setting from the set_ts_config ioctl Jeff Kirsher
2014-06-11 16:33 ` [net-next 03/15] i40e/i40evf: set headwb Tx context flags and use them Jeff Kirsher
2014-06-11 16:33 ` [net-next 04/15] i40e/i40evf: AdminQ API update for new FW Jeff Kirsher
2014-06-11 16:33 ` [net-next 05/15] i40e: Change the notion of src and dst for FD_SB in ethtool Jeff Kirsher
2014-06-11 16:33 ` [net-next 06/15] i40evf: don't go further down Jeff Kirsher
2014-06-11 16:33 ` [net-next 07/15] i40e: Separate out DCB capability and enabled flags Jeff Kirsher
2014-06-12  8:22   ` Or Gerlitz
2014-06-12 16:59     ` Parikh, Neerav
2014-06-11 16:33 ` [net-next 08/15] i40e: Do not accept tagged packets by default Jeff Kirsher
2014-06-11 16:33 ` [net-next 09/15] i40e/i40evf: User ether_addr_copy instead of memcpy Jeff Kirsher
2014-06-11 16:33 ` [net-next 10/15] i40evf: check admin queue error bits Jeff Kirsher
2014-06-11 16:33 ` [net-next 11/15] i40e/i40evf: remove FTYPE Jeff Kirsher
2014-06-11 16:33 ` [net-next 12/15] i40e/i40evf: Add Flow director stats to PF stats Jeff Kirsher
2014-06-11 16:33 ` Jeff Kirsher [this message]
2014-06-11 16:33 ` [net-next 14/15] i40e: use stored base_queue value Jeff Kirsher
2014-06-11 16:33 ` [net-next 15/15] i40e/i40evf: Bump i40e to version 0.4.10 and i40evf to 0.9.34 Jeff Kirsher
2014-06-11 19:25 ` [net-next 00/15][pull request] Intel Wired LAN Driver Updates 2014-06-11 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=1402504404-8954-14-git-send-email-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=anjali.singhai@intel.com \
    --cc=davem@davemloft.net \
    --cc=gospo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --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).