From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80055.outbound.protection.outlook.com [40.107.8.55]) by dpdk.org (Postfix) with ESMTP id 13B2D1B188 for ; Mon, 8 Oct 2018 22:47:01 +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=vekWigeHREBxl8vKxwUXoYIfBA11bji1ez4mndu+HBo=; b=UuCxJDz8tGxm9xgTBLHU7zpWBr1ts/UJvn0i5RUhKityL8q5M610iCv/28nNUEGouxSjwRrgtzqL4bpoXdRiciPHm5laE7rMtft+R6r6WQpN1DWBB9juazozzqPX6HM0JmzDzjQGeSWPiyUKFHUr0drFTeMSjljsNzE99gAmzQM= Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) by DB3PR0502MB4041.eurprd05.prod.outlook.com (52.134.66.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.18; Mon, 8 Oct 2018 20:46:59 +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 20:46:59 +0000 From: Yongseok Koh To: Dekel Peled CC: Shahaf Shuler , "dev@dpdk.org" , Ori Kam Thread-Topic: [PATCH v2 2/4] net/mlx5: add Direct Verbs encap and decap defs Thread-Index: AQHUXknVosKMQ1BFl0ysV8meVQl31KUV04EA Date: Mon, 8 Oct 2018 20:46:59 +0000 Message-ID: <20181008204651.GC7844@mtidpdk.mti.labs.mlnx> References: <1538059845-35896-1-git-send-email-dekelp@mellanox.com> <1538922308-9516-3-git-send-email-dekelp@mellanox.com> In-Reply-To: <1538922308-9516-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: DM5PR16CA0019.namprd16.prod.outlook.com (2603:10b6:3:c0::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; DB3PR0502MB4041; 6:3tPzlX62qVSU4o4/BuY8TcJoPWSqa9QCgt9yuojVJoXnxHH0zhp+t4yzg/cy2vwWJDjIdqVF/eDAWTWmKvwborw8QoVnc5FU3KeTozqkcxK5p9I5usXTMemyDB4Q9XiwoWqrKeDsAzr23HuCkCl0eOHCUsC2Bg1vq53WkvSvyfbXvUowLK+l96pJShksqdzAwi+9Yw1xJEUwUub2BUe4Un8XLHjJ+cb+pu+4tT/ctCOt87qaJvj4Y2AADzjOIpJcxGUGeq75gcsYURxVWXjtz/VWT7WSCSDvh15fbmNqY1L240uKBo0aw+sgV8TtCm83A7Anzv7XoqMWlSe1nLLFiwIGVpnc/8db4/rtNu7e7XEwdjR2H9ReYNknA8oPW+cKCLFI/g++bg5267sAMyAUUcwXnukv9ZZj5/Ctn/HLb7qfTiuWX2X9pxN2mFPJo0GBRxpZ7BPAIp2HJ34sLgWq2w==; 5:Vr5fIJo1YBbo3bpthMPu5GEhBvA2tjpEiBtM9Vn55dVwzwBO0Wf16J7r2IB8+zJOJRpSlCu6PdVWgOxvW08PSHNpy5Lb0bIqC37T9lyw4NxooaxUIqxKpDNdSpd0UCiYujEejiIwyRl5gEyT0S3LlcBWYfO6pPXT5jbd8aor+0I=; 7:J2iwLQhsUAE37C6bDJ6VPSufyAqAcXkYAIgruV/0A+213hP7/QWnZF3t1C8Gf2u3potgL3+y5FxVVn2Nqv6LT2+IoiojxcpvRHvcuDZdJ0uiN2XKS7AY1wxSnuvIw0enUXo/Ps7mfDaMQnYCT9vYXu0m7b51psKKzdANiU5AFv2kDNSSdas+PV/F7ynBL0YJV3mU517Z5rMuOodwg/iW8skE7Pf1fDJdw6K9eewCzL1g/RhuWD/9owKIXqGt/00C x-ms-office365-filtering-correlation-id: 36d57aee-4f5b-46e1-279c-08d62d5f310d 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:DB3PR0502MB4041; x-ms-traffictypediagnostic: DB3PR0502MB4041: 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)(5005006)(8121501046)(3231355)(944501410)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(149066)(150057)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(201708071742011)(7699051); SRVR:DB3PR0502MB4041; BCL:0; PCL:0; RULEID:; SRVR:DB3PR0502MB4041; x-forefront-prvs: 081904387B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(136003)(39860400002)(346002)(376002)(366004)(199004)(189003)(33656002)(105586002)(97736004)(76176011)(6506007)(386003)(6636002)(52116002)(7736002)(3846002)(305945005)(5660300001)(102836004)(54906003)(71190400001)(71200400001)(229853002)(316002)(2906002)(68736007)(33896004)(1076002)(99286004)(106356001)(6116002)(9686003)(25786009)(256004)(6246003)(476003)(11346002)(4326008)(446003)(6436002)(486006)(5250100002)(478600001)(8676002)(26005)(186003)(66066001)(107886003)(53936002)(14454004)(6486002)(6862004)(2900100001)(86362001)(8936002)(6512007)(81166006)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB4041; 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: Ibg0035Hhj2k1FjpcMmkVCh8Bocu8x6/SrcoYR7k/ll09150vJ3/u+Bjv3pIqQH5kqU5ZvSFNujRm5W6hg3ubCmUZ8LGbF73NWxV93C62J0ZRrOYFOcXOf4cCCyX650hr+ZmIB7aDPu027tRrGKyKxbmNmb+5MLkepeK9nncQbcc2zT7EhKEuJ457LqVajWCDbR8/T6e/kuvF2fVquTwvvXruNw8tSMkdqUcKhL5znGj9lHXr8dMZ64it2GIBXA50DPJa7oMClk7oJI1a+sdF4AwwXF5xqPyFBXQpdTXhN6R7mwKxIw5Uiz5uHLjMgmdcAGrNkVavmPpWxqMM6Knkj6wqmIs4/u28sgTnW53OEo= 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: 36d57aee-4f5b-46e1-279c-08d62d5f310d X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Oct 2018 20:46:59.1185 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0502MB4041 Subject: Re: [dpdk-dev] [PATCH v2 2/4] net/mlx5: add Direct Verbs encap and decap defs 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 20:47:01 -0000 On Sun, Oct 07, 2018 at 05:25:06PM +0300, Dekel Peled wrote: > This patch adds 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 > --- You may have to rebase it again as there are more patches adding new MLX5_FLOW_ACTION_*. Shahaf will orchestrate it. Acked-by: Yongseok Koh Thanks > drivers/net/mlx5/mlx5_flow.c | 8 ++++++++ > drivers/net/mlx5/mlx5_flow.h | 6 ++++++ > 2 files changed, 14 insertions(+) >=20 > diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c > index 1087f67..b452e11 100644 > --- a/drivers/net/mlx5/mlx5_flow.c > +++ b/drivers/net/mlx5/mlx5_flow.c > @@ -766,6 +766,14 @@ 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_FLOW_ACTION_TUNNEL_DECAP | > + MLX5_FLOW_ACTION_TUNNEL_DECAP_L3 | > + MLX5_FLOW_ACTION_TUNNEL_ENCAP | > + MLX5_FLOW_ACTION_TUNNEL_ENCAP_L3)) > + return rte_flow_error_set(error, 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, NULL, > diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h > index 690c597..01c73a2 100644 > --- a/drivers/net/mlx5/mlx5_flow.h > +++ b/drivers/net/mlx5/mlx5_flow.h > @@ -82,6 +82,10 @@ > #define MLX5_FLOW_ACTION_OF_SET_VLAN_VID (1u << 9) > #define MLX5_FLOW_ACTION_OF_SET_VLAN_PCP (1u << 10) > #define MLX5_FLOW_ACTION_JUMP (1u << 11) > +#define MLX5_FLOW_ACTION_TUNNEL_ENCAP (1u << 12) > +#define MLX5_FLOW_ACTION_TUNNEL_DECAP (1u << 13) > +#define MLX5_FLOW_ACTION_TUNNEL_ENCAP_L3 (1u << 14) > +#define MLX5_FLOW_ACTION_TUNNEL_DECAP_L3 (1u << 15) > =20 > #define MLX5_FLOW_FATE_ACTIONS \ > (MLX5_FLOW_ACTION_DROP | MLX5_FLOW_ACTION_QUEUE | MLX5_FLOW_ACTION_RSS) > @@ -172,6 +176,8 @@ struct mlx5_flow_dv { > #ifdef HAVE_IBV_FLOW_DV_SUPPORT > struct mlx5dv_flow_action_attr actions[MLX5_DV_MAX_NUMBER_OF_ACTIONS]; > /**< Action list. */ > + 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