From patchwork Wed Jan 22 14:37:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shiri Kuzin X-Patchwork-Id: 65047 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7BB47A0530; Wed, 22 Jan 2020 15:37:57 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5DF4D49E0; Wed, 22 Jan 2020 15:37:57 +0100 (CET) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70048.outbound.protection.outlook.com [40.107.7.48]) by dpdk.org (Postfix) with ESMTP id 3ECB12BBD; Wed, 22 Jan 2020 15:37:56 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H10lLwPiQ7jsBQDKVyHkn+jW7k2cuB1yopqapQA+GsHmf6J0pQGH0okgUn4tq0y5QSy3lodTevAaGCAmutBpBA7mHRjh/wikGTN0SCmMRmOXfaAxmQsOvOD0KeAe5aHrmwGQK/EXHE7gToMsEe0iy/yjdxDiFdIm0qxnvEKSsRL1ezvQDzlJKBCitSkKOR79gyW13QuHyMbWzVrGKt7KWhg9QSJfQfYhANqbBoWs+8JCYsWZJ2fme+3AbxRpS6dbZ5Qdpj3zRt5iKgfdERtNMSUnrVLaxCsZ/+JGlUVnQeR+SWBy+hSod37HjsRHKTTEAVdsEY9df7WXqlTkokrYBQ== 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=Kv65ByuczSHzcsUGoKtvOucyPv2aMUoqsNF3MOXbdkM=; b=GkK74NDy0RDtnKKo9c5ffnfg4Irp9Vdf4R1rgxiH/5KVO23xYPbxtmXKuMPhV0Fpnp1lMaIWvVGopZrq3lrQvGQENKBCtIpi2MSMlUjhPJf/OgURHv4A1qwIFOUPC3VotaymCG/sVms3Np7VXMYRAfJD7wNJdt/nEalPnWMcKselVVAwDO+vsvBRA9RuVtD5e+h7akDRNcBRNyVpYFypXzq86Pc9MvaGWx7Gs39WJnEAPIZ8d3QhckxH0H3T+KAkKpWn3TTHimlo+GIC+20Gm6w5OuutTK0Vt4yVT7aYx3m3Wk60gP48qJPFZr2yI4tYIHUrWN8p8yB/tXeRUHsamg== 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=Kv65ByuczSHzcsUGoKtvOucyPv2aMUoqsNF3MOXbdkM=; b=gOawTlx5NU09DVUreSY1inNU7KgCSw7JNPrWOEYngUbVEalgqXNoHXkoxaLZY2S4AtvBCXl1M3cH7wBZ8SJY2AyL5coYEf7DigBb2mBU4qJJCdX++urtptdECZQf0dQPHKXIpRHNKK9MaPTPHWHmzGHREmDmHJMsvje8lGN56vc= Received: from AM0PR0502MB3874.eurprd05.prod.outlook.com (52.133.45.29) by AM0PR0502MB3842.eurprd05.prod.outlook.com (52.133.49.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Wed, 22 Jan 2020 14:37:54 +0000 Received: from AM0PR0502MB3874.eurprd05.prod.outlook.com ([fe80::79eb:cec4:94e7:aa25]) by AM0PR0502MB3874.eurprd05.prod.outlook.com ([fe80::79eb:cec4:94e7:aa25%6]) with mapi id 15.20.2644.027; Wed, 22 Jan 2020 14:37:54 +0000 Received: from mellanox.com (94.188.199.18) by AM0PR06CA0103.eurprd06.prod.outlook.com (2603:10a6:208:fa::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20 via Frontend Transport; Wed, 22 Jan 2020 14:37:53 +0000 From: Shiri Kuzin To: "dev@dpdk.org" CC: Matan Azrad , Raslan Darawsheh , Ori Kam , Slava Ovsiienko , Dekel Peled , "stable@dpdk.org" Thread-Topic: [PATCH] net/mlx5: fix icmpv6 header rewrite actions Thread-Index: AQHV0TGIWrAQpJO8DUa52Jk7+RCuLw== Date: Wed, 22 Jan 2020 14:37:54 +0000 Message-ID: <20200122142527.257004-1-shirik@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR06CA0103.eurprd06.prod.outlook.com (2603:10a6:208:fa::44) To AM0PR0502MB3874.eurprd05.prod.outlook.com (2603:10a6:208:1a::29) authentication-results: spf=none (sender IP is ) smtp.mailfrom=shirik@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.18.1 x-originating-ip: [94.188.199.18] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 2f9835d3-d34e-4b8e-4ac2-08d79f48aa86 x-ms-traffictypediagnostic: AM0PR0502MB3842:|AM0PR0502MB3842: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-forefront-prvs: 029097202E x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(39860400002)(136003)(366004)(396003)(376002)(199004)(189003)(16526019)(478600001)(36756003)(450100002)(26005)(186003)(86362001)(5660300002)(4326008)(8676002)(956004)(2616005)(64756008)(6916009)(2906002)(66946007)(54906003)(8936002)(66446008)(66476007)(81156014)(81166006)(316002)(66556008)(1076003)(52116002)(71200400001)(7696005)(55016002)(8886007); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB3842; H:AM0PR0502MB3874.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: D5rMv2BVFCNed8AnrhbhqFEdFjBgzE+wAtIVH85caSveuwHhl8tHoDsZg4GT9jo5mIhmBABMq6xkEYpY7Hucxh0BRGGL/AQNEj0rALGLVqNdLkGjOhlNirbDRhDqXV8+izorVx58ySV/kDQAx4cmlGN//zbNzAg8QbTR6okiRVtSho0jabkkr6Fq0COO93X7m4n9iqIJGEzaahfCqoI0dblgd7MiNFA58Di9CBchLEzs40zH67kcAVWgV+Ecs+Tk2Ly2oBQ/gZLc1hgsMbQF7cNg4hMXsjDu6yAyM3ool7gigD4qZb3csEvt1hm8Fb2zZtc4A/B4zFUdmtLIR0gAPJKGklPUDQb5T5y13/lreNjPypNcRi1kCOQWyh00Gok2rLVLA4b/KIEuuovx6f45cKHuQV9CVhWDpDs9u8wN0poRNqhaTd50Ej8AjNKz1TgK MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2f9835d3-d34e-4b8e-4ac2-08d79f48aa86 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Jan 2020 14:37:54.5592 (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: VcVn7cz/DkMbLyrkQdt82AeB5KctErTpmEr/zQ8eMoVBJW16eRNcBVRKsPMwuTBWSsFvLgxp1eerasfMyIGL8A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3842 Subject: [dpdk-dev] [PATCH] net/mlx5: fix icmpv6 header rewrite actions 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" the ConnectX-5 HW cannot calculate the checksum for ICMPv6, therefore flows with pattern 'ipv6 proto is 58' with actions that change the header should be rejected. the actions that change the header in this type of flow are 'set_ipv6_src' and 'set_ipv6_dst'. Fixes: 4bb14c83df95 ("net/mlx5: support modify header using Direct Verbs") Cc: dekelp@mellanox.com Cc: stable@dpdk.org Signed-off-by: Shiri Kuzin Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow_dv.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 26dbaaf329..2475ff336e 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -4447,6 +4447,7 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, uint8_t next_protocol = 0xff; uint16_t ether_type = 0; int actions_n = 0; + uint8_t item_ipv6_proto = 0; const struct rte_flow_item *gre_item = NULL; struct rte_flow_item_tcp nic_tcp_mask = { .hdr = { @@ -4554,6 +4555,9 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, if (items->mask != NULL && ((const struct rte_flow_item_ipv6 *) items->mask)->hdr.proto) { + item_ipv6_proto = + ((const struct rte_flow_item_ipv6 *) + items->spec)->hdr.proto; next_protocol = ((const struct rte_flow_item_ipv6 *) items->spec)->hdr.proto; @@ -4926,6 +4930,12 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, error); if (ret < 0) return ret; + if (item_ipv6_proto == IPPROTO_ICMPV6) + return rte_flow_error_set(error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_ACTION, + actions, + "Can't change header " + "with ICMPv6 proto"); /* Count all modify-header actions as one action. */ if (!(action_flags & MLX5_FLOW_MODIFY_HDR_ACTIONS)) ++actions_n;