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 D5298A0C44; Wed, 12 May 2021 13:54:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 675B041109; Wed, 12 May 2021 13:54:30 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2074.outbound.protection.outlook.com [40.107.237.74]) by mails.dpdk.org (Postfix) with ESMTP id 483AC41106; Wed, 12 May 2021 13:54:29 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W+UWcu9LLoFmBeKMxtu0W0Za5MNBq14xoKvzDbsAEBXT/lY+Pir2+7GJ9i1A0T3clXyNE2tNLhE5P7PQgkM4zEyolGZIpd4AgWYw+TVqj16nZbvE/261eTD9pnF6bN//J1egjZMvFRzWKfBPM9JCdLU2gVjOcXkCjxag+4Quc2gwNOomeaRPqOxjhmgS+3o6KuD/IQCaIJeyRjCRJJ1LDgCUa1qamjH4LDQzx1jD31ZIeaKPXc1g47wWL4Up1QEUZwTyNA5s/+GqAoSswax2Qh07f0SByCAiwVBWIXW3vx9EV82UF5Z+nlKJUcEbz/5ym1mj4OxXdKw/7dMwwt5E4Q== 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=Tz83XCvqGvGR6AteGcFCTh6n2UadDS2sNqv7lQ6ZGnkqRStnYmi196R0FKGQ+CyZw52Izcj4JVVIGWIjYBmjxd7AU2RSfQpBwxStvWbxDp0oWzqKfXhXMTYbdkQkLrD0bhkZutb7/zzJ1m7kSIlekqCDFNw8PaYs5eOKJUF51MEh3Bdh3GAYAUWYJcknVXz2ITkY9JR6mUfzgTky6iVMTCN33M12xkhB9LjEtv72hVUtlYmDe6/03gjWmPbSPfbY5wSPYtV3EYWZsThW2a6WAt73jYIUvQ0vBWi+a0oXcYqZRWOSNECFHGUN1snaWGe07KGJzCCuouwL+TTO1f+sJg== 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=Ig7DYqbVpWlDVLGoEBXj0IMlv26JzE07a+pkjoXpghsZYVta3RP+Fz9uwQB26MIXZWiVPJSTdrOHsiMXxsSjUpQZqf+c0GVHYXOiJVKHySTWS8mSQDCvU4tmX85A5GMIjO3zhVDh2awAidYg84jJ2aB2MHSr05hE0P238XmV1rUVtkZoxsvXpsphTh2CbOau1z1byYORt+UYSGRbz/B6/VaFeEHinNWrx5F2KSTJiZ9IzL/A2GAVNUkVXp1T7BGhugZDxWAc8nTVXIu8GTN8sYgClN9EOsrgRcL0pG21x6C1KZ50SCk7sWjN2sM08/mthrvSMgFoGaS49mDjzHGYYA== Received: from BN6PR20CA0070.namprd20.prod.outlook.com (2603:10b6:404:151::32) by CH2PR12MB4181.namprd12.prod.outlook.com (2603:10b6:610:a8::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.26; Wed, 12 May 2021 11:54:27 +0000 Received: from BN8NAM11FT047.eop-nam11.prod.protection.outlook.com (2603:10b6:404:151:cafe::a1) by BN6PR20CA0070.outlook.office365.com (2603:10b6:404:151::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Wed, 12 May 2021 11:54:27 +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 BN8NAM11FT047.mail.protection.outlook.com (10.13.177.220) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4129.25 via Frontend Transport; Wed, 12 May 2021 11:54:27 +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; Wed, 12 May 2021 11:54:24 +0000 From: Jiawei Wang To: , , , , , Shahaf Shuler , Dekel Peled CC: , , Date: Wed, 12 May 2021 14:52:37 +0300 Message-ID: <20210512115239.12783-2-jiaweiw@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20210512115239.12783-1-jiaweiw@nvidia.com> References: <20210511042407.5742-1-jiaweiw@nvidia.com> <20210512115239.12783-1-jiaweiw@nvidia.com> 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: 1d25e723-c602-42ec-9ce6-08d9153cb1f4 X-MS-TrafficTypeDiagnostic: CH2PR12MB4181: 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: HsVDSY1PEZxDNJ6GYIdIqyxzvC+iVB5MKa/R3ipzaaAhRBn/UHllREcdEiamtkrQJ7LSHVj5tEmfGU4u2kKBkL6Rsamn7tZ2YXLrSoIH524GIPpYrRBlz24ipgQay4HODXZKDUv5oddx1z+IK+oLOKeaeK7mHFKZOwj22lkAPL9X3TihhIUExoM/vEqybDBaGqr2+tYvybG2AGMqiN8m7R7xQwot+89n2H0ZkaExiSgstWIhFKfL1+LjJvuV50No8jiR4ydbY+07eKV5zKp4Ny96tPj91iqA2H73Tyldr9cqvCjIaT6pyPzhM/ubAvFRjlEnGm5e+OpV2QjJSi1OmuulUHm3ZCpU8vz4er6kTcnqxNZxcQ10bxNzY7qJGPHRab9ZEtX3zzWMQMe/VcNhtyOXOfNirfiB3QdiUfatJZFp5GmY+HoYxz61h9N9/P2oDYJ4ACLWjWHWfoWlbmz1kJrOqneGcw5ZpBiAHTb35eF8Y21h4l8y4iWpc8vhi75q18+L94vdhazD6RFNu71jDOzX+jDDI2Z7qQYSfN1lWnv+IKGeOXAxSe870X6QvGdKgb88zj7h9JF4taPki+Vn9zuzmk6a0+eMrSTtGpdCX7Hc5LNMhqUZ3jx1S2xohmVF74SLu5Y24taw57jRU6k91w== 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)(136003)(376002)(396003)(39860400002)(36840700001)(46966006)(8676002)(86362001)(186003)(16526019)(426003)(82310400003)(7696005)(55016002)(478600001)(8936002)(316002)(36906005)(7636003)(110136005)(54906003)(336012)(36756003)(83380400001)(6636002)(6666004)(26005)(2906002)(36860700001)(70586007)(47076005)(6286002)(4326008)(5660300002)(70206006)(1076003)(356005)(82740400003)(2616005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2021 11:54:27.5566 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1d25e723-c602-42ec-9ce6-08d9153cb1f4 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: BN8NAM11FT047.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4181 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