From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0080.outbound.protection.outlook.com [104.47.2.80]) by dpdk.org (Postfix) with ESMTP id B0EB2239 for ; Wed, 3 Oct 2018 04:58:44 +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=ZxpkblbTQvLzC/vZhxjfAtbVcPxMC94o5lISrVYsq/M=; b=oEZsMt86mdJyn2Yw5psVFkv3CAAsnHCBQ9eUo27pmD0anhJ9aO0DaymXGPSKkXMFvGQBAUZ6fGGjU8j27XrX0nz/0GcqIah+4bEmZVshKsaQ84Ddc8q50BZTcaFgaq3iLf4oLJgdyrMoed+hKC0XjgqlWsX+zHGTL8g5IN9Sc5g= Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) by DB3PR0502MB4060.eurprd05.prod.outlook.com (52.134.72.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1164.25; Wed, 3 Oct 2018 02:58:43 +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.1185.024; Wed, 3 Oct 2018 02:58:43 +0000 From: Yongseok Koh To: Dekel Peled CC: "dev@dpdk.org" , Shahaf Shuler , Ori Kam Thread-Topic: [PATCH 2/4] net/mlx5: add definitions for DV encap and decap Thread-Index: AQHUVnHZQK1cfDj3h0SqeZ4fUYau1KUM3Q4A Date: Wed, 3 Oct 2018 02:58:42 +0000 Message-ID: <20181003025829.GC10028@mtidpdk.mti.labs.mlnx> References: <1538059845-35896-1-git-send-email-dekelp@mellanox.com> <1538059845-35896-3-git-send-email-dekelp@mellanox.com> In-Reply-To: <1538059845-35896-3-git-send-email-dekelp@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BN6PR10CA0026.namprd10.prod.outlook.com (2603:10b6:404:109::12) 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; DB3PR0502MB4060; 6:Hv7w/8CzIW/dlJwOfHHA0LIPvmSLfK4vCMdlS6Fm03Nf43cNyIvqBi8Nfd37bWWkuuLPmQ4s6rLYyxPYb//ydEayGG3b2e84PXEAyoCYXgrwfrhPRxquCYcwBa2W9GLJYLVyTo5UKkBwPRmDrrDxKpZ1HmGZssZMMl/+O5rPgmWqvu4TBtdZvC4AqqVIANKSWK7KCQmVCXjpIIA5vnuua4p1XbikV9c7O0Kc3Ag47HMU2c/BvJ3i/qtcdjNFyQlW+xurTeMhS57DkBcWFlVCL9tVDMXLEx1nQ5Cl7n4UY5hcAOS/wjclEZs8VyU04nxM0OGllwqA0OC9YIP+B4nu8jZuPvcddU9H6622lOCsMqJ0HVCsgu4uRw8O3ImVCNjwbrJ55Omu8nlIU+WkZaxwg0KrmvrWeR6tNrO4mIOW27pcZ1QwAIH7IPxEWZ9HShXvrJuvn99bOQOjE+cdyxlmgw==; 5:OL9WiO7jPHc30Wquw3GR62Iuz14ShvSlQXyxObazrrMd+oD8hEcSIKIcZLiGPHJVVMT8E4BcE3zHn/GT8TEgI6jUweZL0L+mKq1QyHMwshBUfQJT+qa4cL01bogZh1AIEl+4ig51dCd74sAINB5MifYKCfA4bNIVbjqshrAaKb4=; 7:2SZftygQ7WJyQEvB7yadXisNPdFoYVChctig0IN5ZQW8IrGqCrQDchLXf+C+Yz+2Nqs7RerSCMjtbbG4PgZxVffAsEXyw5aDSXqZ31KjfnyJBbO8e7sw8rPL8+YwZYYjkQDsuetSbz5LatP/iMmR3vkhcT/wW78KxwmhO1KPbtRuWZBJE/qP6DmpDNXLKSoNZa/fOy02zVraNnGq7Hso4mIsLjzf3xH6oC0U2WKLRAA8BJqzBT21LBL9pv+CsTSn x-ms-office365-filtering-correlation-id: d9ec4478-c8f5-4e14-8605-08d628dc207f 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:DB3PR0502MB4060; x-ms-traffictypediagnostic: DB3PR0502MB4060: 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)(3002001)(93006095)(93001095)(3231355)(944501410)(52105095)(10201501046)(6055026)(149066)(150057)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123560045)(201708071742011)(7699051); SRVR:DB3PR0502MB4060; BCL:0; PCL:0; RULEID:; SRVR:DB3PR0502MB4060; x-forefront-prvs: 0814A2C7A3 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(396003)(366004)(376002)(346002)(136003)(199004)(189003)(105586002)(476003)(229853002)(6246003)(11346002)(2900100001)(99286004)(33656002)(33896004)(6636002)(186003)(6512007)(9686003)(71190400001)(575784001)(52116002)(6486002)(14454004)(68736007)(97736004)(6436002)(76176011)(53936002)(71200400001)(66066001)(446003)(256004)(1076002)(106356001)(316002)(3846002)(54906003)(102836004)(5250100002)(26005)(8676002)(8936002)(86362001)(478600001)(6506007)(305945005)(4326008)(2906002)(107886003)(25786009)(6862004)(7736002)(6116002)(81166006)(81156014)(5660300001)(486006)(386003); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB4060; 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: yWA9Jmrw0WWKyabZSTIn96o9T86f9d5db6Vj0Eb0Ky7UktPn4hEg6NuBe4N+MXO+UMU4oMmnEUVsObvWINeAhJvBJRUPbIr5T3CiXoIcPxfDZc9vmWnL0stjC+y+7lmP0ZkEBGlkigYgk5tKdUcNUI+vtsL6d7MenGgFfa5P8tN7UFn21Tp6dF24d/ks00/ByY+FYEA6knWk27NjaW9fneAXvX7QQzbeM20ggHZqbolwjw7ByDG76FPggsl9wOxpuFIDbBvr6PnWD2BZwJdzyGXK3iaEWwBYdKOJqW9C6xK7DdrPMYqy69j/8HyuBks4h0Nwj0WfXGj3TnQ++MpigPal6pgygjVpxlnMTNi6TPw= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: <6FC57F05B9E0CD45A24E97CB9675AECC@eurprd05.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: d9ec4478-c8f5-4e14-8605-08d628dc207f X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Oct 2018 02:58:42.8932 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0502MB4060 Subject: Re: [dpdk-dev] [PATCH 2/4] net/mlx5: add definitions for DV encap and decap 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: Wed, 03 Oct 2018 02:58:45 -0000 On Thu, Sep 27, 2018 at 05:50:43PM +0300, Dekel Peled wrote: > This patch add the required definitions for DV encap/decap actions. > It also adds usage of the new actions definition in validation > function of existing drop operation. >=20 > Signed-off-by: Dekel Peled > --- > drivers/net/mlx5/mlx5_flow.c | 10 ++++++++++ > drivers/net/mlx5/mlx5_flow.h | 7 +++++++ > 2 files changed, 17 insertions(+) >=20 > diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c > index 79a06df..fed0d29 100644 > --- a/drivers/net/mlx5/mlx5_flow.c > +++ b/drivers/net/mlx5/mlx5_flow.c > @@ -768,6 +768,16 @@ uint32_t mlx5_flow_adjust_priority(struct rte_eth_de= v *dev, int32_t priority, > RTE_FLOW_ERROR_TYPE_ACTION, NULL, > "can't have 2 fate actions in" > " same flow"); > + if (action_flags & (MLX5_ACTION_TUNNEL_DECAP | > + MLX5_ACTION_TUNNEL_DECAP_L3 | > + MLX5_ACTION_TUNNEL_ENCAP | > + MLX5_ACTION_TUNNEL_ENCAP_L3)) > + return rte_flow_error_set(error, > + ENOTSUP, Shouldn't it be EINVAL? > + RTE_FLOW_ERROR_TYPE_ACTION, > + NULL, > + "can't encap or decap and drop in" > + " same flow"); > if (attr->egress) > return rte_flow_error_set(error, ENOTSUP, > RTE_FLOW_ERROR_TYPE_ATTR_EGRESS, > diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h > index a353d07..4a4f923 100644 > --- a/drivers/net/mlx5/mlx5_flow.h > +++ b/drivers/net/mlx5/mlx5_flow.h > @@ -90,6 +90,10 @@ > #define MLX5_ACTION_OF_PUSH_VLAN (1u << 8) > #define MLX5_ACTION_OF_SET_VLAN_VID (1u << 9) > #define MLX5_ACTION_OF_SET_VLAN_PCP (1u << 10) > +#define MLX5_ACTION_TUNNEL_ENCAP (1u << 11) > +#define MLX5_ACTION_TUNNEL_DECAP (1u << 12) > +#define MLX5_ACTION_TUNNEL_ENCAP_L3 (1u << 13) > +#define MLX5_ACTION_TUNNEL_DECAP_L3 (1u << 14) Please rebase it on top of my multi-table patchset, which is PR #878 becaus= e it also adds new actions. > =20 > /* possible L3 layers protocols filtering. */ > #define MLX5_IP_PROTOCOL_TCP 6 > @@ -175,6 +179,9 @@ struct mlx5_flow_dv { > #ifdef HAVE_IBV_FLOW_DV_SUPPORT > struct mlx5dv_flow_action_attr actions[MLX5_DV_MAX_NUMBER_OF_ACTIONS]; > /**< Action list. */ > + No blank line. > + struct ibv_flow_action *encap_verb; /**< Verbs object of encap. */ > + struct ibv_flow_action *decap_verb; /**< Verbs object of decap. */ > #endif > int actions_n; /**< number of actions. */ > }; > --=20 > 1.8.3.1 >=20