netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* VLAN retagging for packets switched between 2 certain ports
@ 2020-02-06  9:02 Vladimir Oltean
  2020-02-06  9:32 ` Vladimir Oltean
  0 siblings, 1 reply; 5+ messages in thread
From: Vladimir Oltean @ 2020-02-06  9:02 UTC (permalink / raw)
  To: netdev

Hi netdev,

I am interested in modeling the following classifier/action with tc filters:
- Match packets with VID N received on port A and going towards port B
- Replace VID with M

Some hardware (DSA switch) I am working on supports this, so it would
be good if I could model this with tc in a way that can be offloaded.
In man tc-flower I found the following matches:
       indev ifname
              Match on incoming interface name. Obviously this makes
sense only for forwarded flows.  ifname is the name of an interface
which must exist at the time of tc invocation.
       vlan_id VID
              Match on vlan tag id.  VID is an unsigned 12bit value in
decimal format.

And there is a generic "vlan" action (man tc-vlan) that supports the
"modify" command.

Judging from this syntax, I would need to add a tc-flower rule on the
egress qdisc of swpB, with indev swpA and vlan_id N.
But what should I do if I need to do VLAN retagging towards the CPU
(where DSA does not give me a hook for attaching tc filters)?

Thanks,
-Vladimir

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-02-10 14:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-06  9:02 VLAN retagging for packets switched between 2 certain ports Vladimir Oltean
2020-02-06  9:32 ` Vladimir Oltean
2020-02-07 17:43   ` Ido Schimmel
2020-02-08 13:32     ` Vladimir Oltean
2020-02-10 14:34   ` Ido Schimmel

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).