From 19fec29373ea237b68a54817cea00d94521021b7 Mon Sep 17 00:00:00 2001 From: Jingjing Wu Date: Thu, 12 May 2016 16:11:40 +0800 Subject: [PATCH] net/i40e: fix disabling flex payload selection rule When setting up the flexible paylaod selection rules, the value NONUSE_FLX_PIT_DEST_OFF (== 63) is meant to disable the rule. However, since the MK_FLX_PIT macro always added on an additional offset of I40E_FLX_OFFSET_IN_FIELD_VECTOR (== 50) to the value passed the functionality to disable the rule was broken. This patch fixes this by checking for the disable value and not adding the offset in that case. Fixes: d8b90c4eabe9 ("i40e: take flow director flexible payload configuration") Reported-by: Michael Habibi Signed-off-by: Jingjing Wu Acked-by: Zhe Tao --- drivers/net/i40e/i40e_fdir.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c index 8aa41e5294..efbcd185a7 100644 --- a/drivers/net/i40e/i40e_fdir.c +++ b/drivers/net/i40e/i40e_fdir.c @@ -94,7 +94,9 @@ I40E_PRTQF_FLX_PIT_SOURCE_OFF_MASK) | \ (((fsize) << I40E_PRTQF_FLX_PIT_FSIZE_SHIFT) & \ I40E_PRTQF_FLX_PIT_FSIZE_MASK) | \ - ((((dst_offset) + I40E_FLX_OFFSET_IN_FIELD_VECTOR) << \ + ((((dst_offset) == NONUSE_FLX_PIT_DEST_OFF ? \ + NONUSE_FLX_PIT_DEST_OFF : \ + ((dst_offset) + I40E_FLX_OFFSET_IN_FIELD_VECTOR)) << \ I40E_PRTQF_FLX_PIT_DEST_OFF_SHIFT) & \ I40E_PRTQF_FLX_PIT_DEST_OFF_MASK)) -- 2.20.1