From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH v2] net/tap: fix eBPF handling of non-RSS flows Date: Mon, 5 Feb 2018 18:10:33 +0000 Message-ID: References: <1517700853-6467-1-git-send-email-ophirmu@mellanox.com> <1517841642-10429-1-git-send-email-ophirmu@mellanox.com> <1517841642-10429-2-git-send-email-ophirmu@mellanox.com> <82465840-531b-8ce5-eb0d-a9fe4c962542@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Thomas Monjalon , Olga Shern To: Pascal Mazon , Ophir Munk , dev@dpdk.org Return-path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 4D9391B694 for ; Mon, 5 Feb 2018 19:10:36 +0100 (CET) In-Reply-To: <82465840-531b-8ce5-eb0d-a9fe4c962542@6wind.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 > The mitigation is good enough, random packets are more likely to have > cb[1] == 0 than something above 7cafe800. > > Acked-by: Pascal Mazon Applied to dpdk-next-net/master, thanks.