From mboxrd@z Thu Jan 1 00:00:00 1970 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) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Feb 2018 10:10:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,465,1511856000"; d="scan'208";a="25001369" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.91]) ([10.237.220.91]) by FMSMGA003.fm.intel.com with ESMTP; 05 Feb 2018 10:10:33 -0800 To: Pascal Mazon , Ophir Munk , dev@dpdk.org Cc: Thomas Monjalon , Olga Shern 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> From: Ferruh Yigit Message-ID: Date: Mon, 5 Feb 2018 18:10:33 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <82465840-531b-8ce5-eb0d-a9fe4c962542@6wind.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2] net/tap: fix eBPF handling of non-RSS flows X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Feb 2018 18:10:37 -0000 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.