]> git.droids-corp.org - dpdk.git/commit
net/i40e: fix risk in descriptor read in scalar Rx
authorRuifeng Wang <ruifeng.wang@arm.com>
Wed, 15 Sep 2021 08:33:39 +0000 (16:33 +0800)
committerQi Zhang <qi.z.zhang@intel.com>
Thu, 11 Nov 2021 12:29:23 +0000 (13:29 +0100)
commitc4d3e8fbe485f244391797f7610512de377675e0
treeb839dbfac58992a603ed0ec9348a86213a028973
parent9143a09dedfe5dcb559cba6ce1c0c06a41776ec7
net/i40e: fix risk in descriptor read in scalar Rx

Rx descriptor is 16B/32B in size. If the DD bit is set, it indicates
that the rest of the descriptor words have valid values. Hence, the
word containing DD bit must be read first before reading the rest of
the descriptor words.

Since the entire descriptor is not read atomically, on relaxed memory
ordered systems like Aarch64, read of the word containing DD field
could be reordered after read of other words.

Read barrier is inserted between read of the word with DD field
and read of other words. The barrier ensures that the fetched data
is correct.

Testpmd single core test showed no performance drop on x86 or N1SDP.
On ThunderX2, 22% performance regression was observed.

Fixes: 7b0cf70135d1 ("net/i40e: support ARM platform")
Cc: stable@dpdk.org
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
drivers/net/i40e/i40e_rxtx.c