From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70049.outbound.protection.outlook.com [40.107.7.49]) by dpdk.org (Postfix) with ESMTP id 34DAF1B415 for ; Mon, 8 Oct 2018 20:02:13 +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=6YqfpIWGCD+QigHzYxhAMBtuagyyUgZNU1lGuMmH91w=; b=p/zbkUjyG/ob5I8tZpe6DVBABoq4Yxasydn/PaeNTdGYSjLuIxKUimulPYQP1xonVznLPkjWyQsq8rIYQFhFz1Ksf+sPPx/0rXxJE1DQ2GVhsawE1jSfhk1MglZZWG9/r7mQR4/Uv6lpWV5I6BRkgCo9Dew/SPibkCIuhdNAQ+o= Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) by DB3PR0502MB3979.eurprd05.prod.outlook.com (52.134.67.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.26; Mon, 8 Oct 2018 18:02:11 +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; Mon, 8 Oct 2018 18:02:11 +0000 From: Yongseok Koh To: Shahaf Shuler CC: "dev@dpdk.org" , Yongseok Koh , Ori Kam Thread-Topic: [PATCH 2/7] net/mlx5: use standard IP protocol numbers Thread-Index: AQHUXzEJR83Qll3tLU+We+/PYI6wxw== Date: Mon, 8 Oct 2018 18:02:11 +0000 Message-ID: <20181008180150.39273-3-yskoh@mellanox.com> References: <20181008180150.39273-1-yskoh@mellanox.com> In-Reply-To: <20181008180150.39273-1-yskoh@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BYAPR02CA0016.namprd02.prod.outlook.com (2603:10b6:a02:ee::29) To DB3PR0502MB3980.eurprd05.prod.outlook.com (2603:10a6:8:10::27) authentication-results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [209.116.155.178] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB3PR0502MB3979; 6:QdkYVFZwrr6MRGZFSVMRZTg7vumV40ZiRSqLkmMCgvllr++bIaSeIdAKsa8+LXDSgy29ludEFJSs9iZqYbpx8YJYwuFh9zdvv+QgfV8ZdpDlxc1fYfKac0NnEEhAUD0iySl0mqqOV9Mpbr5Yt8CgcgfPUd+8VK9gkXVnXOGwK6jKGoqepyAqoHH6ihruddor4sFNBVRErv6P7lnMEiVzX1ds10zCWW0gWcJBPQKEA/2wmxmhd1VE0vH11HFpkyRawQKB+w9nBRoVA5BdZoFeoJe2qqPzbTRJjbH87IfmPCLtDNSaHvWxdZhRKTKhOxNTxJZNooOpDcOrFnHSPe/HEhh3FeicTvZpMvJmWhP9QyV0KSz7SbG8MopMUUhVZ2G00HEwKXbksH2AE533EGllaFyLlggqEsrurKlufIX9mgFMaU3vvM/eOOiXnRhJmVnDUUdO7T4Seq/o2h+R1xnaNw==; 5:xZZzmkdlkNCal0tgS6Bp7babRe+qSj5kR/yg7caRYiWKJDKpNyu2m0lZaJhE6sN0HERSyPXAZvIn5JmbWkC+7wXtLbDfUtCRo43oDDJohrE/cBWyvb6gTD5VTMWHYGZE15ECaGX8Q+qq/knp5Nu06/j0DJc1RG2WWTOCcMQf1dY=; 7:mK+8070kMduZG19qYyvcjOvvvgUxyWaGmus+JmyOS/D2+ywxQO2VfaeELrPVfMwCgjtaY2dQmoDN9evtLbn4dLDATZhe7OIpl/LamoYUbl/kf87OL4jTcPqTyoUhKV37YXhZ8tF9Gl5s9BO6mGcPjETuzvenYOXirOH9g4NGciHPGEAx3nXMMIgetXdaWQwU6/253qROrnNs/ABfIKztOrgUNzVhoVLSlmiP1hoJtfJFk+Tf6YIY9a+OAUmmm7h0 x-ms-office365-filtering-correlation-id: 70d7d19b-7a92-4e56-2d7e-08d62d482b87 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:DB3PR0502MB3979; x-ms-traffictypediagnostic: DB3PR0502MB3979: 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)(93006095)(93001095)(3002001)(10201501046)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123562045)(20161123560045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:DB3PR0502MB3979; BCL:0; PCL:0; RULEID:; SRVR:DB3PR0502MB3979; x-forefront-prvs: 081904387B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(376002)(136003)(39860400002)(396003)(366004)(189003)(199004)(8676002)(2616005)(11346002)(8936002)(476003)(66066001)(446003)(99286004)(14454004)(71200400001)(105586002)(71190400001)(54906003)(97736004)(316002)(2900100001)(305945005)(106356001)(486006)(186003)(26005)(68736007)(76176011)(81166006)(86362001)(52116002)(5250100002)(81156014)(25786009)(7736002)(36756003)(5660300001)(6116002)(1076002)(256004)(3846002)(14444005)(37006003)(4326008)(6862004)(6506007)(478600001)(386003)(102836004)(53936002)(6512007)(6436002)(6636002)(2906002)(107886003)(6486002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB3979; H:DB3PR0502MB3980.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: WWEGv1vzzY/aMJH3GWpnzTH+QUWqy1iBRJ/bQHgdxfvWQ2EbhTqUI5vY4kwezXbVPHoBHQz/Jg07D2/mcdnKi1l5G8H8z/tH+i60mwlvhAcyzn0lHtpfiCVU/I5FUMNNDpPl9chpUQluSmSAYJcGMYkN1WEO6mairTHLmStHYASTHLn1w/SSAqiO8VvY0kxTPHAjWFDk3G4VwxPy6mDZa/+cjfgz/KnLHRYAHm2h5iv4Zd71+KMJjyr79EEir0geq3Q5Q5Y62QPimRhOSiecyRguxDVyukdSpUT6iBzzL1ezO77qjslEEyvOZZWjEwuEsCRaCGyDd5XOLZUHTfV1+x4ZHzeuC7nnLyyz5Y6nEtw= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 70d7d19b-7a92-4e56-2d7e-08d62d482b87 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Oct 2018 18:02:11.6202 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0502MB3979 Subject: [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: Mon, 08 Oct 2018 18:02:13 -0000 Fixes: 0f8775dd8f1c ("net/mlx5: add support for multiple flow drivers") Cc: Ori Kam 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(-) 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_ite= m *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_UD= P) + 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_ite= m *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_TC= P) + 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_ite= m *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_GR= E) + 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_it= em *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_MP= LS) + 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_flo= w_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_i= tem *item __rte_unused, if (*item_flags & MLX5_FLOW_LAYER_OUTER_L3_IPV4) flow_verbs_item_gre_ip_protocol_update(verbs->attr, 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, --=20 2.11.0