From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4213CA0A0E; Tue, 11 May 2021 06:24:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9B3FB4003E; Tue, 11 May 2021 06:24:26 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2043.outbound.protection.outlook.com [40.107.94.43]) by mails.dpdk.org (Postfix) with ESMTP id 462DC4003C; Tue, 11 May 2021 06:24:25 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JiZNHaoYnIr1gErVUaD9WTnTd2eszhkry0kMcLm75DGF2vKJdSPUrVfihPF/+s4XtIr67O7qgKJ4jcJWPe/gMBBcl8R3s81suKD+taydJYj1XndRA1E2x7aaN8YetKx63FhZQ4hsl0T+YGRei5lmGPwoOFV58URoHkYuB8v+4aG3gxqzpklk0jtwJcJNswR2TgMZpooTBix6LOA+n3U4p6ss647trqItA+rtH3+TVlnamC/t1bdOzrrDdWibIKIuXuvJ0TTdGnvc8cPgc71YxtsW7y9BeGS1z75tN2xV1PfnQqWG/8f/6jBwUy/2yvXIF45kVChPLhMd2DPYGRLGiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JDWC0FA0FU6UQq9GoJSq/ZHGZpX4h+eHehZa83SidI0=; b=VWvzg3qps+afR+HXq7DsRaDH45iALswQS8muJTEHw1OIrnCCmNfXxkvl2vQ8lCpqzYAMfYMjs9r3CaDEkpEpqjVBo22dZyG4eH1BD8fMgSnNFRlFhxytqrxOpk5pVdJyTVvz28Al2n7i2aKzvKoqOoWAH8Rv/4X1Eg+TbkDAwTAgAIwnmzwOM3F7HPnEEmpkE7GVlHO3yBBiFOPtqOjAZOaXmEVGByVb40Rm5p/XWv9kGaS/SMd9w/Qu77/u4leUvuAK0hej852ZJUpOuui3LVRIAD0t5Pazjldfmro1S9fROtE83niV4fRuaFPBqUekXJvor/H97n0rr8ghpXbxdQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JDWC0FA0FU6UQq9GoJSq/ZHGZpX4h+eHehZa83SidI0=; b=qcPLi18a3ic1uuY+EEtaEjixgCzCGsJpzECs8azzrvEnttP+XZpKnNTXgDW04iKJEzVeKCJx/cCFFVSerFVZip4u5sa1/wNeIXL+uYk0/bhqwguaD3adK/Zh5SYCzQ89lwefRm9iH5x1ZrETuJQWeTIby3TeHhbmmjSy6OvDpowQNE0L3divCSWfwTY6Xcr0NNk1TLLWovHc936VIXyAbn2R5r7JOLfbBH4k6t+hKRSZ3UcdBkzkj/iT2GOHkmuEpHl0O9OT1p1fgbGnAv8/nSjnxSbv0j3mLvsss4dyyhVamtXepD7TC5FBkAp6SjTEGA4zEgRoPlQvRgkMkgIJbQ== Received: from DM6PR14CA0045.namprd14.prod.outlook.com (2603:10b6:5:18f::22) by DM5PR12MB1547.namprd12.prod.outlook.com (2603:10b6:4:c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25; Tue, 11 May 2021 04:24:23 +0000 Received: from DM6NAM11FT036.eop-nam11.prod.protection.outlook.com (2603:10b6:5:18f:cafe::52) by DM6PR14CA0045.outlook.office365.com (2603:10b6:5:18f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.24 via Frontend Transport; Tue, 11 May 2021 04:24:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT036.mail.protection.outlook.com (10.13.172.64) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4108.25 via Frontend Transport; Tue, 11 May 2021 04:24:23 +0000 Received: from nvidia.com (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 11 May 2021 04:24:21 +0000 From: Jiawei Wang To: , , , , Shahaf Shuler , Dekel Peled CC: , , Date: Tue, 11 May 2021 07:24:06 +0300 Message-ID: <20210511042407.5742-1-jiaweiw@nvidia.com> X-Mailer: git-send-email 2.18.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b2e2da91-1abf-484f-920e-08d91434a7f8 X-MS-TrafficTypeDiagnostic: DM5PR12MB1547: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: g9KDQPivlKtz0UrcsR+GalxhReALP//Si+LwE+PP35wDvGeGTpfBcCEZL4qiGlJWMP6nGUpy/h3ddFybSE2W3FJ3Yd3UmDcRohEb1lVI1qG7odB10EjdA99UCGg0U9IuLU4nXRbMCLs2rJBbvmN8Vb6+pjqSVenTGQD4kM5Vj/nwM6aa65Rx3JZ8ABDGAd6q9CNyloFotjhwbQrmmtTn8ESdZaj97M+IQefvMoGCdMK/A/xkidNw/IwwyRLGdDOE41F38Cktx91JIzI1sGt3jQjkHwS2O/za/REy0/s/oPzmvKriGzWdsfqxZ1P0LuTzHDtks+L6hTyqDqb1mfN3AMTQiqInUC+7BokfW5gPWBjHz5rE9oAOzk+5DLQqjT/Accvd4GHlv+M3mkHxp1BJj/SOhBfd2yR9Oxn8HRnQJrEUsXjZIwjaamsjkr1/hVCor6BKut9Mh1Gvq/fN1qtRLJXyktQfrXCS+ZGD3JagcySqgKbMFwYcEjzawTRjNGnm449VkVZxKassgSoaZ4rtczsSf7iQb6CDdry65M0fz4Y3RLpKQ5yo+fcHKo2Py68k6h7OnnZknBy4yfAfBLa4HO0qqZpRS4NtM9Cn8xpbpknhXW9D8wCWyFUNg1WUGveXSbGsg6k7WibLkbztdc1gSQ== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(346002)(396003)(39860400002)(136003)(376002)(46966006)(36840700001)(55016002)(336012)(6286002)(26005)(478600001)(36756003)(2616005)(36906005)(5660300002)(8936002)(7696005)(426003)(86362001)(8676002)(70586007)(6636002)(70206006)(316002)(186003)(82740400003)(47076005)(7636003)(54906003)(36860700001)(4326008)(82310400003)(2906002)(1076003)(110136005)(83380400001)(6666004)(16526019)(356005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2021 04:24:23.7486 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b2e2da91-1abf-484f-920e-08d91434a7f8 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT036.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1547 Subject: [dpdk-dev] [PATCH 1/2] net/mlx5: fix the checking for age action X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" Current the ASO age action was supported in the non-root table, and the counter based age action was be used in the root table. The FDB table skips group 0 on MLX5 PMD by adding implicit rule that jump to non-root table, but PMD code use the original group value for checking. This patch uses the actual group value for age action checking, Fixes: f9bc5274a6f9 ("net/mlx5: allow age modes combination") Cc: stable@dpdk.org Signed-off-by: Jiawei Wang --- drivers/net/mlx5/mlx5_flow_dv.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 70e8d0b113..8eddd850f2 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -12252,12 +12252,16 @@ flow_dv_translate(struct rte_eth_dev *dev, MLX5_FLOW_FATE_QUEUE; break; case MLX5_RTE_FLOW_ACTION_TYPE_AGE: - flow->age = (uint32_t)(uintptr_t)(action->conf); - age_act = flow_aso_age_get_by_idx(dev, flow->age); - __atomic_fetch_add(&age_act->refcnt, 1, - __ATOMIC_RELAXED); - age_act_pos = actions_n++; - action_flags |= MLX5_FLOW_ACTION_AGE; + if (priv->sh->flow_hit_aso_en && (attr->group || + attr->transfer)) { + flow->age = (uint32_t)(uintptr_t)(action->conf); + age_act = flow_aso_age_get_by_idx(dev, + flow->age); + __atomic_fetch_add(&age_act->refcnt, 1, + __ATOMIC_RELAXED); + age_act_pos = actions_n++; + action_flags |= MLX5_FLOW_ACTION_AGE; + } break; case RTE_FLOW_ACTION_TYPE_AGE: non_shared_age = action->conf; @@ -12615,7 +12619,7 @@ flow_dv_translate(struct rte_eth_dev *dev, if ((non_shared_age && count && !count->shared) || !(priv->sh->flow_hit_aso_en && - attr->group)) { + dev_flow->dv.group)) { /* Creates age by counters. */ cnt_act = flow_dv_prepare_counter (dev, dev_flow, @@ -12628,7 +12632,9 @@ flow_dv_translate(struct rte_eth_dev *dev, cnt_act->action; break; } - if (!flow->age && non_shared_age) { + if (!flow->age && non_shared_age && + priv->sh->flow_hit_aso_en && + dev_flow->dv.group) { flow->age = flow_dv_translate_create_aso_age (dev, @@ -12641,6 +12647,8 @@ flow_dv_translate(struct rte_eth_dev *dev, NULL, "can't create ASO age action"); } + if (!flow->age) + return -rte_errno; age_act = flow_aso_age_get_by_idx(dev, flow->age); dev_flow->dv.actions[age_act_pos] = -- 2.18.1