netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: netdev@vger.kernel.org
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	andrew@lunn.ch, vivien.didelot@savoirfairelinux.com,
	davem@davemloft.net
Subject: [PATCH net-next 1/4] net: dsa: bcm_sf2: Allow targeting CPU ports for CFP rules
Date: Fri,  3 Aug 2018 11:08:41 -0700	[thread overview]
Message-ID: <20180803180844.1010-2-f.fainelli@gmail.com> (raw)
In-Reply-To: <20180803180844.1010-1-f.fainelli@gmail.com>

ds->enabled_port_mask only contains a bitmask of user-facing enabled
ports, we also need to allow programming CFP rules that target CPU ports
(e.g: ports 5 and 8).

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/dsa/bcm_sf2_cfp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/dsa/bcm_sf2_cfp.c b/drivers/net/dsa/bcm_sf2_cfp.c
index b89acaee12d4..1e37b65aab93 100644
--- a/drivers/net/dsa/bcm_sf2_cfp.c
+++ b/drivers/net/dsa/bcm_sf2_cfp.c
@@ -755,7 +755,8 @@ static int bcm_sf2_cfp_rule_set(struct dsa_switch *ds, int port,
 	port_num = fs->ring_cookie / SF2_NUM_EGRESS_QUEUES;
 
 	if (fs->ring_cookie == RX_CLS_FLOW_DISC ||
-	    !dsa_is_user_port(ds, port_num) ||
+	    !(dsa_is_user_port(ds, port_num) ||
+	      dsa_is_cpu_port(ds, port_num)) ||
 	    port_num >= priv->hw_params.num_ports)
 		return -EINVAL;
 	/*
-- 
2.14.1

  reply	other threads:[~2018-08-03 20:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-03 18:08 [PATCH net-next 0/4] net: dsa and systemport WoL changes Florian Fainelli
2018-08-03 18:08 ` Florian Fainelli [this message]
2018-08-03 18:22   ` [PATCH net-next 1/4] net: dsa: bcm_sf2: Allow targeting CPU ports for CFP rules Andrew Lunn
2018-08-03 18:08 ` [PATCH net-next 2/4] net: dsa: bcm_sf2: Disable learning while in WoL Florian Fainelli
2018-08-03 18:24   ` Andrew Lunn
2018-08-03 18:08 ` [PATCH net-next 3/4] net: systemport: Do not re-configure upon WoL interrupt Florian Fainelli
2018-08-03 18:08 ` [PATCH net-next 4/4] net: systemport: Create helper to set MPD Florian Fainelli
2018-08-03 18:25   ` Andrew Lunn
2018-08-03 19:13 ` [PATCH net-next 0/4] net: dsa and systemport WoL changes 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=20180803180844.1010-2-f.fainelli@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@savoirfairelinux.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).