From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10084.outbound.protection.outlook.com [40.107.1.84]) by dpdk.org (Postfix) with ESMTP id 671FE5A44 for ; Tue, 9 Oct 2018 09:38:00 +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=P036AS1V5sPzdonLB4846piHLxSQuT5GhH6TB9ftjhk=; b=SCfRgHg9YVu+eG4QZ+LcQD3q6YMNBH2piTalXpL1aGFCsWOHhpM9rwN727YFMYrIQ4a489m3AL7UKrzxdaux5If5pPjPOc+TOfPP6Ky7uQNcksIF7llFpnBH1HlRYE77+B843qpOJYytjm/RQsqK/M7QRTw67xbI4WaDeqKj5T0= Received: from AM4PR05MB3425.eurprd05.prod.outlook.com (10.171.187.142) by AM4PR05MB3492.eurprd05.prod.outlook.com (10.171.187.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.26; Tue, 9 Oct 2018 07:37:58 +0000 Received: from AM4PR05MB3425.eurprd05.prod.outlook.com ([fe80::fdeb:3890:f0f0:2202]) by AM4PR05MB3425.eurprd05.prod.outlook.com ([fe80::fdeb:3890:f0f0:2202%4]) with mapi id 15.20.1207.024; Tue, 9 Oct 2018 07:37:58 +0000 From: Ori Kam To: Yongseok Koh , Shahaf Shuler CC: "dev@dpdk.org" Thread-Topic: [PATCH 2/7] net/mlx5: use standard IP protocol numbers Thread-Index: AQHUXzEJR83Qll3tLU+We+/PYI6wx6UWcFdg Date: Tue, 9 Oct 2018 07:37:58 +0000 Message-ID: References: <20181008180150.39273-1-yskoh@mellanox.com> <20181008180150.39273-3-yskoh@mellanox.com> In-Reply-To: <20181008180150.39273-3-yskoh@mellanox.com> 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=orika@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM4PR05MB3492; 6:+WT7YZJm7lnzezlJ6K/1iymn9SmyTCzovHeWgF4LcJgemDGKjeYwqXxES9XRdDlz5Bf/TEpEEIVUsbCGgPAM+8lnrMbTeFfYbRamfKuEhfpLn2dysF071JNqkJjRq0E7rZfIBSBgo+Aj2tEOIT2lkf5aBqCQkYiUk0yYPCkU6htnDtoADKrFLoKmxGUHRCXoqdTGlfK0Zohe1wW7lqI9YHEbxUFmrbCB8rDt5tArc6RxptKir1KRSpp3GHiXZp5PPVAiJUnfDlrXkHokfLZM+RMHVSFQdYyx96e3q77F3k0nxYV7UhQekLR4u/vXWZwPvAdXD974k3JKSbIyaFEPFc5tRlSCaJRMAM42JQmlDyyBG6P9wCkXOpmI5lb+G3Ci8witi/ecjKnxlGYlxYIyJfFuRDb8p3egr7Eg83KWQLCZ9kMU/efbge2XjXA2oh/Oqo1+EughUNsPAw/B/Jkl9g==; 5:jZYzHwSilXaMoWCwo5IrxcM1NAybjOC9hB0ptgzIMIl4q9bYh7VJZ4xoRdlHphxcvheeewvNwqCc7Qhq2wHveOF4sXMkTzCZl9eb45nmcS4byw6PpPBLdnepeYI+jI9WCMJzOOl9mqIt2sQCOh7JfB1YO/iW4qFx+XO7d8ONgrA=; 7:fv1tPHtT7P+RjkXTp0VNYKeKSMcv/4cmoOWfRi3Gjed/lwO2wN2PRaigqPOBBAnTNUqH83EsxehhPQLZDZ10JTQJV47zmyLv7BlRZvE/gXIfE/bNdsrOnt4Fd472701fvwebpmt0TBwxSP35lUz44pXykpK/c3g8QJH6EWhTcToLPctzokfFEX2RFCYuKNtenp1vgtaaXXeKdhGpNWaYBpeIMpWaJC5ovwdXN4x5t2gMEbpMZKwwnGdwGc/AGokf x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 98d4ff90-9a0a-47dd-8eb3-08d62dba2286 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:AM4PR05MB3492; x-ms-traffictypediagnostic: AM4PR05MB3492: 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)(20161123562045)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051); SRVR:AM4PR05MB3492; BCL:0; PCL:0; RULEID:; SRVR:AM4PR05MB3492; x-forefront-prvs: 08200063E9 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(39860400002)(376002)(396003)(366004)(346002)(189003)(13464003)(199004)(2900100001)(9686003)(66066001)(68736007)(6436002)(6506007)(25786009)(2906002)(110136005)(86362001)(55016002)(99286004)(186003)(53936002)(478600001)(486006)(53546011)(6116002)(3846002)(316002)(256004)(14444005)(33656002)(8676002)(26005)(8936002)(106356001)(305945005)(6246003)(81166006)(81156014)(74316002)(14454004)(71200400001)(71190400001)(5250100002)(6636002)(5660300001)(105586002)(229853002)(4326008)(476003)(11346002)(446003)(7696005)(76176011)(7736002)(97736004)(102836004); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3492; H:AM4PR05MB3425.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: inhiaDd1BtQj9P600TmKYpdZ6dQJdd2Tk/bjeB1XRrhv4Y9+ukuRp6miaPtEhk1kNXLnOIge4AHrJOx0XIawbNxOHOXHwboS8PEBMv6eEiByEyhqQrp/kglq03D4xvFApkNa10aoMY8tKt5TiMt8/xPwGzZSaDsIumjskwlcu5ruRrCuiP/ZWv9+SIWU93Jl9nEsCiCV2QGpX/8I5apib2clTJ9ri7JKepj+ovm5y6gcs0jV61WrRlw99ytIcn0I0sjqFPkwNVl+HJoBMmM2lVhZoyqiIoFsEXzUFfzYnhB2sMy+XYSKeETwzol1Cwvroi1WSRNwKeO0fFlydYX4cJiu5S4EXEtnrDuAITMm8l0= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 98d4ff90-9a0a-47dd-8eb3-08d62dba2286 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Oct 2018 07:37:58.4820 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3492 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 07:38:00 -0000 Hi, PSB > -----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") I don't think this is a fix since there is no issue with the implementation= , you are just beautify the code. Otherwise Acked-by: Ori Kam > 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