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 6A2B5A0A0F; Mon, 5 Jul 2021 17:58:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 337314120E; Mon, 5 Jul 2021 17:58:31 +0200 (CEST) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2083.outbound.protection.outlook.com [40.107.212.83]) by mails.dpdk.org (Postfix) with ESMTP id 854C541201 for ; Mon, 5 Jul 2021 17:58:29 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vx01N0IxUiefiDEU/Pm8FKkGJfj5SxfthBpV7mmvCYTvvQGxlnHWuaYVPB1RJNiFfsPjYxMtujlHMXCOILwPP1SH25GsZQijif6FUsTQq6uXxfRV0JngmClbAv4o3+28r74D1PVsZ73dfJV4EdDIu9hlWZ9QIGqPlg5rtM+dULIcNayOtwnMRBXjgtoxlEHmEV7tdLL7LBRoVRLEpDoPkFR4hjFPwMEP7Lb5WhVscHCNB68Bmt8kExOp8bqR8aNOJOqsY/vEGWfvj8AyJ8NsLwCj0AjXb2PgyaXoIcmNICXMckcBhaZOnQLCGUJuyA1gTdoyJktfPW25zlMBLoVubQ== 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=LnBdt7/x2hmz2Rkr7MOV4QM9Y7SRRkFXZ3aEsk6QY4w=; b=lw7lRvwDpuRqNPKIarQ2OqgYp065isMbp8JzG2qgIEunCk8gYTffZaF8hC48sn0y09N+eF1AyhG2LlHBrMiw3263kmUj2UCGV5TYoKHZdBl9WIhoQ9LK6qRzTA0slWWMF9Gti+PUjYYGwJS1BkknfNqWhmGyqgfTars+w8b4ihoXbHgbMWn1FfvlwTaMY/9k/YQtJAO+dfCzaK1gUf7DtsZ3vlHuJ6YUnCAaU2wfQgaqUrukuRuz6nArCjvx/nS+eUcJYbiIo/TpPbvo86m/1ADfM0KU7+7buGuX/Su437OQJn1w4GXw8pzzbsmZhAbZqsSeykdSVuc3vL0BebgbAw== 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=LnBdt7/x2hmz2Rkr7MOV4QM9Y7SRRkFXZ3aEsk6QY4w=; b=YFy88fgXkwxUihvzAAKxnA2YVOJKXHguQQ19beIy72vkf5MQ856QjGlJcva/oRiIYvm2Tb+AK+nSgqisPDbVDpqH6wZ7q854kblYxT4GeUHKped8a3PHw2a8bDWq1i78hgrDwdp4WGCquXweqkIJs3iM+o6liHrLrABjJwRJCF+Y1sxzr1sihHvsslu4tLS4QtkRuBFI8Y9yeEIv17zLbJPIbYE+DEbAOb74W3yIdaoLwHaeFBY5p5+z04QRDvI4nYkdJt2t1AwDxtU/nAFjzbQc2kEtrsgp+pGrdmHMldhNAsPa1Kt1Tb69TRnRFii9PreZSXgZFyoJjf06NPq1lw== Received: from DM5PR13CA0072.namprd13.prod.outlook.com (2603:10b6:3:117::34) by MW2PR12MB2555.namprd12.prod.outlook.com (2603:10b6:907:b::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.23; Mon, 5 Jul 2021 15:58:26 +0000 Received: from DM6NAM11FT035.eop-nam11.prod.protection.outlook.com (2603:10b6:3:117:cafe::6a) by DM5PR13CA0072.outlook.office365.com (2603:10b6:3:117::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.7 via Frontend Transport; Mon, 5 Jul 2021 15:58:26 +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 DM6NAM11FT035.mail.protection.outlook.com (10.13.172.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4287.22 via Frontend Transport; Mon, 5 Jul 2021 15:58:26 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 5 Jul 2021 15:58:24 +0000 From: Bing Zhao To: , CC: , , Date: Mon, 5 Jul 2021 18:57:53 +0300 Message-ID: <20210705155756.21443-4-bingz@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210705155756.21443-1-bingz@nvidia.com> References: <20210705155756.21443-1-bingz@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f9cce250-b27e-46cc-be18-08d93fcdb988 X-MS-TrafficTypeDiagnostic: MW2PR12MB2555: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:446; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: V5B5gN0wLBjH5OA0erUV5dMKGsMDjwgznf/6RSxGDImO2jvqWDqNXEMJTmzkr3SfVjlA8sQljkmQO0aIMl24rLF514GebW76fjYqcx1ngg9GtBA2CmIumE77UeIIZ5VjaRYxrM7Cf949PKGJf0Zx+nuIN+MXeL9YyH0kiadWsEWVQpJ1BMa6+hjMGXI4MeaajFGxijMGb2et+hjYwQidHfJZjDHuIB1nT4qVe/ZfG6T14aSUqh7XLdw9I9tjEofrTGmMr1zmOFe8WZaJue1NT7IfnDNAzSj1VQ1cHFoEwVhsuSYDOftZldg5+u3piCrruyUqbrA/zEP0qhKyhhGeLJCAYjZAJrLHKnp5bSb8Ggpfm6X0aMYjXDFoldU8IrsZ83rNWpMZPGm01wuxC5ayCyoEYjuQIsKClx3iiLFTssJDb8Tv7s9bDXIUJtQC/Vd4m4KPGl2amwSQlaUoEjm1BEU5+mEQEaY3rNMb99qNKMrGsoloRFk5nGTcM3tzemvWgcoEAUVvV0Ddzup9V12vkjVaXOv7TInMBzvqUGzkp9bJnnDuzXXoESEC5u7tO1ZqIyzFFY0gHw2ZXIUG1em74l4Ic8/KDgbuIKTKGdkSVLQMisOryJONQiAkzlquzY7jylNHtJTZYc+bW+vfvmsiykrcD0BHRrQ4i2pO5x0OGXo13bi/sFiUMzx08FZGGbDeko1TVKWhiOfUhpQTW0oY2Q== 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)(136003)(346002)(376002)(39860400002)(396003)(36840700001)(46966006)(55016002)(7696005)(2616005)(426003)(4326008)(86362001)(54906003)(36906005)(6666004)(110136005)(186003)(356005)(26005)(16526019)(82310400003)(83380400001)(36860700001)(36756003)(8676002)(6636002)(5660300002)(336012)(2906002)(70586007)(70206006)(1076003)(47076005)(107886003)(478600001)(316002)(8936002)(6286002)(82740400003)(7636003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2021 15:58:26.2118 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f9cce250-b27e-46cc-be18-08d93fcdb988 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: DM6NAM11FT035.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR12MB2555 Subject: [dpdk-dev] [PATCH 3/6] net/mlx5: enable meter bucket overflow for yellow color 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" To support the meter policy for yellow action, the prerequisite is that the hardware needs to support the EBS and then the yellow color of packets can be marked for the further steering. In the current implementation EBS and overflow were ignored when creating a meter profile. With this commit, if EBS is set by the application, the generation of yellow color will be enabled in the hardware for flow rules steering of packets. Signed-off-by: Bing Zhao --- drivers/net/mlx5/mlx5_flow_aso.c | 3 +++ drivers/net/mlx5/mlx5_flow_meter.c | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_aso.c b/drivers/net/mlx5/mlx5_flow_aso.c index 64631ffc29..a8cb590b57 100644 --- a/drivers/net/mlx5/mlx5_flow_aso.c +++ b/drivers/net/mlx5/mlx5_flow_aso.c @@ -747,6 +747,9 @@ mlx5_aso_mtr_sq_enqueue_single(struct mlx5_aso_sq *sq, wqe->aso_dseg.mtrs[dseg_idx].v_bo_sc_bbog_mm = RTE_BE32((1 << ASO_DSEG_VALID_OFFSET) | (MLX5_FLOW_COLOR_GREEN << ASO_DSEG_SC_OFFSET)); + if (fm->profile->srtcm_prm.ebs_eir) + wqe->aso_dseg.mtrs[dseg_idx].v_bo_sc_bbog_mm |= + RTE_BE32(1 << ASO_DSEG_BO_OFFSET); sq->head++; sq->pi += 2;/* Each WQE contains 2 WQEBB's. */ rte_io_wmb(); diff --git a/drivers/net/mlx5/mlx5_flow_meter.c b/drivers/net/mlx5/mlx5_flow_meter.c index d313786eb3..68351db1ce 100644 --- a/drivers/net/mlx5/mlx5_flow_meter.c +++ b/drivers/net/mlx5/mlx5_flow_meter.c @@ -312,9 +312,9 @@ mlx5_flow_meter_param_fill(struct mlx5_flow_meter_profile *fmp, cbs_man = man; cbs_exp = exp; srtcm->cbs_cir = rte_cpu_to_be_32(cbs_exp << ASO_DSEG_CBS_EXP_OFFSET | - cbs_man << ASO_DSEG_CBS_MAN_OFFSET | - cir_exp << ASO_DSEG_CIR_EXP_OFFSET | - cir_man); + cbs_man << ASO_DSEG_CBS_MAN_OFFSET | + cir_exp << ASO_DSEG_CIR_EXP_OFFSET | + cir_man); mlx5_flow_meter_xbs_man_exp_calc(ebs, &man, &exp); /* Check if ebs mantissa is too large. */ if (exp > ASO_DSEG_EXP_MASK) @@ -325,7 +325,7 @@ mlx5_flow_meter_param_fill(struct mlx5_flow_meter_profile *fmp, ebs_man = man; ebs_exp = exp; srtcm->ebs_eir = rte_cpu_to_be_32(ebs_exp << ASO_DSEG_EBS_EXP_OFFSET | - ebs_man << ASO_DSEG_EBS_MAN_OFFSET); + ebs_man << ASO_DSEG_EBS_MAN_OFFSET); return 0; } @@ -414,7 +414,7 @@ mlx5_flow_meter_profile_add(struct rte_eth_dev *dev, return ret; /* Meter profile memory allocation. */ fmp = mlx5_malloc(MLX5_MEM_ZERO, sizeof(struct mlx5_flow_meter_profile), - RTE_CACHE_LINE_SIZE, SOCKET_ID_ANY); + RTE_CACHE_LINE_SIZE, SOCKET_ID_ANY); if (fmp == NULL) return -rte_mtr_error_set(error, ENOMEM, RTE_MTR_ERROR_TYPE_UNSPECIFIED, -- 2.27.0