All of lore.kernel.org
 help / color / mirror / Atom feed
* xdp-cpumap-tc multi queue schema and traffic mirroring
@ 2021-10-06 21:18 Ethy H. Brito
  2021-10-07 17:02 ` Toke Høiland-Jørgensen
  0 siblings, 1 reply; 4+ messages in thread
From: Ethy H. Brito @ 2021-10-06 21:18 UTC (permalink / raw)
  To: xdp-newbies


Hi All

Before I moved to XDP cpumap bandwidth control "philosophy" I used to snoop inside the htb classes (mainly the default one) mirroring traffic to a dummy interface then run tcpdump on that like:

	tc filter add dev eth0 parent 1: protocol all prio 0xffff \
	u32 match u32 0 0 flowid 1:$shp action mirred egress mirror dev dummy0

Then "tcpdump -npi dummy0" used to show me all that classid "1:$shp" was carrying.

Now, with the multi queue environment XDP creates, I can't make mirroring to work.
For instance: I need to see what is going on with HTB classid e:102, so I tried:
	
	tc filter add dev eth0 parent e: ... e:102 action mirred egress ...

and "tcpdump -npi dummy0" prints traffic that has nothing to do with classid e:102. 
I can confirm the traffic is pored thru the class since its bandwidth is
controlled/limited correctly.

I also tried:
		
	tc filter add dev eth0 parent 1: ... e:102 action mirred egress ...

	tc filter add dev eth0 parent e:1 ... e:102 action mirred egress ...

	tc filter add dev eth0 parent 7fff:e: ... e:102 action mirred egress ...
	(tc complaints with error)

with no results that make sense.

Classes were configured as:

	tc qdisc replace dev eth0 root handle 7FFF: mq

	tc qdisc add dev eth0 parent 7FFF:e handle e: htb default fffd

	tc class add dev eth0 parent e: classid e:1 htb \
	rate 6gibit ceil 6gibit 

	tc class add dev eth0 parent e:1 classid e:102 htb prio 2 \
	rate 25mibit ceil 50mibit 

Packets' target class was configured as:

	xdp_iphash_to_cpu_cmdline --add --ip 'A.B.C.D' --classid 'e:102' --cpu 13

And I can't see any packets to or from A.B.C.D in dummy0. 
Only "garbage" form other random hosts.

Do anyone of you guys know how to use "tc filter ... mirred..." in XDP multi queue environment??

Regards

Ethy


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

* Re: xdp-cpumap-tc multi queue schema and traffic mirroring
  2021-10-06 21:18 xdp-cpumap-tc multi queue schema and traffic mirroring Ethy H. Brito
@ 2021-10-07 17:02 ` Toke Høiland-Jørgensen
  2021-10-08 13:50   ` Ethy H. Brito
  0 siblings, 1 reply; 4+ messages in thread
From: Toke Høiland-Jørgensen @ 2021-10-07 17:02 UTC (permalink / raw)
  To: Ethy H. Brito, xdp-newbies; +Cc: Jesper Brouer

"Ethy H. Brito" <ethy.brito@inexo.com.br> writes:

> Hi All
>
> Before I moved to XDP cpumap bandwidth control "philosophy" I used to snoop inside the htb classes (mainly the default one) mirroring traffic to a dummy interface then run tcpdump on that like:
>
> 	tc filter add dev eth0 parent 1: protocol all prio 0xffff \
> 	u32 match u32 0 0 flowid 1:$shp action mirred egress mirror dev dummy0
>
> Then "tcpdump -npi dummy0" used to show me all that classid "1:$shp" was carrying.
>
> Now, with the multi queue environment XDP creates, I can't make mirroring to work.
> For instance: I need to see what is going on with HTB classid e:102, so I tried:
> 	
> 	tc filter add dev eth0 parent e: ... e:102 action mirred egress ...
>
> and "tcpdump -npi dummy0" prints traffic that has nothing to do with classid e:102. 
> I can confirm the traffic is pored thru the class since its bandwidth is
> controlled/limited correctly.

The xdp-cpumap-tc utility will attach a filter to the egress interface,
presumably that is taking priority and short-circuit your mirred filter?

-Toke


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

* Re: xdp-cpumap-tc multi queue schema and traffic mirroring
  2021-10-07 17:02 ` Toke Høiland-Jørgensen
@ 2021-10-08 13:50   ` Ethy H. Brito
  2021-10-08 17:36     ` Toke Høiland-Jørgensen
  0 siblings, 1 reply; 4+ messages in thread
From: Ethy H. Brito @ 2021-10-08 13:50 UTC (permalink / raw)
  To: Toke Høiland-Jørgensen; +Cc: xdp-newbies, Jesper Brouer

On Thu, 07 Oct 2021 19:02:58 +0200
Toke Høiland-Jørgensen <toke@redhat.com> wrote:

> "Ethy H. Brito" <ethy.brito@inexo.com.br> writes:
> 
> > Hi All
> >
> > Before I moved to XDP cpumap bandwidth control "philosophy" I used to snoop
> > inside the htb classes (mainly the default one) mirroring traffic to a
> > dummy interface then run tcpdump on that like:
> >
> > 	tc filter add dev eth0 parent 1: protocol all prio 0xffff \
> > 	u32 match u32 0 0 flowid 1:$shp action mirred egress mirror dev
> > dummy0
> >
> > Then "tcpdump -npi dummy0" used to show me all that classid "1:$shp" was
> > carrying.
> >
> > Now, with the multi queue environment XDP creates, I can't make mirroring
> > to work. For instance: I need to see what is going on with HTB classid
> > e:102, so I tried: 
> > 	tc filter add dev eth0 parent e: ... e:102 action mirred egress ...
> >
> > and "tcpdump -npi dummy0" prints traffic that has nothing to do with
> > classid e:102. I can confirm the traffic is pored thru the class since its
> > bandwidth is controlled/limited correctly.  


Hi Toke, et All.

> 
> The xdp-cpumap-tc utility will attach a filter to the egress interface,
> presumably that is taking priority and short-circuit your mirred filter?

This makes sense. 
But How to circumvent this??

Snooping the default class (classes, in xdp-cpumap case) is essencial to catch misconfigured mappings.

Regards

Ethy

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

* Re: xdp-cpumap-tc multi queue schema and traffic mirroring
  2021-10-08 13:50   ` Ethy H. Brito
@ 2021-10-08 17:36     ` Toke Høiland-Jørgensen
  0 siblings, 0 replies; 4+ messages in thread
From: Toke Høiland-Jørgensen @ 2021-10-08 17:36 UTC (permalink / raw)
  To: Ethy H. Brito; +Cc: xdp-newbies, Jesper Brouer

"Ethy H. Brito" <ethy.brito@inexo.com.br> writes:

> On Thu, 07 Oct 2021 19:02:58 +0200
> Toke Høiland-Jørgensen <toke@redhat.com> wrote:
>
>> "Ethy H. Brito" <ethy.brito@inexo.com.br> writes:
>> 
>> > Hi All
>> >
>> > Before I moved to XDP cpumap bandwidth control "philosophy" I used to snoop
>> > inside the htb classes (mainly the default one) mirroring traffic to a
>> > dummy interface then run tcpdump on that like:
>> >
>> > 	tc filter add dev eth0 parent 1: protocol all prio 0xffff \
>> > 	u32 match u32 0 0 flowid 1:$shp action mirred egress mirror dev
>> > dummy0
>> >
>> > Then "tcpdump -npi dummy0" used to show me all that classid "1:$shp" was
>> > carrying.
>> >
>> > Now, with the multi queue environment XDP creates, I can't make mirroring
>> > to work. For instance: I need to see what is going on with HTB classid
>> > e:102, so I tried: 
>> > 	tc filter add dev eth0 parent e: ... e:102 action mirred egress ...
>> >
>> > and "tcpdump -npi dummy0" prints traffic that has nothing to do with
>> > classid e:102. I can confirm the traffic is pored thru the class since its
>> > bandwidth is controlled/limited correctly.  
>
>
> Hi Toke, et All.
>
>> 
>> The xdp-cpumap-tc utility will attach a filter to the egress interface,
>> presumably that is taking priority and short-circuit your mirred filter?
>
> This makes sense. 
> But How to circumvent this??
>
> Snooping the default class (classes, in xdp-cpumap case) is essencial
> to catch misconfigured mappings.

Well, it's possible to chain multiple filters, they just need to be
configured properly. Not sure exactly what the right incantation is, but
it'll likely require at least changing the priority of the filter
installed by xdp-cpumap. I'd suggest you open an issue on the github
repository, as that is really the appropriate place to discuss this, as
it's not really XDP-specific...

-Toke


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

end of thread, other threads:[~2021-10-08 17:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-06 21:18 xdp-cpumap-tc multi queue schema and traffic mirroring Ethy H. Brito
2021-10-07 17:02 ` Toke Høiland-Jørgensen
2021-10-08 13:50   ` Ethy H. Brito
2021-10-08 17:36     ` Toke Høiland-Jørgensen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.