From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20046.outbound.protection.outlook.com [40.107.2.46]) by dpdk.org (Postfix) with ESMTP id 9465A1B018; Wed, 13 Dec 2017 15:29:49 +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; bh=lxkUoyZKa7VAfzrEaxWytEc8VoMBP7Fvksjwc0sOVOc=; b=jwb2dPft/AiM/VTBaBZhxzj54dX9jWNT1neqgcm6cOv/JxYnPW7+oVeLK0wvOKZ1Tl5xh4Z8pTfk1hvsvBUwEAoFdQfNjodNiJu44keTfIWeLBX141PKv0q/9ZtfyVIWtUMaqO+hQAawMpguLibwpHe4xgmhbJv20mK0KritLKU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; Received: from mellanox.com (37.142.13.130) by AM0PR0502MB3649.eurprd05.prod.outlook.com (2603:10a6:208:1d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Wed, 13 Dec 2017 14:29:47 +0000 From: Matan Azrad To: Adrien Mazarguil , Thomas Monjalon , Gaetan Rivet Cc: dev@dpdk.org, stable@dpdk.org Date: Wed, 13 Dec 2017 14:29:30 +0000 Message-Id: <1513175370-16583-5-git-send-email-matan@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1513175370-16583-1-git-send-email-matan@mellanox.com> References: <1509637324-13525-1-git-send-email-matan@mellanox.com> <1513175370-16583-1-git-send-email-matan@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: DB6PR0301CA0049.eurprd03.prod.outlook.com (2603:10a6:4:54::17) To AM0PR0502MB3649.eurprd05.prod.outlook.com (2603:10a6:208:1d::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9723242f-4d29-4210-03be-08d54235f6a9 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(48565401081)(2017052603307); SRVR:AM0PR0502MB3649; X-Microsoft-Exchange-Diagnostics: 1; AM0PR0502MB3649; 3:QwwYBIONBAlSd5DPJQY+M4HVXGUSsEXHtUU0E36R/MCoxtk2RQkeZSUr5ahvVI7eFNaAAdoiRj5HBkXi47XZtR97cW0kCIlQLZsVg9wEffIj9BDPWGRiT8Qm5YoTQVhExhKvusuFCVEDboO9imFIrpSw/edQZ3rEc8EPqMfmNzeCBnVlbPSkZ0YrrZRUCCMBFmvCexcL4kME+pbcmDLH0NpHMBbQ5BOPvdt5JML0TvZftkOEH7fh9RL+UCaMHE4f; 25:4jONVIUZXxuebXfwygWXte9jiBdhcPfYZHvaRFT9lta3ZcD36ilWLj1GZ2zuGr+ShzS80f7dIOs1NQrzBOJh7aZ94sYcvpl0N8l59M1jBCTvuq0SUUpIlW0WKBH5FIAqoMYG4dmngPgLL9KWEyRKw7AM3L6QNMa8QHy2nGKqWvBCm3GcENb1RV+Ah/CfKuz62UUVntO6xbU/aztWFj9v1F0NEcg/NgnB7CgtDY4DyzUGgJAtcR/zwIiaeB1JaxVdUs36sU/L4RN3psdNO23hn/JvrMKWcaKL8cND/HL0ZYhw8RRxjZ8/SYDv1UXBf3xJJQL9yDbw4EhfzpUG4CReew==; 31:+siEoLec6ICWo0MmxpvaHPRjTojdkW5dwGZIhDUkxSHhf1UyiVQShR3ZjcXYlMi5SrXKuXY+TQPw/itfJNaN15OctXO4AGHX7VwDk6mFwavURcAHQkxFGK5ENiGUwXLPpRdFpMrjPlphJ7lLEsw4EwARsnLwlsh8jvJdOrj/smlDunTss96Lrt/umMeM+5Xg4fzFkAw6ZiuJp9H0lxBzV0izFeSupXCQYXgdV/3QKAs= X-MS-TrafficTypeDiagnostic: AM0PR0502MB3649: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM0PR0502MB3649; 20:O5K/gl1SVo2fRnVAq/j4CejJdRBJHNtBwx9BlIVP0ndfnm3Pfo0LW9jWRvXnyc34I8AspPg0xQ2pP9CHu6X/xrUMhK0f7+kSmTtOdoicV5tZlDl1cTwedMd8A22lmx6ixtNGkaGBYERvETpXgW6qCnjA1JdsatpVkL7trtDzaW2u80IY56IZ5tK9ATkFXnkkQWm0Y9VnpP/5+vGl0IogzL4wWly9cmsiMyYPvzCzSC5s++M5NbQFD/pnx/pNLnIVitCYcCh2C0TfIGwNG/7Mk93rDS6XYfGFx6YrVwt8wPsUVlORPyi0wXcKntuKMcD1mwbYVRS6AB+mdCDA/79g4v3hwdB517ZFaW1Bb52k8zPHpZKaWwaPNjV17bLv6htU4i4wx39eLq8UPeWF7FwFUN02k6ChQxLFIrEAdoE2ySPZH+bg8jGQmreXoF3Pi+jzjukxtCCotQGT6nfw/5ukr5b8jQYZnZK42IMVzLYUDIbU4T4HXnebkmlodsrXExS9; 4:zgk0nzswTgtUGTF1hkPqCdK+jZI4btPMWQ/yev2OpxGSsUj7OSEbO2BP3M4eUXKz8IlZBmC1qS16L/HSSrszuMdS1ODbZ5IW+IpaxlGKK8uRt6z0oCPFWjwwh2tloOhor1dGYCgUIefEScl84HXvIU0TDuOzWLmmlARSraA0pROHACY7aHKm72zNWgGvjtGHt2nFE5picaduyA4OLa5wt2XV9El5NlRW/vBRS49vjwwTLc6wLF4HaBvLpvd3MvjgZl1XuT4dLjyq/s3Sk9K8F9lR00TY7Uiq8BbCrxgfW/fMVkv0yzo5O+kQbgvnI7h7 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(278428928389397); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(3231023)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041248)(20161123564025)(20161123560025)(20161123558100)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:AM0PR0502MB3649; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:AM0PR0502MB3649; X-Forefront-PRVS: 052017CAF1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(39860400002)(376002)(346002)(199004)(189003)(8936002)(305945005)(16526018)(51416003)(7696005)(106356001)(68736007)(52116002)(4326008)(81156014)(3846002)(16586007)(81166006)(36756003)(6116002)(97736004)(316002)(76176011)(8676002)(86362001)(5660300001)(33026002)(66066001)(7736002)(4720700003)(53936002)(47776003)(478600001)(2906002)(69596002)(6666003)(25786009)(110136005)(55016002)(50226002)(48376002)(59450400001)(2950100002)(50466002)(21086003)(386003)(105586002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB3649; H:mellanox.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR0502MB3649; 23:h3LkSDi3H/+sx8kS5LPZsZqCGdL4bvVMshWn0KF?= =?us-ascii?Q?KBg6Bsrq7w8NwKY+yUpyZz0bJZAOvea2rYa3gF5NAycpsBhqnUbfCpBPK1NR?= =?us-ascii?Q?EQHaOlcsduyYiGuLD5NlicRtU56hEqybdV3DYZZQthXspfCuuQDx3iHEbVcr?= =?us-ascii?Q?4vGHq6yJxMpTnVHYUIR4rCSHujhxV2qarfWj3bKK3MdutuTPknbWf3yK+deY?= =?us-ascii?Q?/+yYwCJ5ZB5xH891Ud0vIo6izJkPYU6TIDq3nzdTVsO77TJZtgxwb+a2oJiG?= =?us-ascii?Q?1HFcDq+ZJj1Sf2PGAebTWNZE9jqKP+e7FKSrrIltVzntF+IzP7J5pza1UrMC?= =?us-ascii?Q?LXXXKA2sMglvWxWwapu2B1wC6L8+wg52FmUDVzW5fdVWCPL5BZjDeVE4PLS/?= =?us-ascii?Q?dXEzwACtgzUhz+vk0g4brOL0QQXE5Nrhm39cRhw4ADmclhHKbG7U7OvzmVmj?= =?us-ascii?Q?yIVT62DgHtpsrNwosRHewjHtzLsK+59wctUvseXKsDvHLdKyzFqxyDQ6uhJU?= =?us-ascii?Q?pgtj8mixFL1KamCrl2P1vAr2DCgJ5fAEiQoBE/19lneoPtUF5KsPDmD5IwSb?= =?us-ascii?Q?lanHNryBp8XsZFlMFwLkaFpO0kfbj9G/LtbkMWKmlMwNH8Lyz1D4uVvyrB3h?= =?us-ascii?Q?vkWLVZu1wnewdpUo4tbw92wlSpxwaTzjFZNxhl8oc4Yw+E4cYFO8tqdRzjxi?= =?us-ascii?Q?Gi1osWEbqzLnWyjs/uGWacEEteH1pdgnPapbkNZ+GeyUXQIH13YB0IfxhRCA?= =?us-ascii?Q?I8UQ5NYTLi86QeGaqd8ufWfVqU5yYb6GE2xJST8V5BI7OI0NbzznLlY/sDB6?= =?us-ascii?Q?xgbIl2IyI8+597gt9DhO03p8CetfJdLxKVGZvD1uzk7y1qhqLq0miAKXu43j?= =?us-ascii?Q?LKlpRtB6qNia5gsFtV3CWiexCHvoYFwnDZc8lwZz6rzsW6WVwQ31LRjGe0XB?= =?us-ascii?Q?R9eAhkpbM5tnDjKvBaD3MxlItrl+xSsYZmuaKsO+JXvyoEL/AUHOD59fhOYC?= =?us-ascii?Q?JWl4Vux1fCXlIKDNnx1LNvLoqy2nj9ySazcuwMVw8+4fvRl8DZZXL0nxV2NB?= =?us-ascii?Q?I+RWMJHU4N2HPM4VHw+6L8sizzcB47M4XjdHcajDeigEwD0dkR28SJ5wWsHW?= =?us-ascii?Q?WeHN1QvAxRX+9tVcGOeKCZywQ672GAmXj?= X-Microsoft-Exchange-Diagnostics: 1; AM0PR0502MB3649; 6:fBOD0kkPDzAlqxAqe1CQlC9xltKgbQlArJTq92J/5oEVfJGK7cYwWH7LrIxpCUeu+l6gXVHSd13hStGOT/aiyc28fK+76U/wuwOBoIfTod25uBW79KdmmUga2OJBi4tTO47yAMeyCFqicRhtbltsqC66Y6gATgZgg9zVGHoRgw9RoK99S0mOhbdXcustJwhdhwveatDpeNpNsR1QQsUAYjJXX7QoRq/A/89NbaUhRXJwRsjdqfHcDWF1aFOpaeZhFfCQwwlBwWWLwbUrV78YEWcRPsB3UAz1D0kDXdDtbtkLXnm1rbq5PgIcAo6xk+0LYREZ5Y4oQ7QZqJiMLRex0x/0ydlHLMb4WOQAaNhGUK8=; 5:A1ai3gkFfL5+G8pIUtmn2lZjmJSXd5XDn8p2FX8w6po4vBnr8x5ruMnzgUX28DYYA1nbCAM6CsLH5blpiQ5v1v0lJnlishF4tmAztLRpnX+ZdTpL9y8vMtoNrys9wCxjn5M9j15fhGFsXHlI37A5XyTP/4I93HEK8vq+HQG6Azg=; 24:gUfQI3fsLabufpBTAunIrH/nIiri4mheecseHQpvVcGJ7fKcenkPFEBN3Aq26ct+hlC2/0dmK/Yq1CYe6tfyyv/mmX/tFWab20SGg/KSBzA=; 7:K+LJRTTj8pX33o4dG6GY53Ebo1U2+T0bMy+/FzGM+QKXTJgCMuswsOy098d1MUNgbx+xo2CLLz2khVjXeYeXytjbEIpc6HYk726oXFxGIiY7nEeEHCL3ZaR5z14M40kvBXSGzqzJWNcH4q1r7+JoWsWPLQD3NdgO7WSnM75Po2YAXnddHSQ3iziTEZL+jAf24lDLJmbCJ+7MipDbxlXcLzxwOtgdx9e81TWCJzmYjwsdb6/yBDCtDEmrIRoS97+t SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2017 14:29:47.1920 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9723242f-4d29-4210-03be-08d54235f6a9 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3649 Subject: [dpdk-dev] [PATCH v2 4/4] net/failsafe: fix removed device handling 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, 13 Dec 2017 14:29:50 -0000 There is time between the physical removal of the device until sub-device PMDs get a RMV interrupt. At this time DPDK PMDs and applications still don't know about the removal and may call sub-device control operation which should return an error. In previous code this error is reported to the application contrary to fail-safe principle that the app should not be aware of device removal. Add an removal check in each relevant control command error flow and prevent an error report to application when the sub-device is removed. Fixes: a46f8d5 ("net/failsafe: add fail-safe PMD") Fixes: b737a1e ("net/failsafe: support flow API") Cc: stable@dpdk.org Signed-off-by: Matan Azrad --- drivers/net/failsafe/failsafe_flow.c | 18 ++++++++++------- drivers/net/failsafe/failsafe_ops.c | 34 ++++++++++++++++++++++----------- drivers/net/failsafe/failsafe_private.h | 10 ++++++++++ 3 files changed, 44 insertions(+), 18 deletions(-) diff --git a/drivers/net/failsafe/failsafe_flow.c b/drivers/net/failsafe/failsafe_flow.c index 153ceee..1e39d66 100644 --- a/drivers/net/failsafe/failsafe_flow.c +++ b/drivers/net/failsafe/failsafe_flow.c @@ -87,7 +87,7 @@ DEBUG("Calling rte_flow_validate on sub_device %d", i); ret = rte_flow_validate(PORT_ID(sdev), attr, patterns, actions, error); - if (ret) { + if (ret && fs_is_removed(sdev) == 0) { ERROR("Operation rte_flow_validate failed for sub_device %d" " with error %d", i, ret); return ret; @@ -111,7 +111,7 @@ FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) { flow->flows[i] = rte_flow_create(PORT_ID(sdev), attr, patterns, actions, error); - if (flow->flows[i] == NULL) { + if (flow->flows[i] == NULL && fs_is_removed(sdev) == 0) { ERROR("Failed to create flow on sub_device %d", i); goto err; @@ -150,7 +150,7 @@ continue; local_ret = rte_flow_destroy(PORT_ID(sdev), flow->flows[i], error); - if (local_ret) { + if (local_ret && fs_is_removed(sdev) == 0) { ERROR("Failed to destroy flow on sub_device %d: %d", i, local_ret); if (ret == 0) @@ -175,7 +175,7 @@ FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) { DEBUG("Calling rte_flow_flush on sub_device %d", i); ret = rte_flow_flush(PORT_ID(sdev), error); - if (ret) { + if (ret && fs_is_removed(sdev) == 0) { ERROR("Operation rte_flow_flush failed for sub_device %d" " with error %d", i, ret); return ret; @@ -199,8 +199,12 @@ sdev = TX_SUBDEV(dev); if (sdev != NULL) { - return rte_flow_query(PORT_ID(sdev), - flow->flows[SUB_ID(sdev)], type, arg, error); + int ret = rte_flow_query(PORT_ID(sdev), + flow->flows[SUB_ID(sdev)], + type, arg, error); + + if (ret && fs_is_removed(sdev) == 0) + return ret; } WARN("No active sub_device to query about its flow"); return -1; @@ -223,7 +227,7 @@ WARN("flow isolation mode of sub_device %d in incoherent state.", i); ret = rte_flow_isolate(PORT_ID(sdev), set, error); - if (ret) { + if (ret && fs_is_removed(sdev) == 0) { ERROR("Operation rte_flow_isolate failed for sub_device %d" " with error %d", i, ret); return ret; diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c index e16a590..6799b55 100644 --- a/drivers/net/failsafe/failsafe_ops.c +++ b/drivers/net/failsafe/failsafe_ops.c @@ -121,6 +121,8 @@ dev->data->nb_tx_queues, &dev->data->dev_conf); if (ret) { + if (fs_is_removed(sdev) != 0) + continue; ERROR("Could not configure sub_device %d", i); return ret; } @@ -163,8 +165,11 @@ continue; DEBUG("Starting sub_device %d", i); ret = rte_eth_dev_start(PORT_ID(sdev)); - if (ret) + if (ret) { + if (fs_is_removed(sdev) != 0) + continue; return ret; + } sdev->state = DEV_STARTED; } if (PRIV(dev)->state < DEV_STARTED) @@ -196,7 +201,7 @@ FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) { DEBUG("Calling rte_eth_dev_set_link_up on sub_device %d", i); ret = rte_eth_dev_set_link_up(PORT_ID(sdev)); - if (ret) { + if (ret && fs_is_removed(sdev) == 0) { ERROR("Operation rte_eth_dev_set_link_up failed for sub_device %d" " with error %d", i, ret); return ret; @@ -215,7 +220,7 @@ FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) { DEBUG("Calling rte_eth_dev_set_link_down on sub_device %d", i); ret = rte_eth_dev_set_link_down(PORT_ID(sdev)); - if (ret) { + if (ret && fs_is_removed(sdev) == 0) { ERROR("Operation rte_eth_dev_set_link_down failed for sub_device %d" " with error %d", i, ret); return ret; @@ -300,7 +305,7 @@ rx_queue_id, nb_rx_desc, socket_id, rx_conf, mb_pool); - if (ret) { + if (ret && fs_is_removed(sdev) == 0) { ERROR("RX queue setup failed for sub_device %d", i); goto free_rxq; } @@ -366,7 +371,7 @@ tx_queue_id, nb_tx_desc, socket_id, tx_conf); - if (ret) { + if (ret && fs_is_removed(sdev) == 0) { ERROR("TX queue setup failed for sub_device %d", i); goto free_txq; } @@ -445,7 +450,7 @@ FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) { DEBUG("Calling link_update on sub_device %d", i); ret = (SUBOPS(sdev, link_update))(ETH(sdev), wait_to_complete); - if (ret && ret != -1) { + if (ret && ret != -1 && fs_is_removed(sdev) == 0) { ERROR("Link update failed for sub_device %d with error %d", i, ret); return ret; @@ -469,6 +474,7 @@ fs_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) { + struct rte_eth_stats backup; struct sub_device *sdev; uint8_t i; int ret; @@ -478,14 +484,20 @@ struct rte_eth_stats *snapshot = &sdev->stats_snapshot.stats; uint64_t *timestamp = &sdev->stats_snapshot.timestamp; + rte_memcpy(&backup, snapshot, sizeof(backup)); ret = rte_eth_stats_get(PORT_ID(sdev), snapshot); if (ret) { + if (fs_is_removed(sdev) != 0) { + rte_memcpy(snapshot, &backup, sizeof(backup)); + goto inc; + } ERROR("Operation rte_eth_stats_get failed for sub_device %d with error %d", i, ret); *timestamp = 0; return ret; } *timestamp = rte_rdtsc(); +inc: failsafe_stats_increment(stats, snapshot); } return 0; @@ -598,7 +610,7 @@ FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) { DEBUG("Calling rte_eth_dev_set_mtu on sub_device %d", i); ret = rte_eth_dev_set_mtu(PORT_ID(sdev), mtu); - if (ret) { + if (ret && fs_is_removed(sdev) == 0) { ERROR("Operation rte_eth_dev_set_mtu failed for sub_device %d with error %d", i, ret); return ret; @@ -617,7 +629,7 @@ FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) { DEBUG("Calling rte_eth_dev_vlan_filter on sub_device %d", i); ret = rte_eth_dev_vlan_filter(PORT_ID(sdev), vlan_id, on); - if (ret) { + if (ret && fs_is_removed(sdev) == 0) { ERROR("Operation rte_eth_dev_vlan_filter failed for sub_device %d" " with error %d", i, ret); return ret; @@ -651,7 +663,7 @@ FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) { DEBUG("Calling rte_eth_dev_flow_ctrl_set on sub_device %d", i); ret = rte_eth_dev_flow_ctrl_set(PORT_ID(sdev), fc_conf); - if (ret) { + if (ret && fs_is_removed(sdev) == 0) { ERROR("Operation rte_eth_dev_flow_ctrl_set failed for sub_device %d" " with error %d", i, ret); return ret; @@ -688,7 +700,7 @@ RTE_ASSERT(index < FAILSAFE_MAX_ETHADDR); FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) { ret = rte_eth_dev_mac_addr_add(PORT_ID(sdev), mac_addr, vmdq); - if (ret) { + if (ret && fs_is_removed(sdev) == 0) { ERROR("Operation rte_eth_dev_mac_addr_add failed for sub_device %" PRIu8 " with error %d", i, ret); return ret; @@ -730,7 +742,7 @@ FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) { DEBUG("Calling rte_eth_dev_filter_ctrl on sub_device %d", i); ret = rte_eth_dev_filter_ctrl(PORT_ID(sdev), type, op, arg); - if (ret) { + if (ret && fs_is_removed(sdev) == 0) { ERROR("Operation rte_eth_dev_filter_ctrl failed for sub_device %d" " with error %d", i, ret); return ret; diff --git a/drivers/net/failsafe/failsafe_private.h b/drivers/net/failsafe/failsafe_private.h index d81cc3c..0539782 100644 --- a/drivers/net/failsafe/failsafe_private.h +++ b/drivers/net/failsafe/failsafe_private.h @@ -375,4 +375,14 @@ int failsafe_eth_lsc_event_callback(uint16_t port_id, rte_wmb(); } +/* + * Check if sub device was removed. + */ +static inline int +fs_is_removed(struct sub_device *sdev) +{ + if (sdev->remove == 1 || rte_eth_dev_is_removed(PORT_ID(sdev)) != 0) + return 1; + return 0; +} #endif /* _RTE_ETH_FAILSAFE_PRIVATE_H_ */ -- 1.8.3.1