From: Andrew Lunn <andrew@lunn.ch>
To: Iwan R Timmer <irtimmer@gmail.com>
Cc: netdev@vger.kernel.org, vivien.didelot@gmail.com,
f.fainelli@gmail.com, davem@davemloft.net
Subject: Re: [PATCH net-next v2 2/2] net: dsa: mv88e6xxx: Add support for port mirroring
Date: Wed, 23 Oct 2019 03:18:02 +0200 [thread overview]
Message-ID: <20191023011802.GI5707@lunn.ch> (raw)
In-Reply-To: <20191021210143.119426-3-irtimmer@gmail.com>
On Mon, Oct 21, 2019 at 11:01:43PM +0200, Iwan R Timmer wrote:
> Add support for configuring port mirroring through the cls_matchall
> classifier. We do a full ingress and/or egress capture towards a
> capture port. It allows setting a different capture port for ingress
> and egress traffic.
>
> It keeps track of the mirrored ports and the destination ports to
> prevent changes to the capture port while other ports are being
> mirrored.
>
> Signed-off-by: Iwan R Timmer <irtimmer@gmail.com>
> ---
> drivers/net/dsa/mv88e6xxx/chip.c | 70 +++++++++++++++++++++++++++++
> drivers/net/dsa/mv88e6xxx/chip.h | 6 +++
> drivers/net/dsa/mv88e6xxx/global1.c | 11 ++++-
> drivers/net/dsa/mv88e6xxx/port.c | 29 ++++++++++++
> drivers/net/dsa/mv88e6xxx/port.h | 2 +
> 5 files changed, 117 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
> index e9735346838d..14e71bc98513 100644
> --- a/drivers/net/dsa/mv88e6xxx/chip.c
> +++ b/drivers/net/dsa/mv88e6xxx/chip.c
> @@ -4921,6 +4921,74 @@ static int mv88e6xxx_port_mdb_del(struct dsa_switch *ds, int port,
> return err;
> }
>
> +static int mv88e6xxx_port_mirror_add(struct dsa_switch *ds, int port,
> + struct dsa_mall_mirror_tc_entry *mirror,
> + bool ingress)
This bool is defined by the API to the DSA core, so we cannot do much
to make it easier to understand.
> + err = mv88e6xxx_port_set_mirror(chip, port, ingress, true);
but here we could use enums for both ingress and this second true.
Maybe the enum i suggested for the previous patch could be more
generic and just represent ingress/egress?
> @@ -228,6 +228,8 @@ struct mv88e6xxx_port {
> u64 vtu_miss_violation;
> u8 cmode;
> unsigned int serdes_irq;
> + bool mirror_ingress;
> + bool mirror_egress;
> };
In terms of structure packing, it might be better to put these two
bools after cmode.
Andrew
prev parent reply other threads:[~2019-10-23 1:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-21 21:01 [PATCH net-next v2 0/2] net: dsa: mv88e6xxx: Add support for port mirroring Iwan R Timmer
2019-10-21 21:01 ` [PATCH net-next v2 1/2] net: dsa: mv88e6xxx: Split monitor port configuration Iwan R Timmer
2019-10-23 1:06 ` Andrew Lunn
2019-10-21 21:01 ` [PATCH net-next v2 2/2] net: dsa: mv88e6xxx: Add support for port mirroring Iwan R Timmer
2019-10-23 1:18 ` Andrew Lunn [this message]
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=20191023011802.GI5707@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=irtimmer@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=vivien.didelot@gmail.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).