[dpdk-dev] [PATCH v2] net/tap: fix eBPF handling of non-RSS flows

Ferruh Yigit ferruh.yigit at intel.com
Mon Feb 5 19:10:33 CET 2018


On 2/5/2018 2:51 PM, Pascal Mazon wrote:

> On 05/02/2018 15:40, Ophir Munk wrote:
>> The eBPF classifier (section "cls_q" in tap_bpf_program.c) is tracing
>> marked packets in which skb->cb[1] contains an RSS queue number, and
>> redirects those packets to the matched queue.
>> It is expected that skb->cb[1] has been previously set with a valid RSS
>> queue number during an eBPF action (section "l3_l4" in tap_bpf_program.c).
>> However, for non-RSS flows, skb->cb[1] may contain a random unset value,
>> which could falsely be interpreted as a valid RSS queue.
>> To avoid this potential error, tap_bpf_program.c has been updated as
>> follows:
>> 1. After calculating the RSS queue number, it is added a unique offset in
>> order to uniquely identify it as a valid RSS queue number.
>> 2. After matching an RSS queue to a packet, skb->cb[1] is set to 0.
>>
>> Fixes: cdc07e83bb24 ("net/tap: add eBPF program file")
>> Fixes: aabe70df73a3 ("net/tap: add eBPF bytes code")
>>
>> Signed-off-by: Ophir Munk <ophirmu at mellanox.com>

> The mitigation is good enough, random packets are more likely to have
> cb[1] == 0 than something above 7cafe800.
>
> Acked-by: Pascal Mazon <pascal.mazon at 6wind.com>

Applied to dpdk-next-net/master, thanks.


More information about the dev mailing list