From patchwork Fri Nov 9 07:56:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Lakkireddy X-Patchwork-Id: 47956 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 72A50568A; Fri, 9 Nov 2018 08:57:56 +0100 (CET) Received: from stargate.chelsio.com (stargate.chelsio.com [12.32.117.8]) by dpdk.org (Postfix) with ESMTP id 63C165689; Fri, 9 Nov 2018 08:57:55 +0100 (CET) Received: from localhost (scalar.blr.asicdesigners.com [10.193.185.94]) by stargate.chelsio.com (8.13.8/8.13.8) with ESMTP id wA97vp8t014832; Thu, 8 Nov 2018 23:57:52 -0800 From: Rahul Lakkireddy To: dev@dpdk.org Cc: indranil@chelsio.com, nirranjan@chelsio.com, stable@dpdk.org Date: Fri, 9 Nov 2018 13:26:27 +0530 Message-Id: <042dd76c10f5dab0f04fd63062f470cc60f704ae.1541747960.git.rahul.lakkireddy@chelsio.com> X-Mailer: git-send-email 2.5.3 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH 5/6] net/cxgbe: fix wrong ingress port value set in filter spec 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Set the "value" in the filter spec and not the "mask". Also, remove duplicate comparison for hardware supported match items already done earlier. Fixes: af44a577988b ("net/cxgbe: support to offload flows to HASH region") Cc: stable@dpdk.org Signed-off-by: Rahul Lakkireddy --- drivers/net/cxgbe/cxgbe_filter.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/net/cxgbe/cxgbe_filter.c b/drivers/net/cxgbe/cxgbe_filter.c index ef1102be3..3a7912e48 100644 --- a/drivers/net/cxgbe/cxgbe_filter.c +++ b/drivers/net/cxgbe/cxgbe_filter.c @@ -263,8 +263,8 @@ static u64 hash_filter_ntuple(const struct filter_entry *f) u64 ntuple = 0; u16 tcp_proto = IPPROTO_TCP; /* TCP Protocol Number */ - if (tp->port_shift >= 0) - ntuple |= (u64)f->fs.mask.iport << tp->port_shift; + if (tp->port_shift >= 0 && f->fs.mask.iport) + ntuple |= (u64)f->fs.val.iport << tp->port_shift; if (tp->protocol_shift >= 0) { if (!f->fs.val.proto) @@ -278,9 +278,6 @@ static u64 hash_filter_ntuple(const struct filter_entry *f) if (tp->macmatch_shift >= 0 && f->fs.mask.macidx) ntuple |= (u64)(f->fs.val.macidx) << tp->macmatch_shift; - if (ntuple != tp->hash_filter_mask) - return 0; - return ntuple; }