From: Vladimir Oltean <olteanv@gmail.com>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: "David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, Andrew Lunn <andrew@lunn.ch>,
Vivien Didelot <vivien.didelot@gmail.com>
Subject: Re: [PATCH net-next] net: dsa: allow port mirroring towards foreign interfaces
Date: Sat, 6 Feb 2021 01:05:21 +0200 [thread overview]
Message-ID: <20210205230521.s2eb2alw5pkqqafv@skbuf> (raw)
In-Reply-To: <fead6d2a-3455-785a-a367-974c2e6efdf3@gmail.com>
On Fri, Feb 05, 2021 at 02:42:55PM -0800, Florian Fainelli wrote:
> How does the mirred action deal with that case? How does it know that
> packets delivered to the DSA master should be sent towards a foreign
> address, do I need to set-up two mirred rules? One that set-ups the
> filter on say sw0p0 to redirect egress to eth0 (DSA master) and another
> one to ingress filter on eth0 and egress mirror to eth1 (USB ethernet
> dongle)?
[ I should have posted this as RFC, somebody asked me if it's possible,
I only tested ingress mirroring, saw something come out, and posted this.
I didn't even study act_mirred.c to see why I got anything at all ]
For ingress mirroring there should be nothing special about the mirror
packets, it's just more traffic in the ingress data path where the qdisc
hook already exists.
For egress mirroring I don't think there's really any way for the mirred
action to take over the packets from what is basically the ingress qdisc
and into the egress qdisc of the DSA interface such that they will be
redirected to the selected mirror. I hadn't even thought about egress
mirroring. I suppose with more API, we could have DSA do introspection
into the frame header, see it's an egress-mirrored packet, and inject it
into the egress qdisc of the net device instead of doing netif_rx.
The idea with 2 mirrors might work however it's not amazing and I was
thinking that if we bother to do something at all, we could as well try
to think it through and come up with something that's seamless for the
user.
next prev parent reply other threads:[~2021-02-06 2:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-05 22:33 [PATCH net-next] net: dsa: allow port mirroring towards foreign interfaces Vladimir Oltean
2021-02-05 22:42 ` Florian Fainelli
2021-02-05 23:05 ` Vladimir Oltean [this message]
2021-02-06 23:58 ` Jakub Kicinski
2021-02-07 0:16 ` Vladimir Oltean
2021-02-07 0:43 ` Jakub Kicinski
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=20210205230521.s2eb2alw5pkqqafv@skbuf \
--to=olteanv@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--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