From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 854505957 for ; Thu, 12 May 2016 10:11:53 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 12 May 2016 01:11:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,609,1455004800"; d="scan'208";a="951622662" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga001.jf.intel.com with ESMTP; 12 May 2016 01:11:50 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id u4C8BjRa008964; Thu, 12 May 2016 16:11:45 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id u4C8BgF8032199; Thu, 12 May 2016 16:11:44 +0800 Received: (from wujingji@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id u4C8BgpK032195; Thu, 12 May 2016 16:11:42 +0800 From: Jingjing Wu To: helin.zhang@intel.com Cc: dev@dpdk.org, jingjing.wu@intel.com, mikehabibi@gmail.com Date: Thu, 12 May 2016 16:11:40 +0800 Message-Id: <1463040700-32165-1-git-send-email-jingjing.wu@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH] i40e: fix flexible payload selection X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2016 08:11:53 -0000 When setting up flexible payload selection rules, it is allowed that setting value to 63 to disable the rule (NONUSE_FLX_PIT_DEST_OFF). However, MK_FLX_PIT macro is always adding an offset value 50 (I40E_FLX_OFFSET_IN_FIELD_VECTOR), it will be set to "63 + 50" and when setting NONUSE_FLX_PIT_DEST_OFF to disable it. It breaks the functionality. This patch fixes this issue. Fixes: d8b90c4eabe9 ("i40e: take flow director flexible payload configuration") Reported-by: Michael Habibi Signed-off-by: Jingjing Wu --- 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 8aa41e5..efbcd18 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.4.0