All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>,
	netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 10/15] ice: Fix forward to queue group logic
Date: Wed,  3 Oct 2018 08:48:20 -0700	[thread overview]
Message-ID: <20181003154825.5440-11-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <20181003154825.5440-1-jeffrey.t.kirsher@intel.com>

From: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>

When adding a rule, queue region size needs to be provided as log base 2
of the number of queues in region. Fix that.

Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_switch.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c
index 9a2664fd87b8..ff933a348acc 100644
--- a/drivers/net/ethernet/intel/ice/ice_switch.c
+++ b/drivers/net/ethernet/intel/ice/ice_switch.c
@@ -656,6 +656,7 @@ ice_fill_sw_rule(struct ice_hw *hw, struct ice_fltr_info *f_info,
 	u8 *eth_hdr;
 	u32 act = 0;
 	__be16 *off;
+	u8 q_rgn;
 
 	if (opc == ice_aqc_opc_remove_sw_rules) {
 		s_rule->pdata.lkup_tx_rx.act = 0;
@@ -694,14 +695,19 @@ ice_fill_sw_rule(struct ice_hw *hw, struct ice_fltr_info *f_info,
 		act |= (f_info->fwd_id.q_id << ICE_SINGLE_ACT_Q_INDEX_S) &
 			ICE_SINGLE_ACT_Q_INDEX_M;
 		break;
+	case ICE_DROP_PACKET:
+		act |= ICE_SINGLE_ACT_VSI_FORWARDING | ICE_SINGLE_ACT_DROP |
+			ICE_SINGLE_ACT_VALID_BIT;
+		break;
 	case ICE_FWD_TO_QGRP:
+		q_rgn = f_info->qgrp_size > 0 ?
+			(u8)ilog2(f_info->qgrp_size) : 0;
 		act |= ICE_SINGLE_ACT_TO_Q;
-		act |= (f_info->qgrp_size << ICE_SINGLE_ACT_Q_REGION_S) &
+		act |= (f_info->fwd_id.q_id << ICE_SINGLE_ACT_Q_INDEX_S) &
+			ICE_SINGLE_ACT_Q_INDEX_M;
+		act |= (q_rgn << ICE_SINGLE_ACT_Q_REGION_S) &
 			ICE_SINGLE_ACT_Q_REGION_M;
 		break;
-	case ICE_DROP_PACKET:
-		act |= ICE_SINGLE_ACT_VSI_FORWARDING | ICE_SINGLE_ACT_DROP;
-		break;
 	default:
 		return;
 	}
-- 
2.17.1

  parent reply	other threads:[~2018-10-03 22:34 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-03 15:48 [net-next 00/15][pull request] 100GbE Intel Wired LAN Driver Updates 2018-10-03 Jeff Kirsher
2018-10-03 15:48 ` [net-next 01/15] virtchnl: Added support to exchange additional speed values Jeff Kirsher
2018-10-03 15:48 ` [net-next 02/15] ice: Add support to detect SR-IOV capability and mailbox queues Jeff Kirsher
2018-10-03 15:48 ` [net-next 03/15] ice: Add handler to configure SR-IOV Jeff Kirsher
2018-10-03 15:48 ` [net-next 04/15] ice: Update VSI and queue management code to handle VF VSI Jeff Kirsher
2018-10-03 15:48 ` [net-next 05/15] ice: Add support for VF reset events Jeff Kirsher
2018-10-03 15:48 ` [net-next 06/15] ice: Add handlers for VF netdevice operations Jeff Kirsher
2018-10-03 15:48 ` [net-next 07/15] ice: Implement virtchnl commands for AVF support Jeff Kirsher
2018-10-03 15:48 ` [net-next 08/15] ice: Notify VF of link status change Jeff Kirsher
2018-10-03 17:23   ` Or Gerlitz
2018-10-04 17:36     ` Abodunrin, Akeem G
2018-10-03 15:48 ` [net-next 09/15] ice: Extend malicious operations detection logic Jeff Kirsher
2018-10-03 15:48 ` Jeff Kirsher [this message]
2018-10-03 15:48 ` [net-next 11/15] ice: Add code to go from ICE_FWD_TO_VSI_LIST to ICE_FWD_TO_VSI Jeff Kirsher
2018-10-03 15:48 ` [net-next 12/15] ice: Fix potential null pointer issues Jeff Kirsher
2018-10-03 15:48 ` [net-next 13/15] ice: Add more flexibility on how we assign an ITR index Jeff Kirsher
2018-10-03 15:48 ` [net-next 14/15] ice: Use the right function to enable/disable VSI Jeff Kirsher
2018-10-03 15:48 ` [net-next 15/15] ice: Update version string Jeff Kirsher
2018-10-03 16:41 ` [net-next 00/15][pull request] 100GbE Intel Wired LAN Driver Updates 2018-10-03 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=20181003154825.5440-11-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=anirudh.venkataramanan@intel.com \
    --cc=davem@davemloft.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.