From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00079.outbound.protection.outlook.com [40.107.0.79]) by dpdk.org (Postfix) with ESMTP id 19DA52E81 for ; Sun, 11 Nov 2018 12:34:04 +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=6nSH3cnvKXpX+uN9U7uyyAvyJskh5CstxdSZhCWZy5E=; b=tpvqBxnqta7EgPmHscingLywuiZRgTIgzRvJYzi9zDrSwTViJUIprO7uLFCq2sBnfzIGpIU7ZeCBouaTTlrXX/OwZYcZLAeg4H5xUyQ1GLyp92GztcJjmPPYIDc9wU6DyVNxuREocem82qckD7c8pOhS0/7uTJtdzXmFHehqU0M= Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) by DB3PR0502MB4091.eurprd05.prod.outlook.com (52.134.68.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.27; Sun, 11 Nov 2018 11:34:03 +0000 Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::58e7:97d8:f9c1:4323]) by DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::58e7:97d8:f9c1:4323%3]) with mapi id 15.20.1294.044; Sun, 11 Nov 2018 11:34:03 +0000 From: Yongseok Koh To: Slava Ovsiienko CC: Shahaf Shuler , "dev@dpdk.org" Thread-Topic: [PATCH] net/mlx5: fix VXLAN device rollback if rule apply fails Thread-Index: AQHUeNxr/qrlPQ8rzUGfD1HkAbs8KKVKcymA Date: Sun, 11 Nov 2018 11:34:03 +0000 Message-ID: <3C3703BE-E995-430B-AB08-C2D86C00CD32@mellanox.com> References: <1541844105-32135-1-git-send-email-viacheslavo@mellanox.com> In-Reply-To: <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: authentication-results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; x-originating-ip: [69.181.245.183] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB3PR0502MB4091; 6:3rJv8ER+UvxaWBf0oN4d60Y3w92HCROXtkwKeXqC4du7AYnW7CH4t2VwJjvDzRkqN3CJ0EhsJVAuoDlPRmSK473H0qd2uARDBygcLE4ZLQTGlm0a25rM4xvP3xsjtvSZYbxDYR4eyFj7jSVXWUO59RSAnhbfspQulPdOOJYRuAjW3dn8mBlupbXVv1Ff0GQKOVUYEaAg/RgWCgmqZcU3J/wb6uSIPvJ5Iv5dAH7F1EdgnQbuj9cJ+E5M+Paa95Pzy5j0UsQws58MS4zOk2m4r/ZB36QtKqzwkxCXx7vgrRpu0yy+ECuw+dEgjkhgqDuXYZT3yzB5PVG+g3xenHSVcU4xhGckHATayRm+eQ6g/3kl9n7zuzv4kSG6iv7g+CcWVbFDj43YZSchglV4WTOeeHAIMLMYVru19O0Vc/WJM5gHGQDWeC3/IBleJzyaljvlk8DbU4H3qRT92dIGx0Sngg==; 5:FpP74E9Q+JjO9oznffJc2oMWVY/5n2PEom034VFrsuc5GJZ83ZfuXRcLNjxRDRedhLK5RfavAq9m7iIq2KoX1HhSYzspK8FEPQAg6S/Cm51EwgYgShIBx5kWKCtG45PVRLR4HmJ67zYSV2DfB+OXppf7Dj4J6V80LpasKmw1uDY=; 7:bDEMtJEmpYhiN79fozel0EXqOnGF9ayV/pas3iIjfVIjBIXMVYGbzcJ0mWjmu2CV+v6qQ2K+a5U/4+D69BRMTzA1r+RE/LvpUHjBYjc0Lz/v3n5dEQ7Gn4iVEbNfrjvNTQ/fDXoycLbFECH1gS+qsw== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 0aa9f0f3-8d9a-473d-977e-08d647c994d9 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390040)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:DB3PR0502MB4091; x-ms-traffictypediagnostic: DB3PR0502MB4091: 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)(10201501046)(93006095)(93001095)(3002001)(3231402)(944501410)(52105112)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:DB3PR0502MB4091; BCL:0; PCL:0; RULEID:; SRVR:DB3PR0502MB4091; x-forefront-prvs: 08534B37A7 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(366004)(136003)(376002)(39860400002)(346002)(189003)(199004)(11346002)(2900100001)(8936002)(316002)(476003)(86362001)(2616005)(186003)(66066001)(7736002)(14454004)(446003)(99286004)(53546011)(5660300001)(6506007)(81156014)(81166006)(8676002)(102836004)(76176011)(305945005)(229853002)(26005)(36756003)(68736007)(2906002)(6636002)(105586002)(106356001)(33656002)(82746002)(25786009)(53936002)(4326008)(6512007)(6436002)(6862004)(71200400001)(6246003)(97736004)(71190400001)(6486002)(486006)(6116002)(83716004)(256004)(37006003)(3846002)(54906003)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB4091; 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: +AIF7zoWP+G5M4wZw6OMFo2sIXL5xcKhX7Y/lSDr+fmGCgk7hR1C9voBD/5yyfL6ku+Z3sUrtykuLwwNZbcA/g1S87KluTR5nuCAf1ryTWd5QnueZdpQjFYpVurtDlKS/stdWGJjhHhHPYnJcNahBW+d2buulnavxjP/qQQxWS6Y2MFehdKd8LH32Md0w3La55+YMDw7Zhbv4jC8WpDTFJu+tRzLNiMOiB7Q6hYBMYpluN+53Qu8lzDtYmgPrNK4J0NHZ5EC59Wk3QT1Y9WJ/QluRo9sg43zX/WR8CsXJkHeaJU3JaDt5XcxzpZjOioALzwgCNSjGkoNr4wfuvxyfAOmdfZFmC/EjyzfBnldTAU= 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: 0aa9f0f3-8d9a-473d-977e-08d647c994d9 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Nov 2018 11:34:03.0321 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0502MB4091 Subject: Re: [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: Sun, 11 Nov 2018 11:34:04 -0000 > On Nov 10, 2018, at 2:01 AM, Slava Ovsiienko w= rote: >=20 > 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. >=20 > Fixes: 95a464cecc21 ("net/mlx5: add E-switch VXLAN tunnel devices managem= ent") >=20 > Signed-off-by: Viacheslav Ovsiienko > --- Acked-by: Yongseok Koh =20 Thanks > drivers/net/mlx5/mlx5_flow_tcf.c | 7 +++++++ > 1 file changed, 7 insertions(+) >=20 > diff --git a/drivers/net/mlx5/mlx5_flow_tcf.c b/drivers/net/mlx5/mlx5_flo= w_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 >=20