Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1423913ybl; Thu, 22 Aug 2019 14:25:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqytPZua4SpVjcJsIcEbKOGctWhRNTacvkmmczJdwBOoCl9oR2XiRmLtOw6o+sAoGGZiOyCx X-Received: by 2002:a63:4c46:: with SMTP id m6mr1112021pgl.59.1566509150143; Thu, 22 Aug 2019 14:25:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566509150; cv=none; d=google.com; s=arc-20160816; b=eS2Chn0ASa/UBBciUWbkxOtdrNvxvRr3afthn8zLWOfMbd/cByDpxsGV5k3CJ5aAhH u0xpPPdPbj4GSO01cf093kQWV5h5gf93saYqWcYDh5rkZlXFtGJLl/xEJzkZQv9CNukk xpxpirLduXl7ATNHy7M3aDB9vwm6jj0mRcS7ZR1cOuqdY0w7yXyPM+8WGUsUb8DL2zrj Xi8ZgddZ2OvTarBaUc3+vFZnt6PScuDD4Vw0WOiwNaUWzp2v1MRS1qVjj+yKDOu7dhM7 ZOUgBxh8xhIcrmbBbI0n54zWTVkgfto9eUWGpGN25VnVqlqhd5qLXw50NcwGr9n/Skuj 4SqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JNtfHBYjyhofEd9IGXGCOgRHORIm3lCuhHrNTQo4mdY=; b=SNxn5j7YjiUBJk6UtZ4RrrxTY83essj6tWW9hBrbVORTrKga44V6/qRRIvNhlnU83C CIQvz2+uvk/lhsQTn/m1HzUzLFKRz+3y6Eau1UJeMSJkySMPvZDpe73qnm3ldiM2ZcmE Ylej7AqPuVpmYv54nTITFEjFuuLKgwQj0ZvofeTRICA3wo2p+2z4L+tNrtpAxZdch4Z8 GfMG47glspYES+MLSjjwkK0nU++sPZIHc8SVQzSnhTJecA7SDlX6WdDTuk3aJsp6VVBj nUnr7+6dGnSg9NB/TqQPB33tMjZTxUJYOxnSDQ8tLeW2jTWZJMz+Zkt4uc5MSMscnS44 IT/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TTdULU+4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id az8si559868plb.34.2019.08.22.14.25.34; Thu, 22 Aug 2019 14:25:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TTdULU+4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732628AbfHVRJi (ORCPT + 99 others); Thu, 22 Aug 2019 13:09:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:59656 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390738AbfHVRJV (ORCPT ); Thu, 22 Aug 2019 13:09:21 -0400 Received: from sasha-vm.mshome.net (wsip-184-188-36-2.sd.sd.cox.net [184.188.36.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E97C323427; Thu, 22 Aug 2019 17:09:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566493761; bh=qN5xMvra3JxVUtZYr+93qeFSSxlpJaZuuoRwvFoOs4Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TTdULU+4ya+3oAsxVkrBq3zgjnjjwCM3TXGXUk4Q+eR5857QHF1mdySyv3L6OF0Bd 6LrNXVlIHnvLrS3akD8mvdPaNLSlcEl6SC9tcmcKJ6L1X5ELwyxT+31MdFlDkcfHIJ auSbMv/ePF03ELzGFMKvjST7pkV/QTlHVt7vM5f0= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Somnath Kotur , Michael Chan , "David S . Miller" , Greg Kroah-Hartman Subject: [PATCH 5.2 124/135] bnxt_en: Fix to include flow direction in L2 key Date: Thu, 22 Aug 2019 13:08:00 -0400 Message-Id: <20190822170811.13303-125-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190822170811.13303-1-sashal@kernel.org> References: <20190822170811.13303-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.2.10-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.2.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.2.10-rc1 X-KernelTest-Deadline: 2019-08-24T17:07+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Somnath Kotur [ Upstream commit 9bf46566e80fd94845527d01ebd888eb49313551 ] FW expects the driver to provide unique flow reference handles for Tx or Rx flows. When a Tx flow and an Rx flow end up sharing a reference handle, flow offload does not seem to work. This could happen in the case of 2 flows having their L2 fields wildcarded but in different direction. Fix to incorporate the flow direction as part of the L2 key v2: Move the dir field to the end of the bnxt_tc_l2_key struct to fix the warning reported by kbuild test robot . There is existing code that initializes the structure using nested initializer and will warn with the new u8 field added to the beginning. The structure also packs nicer when this new u8 is added to the end of the structure [MChan]. Fixes: abd43a13525d ("bnxt_en: Support for 64-bit flow handle.") Signed-off-by: Somnath Kotur Signed-off-by: Michael Chan Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 4 ++-- drivers/net/ethernet/broadcom/bnxt/bnxt_tc.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c index a25ed190b5b2e..434470a6b9f3b 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c @@ -1236,7 +1236,7 @@ static int __bnxt_tc_del_flow(struct bnxt *bp, static void bnxt_tc_set_flow_dir(struct bnxt *bp, struct bnxt_tc_flow *flow, u16 src_fid) { - flow->dir = (bp->pf.fw_fid == src_fid) ? BNXT_DIR_RX : BNXT_DIR_TX; + flow->l2_key.dir = (bp->pf.fw_fid == src_fid) ? BNXT_DIR_RX : BNXT_DIR_TX; } static void bnxt_tc_set_src_fid(struct bnxt *bp, struct bnxt_tc_flow *flow, @@ -1405,7 +1405,7 @@ static void bnxt_fill_cfa_stats_req(struct bnxt *bp, * 2. 15th bit of flow_handle must specify the flow * direction (TX/RX). */ - if (flow_node->flow.dir == BNXT_DIR_RX) + if (flow_node->flow.l2_key.dir == BNXT_DIR_RX) handle = CFA_FLOW_INFO_REQ_FLOW_HANDLE_DIR_RX | CFA_FLOW_INFO_REQ_FLOW_HANDLE_MAX_MASK; else diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.h b/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.h index 8a0968967bc5e..8b0f1510bdc48 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.h +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.h @@ -23,6 +23,9 @@ struct bnxt_tc_l2_key { __be16 inner_vlan_tci; __be16 ether_type; u8 num_vlans; + u8 dir; +#define BNXT_DIR_RX 1 +#define BNXT_DIR_TX 0 }; struct bnxt_tc_l3_key { @@ -98,9 +101,6 @@ struct bnxt_tc_flow { /* flow applicable to pkts ingressing on this fid */ u16 src_fid; - u8 dir; -#define BNXT_DIR_RX 1 -#define BNXT_DIR_TX 0 struct bnxt_tc_l2_key l2_key; struct bnxt_tc_l2_key l2_mask; struct bnxt_tc_l3_key l3_key; -- 2.20.1