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 C65E3A0A0C; Tue, 29 Jun 2021 09:00:17 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 51C4C40E01; Tue, 29 Jun 2021 09:00:17 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2075.outbound.protection.outlook.com [40.107.243.75]) by mails.dpdk.org (Postfix) with ESMTP id EB4DC4069F; Tue, 29 Jun 2021 09:00:15 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ef8onltYoMtyMVOL5B1sZUoDLa4WPU4XFnDMiTfrgP3N74Fe501Jv96Fihqn40Rj8ndeaxKL79GWOnScdl5K8/GT3Bf2escsKId8eskyKx7bvPv3MCSmcxM3pIeYfVbQqsLfZTFlgWcW7UbCMsdiNjdSAqyLShD5a1F3RNECcej/YW/Y28trzZlHIKJtKX5lm2Asi2ID3UaJ93uhV4+qN/moeS7gUofG/IxbkP4dawh+1XYGXA14waUYXcEoUnlE8cqV9yPbuETFvsE5/bvsDxRdjfaraakPzXwRNWzIuXtBp1GCgikVyMFuo+BLNItZGxbmGi1pHwvoQfriBA5fng== 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=tim/6pCzxFaF6Aj1oW9BQtkCPYPJla3zRDyF+voe0s0=; b=P4EhSdJ4P0C7LGhNy6m+TSA7w5VwqJP1iuKdyY1LuEy+YLb5h4LLv8L4orSsV03mt7NiH5TWYebXvI4tLJrKSclwwwtxZ3u6gEosxMbfLZSVn2SMykAapMlyuBB4qh1rJIvhAn1ziybeOWnSq5W7EhqWgEDo+ni8J1VV6bXjfKObObBg9V8i4gOuyrCSGpcN5yAE8Qm1EYFS/BxzzCiUclWRUxXnqSfZIHE7Bc1lr5mG0Cd1hUOLpUF2F1gZpKld/e0JQC1gMfnlzDR0qsNByRtan0qDBn6bgpqxtMGIXdmQePwuVT/ld6tYJ7Dgto8pRadFOgdBwVQA3hCFwbFzmA== 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=tim/6pCzxFaF6Aj1oW9BQtkCPYPJla3zRDyF+voe0s0=; b=EyQrynGamO2honJ5QssN3Q6tlprftfmRhycdr6Re7fysB7N+k+wtx+7pek4SI85L5pmocYc0NcaiuRvtP4o5HUzwPEKolQH8AGLOXwFUosP3WYhrf2HkeRbxLnFSdQs1JbasIKLa3h4jnmIvgdJX/DmCBEY/Cmp1luEqQBTvUir+EN3sc2sUFDmd2IlGt79lULYSAfdfqjGw6UqKTbKSkRvXi9r/GH9sOg4afYkwko312jNnaBGsKAYAx+kmrsZ0eJiQPZn7gh63K/2wBgCsefCpeFjsxTnTzNAbmnNZtk8K8FYnZ5Mgqe01GgtI34GgVJQHpBLCOFR0BbFoo0POmA== Received: from DM5PR13CA0024.namprd13.prod.outlook.com (2603:10b6:3:23::34) by CY4PR1201MB0261.namprd12.prod.outlook.com (2603:10b6:910:1c::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.20; Tue, 29 Jun 2021 07:00:14 +0000 Received: from DM6NAM11FT020.eop-nam11.prod.protection.outlook.com (2603:10b6:3:23:cafe::1a) by DM5PR13CA0024.outlook.office365.com (2603:10b6:3:23::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.12 via Frontend Transport; Tue, 29 Jun 2021 07:00:14 +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 DM6NAM11FT020.mail.protection.outlook.com (10.13.172.224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4264.18 via Frontend Transport; Tue, 29 Jun 2021 07:00:13 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 29 Jun 2021 07:00:07 +0000 From: Jiawei Wang To: , , , , Shahaf Shuler , Xueming Li CC: , , Date: Tue, 29 Jun 2021 09:59:53 +0300 Message-ID: <20210629065953.47924-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.187.5] 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: 81148747-6fb8-4747-d97e-08d93acb8b63 X-MS-TrafficTypeDiagnostic: CY4PR1201MB0261: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gkJawpCe8xyXObixfSW2lQxfGWnU7ct4XFIFfsRUt3PgZrvj6u9trjhwrpovb8B2H5ovQYm3l4nDvQ8NUEF+HNKw6TciovQRWcWO6BV2vnuVfiE8TSEp2eNijUp07/yNReViHYHXLUrEgxht1muV1Py1eg4VS0Gbj1y76q45hj7aKaqeySq/wy5Ta5sYHaPYmOoxkfK2x7yyQnqlVqqWrKoeAwIgaMgednCBZFqPnj6gwCJgP5qqLA/KoCHoudctM531+pfQZUWrWC0SSBo/UkEnvCBTvow9ipb5AjpUgqtQaC10w5KuRQPvivrkqJll2XY0DRtCFrUdO99IWYo1SeMb8T+WUGRmbszOaaSgSSuqlibQSNq9RpdeIXdZVXVGgGr3+2Et/y7or3GlpvJ+dN7E8POyFAaIqj24YXELToqqQVHRCl1SZlzRszH5Zc+cPMC0UlLLDkyxE3vHTIeDD/1rBS46gmMlje1cRCuQYUKc6xL4WHKJRPIvH81Eg/dTJkcXNJoIt7m+rflJZ5DHchdXk+V3o9AVDeYaUFX0pqprARQ24mOqtqOegGHeOi+GwD9Zcu5onrYsMGjEIWpPBlb4x7cM2IZf3OqhwqHMde+cPsnR0PYet41BmbIhptcvYIrJ7F0cwOfynuzVKgg30hGa+qarp6SxxqhgIOZXu/ATfESuZRlBHBSl6v3ebtf4rwyI8FrqIyZQhhnc+3AlvQ== 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)(376002)(396003)(136003)(39860400002)(346002)(36840700001)(46966006)(316002)(86362001)(70586007)(2906002)(47076005)(5660300002)(36756003)(26005)(83380400001)(426003)(82740400003)(70206006)(54906003)(478600001)(7636003)(186003)(336012)(36860700001)(6286002)(7696005)(82310400003)(16526019)(6636002)(1076003)(8676002)(8936002)(356005)(55016002)(4326008)(6666004)(110136005)(2616005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jun 2021 07:00:13.9745 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 81148747-6fb8-4747-d97e-08d93acb8b63 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: DM6NAM11FT020.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1201MB0261 Subject: [dpdk-dev] [PATCH] net/mlx5: fix the wrong representor ID checking for sample 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" The representor definition was introduced in the latest code. For non-representor port, like PF port, use the 0xffff instead of -1. This patch updates the representor id checking during splitting sample flow. Fixes: cb95feefdd03 ("net/mlx5: support sub-function representor") Cc: stable@dpdk.org Signed-off-by: Jiawei Wang Acked-by: Xueming Li --- drivers/net/mlx5/mlx5.h | 2 +- drivers/net/mlx5/mlx5_flow.c | 4 ++-- drivers/net/mlx5/mlx5_flow_dv.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index 32b2817bf2..1b2dc8f815 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -1331,7 +1331,7 @@ struct mlx5_priv { uint16_t vport_id; /* Associated VF vport index (if any). */ uint32_t vport_meta_tag; /* Used for vport index match ove VF LAG. */ uint32_t vport_meta_mask; /* Used for vport index field match mask. */ - int32_t representor_id; /* -1 if not a representor. */ + uint16_t representor_id; /* UINT16_MAX if not a representor. */ int32_t pf_bond; /* >=0, representor owner PF index in bonding. */ unsigned int if_index; /* Associated kernel network device index. */ /* RX/TX queues. */ diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index c5d4a95a8f..3b7c94d92f 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -5900,8 +5900,8 @@ flow_create_split_sample(struct rte_eth_dev *dev, RTE_FLOW_ERROR_TYPE_ACTION, NULL, "no memory to split " "sample flow"); - /* The representor_id is -1 for uplink. */ - fdb_tx = (attr->transfer && priv->representor_id != -1); + /* The representor_id is UINT16_MAX for uplink. */ + fdb_tx = (attr->transfer && priv->representor_id != UINT16_MAX); /* * When reg_c_preserve is set, metadata registers Cx preserve * their value even through packet duplication. diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index c5d4b01e57..929d006dd8 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -5524,7 +5524,7 @@ flow_dv_validate_action_sample(uint64_t *action_flags, "E-Switch must has a dest " "port for mirroring"); if (!priv->config.hca_attr.reg_c_preserve && - priv->representor_id != -1) + priv->representor_id != UINT16_MAX) *fdb_mirror_limit = 1; } /* Continue validation for Xcap actions.*/ -- 2.18.1