From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50058.outbound.protection.outlook.com [40.107.5.58]) by dpdk.org (Postfix) with ESMTP id D646549E0 for ; Tue, 9 Oct 2018 10:02:03 +0200 (CEST) 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=NgrwdMe4709PJH3z9HajDQX/Bn/jEgjkdfiU9vFpBpg=; b=gTnpEjK1d+bFo1gKOD61oF3z8iHJJD0kUyJNNcSjhjG1c8qfWq/ADqn+rNUTufyTYVgJy1IypP8hiXmeCq2oBttIXZxbg3MqP+fsfhKNxQOZ9LBf5y7EcWueCwJIiSPbxA3cjeajARZUH7iKx+8LK/bCpwM6WncqzAjx1n28fCA= Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) by DB3PR0502MB4027.eurprd05.prod.outlook.com (52.134.72.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.21; Tue, 9 Oct 2018 08:02:02 +0000 Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::1cb0:661b:ecab:6045]) by DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::1cb0:661b:ecab:6045%2]) with mapi id 15.20.1207.024; Tue, 9 Oct 2018 08:02:02 +0000 From: Yongseok Koh To: Ori Kam CC: Shahaf Shuler , "dev@dpdk.org" Thread-Topic: [PATCH 2/7] net/mlx5: use standard IP protocol numbers Thread-Index: AQHUXzEJR83Qll3tLU+We+/PYI6wx6UWcFdggAAd9gA= Date: Tue, 9 Oct 2018 08:02:02 +0000 Message-ID: <4460123A-3FD5-4D2B-89D8-0869EEA4D1FB@mellanox.com> References: <20181008180150.39273-1-yskoh@mellanox.com> <20181008180150.39273-3-yskoh@mellanox.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; x-originating-ip: [69.181.245.183] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB3PR0502MB4027; 6:YLdlvXJLz9ushvT0ud5mhMZrOl3Ot4BNrMVlr01/1DCBRlbQ75l5WfsLD2+89RWQehbnr4/bdKn8pdKanUxtHk0gT0r8A0lB8UGMuVmnrgNU8RW0u7nJKb2+e3gpaX9C6PjPCu9ebNtdl00+diNf9cUDZCBvCFrYipSINxp+U7NUwzYHUZt+FsfZduhzds+mIxhfwLgXNGwoikQ3rajQ25V2m+Nf/vOO1JZQpgsw9z8pWFZsZQ9OZ3Dg4G9fNuqhe+HW55WC5/dnGlylfzJDaeaKXyzZpXVdgxFYYfv2EOY8G0TAe3IY+IwXaEowYQJeMi6WGuX2bXZekBgajWLUjBkMsrtCZP+pwwq5BEmHXNcUgczrx2pMLYOHYsX4CG2c7EuItVpzsChAC64Hf89OHf3TDb/IrvlrlVe/Fw97jdY6tEL38iW7+962BPaN2/CuHC3yfcNIxIwngWSAcQ2gpg==; 5:KQtXi4wd1l/kvJ8GCnqXzDdedkXEMVuM+ajzWszO3U/x2JjgaFXC/qBhSdAU8b54JfBntBNM34DHY5Cub109lEmLkuW12TEorD0tC0MdZLB0WUj4Yjy1KyB2r23joN/+qP22YEoXbTTx7l8L2hK5xWx5crk+01RQsXenDZD7LVA=; 7:caQeQeMJFZqnC9N5m3WH/QUvCugMfMfyu2KsNtf/2VaM5h99iX5qEHe/nyg92Y6dzpUr2Ps5JtGWl0R/7T4uU6NMvVlFoS0D6cYj5pEqVnlBaXsmNTHyr8n4Xt4jPh0tNjcU0/5LbNyvV2Wq+IVWGqHV6IVUP3k6Pt2DHPxQLcy2F1cFXFtd7KjCGmwEtPyMmuB44Um48sP1mm5lBKqUdbQim5vE8nmSUN3x0zL2wHEp/kWowG9QHMf81rF5uSb8 x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: e49e5ccb-0a31-4cc2-eef6-08d62dbd7f34 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB3PR0502MB4027; x-ms-traffictypediagnostic: DB3PR0502MB4027: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231355)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(6055026)(149066)(150057)(6041310)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(201708071742011)(7699051); SRVR:DB3PR0502MB4027; BCL:0; PCL:0; RULEID:; SRVR:DB3PR0502MB4027; x-forefront-prvs: 08200063E9 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(396003)(376002)(39860400002)(366004)(346002)(13464003)(199004)(189003)(446003)(68736007)(476003)(11346002)(186003)(26005)(2616005)(486006)(316002)(229853002)(6246003)(6512007)(5250100002)(53936002)(6486002)(6436002)(8936002)(256004)(8676002)(14444005)(53546011)(6506007)(76176011)(99286004)(14454004)(54906003)(2900100001)(97736004)(478600001)(81156014)(81166006)(82746002)(105586002)(33656002)(6862004)(4326008)(5660300001)(25786009)(7736002)(37006003)(71190400001)(71200400001)(106356001)(305945005)(83716004)(86362001)(6116002)(3846002)(6636002)(2906002)(102836004)(66066001)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB4027; H:DB3PR0502MB3980.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-microsoft-antispam-message-info: CIkakyDoIzouDqA7K0UT0DJ2ujESrxKzEHq/4KbFqAT0K/2JOpWdbQMnMKBkTBhM/XqcGtkMVCVOH8LyomyiUvo9L9DeTWqpzR+8EvzxtPnIWxsCLgp86BB41dXcZro+R13CxM67ZWbOtaGswprYbspbO/QiTZzfw3J89I6q9Xd+8j5IUJb4Il2A75zOF4HEEAbOw7Va6qdUPTLA9xzf2aTWXIdaz5F6145SOoskr9Bgy6hAAGkfjvdsnE+DDj7ZouqU+fXMXA8iM9WP9AfMeZIzqDOZCp4iELGLs/FZO1wwSe6PqBjNMWAFFqz7QbCKFYeSSTDv89NPG0QTH/AOPSJ/TkL7aoA2ouu6lQAULkI= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: e49e5ccb-0a31-4cc2-eef6-08d62dbd7f34 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Oct 2018 08:02:02.4307 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0502MB4027 Subject: Re: [dpdk-dev] [PATCH 2/7] net/mlx5: use standard IP protocol numbers 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: , X-List-Received-Date: Tue, 09 Oct 2018 08:02:04 -0000 > On Oct 9, 2018, at 12:37 AM, Ori Kam wrote: >=20 > Hi, > PSB >=20 >> -----Original Message----- >> From: Yongseok Koh >> Sent: Monday, October 8, 2018 9:02 PM >> To: Shahaf Shuler >> Cc: dev@dpdk.org; Yongseok Koh ; Ori Kam >> >> Subject: [PATCH 2/7] net/mlx5: use standard IP protocol numbers >>=20 >> Fixes: 0f8775dd8f1c ("net/mlx5: add support for multiple flow drivers") >=20 > I don't think this is a fix since there is no issue with the implementati= on, > you are just beautify the code. -#define MLX5_IP_PROTOCOL_MPLS 147 MPLS protocol number was wrong, it should be 137 Thanks, Yongseok > Otherwise > Acked-by: Ori Kam >=20 >> Cc: Ori Kam >>=20 >> Signed-off-by: Yongseok Koh >> --- >> drivers/net/mlx5/mlx5_flow.c | 9 +++++---- >> drivers/net/mlx5/mlx5_flow.h | 9 ++++----- >> drivers/net/mlx5/mlx5_flow_verbs.c | 7 ++++--- >> 3 files changed, 13 insertions(+), 12 deletions(-) >>=20 >> diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c >> index 8007bf10f..ef5e4684f 100644 >> --- a/drivers/net/mlx5/mlx5_flow.c >> +++ b/drivers/net/mlx5/mlx5_flow.c >> @@ -3,6 +3,7 @@ >> * Copyright 2016 Mellanox Technologies, Ltd >> */ >>=20 >> +#include >> #include >> #include >> #include >> @@ -1188,7 +1189,7 @@ mlx5_flow_validate_item_udp(const struct >> rte_flow_item *item, >> const int tunnel =3D !!(item_flags & MLX5_FLOW_LAYER_TUNNEL); >> int ret; >>=20 >> - if (target_protocol !=3D 0xff && target_protocol !=3D >> MLX5_IP_PROTOCOL_UDP) >> + if (target_protocol !=3D 0xff && target_protocol !=3D IPPROTO_UDP) >> return rte_flow_error_set(error, ENOTSUP, >> RTE_FLOW_ERROR_TYPE_ITEM, >> item, >> "protocol filtering not compatible" >> @@ -1239,7 +1240,7 @@ mlx5_flow_validate_item_tcp(const struct >> rte_flow_item *item, >> const int tunnel =3D !!(item_flags & MLX5_FLOW_LAYER_TUNNEL); >> int ret; >>=20 >> - if (target_protocol !=3D 0xff && target_protocol !=3D >> MLX5_IP_PROTOCOL_TCP) >> + if (target_protocol !=3D 0xff && target_protocol !=3D IPPROTO_TCP) >> return rte_flow_error_set(error, ENOTSUP, >> RTE_FLOW_ERROR_TYPE_ITEM, >> item, >> "protocol filtering not compatible" >> @@ -1459,7 +1460,7 @@ mlx5_flow_validate_item_gre(const struct >> rte_flow_item *item, >> const struct rte_flow_item_gre *mask =3D item->mask; >> int ret; >>=20 >> - if (target_protocol !=3D 0xff && target_protocol !=3D >> MLX5_IP_PROTOCOL_GRE) >> + if (target_protocol !=3D 0xff && target_protocol !=3D IPPROTO_GRE) >> return rte_flow_error_set(error, ENOTSUP, >> RTE_FLOW_ERROR_TYPE_ITEM, >> item, >> "protocol filtering not compatible" >> @@ -1516,7 +1517,7 @@ mlx5_flow_validate_item_mpls(const struct >> rte_flow_item *item __rte_unused, >> const struct rte_flow_item_mpls *mask =3D item->mask; >> int ret; >>=20 >> - if (target_protocol !=3D 0xff && target_protocol !=3D >> MLX5_IP_PROTOCOL_MPLS) >> + if (target_protocol !=3D 0xff && target_protocol !=3D IPPROTO_MPLS) >> return rte_flow_error_set(error, ENOTSUP, >> RTE_FLOW_ERROR_TYPE_ITEM, >> item, >> "protocol filtering not compatible" >> diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h >> index 79d4a2619..1ac871b3a 100644 >> --- a/drivers/net/mlx5/mlx5_flow.h >> +++ b/drivers/net/mlx5/mlx5_flow.h >> @@ -5,6 +5,7 @@ >> #ifndef RTE_PMD_MLX5_FLOW_H_ >> #define RTE_PMD_MLX5_FLOW_H_ >>=20 >> +#include >> #include >> #include >> #include >> @@ -78,11 +79,9 @@ >> #define MLX5_ACTION_OF_SET_VLAN_VID (1u << 9) >> #define MLX5_ACTION_OF_SET_VLAN_PCP (1u << 10) >>=20 >> -/* possible L3 layers protocols filtering. */ >> -#define MLX5_IP_PROTOCOL_TCP 6 >> -#define MLX5_IP_PROTOCOL_UDP 17 >> -#define MLX5_IP_PROTOCOL_GRE 47 >> -#define MLX5_IP_PROTOCOL_MPLS 147 >> +#ifndef IPPROTO_MPLS >> +#define IPPROTO_MPLS 137 >> +#endif >>=20 >> /* Internent Protocol versions. */ >> #define MLX5_VXLAN 4789 >> diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c >> b/drivers/net/mlx5/mlx5_flow_verbs.c >> index 05ab5fdad..076bb39e6 100644 >> --- a/drivers/net/mlx5/mlx5_flow_verbs.c >> +++ b/drivers/net/mlx5/mlx5_flow_verbs.c >> @@ -2,6 +2,7 @@ >> * Copyright 2018 Mellanox Technologies, Ltd >> */ >>=20 >> +#include >> #include >> #include >> #include >> @@ -683,11 +684,11 @@ flow_verbs_translate_item_gre(const struct >> rte_flow_item *item __rte_unused, >> if (*item_flags & MLX5_FLOW_LAYER_OUTER_L3_IPV4) >> flow_verbs_item_gre_ip_protocol_update(verbs->attr, >>=20 >> IBV_FLOW_SPEC_IPV4_EXT, >> - >> MLX5_IP_PROTOCOL_GRE); >> + IPPROTO_GRE); >> else >> flow_verbs_item_gre_ip_protocol_update(verbs->attr, >> IBV_FLOW_SPEC_IPV6, >> - >> MLX5_IP_PROTOCOL_GRE); >> + IPPROTO_GRE); >> flow_verbs_spec_add(dev_flow, &tunnel, size); >> verbs->attr->priority =3D MLX5_PRIORITY_MAP_L2; >> *item_flags |=3D MLX5_FLOW_LAYER_GRE; >> @@ -1091,7 +1092,7 @@ flow_verbs_validate(struct rte_eth_dev *dev, >> if (ret < 0) >> return ret; >> if (next_protocol !=3D 0xff && >> - next_protocol !=3D MLX5_IP_PROTOCOL_MPLS) >> + next_protocol !=3D IPPROTO_MPLS) >> return rte_flow_error_set >> (error, ENOTSUP, >> RTE_FLOW_ERROR_TYPE_ITEM, >> items, >> -- >> 2.11.0 >=20