From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140082.outbound.protection.outlook.com [40.107.14.82]) by dpdk.org (Postfix) with ESMTP id 3DE30239 for ; Sat, 10 Nov 2018 11:02:00 +0100 (CET) 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=IYI9v714F9wKIW6/VVOmJEKeuNts5tus1EPz3/udcJE=; b=cgZW/DAUvwBVQVDhX1y/uhSazOCs2UGulF4W42eHMsJmHyAmnKJm5ux7Zyv56LB+uVzeipdIpKfh55m1LCoSqfZBORO3JC+QPfxoKJkEzUmFNaanfn/CAk8FvOZcfZaxVFSdRWOoaeZ4gOKU6QL1D+ZW/LQ4e7oHYG2WoIA80Ak= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (10.171.186.150) by AM4PR05MB3250.eurprd05.prod.outlook.com (10.171.186.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.21; Sat, 10 Nov 2018 10:01:59 +0000 Received: from AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::544b:a68d:e6a5:ba6e]) by AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::544b:a68d:e6a5:ba6e%2]) with mapi id 15.20.1294.039; Sat, 10 Nov 2018 10:01:59 +0000 From: Slava Ovsiienko To: Shahaf Shuler , Yongseok Koh CC: "dev@dpdk.org" , Slava Ovsiienko Thread-Topic: [PATCH] net/mlx5: fix VXLAN device rollback if rule apply fails Thread-Index: AQHUeNxr/qrlPQ8rzUGfD1HkAbs8KA== Date: Sat, 10 Nov 2018 10:01:59 +0000 Message-ID: <1541844105-32135-1-git-send-email-viacheslavo@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: LO2P265CA0472.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a2::28) To AM4PR05MB3265.eurprd05.prod.outlook.com (2603:10a6:205:4::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=viacheslavo@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [37.142.13.130] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM4PR05MB3250; 6:9oXZbS+tqTy1UImMG94498kMLUiY81CVInaoZG09DxAPdKhJ0xwSffjhUpZdfQvuku/NQK5L+luqOsf7vV4LQpGhfhZ1lYbkZIBT9uid+i7JNcD8XoEUqAs962vYw6HMTyrtzp8gXDJN75VEiRCaqS0oniEfDRwq6cvAorIL7p1CUnP2D3QpaEvWHMmSohLpYh1d89D4CybuujMKnBCy+lKHEDBXvQc3b3kSJ9AK6cCvlo7XWNxtHqpw23OQE+dZSoUtCCUcTh325mIztTK6T6sWeITd+2vKrCVMDWqt0jwrT4eGXHNtKWlj1quonmeaSwwm0Vl8sLcc3K9vTVblSFmHCxm180Bgeu3YensgjI914q/u56kj2PtHhsHCvaNkfRrFo8BklsyGdMBrT593fFCT8LdKJo2DQBkKRCx3ZBUip+K1me0X2JSeoP6XFQL+Zmp6YRaTYh2JjN+fRI9ONA==; 5:KmiR5FWtoisemvpTfrOL2NB7drlV8Tcc2pgC4qzpTVO2AtHrmiVuUuEX2KAEO3jYP1fBnMDomlx71zpeuPzWdi1EKDJGPRtP9L/EYy5SM3976+TiqFatQ06ezOAhdBQ4KuxUPg95ahDGeui1VZ2jDpgEzJVj8Tzzz5cOUwGOG/A=; 7:/vCwFDx2CsUQMMYkmIAX42S8SsQ5AvMlZNkvpAYpOJBm4euPE9t3xYuWovPbxfdEOt9x6OGckkoJcS7HoEGp5sWqZt8MKyPtTlitKnTSTKoQqsDIp8MFyMO/5mxCSvUuzgDctJAPTohcbmT+v+18XA== x-ms-office365-filtering-correlation-id: 3451fa73-4b7c-476d-e8ff-08d646f38de1 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390040)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM4PR05MB3250; x-ms-traffictypediagnostic: AM4PR05MB3250: 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)(3231382)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:AM4PR05MB3250; BCL:0; PCL:0; RULEID:; SRVR:AM4PR05MB3250; x-forefront-prvs: 0852EB6797 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(366004)(136003)(346002)(376002)(396003)(189003)(199004)(2900100001)(53936002)(8676002)(5660300001)(71190400001)(6636002)(256004)(26005)(86362001)(85306007)(71200400001)(8936002)(99286004)(107886003)(316002)(478600001)(68736007)(6486002)(6116002)(110136005)(25786009)(305945005)(4326008)(3846002)(2906002)(7736002)(1857600001)(2616005)(486006)(476003)(6436002)(105586002)(54906003)(186003)(106356001)(6512007)(81166006)(97736004)(14454004)(6506007)(386003)(66066001)(81156014)(52116002)(36756003)(102836004); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3250; H:AM4PR05MB3265.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: 5xPmXQd6a5696c0nhQ4w3TrpLAuTcxA08Xt2Qu1olDb5bhjQKn8fwdKOdNR8pmFEPQbdUedJq+VI6mN0APdzUnn9YukdSt1HgDj7egvuaLSdDkx0fvtR14UfZBkH8kuEAgI9nzBtgi/kzDKQLhs+vkcN3N+z5hSZLrQqFtEfL4qWTwYDtRrp6/PFElnRJdPqUlePbvi2uuVVsKK++OprE/hXiWfBF9dTea1Ex1UJrOTlq+G+y0/JbIcKj3unixTcODnJfDrd7kdeBMcWtmijZGuqhFbwp/vEPV+63kaMfTG9GOU++nHqN7Zi2VLAYr73VlXGSjMSPcfOQuhiAb1S1E5zvAk167BdkxjKST6JwSE= 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: 3451fa73-4b7c-476d-e8ff-08d646f38de1 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Nov 2018 10:01:59.3855 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3250 Subject: [dpdk-dev] [PATCH] net/mlx5: fix VXLAN device rollback if rule apply fails 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: Sat, 10 Nov 2018 10:02:00 -0000 If rule contains tunneling action (like VXLAN encapsulation) the VTEP (Virtual Tunneling EndPoint) device is preconfigured before appying the rule. If kernel returnsan error this VTEP configuration should be rolled back to the origin state. The patch adds the missing VTEP configuration restoration. Fixes: 95a464cecc21 ("net/mlx5: add E-switch VXLAN tunnel devices managemen= t") Signed-off-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow_tcf.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow_tcf.c b/drivers/net/mlx5/mlx5_flow_= tcf.c index 21eb99e..7dd3a64 100644 --- a/drivers/net/mlx5/mlx5_flow_tcf.c +++ b/drivers/net/mlx5/mlx5_flow_tcf.c @@ -5124,6 +5124,13 @@ struct tcf_nlcb_context { dev_flow->tcf.applied =3D 1; return 0; } + if (dev_flow->tcf.tunnel) { + /* Rollback the VTEP configuration if rule aplly failed. */ + assert(dev_flow->tcf.tunnel->vtep); + flow_tcf_vtep_release(ctx, dev_flow->tcf.tunnel->vtep, + dev_flow); + dev_flow->tcf.tunnel->vtep =3D NULL; + } return rte_flow_error_set(error, rte_errno, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, "netlink: failed to create TC flow rule"); --=20 1.8.3.1