From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E118BA00C5; Thu, 30 Apr 2020 10:31:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BD6701D9A5; Thu, 30 Apr 2020 10:31:24 +0200 (CEST) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140083.outbound.protection.outlook.com [40.107.14.83]) by dpdk.org (Postfix) with ESMTP id 45C621D9A3; Thu, 30 Apr 2020 10:31:23 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ldNpMrmCOh8JOEe+JRNYusz9GEyPhmhuUuCJxZirM0VzWk16ghd0uV1QUV0JovYx4zHtqbCB+rCtgWnba8SdL4x7J3syYT/4FRCqJpf3bH8ii55+hvTpjXzI027WyOdldAWmbPxzQC+c5Zr3BRxA5mEQt+MnJojcwOPI/I7lYt2Tm2SnNvwKqEBQzWM+gV2EnMi6F2YMfAigR+SklRR0+ufWJ61cnKbdVc+i+Mxpcl4Y0tYctzElFfL8LcgJOJ23ykjhnZ//Wxhwh/qJMkUtnpnW5hVy3MzJ/lX5gcsb28MVH5WZY854M9CLGHW63tvYJ7SLwsEUREmjvWge46QJVw== 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=kQF84w2AxSkwMKUa9i9dkhBPBupuCMf84hdQJIW+L9E=; b=hYw0lRs/XpaaTRidaQWz7WU00yQXMczV5cnGoBR1hXLts7dLdvMTzV3/LJ5Qz3VxwKuGTKY1QuWMwg8oA1ces2BDsUA8GWZ3yqVK+Ck6+Ic1lOwUNmDcPFLovWV1x3mDg/IBg2rh3QsQMoQaO3/e2oTHxuN08PkYEhPIBO7eUEpNIYdlMHh3UA6XcD9mMoU3qAuTldX56QEo++foilq62bBTwww2jBcZchT/SJ3rbsUb6IpDQYbiuBtnAJqpqXIYjcWJcp9MyprrkmuX3LjaRQ/IURka/Yf7/3/OPa0nBc61pHy6sw+m0sHQJqsbG5jORuoAPGxffCy3SyY7vAleKA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kQF84w2AxSkwMKUa9i9dkhBPBupuCMf84hdQJIW+L9E=; b=MBn+Vjj57dMPd+uJka4fAzSTWFznV0ZJnQrT6EX7TVagXAe4EpudXQuJIZqtFIju8KiXt1KgMsGJA0kq0xQ+ZlLbG4lAtmAVw3Ia4R4mL/QRZkUqSu12VivLWq+k19/A56kzI+lrTgzraIYeECO7txR2d+5PeFh0QSApjV/xtWM= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=mellanox.com; Received: from AM0PR05MB6610.eurprd05.prod.outlook.com (2603:10a6:208:12f::18) by AM0PR05MB6084.eurprd05.prod.outlook.com (2603:10a6:208:134::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19; Thu, 30 Apr 2020 08:31:10 +0000 Received: from AM0PR05MB6610.eurprd05.prod.outlook.com ([fe80::900:c0ac:78bd:18fc]) by AM0PR05MB6610.eurprd05.prod.outlook.com ([fe80::900:c0ac:78bd:18fc%6]) with mapi id 15.20.2937.028; Thu, 30 Apr 2020 08:31:09 +0000 From: Wisam Jaddo To: dev@dpdk.org, dekelp@mellanox.com, viacheslavo@mellanox.com, rasland@mellanox.com Cc: motih@mellanox.com, stable@dpdk.org Date: Thu, 30 Apr 2020 08:31:03 +0000 Message-Id: <20200430083103.10320-1-wisamm@mellanox.com> X-Mailer: git-send-email 2.17.1 Content-Type: text/plain X-ClientProxiedBy: PR0P264CA0169.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::13) To AM0PR05MB6610.eurprd05.prod.outlook.com (2603:10a6:208:12f::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mellanox.com (37.142.13.130) by PR0P264CA0169.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19 via Frontend Transport; Thu, 30 Apr 2020 08:31:08 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [37.142.13.130] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 17641d68-c6e1-454f-3c57-08d7ece0d593 X-MS-TrafficTypeDiagnostic: AM0PR05MB6084:|AM0PR05MB6084: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr,ExtFwd X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-Forefront-PRVS: 0389EDA07F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6AA4A/biGI2PzJkMAXosG3N4hfkwCEWu02nL5Hsw+mLQ4Y1rLHI22Scao3dVmPVbgrAg543uMOeHbhYFhjSQ4T3Ead63gm+RLOBYduhU5SHB0Q2QOl3AuNvF/fUh/K9Br0bu32rqfWZ7THd8QtJ/h2Dt0C+Yf8MScMx0sXp50LsfmpzFNZpTLlRfw5QluO4QxN2TbxFMd8R7PYZ6Lyn+IH5zh7EMT51/MBJQBaOyzKsaLZxntHG+CcxnFBVXXQIx2Udz2GQpGXKm4e2IgDzc9gk55GK7xiJKYZcbX7geM/pfx1SzNeVttRnKvuh8HwAIsf5HW0+Ds3XybYjOS+ZO9hrOOzSOebxyi8dKxutO9DpU7PJha73MB+swDV8NP9g8Ige10wl+AnrkLYW4j29npLfSxHxcUOaWjbuPvdfwYXPmxCBr/dsYus8Z/Djmg3ZS X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR05MB6610.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(66946007)(4326008)(450100002)(8936002)(6666004)(2906002)(55016002)(66476007)(66556008)(8676002)(5660300002)(498600001)(86362001)(956004)(26005)(16526019)(7696005)(8886007)(52116002)(1076003)(2616005)(186003)(6636002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 0yFwWsHYktQxGjcYbr5gJcSI79ScJ+tcNZyS4oF5oMz089iBfW9NOFs5fG7UUDPxGKNh11q5QfiDMmL/YlKx346ERZOUTg8bS8ViaKbg8UoDP5ZL0RyujHwuhguWbCJKXee9xkyoa7pBHHwqmbw8HAW80gKjKO1HHFTfOh3kTz2VtzPI89CUJGFyc4uaQx9YwnzE0JR6Xx0SjPxUN+YU9RH9m2K0ZRZlEwzs2Ac/Akx3pONC1bsrvA7w6EFabHCcmiHRA/34oq+leIUIM0WtjhUkxgn61SUm/SNNoZoffJ4WcX+saJkJ0JWjLK/vaDt2EaIepXNDrLWS5WM6v7Aym8IE0a0AMKcJxFLIyBsmLNUp0lzCvTIlWQ59DFDev2/9jg5EUiu6liT7fhiPNVmaR4sBdg6BDTooms6VsrvMlc/kb1fxvYOTrJf8LiFDTP4QlUUaTOuOy02kVXARo+8Rq/D0ZWJrz21umridssW6BHLpKZfSsStG0TTkbiO4UGI2mKItpAiiufUOj+i5hRYt1Bx3vrwmcTngBhLf2K5bf9tGApIhtRA2I8qlkLF7G2GNrtUu1fdZPm16opW9MAmcUM13KyVs+dM22RgbExDHpd2nXCnXkIWM+tcEPKTSmFBvdxtUa/O43N1XG10sCzDXxgciUNL8sG0PetMDAljxPU701AWUP5QjZQBbbzXNjHbRaDK6RpNdXMxHlRO7Q96A3OMX4c8RicJ6ZQPWZDDBZwNRlE0P6F17a1FJFW5/0Ajx7cLHbt5n6zAtjgI6trKZJmJbkD9xYGQhydH6vP0kiro= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 17641d68-c6e1-454f-3c57-08d7ece0d593 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2020 08:31:09.8358 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: gOGNnlDl4VO2XSpcs0LT0pNGQhPGMQKHjFBHw8qD5RxfmSa7c6NdqCa5K0vOkkzpjeMOFWDpot5AdRVHNe8cjg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB6084 Subject: [dpdk-dev] [PATCH] net/mlx5: fix set VLAN vid size check X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" All comparison should be done in CPU endianness, otherwise it will not give right results. for example: 255 after converting into RTE_BE16 will be biger than 4096 after converting into RTE_BE16. Fixes: a5f2da0b816b ("net/mlx5: support modify VLAN ID on new VLAN header") Cc: motih@mellanox.com Cc: stable@dpdk.org backport Signed-off-by: Wisam Jaddo --- drivers/net/mlx5/mlx5_flow_dv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 6263ecc731..2b88e85248 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -1965,7 +1965,7 @@ flow_dv_validate_action_set_vlan_vid(uint64_t item_flags, const struct rte_flow_action *action = actions; const struct rte_flow_action_of_set_vlan_vid *conf = action->conf; - if (conf->vlan_vid > RTE_BE16(0xFFE)) + if (rte_be_to_cpu_16(conf->vlan_vid) > 0xFFE) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, action, "VLAN VID value is too big"); -- 2.17.1