All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Yashaswini Raghuram Prathivadi Bhayankaram 
	<yashaswini.raghuram.prathivadi.bhayankaram@intel.com>,
	netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
	Bruce Allan <bruce.w.allan@intel.com>,
	Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>,
	Andrew Bowers <andrewx.bowers@intel.com>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 11/15] ice: Enable LAN_EN for the right recipes
Date: Fri, 22 Mar 2019 10:33:24 -0700	[thread overview]
Message-ID: <20190322173328.2493-12-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <20190322173328.2493-1-jeffrey.t.kirsher@intel.com>

From: Yashaswini Raghuram Prathivadi Bhayankaram <yashaswini.raghuram.prathivadi.bhayankaram@intel.com>

In VEB mode, enable LAN_EN bit in the action fields for filter rules
corresponding to the right recipes.

Signed-off-by: Yashaswini Raghuram Prathivadi Bhayankaram <yashaswini.raghuram.prathivadi.bhayankaram@intel.com>
Reviewed-by: Bruce Allan <bruce.w.allan@intel.com>
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 | 29 ++++++++++++++-------
 1 file changed, 20 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c
index 64e9e0cb61ce..48864b59036a 100644
--- a/drivers/net/ethernet/intel/ice/ice_switch.c
+++ b/drivers/net/ethernet/intel/ice/ice_switch.c
@@ -644,20 +644,31 @@ static void ice_fill_sw_info(struct ice_hw *hw, struct ice_fltr_info *fi)
 	     fi->fltr_act == ICE_FWD_TO_Q ||
 	     fi->fltr_act == ICE_FWD_TO_QGRP)) {
 		fi->lb_en = true;
-		/* Do not set lan_en to TRUE if
+		/* Set lan_en to TRUE if
 		 * 1. The switch is a VEB AND
 		 * 2
-		 * 2.1 The lookup is MAC with unicast addr for MAC, OR
-		 * 2.2 The lookup is MAC_VLAN with unicast addr for MAC
+		 * 2.1 The lookup is VLAN, OR
+		 * 2.2 The lookup is default port mode, OR
+		 * 2.3 The lookup is MAC with mcast or bcast addr for MAC, OR
+		 * 2.4 The lookup is MAC_VLAN with mcast or bcast addr for MAC.
 		 *
-		 * In all other cases, the LAN enable has to be set to true.
+		 * OR
+		 *
+		 * The switch is a VEPA.
+		 *
+		 * In all other cases, the LAN enable has to be set to false.
 		 */
-		if (!(hw->evb_veb &&
-		      ((fi->lkup_type == ICE_SW_LKUP_MAC &&
-			is_unicast_ether_addr(fi->l_data.mac.mac_addr)) ||
-		       (fi->lkup_type == ICE_SW_LKUP_MAC_VLAN &&
-			is_unicast_ether_addr(fi->l_data.mac_vlan.mac_addr)))))
+		if (hw->evb_veb) {
+			if (fi->lkup_type == ICE_SW_LKUP_VLAN ||
+			    fi->lkup_type == ICE_SW_LKUP_DFLT ||
+			    (fi->lkup_type == ICE_SW_LKUP_MAC &&
+			     !is_unicast_ether_addr(fi->l_data.mac.mac_addr)) ||
+			    (fi->lkup_type == ICE_SW_LKUP_MAC_VLAN &&
+			     !is_unicast_ether_addr(fi->l_data.mac.mac_addr)))
+				fi->lan_en = true;
+		} else {
 			fi->lan_en = true;
+		}
 	}
 }
 
-- 
2.20.1


  parent reply	other threads:[~2019-03-22 17:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-22 17:33 [net-next 00/15][pull request] 100GbE Intel Wired LAN Driver Updates 2019-03-22 Jeff Kirsher
2019-03-22 17:33 ` [net-next 01/15] ice: Enable MAC anti-spoof by default Jeff Kirsher
2019-03-22 17:33 ` [net-next 02/15] ice: Fix issue reclaiming resources back to the pool after reset Jeff Kirsher
2019-03-22 17:33 ` [net-next 03/15] ice: fix static analysis warnings Jeff Kirsher
2019-03-22 17:33 ` [net-next 04/15] ice: Remove unused function prototype Jeff Kirsher
2019-03-22 17:33 ` [net-next 05/15] ice: Fix issue reconfiguring VF queues Jeff Kirsher
2019-03-22 17:33 ` [net-next 06/15] ice: fix the divide by zero issue Jeff Kirsher
2019-03-22 17:33 ` [net-next 07/15] ice: fix some function prototype and signature style issues Jeff Kirsher
2019-03-22 17:33 ` [net-next 08/15] ice: Remove unused vsi_id field Jeff Kirsher
2019-03-22 17:33 ` [net-next 09/15] ice: code cleanup in ice_sched.c Jeff Kirsher
2019-03-22 17:33 ` [net-next 10/15] ice: Add support for PF/VF promiscuous mode Jeff Kirsher
2019-03-22 17:33 ` Jeff Kirsher [this message]
2019-03-22 17:33 ` [net-next 12/15] ice: Do not set LB_EN for prune switch rules Jeff Kirsher
2019-03-22 17:33 ` [net-next 13/15] ice: Set LAN_EN for all directional rules Jeff Kirsher
2019-03-22 17:33 ` [net-next 14/15] ice: Don't let VF know that it is untrusted Jeff Kirsher
2019-03-22 17:33 ` [net-next 15/15] ice: Get VF VSI instances directly via PF Jeff Kirsher
2019-03-24  2:03 ` [net-next 00/15][pull request] 100GbE Intel Wired LAN Driver Updates 2019-03-22 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=20190322173328.2493-12-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=andrewx.bowers@intel.com \
    --cc=anirudh.venkataramanan@intel.com \
    --cc=bruce.w.allan@intel.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@redhat.com \
    --cc=sassmann@redhat.com \
    --cc=yashaswini.raghuram.prathivadi.bhayankaram@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.