All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: davem@davemloft.net
Cc: Tarun Singh <tarun.k.singh@intel.com>,
	netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
	jeffrey.t.kirsher@intel.com, anthony.l.nguyen@intel.com,
	Andrew Bowers <andrewx.bowers@intel.com>
Subject: [net-next 07/15] ice: Add RL profile bit mask check
Date: Wed, 29 Jul 2020 09:23:57 -0700	[thread overview]
Message-ID: <20200729162405.1596435-8-anthony.l.nguyen@intel.com> (raw)
In-Reply-To: <20200729162405.1596435-1-anthony.l.nguyen@intel.com>

From: Tarun Singh <tarun.k.singh@intel.com>

Mask bits before accessing the profile type field.

Signed-off-by: Tarun Singh <tarun.k.singh@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_sched.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_sched.c b/drivers/net/ethernet/intel/ice/ice_sched.c
index 1c29cfa1cf33..ac5b05bb978f 100644
--- a/drivers/net/ethernet/intel/ice/ice_sched.c
+++ b/drivers/net/ethernet/intel/ice/ice_sched.c
@@ -2153,8 +2153,8 @@ ice_sched_add_rl_profile(struct ice_port_info *pi,
 	hw = pi->hw;
 	list_for_each_entry(rl_prof_elem, &pi->rl_prof_list[layer_num],
 			    list_entry)
-		if (rl_prof_elem->profile.flags == profile_type &&
-		    rl_prof_elem->bw == bw)
+		if ((rl_prof_elem->profile.flags & ICE_AQC_RL_PROFILE_TYPE_M) ==
+		    profile_type && rl_prof_elem->bw == bw)
 			/* Return existing profile ID info */
 			return rl_prof_elem;
 
@@ -2384,7 +2384,8 @@ ice_sched_rm_rl_profile(struct ice_port_info *pi, u8 layer_num, u8 profile_type,
 	/* Check the existing list for RL profile */
 	list_for_each_entry(rl_prof_elem, &pi->rl_prof_list[layer_num],
 			    list_entry)
-		if (rl_prof_elem->profile.flags == profile_type &&
+		if ((rl_prof_elem->profile.flags & ICE_AQC_RL_PROFILE_TYPE_M) ==
+		    profile_type &&
 		    le16_to_cpu(rl_prof_elem->profile.profile_id) ==
 		    profile_id) {
 			if (rl_prof_elem->prof_id_ref)
@@ -2546,8 +2547,8 @@ ice_sched_set_node_bw(struct ice_port_info *pi, struct ice_sched_node *node,
 		return 0;
 
 	return ice_sched_rm_rl_profile(pi, layer_num,
-				       rl_prof_info->profile.flags,
-				       old_id);
+				       rl_prof_info->profile.flags &
+				       ICE_AQC_RL_PROFILE_TYPE_M, old_id);
 }
 
 /**
-- 
2.26.2


  parent reply	other threads:[~2020-07-29 16:24 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-29 16:23 [net-next 00/15][pull request] 100GbE Intel Wired LAN Driver Updates 2020-07-29 Tony Nguyen
2020-07-29 16:23 ` [net-next 01/15] ice: Implement LFC workaround Tony Nguyen
2020-07-29 16:23 ` [net-next 02/15] ice: Fix link broken after GLOBR reset Tony Nguyen
2020-07-29 16:23 ` [net-next 03/15] ice: fix link event handling timing Tony Nguyen
2020-07-29 16:23 ` [net-next 04/15] ice: restore VF MSI-X state during PCI reset Tony Nguyen
2020-07-29 16:23 ` [net-next 05/15] ice: return correct error code from ice_aq_sw_rules Tony Nguyen
2020-07-29 16:26   ` Patil, Kiran
2020-07-29 16:23 ` [net-next 06/15] ice: fix overwriting TX/RX descriptor values when rebuilding VSI Tony Nguyen
2020-07-29 16:23 ` Tony Nguyen [this message]
2020-07-29 16:23 ` [net-next 08/15] ice: Adjust scheduler default BW weight Tony Nguyen
2020-07-29 16:23 ` [net-next 09/15] ice: distribute Tx queues evenly Tony Nguyen
2020-07-29 16:24 ` [net-next 10/15] ice: need_wakeup flag might not be set for Tx Tony Nguyen
2020-07-29 16:24 ` [net-next 11/15] ice: Allow all VLANs in safe mode Tony Nguyen
2020-07-29 16:31   ` Creeley, Brett
2020-07-29 16:24 ` [net-next 12/15] ice: cleanup VSI on probe fail Tony Nguyen
2020-07-29 16:24 ` [net-next 13/15] ice: reduce scope of variable Tony Nguyen
2020-07-29 16:24 ` [net-next 14/15] ice: disable no longer needed workaround for FW logging Tony Nguyen
2020-07-29 16:24 ` [net-next 15/15] ice: fix unused parameter warning Tony Nguyen
2020-07-29 20:15 ` [net-next 00/15][pull request] 100GbE Intel Wired LAN Driver Updates 2020-07-29 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=20200729162405.1596435-8-anthony.l.nguyen@intel.com \
    --to=anthony.l.nguyen@intel.com \
    --cc=andrewx.bowers@intel.com \
    --cc=davem@davemloft.net \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@redhat.com \
    --cc=sassmann@redhat.com \
    --cc=tarun.k.singh@intel.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.