Thread (7 messages) 7 messages, 3 authors, 2023-12-15

Re: [PATCH net-next v6 3/3] net/sched: act_mirred: Allow mirred to block

From: Victor Nogueira <hidden>
Date: 2023-12-15 11:12:05


On 15/12/2023 00:09, Jakub Kicinski wrote:
On Thu, 14 Dec 2023 11:10:06 -0300 Victor Nogueira wrote:
quoted
So far the mirred action has dealt with syntax that handles mirror/redirection for netdev.
A matching packet is redirected or mirrored to a target netdev.

In this patch we enable mirred to mirror to a tc block as well.
IOW, the new syntax looks as follows:
... mirred <ingress | egress> <mirror | redirect> [index INDEX] < <blockid BLOCKID> | <dev <devname>> >

Examples of mirroring or redirecting to a tc block:
$ tc filter add block 22 protocol ip pref 25 \
   flower dst_ip 192.168.0.0/16 action mirred egress mirror blockid 22

$ tc filter add block 22 protocol ip pref 25 \
   flower dst_ip 10.10.10.10/32 action mirred egress redirect blockid 22
net/sched/act_mirred.c:424:6: warning: variable 'err' set but not used [-Wunused-but-set-variable]
   424 |         int err = 0;
       |             ^
Thank you for the catch.
Sent a v7 fixing it.

cheers,
Victor
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help