get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/59004/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 59004,
    "url": "https://patches.dpdk.org/api/patches/59004/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1568030331-16526-5-git-send-email-arybchenko@solarflare.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1568030331-16526-5-git-send-email-arybchenko@solarflare.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1568030331-16526-5-git-send-email-arybchenko@solarflare.com",
    "date": "2019-09-09T11:58:41",
    "name": "[v2,04/13] ethdev: change promiscuous callbacks to return status",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "467652653650bae45d67edf8586693e3b3d6f7d0",
    "submitter": {
        "id": 607,
        "url": "https://patches.dpdk.org/api/people/607/?format=api",
        "name": "Andrew Rybchenko",
        "email": "arybchenko@solarflare.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1568030331-16526-5-git-send-email-arybchenko@solarflare.com/mbox/",
    "series": [
        {
            "id": 6334,
            "url": "https://patches.dpdk.org/api/series/6334/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=6334",
            "date": "2019-09-09T11:58:37",
            "name": "ethdev: change promiscuous mode functions to return status",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/6334/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/59004/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/59004/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 90ED51ED51;\n\tMon,  9 Sep 2019 13:59:35 +0200 (CEST)",
            "from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com\n\t[148.163.129.52]) by dpdk.org (Postfix) with ESMTP id E32671EC85\n\tfor <dev@dpdk.org>; Mon,  9 Sep 2019 13:59:12 +0200 (CEST)",
            "from webmail.solarflare.com (webmail.solarflare.com\n\t[12.187.104.26])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby mx1-us3.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id\n\t14438B4005B; Mon,  9 Sep 2019 11:59:10 +0000 (UTC)",
            "from ocex03.SolarFlarecom.com (10.20.40.36) by\n\tocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server\n\t(TLS) id 15.0.1395.4; Mon, 9 Sep 2019 04:59:04 -0700",
            "from opal.uk.solarflarecom.com (10.17.10.1) by\n\tocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server\n\t(TLS) id\n\t15.0.1395.4 via Frontend Transport; Mon, 9 Sep 2019 04:59:03 -0700",
            "from ukv-loginhost.uk.solarflarecom.com\n\t(ukv-loginhost.uk.solarflarecom.com [10.17.10.39])\n\tby opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id\n\tx89Bwxux027715; Mon, 9 Sep 2019 12:59:01 +0100",
            "from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1])\n\tby ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id\n\tA1D491613D1; Mon,  9 Sep 2019 12:59:00 +0100 (BST)"
        ],
        "X-Virus-Scanned": "Proofpoint Essentials engine",
        "From": "Andrew Rybchenko <arybchenko@solarflare.com>",
        "To": "\"John W. Linville\" <linville@tuxdriver.com>, Xiaolong Ye\n\t<xiaolong.ye@intel.com>, Qi Zhang <qi.z.zhang@intel.com>, Igor Russkikh\n\t<igor.russkikh@aquantia.com>, Pavel Belous <pavel.belous@aquantia.com>,\n\tAllain Legacy <allain.legacy@windriver.com>, Matt Peters\n\t<matt.peters@windriver.com>, Ravi Kumar <ravi1.kumar@amd.com>,\n\tRasesh Mody <rmody@marvell.com>, Shahed Shaikh <shshaikh@marvell.com>,\n\tAjit Khaparde <ajit.khaparde@broadcom.com>,\n\tSomnath Kotur <somnath.kotur@broadcom.com>, \n\tChas Williams <chas3@att.com>, Rahul Lakkireddy\n\t<rahul.lakkireddy@chelsio.com>, Hemant Agrawal <hemant.agrawal@nxp.com>, \n\tSachin Saxena <sachin.saxena@nxp.com>,\n\tWenzhuo Lu <wenzhuo.lu@intel.com>, \n\tGagandeep Singh <g.singh@nxp.com>, John Daley <johndale@cisco.com>,\n\t\"Hyong\n\tYoub Kim\" <hyonkim@cisco.com>, Gaetan Rivet <gaetan.rivet@6wind.com>,\n\t\"Xiao\n\tWang\" <xiao.w.wang@intel.com>, Ziyang Xuan <xuanziyang2@huawei.com>,\n\t\"Xiaoyun Wang\" <cloud.wangxiaoyun@huawei.com>,\n\tGuoyang Zhou <zhouguoyang@huawei.com>, \n\tBeilei Xing <beilei.xing@intel.com>,\n\tJingjing Wu <jingjing.wu@intel.com>, \n\tQiming Yang <qiming.yang@intel.com>, Rosen Xu <rosen.xu@intel.com>,\n\tKonstantin Ananyev <konstantin.ananyev@intel.com>, Shijith Thotton\n\t<sthotton@marvell.com>, Srisivasubramanian Srinivasan\n\t<srinivasan@marvell.com>, Matan Azrad <matan@mellanox.com>, Shahaf Shuler\n\t<shahafs@mellanox.com>, Yongseok Koh <yskoh@mellanox.com>, \"Viacheslav\n\tOvsiienko\" <viacheslavo@mellanox.com>, Zyta Szpak <zr@semihalf.com>,\n\t\"Liron Himi\" <lironh@marvell.com>, Tomasz Duszynski <tdu@semihalf.com>,\n\t\"Stephen Hemminger\" <sthemmin@microsoft.com>,\n\t\"K. Y. Srinivasan\" <kys@microsoft.com>, \n\tHaiyang Zhang <haiyangz@microsoft.com>, Rastislav Cernay\n\t<cernay@netcope.com>, Jan Remes <remes@netcope.com>, Alejandro Lucero\n\t<alejandro.lucero@netronome.com>, Jerin Jacob <jerinj@marvell.com>,\n\t\"Nithin Dabilpuram\" <ndabilpuram@marvell.com>, Kiran Kumar K\n\t<kirankumark@marvell.com>, Keith Wiles <keith.wiles@intel.com>,\n\tMaciej Czekaj\n\t<mczekaj@marvell.com>, Maxime Coquelin <maxime.coquelin@redhat.com>,\n\t\"Tiwei Bie\" <tiwei.bie@intel.com>, Zhihong Wang <zhihong.wang@intel.com>,\n\tYong Wang <yongwang@vmware.com>, Thomas Monjalon <thomas@monjalon.net>,\n\tFerruh Yigit <ferruh.yigit@intel.com>",
        "CC": "<dev@dpdk.org>",
        "Date": "Mon, 9 Sep 2019 12:58:41 +0100",
        "Message-ID": "<1568030331-16526-5-git-send-email-arybchenko@solarflare.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1568030331-16526-1-git-send-email-arybchenko@solarflare.com>",
        "References": "<1567699852-31693-1-git-send-email-arybchenko@solarflare.com>\n\t<1568030331-16526-1-git-send-email-arybchenko@solarflare.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-TM-AS-Product-Ver": "SMEX-12.5.0.1300-8.5.1010-24898.005",
        "X-TM-AS-Result": "No-7.976200-4.000000-10",
        "X-TMASE-MatchedRID": "KjD1bwMIPIXed0Ij9t5iQ301rxt6Vy+Ey733NwuklsJpsnGGIgWMmVYv\n\tWmlP6FyeM22M43riQ2pXuQ2wIHEaxNpsFVyqUNwXuwdUMMznEA9kwN/8r1an37UPyO+4Sb5l4tE\n\tYaayedIO4oPkqxH17jHDlPghqPnfyYlldA0POS1LVsW2YGqoUtNi5W7Rf+s6Qx6C6dcifNxg56G\n\tdZxUF9Vk8oJGCep2oiP1k3OJChCQ+wrg7mL9XMWnCO70QAsBdCUGKOMTReNj5kZDQ6hxOoSb6YV\n\tRYkPkYCRYUgITkYlDS0kCegE2iLzsL9Je5QIIbBDDlsUbcsIPq6hgVvSdGKox53XUX0iwoUcJj/\n\t63vxb+ah/9Db0raJ+1zGbK9kunN210G5DxR2TN91e7Xbb6Im2oHLFWR93TgkpF5rzBQB1Dpl54o\n\tJf2EWf6uuJfvEhnc4rsyU+TJXC+ZZhsLGSVfWrtn6L+08IS/JK/YFZTiDf+qfuM4lD6uC8U8fY4\n\tSH/55svjtd9RSmR7MNipCDoGXpNeX7oeB1ym1+/NOUkr6ADzepR2kMGcsw7aSOQbM+7o0JdjZax\n\tBOjo40sKAu/3hMTF+UoMhYTSVqyl4RFq8MrhOlZMZ6MZ0H1UlsP0tBwe3qDTnPZAM+cOYISg3if\n\teD1GtoBs6iHlIlslJQ+upk/KuD9H6+lhuE4fWr9bzwD89thZNU8z+tFJHR103EU8crzuS5fTLqe\n\tXC7bMFJMSKKQ6uBvL/8swNHW7mEW/wi92CXsDwPWnlFaUZMCpXdWa4gU0S7Lbmp+EnGIKC/EqLG\n\toBo2F+EMveJfqD6MMr9+yCjfRsxAqYyO8DoByeAiCmPx4NwJuJ+Pb8n/VxSnQ4MjwaO9cqtq5d3\n\tcxkNQP90fJP9eHt",
        "X-TM-AS-User-Approved-Sender": "No",
        "X-TM-AS-User-Blocked-Sender": "No",
        "X-TMASE-Result": "10--7.976200-4.000000",
        "X-TMASE-Version": "SMEX-12.5.0.1300-8.5.1010-24898.005",
        "X-MDID": "1568030351-w-nBh904KSYA",
        "Subject": "[dpdk-dev] [PATCH v2 04/13] ethdev: change promiscuous callbacks to\n\treturn status",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Enabling/disabling of promiscuous mode is not always successful and\nit should be taken into account to be able to handle it properly.\n\nWhen correct return status is unclear from driver code, -EAGAIN is used.\n\nSigned-off-by: Andrew Rybchenko <arybchenko@solarflare.com>\n---\n app/test/virtual_pmd.c                    | 12 ++++--\n drivers/net/af_packet/rte_eth_af_packet.c | 22 ++++++----\n drivers/net/af_xdp/rte_eth_af_xdp.c       | 20 ++++++---\n drivers/net/atlantic/atl_ethdev.c         | 12 ++++--\n drivers/net/avp/avp_ethdev.c              | 12 ++++--\n drivers/net/axgbe/axgbe_ethdev.c          | 12 ++++--\n drivers/net/bnx2x/bnx2x_ethdev.c          |  8 +++-\n drivers/net/bnxt/bnxt_ethdev.c            | 26 +++++++++---\n drivers/net/bonding/rte_eth_bond_pmd.c    | 42 +++++++++++++++---\n drivers/net/cxgbe/cxgbe_ethdev.c          | 12 +++---\n drivers/net/cxgbe/cxgbe_pfvf.h            |  4 +-\n drivers/net/dpaa/dpaa_ethdev.c            |  8 +++-\n drivers/net/dpaa2/dpaa2_ethdev.c          | 12 ++++--\n drivers/net/e1000/em_ethdev.c             | 12 ++++--\n drivers/net/e1000/igb_ethdev.c            | 24 +++++++----\n drivers/net/enetc/enetc_ethdev.c          |  8 +++-\n drivers/net/enic/enic.h                   |  2 +-\n drivers/net/enic/enic_ethdev.c            | 22 +++++++---\n drivers/net/enic/enic_main.c              |  4 +-\n drivers/net/failsafe/failsafe_ops.c       |  8 +++-\n drivers/net/fm10k/fm10k_ethdev.c          | 24 +++++++----\n drivers/net/hinic/hinic_pmd_ethdev.c      | 16 ++++++-\n drivers/net/i40e/i40e_ethdev.c            | 35 +++++++++++----\n drivers/net/i40e/i40e_ethdev_vf.c         | 20 ++++++---\n drivers/net/i40e/i40e_vf_representor.c    |  8 ++--\n drivers/net/iavf/iavf_ethdev.c            | 20 ++++++---\n drivers/net/ice/ice_ethdev.c              | 27 +++++++++---\n drivers/net/ipn3ke/ipn3ke_ethdev.h        |  4 +-\n drivers/net/ipn3ke/ipn3ke_representor.c   |  8 +++-\n drivers/net/ixgbe/ixgbe_ethdev.c          | 50 +++++++++++++++++-----\n drivers/net/liquidio/lio_ethdev.c         | 30 ++++++++-----\n drivers/net/mlx4/mlx4.h                   |  4 +-\n drivers/net/mlx4/mlx4_ethdev.c            | 24 ++++++++---\n drivers/net/mlx5/mlx5.h                   |  4 +-\n drivers/net/mlx5/mlx5_rxmode.c            | 40 ++++++++++++++---\n drivers/net/mvneta/mvneta_ethdev.c        | 22 +++++++---\n drivers/net/mvpp2/mrvl_ethdev.c           | 28 +++++++++---\n drivers/net/netvsc/hn_ethdev.c            |  8 ++--\n drivers/net/netvsc/hn_var.h               |  4 +-\n drivers/net/netvsc/hn_vf.c                | 22 ++++++++--\n drivers/net/nfb/nfb_rxmode.c              | 10 +++--\n drivers/net/nfb/nfb_rxmode.h              |  8 +++-\n drivers/net/nfp/nfp_net.c                 | 30 ++++++++-----\n drivers/net/octeontx/octeontx_ethdev.c    | 16 ++++---\n drivers/net/octeontx2/otx2_ethdev.h       |  4 +-\n drivers/net/octeontx2/otx2_ethdev_ops.c   |  8 +++-\n drivers/net/qede/qede_ethdev.c            | 16 ++++---\n drivers/net/sfc/sfc_ethdev.c              | 14 +++---\n drivers/net/szedata2/rte_eth_szedata2.c   |  6 ++-\n drivers/net/tap/rte_eth_tap.c             | 52 ++++++++++++++++++-----\n drivers/net/thunderx/nicvf_ethdev.c       |  3 +-\n drivers/net/virtio/virtio_ethdev.c        | 24 +++++++----\n drivers/net/vmxnet3/vmxnet3_ethdev.c      | 12 ++++--\n lib/librte_ethdev/rte_ethdev.c            | 18 +++++---\n lib/librte_ethdev/rte_ethdev_core.h       |  4 +-\n 55 files changed, 645 insertions(+), 260 deletions(-)",
    "diff": "diff --git a/app/test/virtual_pmd.c b/app/test/virtual_pmd.c\nindex e295891c06..b34df416a2 100644\n--- a/app/test/virtual_pmd.c\n+++ b/app/test/virtual_pmd.c\n@@ -210,13 +210,17 @@ virtual_ethdev_stats_reset(struct rte_eth_dev *dev)\n \tmemset(&dev_private->eth_stats, 0, sizeof(dev_private->eth_stats));\n }\n \n-static void\n+static int\n virtual_ethdev_promiscuous_mode_enable(struct rte_eth_dev *dev __rte_unused)\n-{}\n+{\n+\treturn 0;\n+}\n \n-static void\n+static int\n virtual_ethdev_promiscuous_mode_disable(struct rte_eth_dev *dev __rte_unused)\n-{}\n+{\n+\treturn 0;\n+}\n \n static int\n virtual_ethdev_mac_address_set(__rte_unused struct rte_eth_dev *dev,\ndiff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c\nindex 66131b53e7..0495727281 100644\n--- a/drivers/net/af_packet/rte_eth_af_packet.c\n+++ b/drivers/net/af_packet/rte_eth_af_packet.c\n@@ -458,41 +458,47 @@ eth_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)\n \treturn 0;\n }\n \n-static void\n+static int\n eth_dev_change_flags(char *if_name, uint32_t flags, uint32_t mask)\n {\n \tstruct ifreq ifr;\n+\tint ret = 0;\n \tint s;\n \n \ts = socket(PF_INET, SOCK_DGRAM, 0);\n \tif (s < 0)\n-\t\treturn;\n+\t\treturn -errno;\n \n \tstrlcpy(ifr.ifr_name, if_name, IFNAMSIZ);\n-\tif (ioctl(s, SIOCGIFFLAGS, &ifr) < 0)\n+\tif (ioctl(s, SIOCGIFFLAGS, &ifr) < 0) {\n+\t\tret = -errno;\n \t\tgoto out;\n+\t}\n \tifr.ifr_flags &= mask;\n \tifr.ifr_flags |= flags;\n-\tif (ioctl(s, SIOCSIFFLAGS, &ifr) < 0)\n+\tif (ioctl(s, SIOCSIFFLAGS, &ifr) < 0) {\n+\t\tret = -errno;\n \t\tgoto out;\n+\t}\n out:\n \tclose(s);\n+\treturn ret;\n }\n \n-static void\n+static int\n eth_dev_promiscuous_enable(struct rte_eth_dev *dev)\n {\n \tstruct pmd_internals *internals = dev->data->dev_private;\n \n-\teth_dev_change_flags(internals->if_name, IFF_PROMISC, ~0);\n+\treturn eth_dev_change_flags(internals->if_name, IFF_PROMISC, ~0);\n }\n \n-static void\n+static int\n eth_dev_promiscuous_disable(struct rte_eth_dev *dev)\n {\n \tstruct pmd_internals *internals = dev->data->dev_private;\n \n-\teth_dev_change_flags(internals->if_name, 0, ~IFF_PROMISC);\n+\treturn eth_dev_change_flags(internals->if_name, 0, ~IFF_PROMISC);\n }\n \n static const struct eth_dev_ops ops = {\ndiff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c\nindex aa716f3195..1da22ff866 100644\n--- a/drivers/net/af_xdp/rte_eth_af_xdp.c\n+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c\n@@ -750,37 +750,43 @@ static void\n eth_dev_change_flags(char *if_name, uint32_t flags, uint32_t mask)\n {\n \tstruct ifreq ifr;\n+\tint ret = 0;\n \tint s;\n \n \ts = socket(PF_INET, SOCK_DGRAM, 0);\n \tif (s < 0)\n-\t\treturn;\n+\t\treturn -errno;\n \n \tstrlcpy(ifr.ifr_name, if_name, IFNAMSIZ);\n-\tif (ioctl(s, SIOCGIFFLAGS, &ifr) < 0)\n+\tif (ioctl(s, SIOCGIFFLAGS, &ifr) < 0) {\n+\t\tret = -errno;\n \t\tgoto out;\n+\t}\n \tifr.ifr_flags &= mask;\n \tifr.ifr_flags |= flags;\n-\tif (ioctl(s, SIOCSIFFLAGS, &ifr) < 0)\n+\tif (ioctl(s, SIOCSIFFLAGS, &ifr) < 0) {\n+\t\tret = -errno;\n \t\tgoto out;\n+\t}\n out:\n \tclose(s);\n+\treturn ret;\n }\n \n-static void\n+static int\n eth_dev_promiscuous_enable(struct rte_eth_dev *dev)\n {\n \tstruct pmd_internals *internals = dev->data->dev_private;\n \n-\teth_dev_change_flags(internals->if_name, IFF_PROMISC, ~0);\n+\treturn eth_dev_change_flags(internals->if_name, IFF_PROMISC, ~0);\n }\n \n-static void\n+static int\n eth_dev_promiscuous_disable(struct rte_eth_dev *dev)\n {\n \tstruct pmd_internals *internals = dev->data->dev_private;\n \n-\teth_dev_change_flags(internals->if_name, 0, ~IFF_PROMISC);\n+\treturn eth_dev_change_flags(internals->if_name, 0, ~IFF_PROMISC);\n }\n \n static const struct eth_dev_ops ops = {\ndiff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c\nindex b056f8229a..5018529da1 100644\n--- a/drivers/net/atlantic/atl_ethdev.c\n+++ b/drivers/net/atlantic/atl_ethdev.c\n@@ -24,8 +24,8 @@ static int  atl_dev_set_link_up(struct rte_eth_dev *dev);\n static int  atl_dev_set_link_down(struct rte_eth_dev *dev);\n static void atl_dev_close(struct rte_eth_dev *dev);\n static int  atl_dev_reset(struct rte_eth_dev *dev);\n-static void atl_dev_promiscuous_enable(struct rte_eth_dev *dev);\n-static void atl_dev_promiscuous_disable(struct rte_eth_dev *dev);\n+static int  atl_dev_promiscuous_enable(struct rte_eth_dev *dev);\n+static int  atl_dev_promiscuous_disable(struct rte_eth_dev *dev);\n static void atl_dev_allmulticast_enable(struct rte_eth_dev *dev);\n static void atl_dev_allmulticast_disable(struct rte_eth_dev *dev);\n static int  atl_dev_link_update(struct rte_eth_dev *dev, int wait);\n@@ -1207,20 +1207,24 @@ atl_dev_link_update(struct rte_eth_dev *dev, int wait __rte_unused)\n \treturn 0;\n }\n \n-static void\n+static int\n atl_dev_promiscuous_enable(struct rte_eth_dev *dev)\n {\n \tstruct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n \n \thw_atl_rpfl2promiscuous_mode_en_set(hw, true);\n+\n+\treturn 0;\n }\n \n-static void\n+static int\n atl_dev_promiscuous_disable(struct rte_eth_dev *dev)\n {\n \tstruct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n \n \thw_atl_rpfl2promiscuous_mode_en_set(hw, false);\n+\n+\treturn 0;\n }\n \n static void\ndiff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c\nindex c5801f319a..050901990c 100644\n--- a/drivers/net/avp/avp_ethdev.c\n+++ b/drivers/net/avp/avp_ethdev.c\n@@ -45,8 +45,8 @@ static int avp_dev_info_get(struct rte_eth_dev *dev,\n \t\t\t    struct rte_eth_dev_info *dev_info);\n static int avp_vlan_offload_set(struct rte_eth_dev *dev, int mask);\n static int avp_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete);\n-static void avp_dev_promiscuous_enable(struct rte_eth_dev *dev);\n-static void avp_dev_promiscuous_disable(struct rte_eth_dev *dev);\n+static int avp_dev_promiscuous_enable(struct rte_eth_dev *dev);\n+static int avp_dev_promiscuous_disable(struct rte_eth_dev *dev);\n \n static int avp_dev_rx_queue_setup(struct rte_eth_dev *dev,\n \t\t\t\t  uint16_t rx_queue_id,\n@@ -2157,7 +2157,7 @@ avp_dev_link_update(struct rte_eth_dev *eth_dev,\n \treturn -1;\n }\n \n-static void\n+static int\n avp_dev_promiscuous_enable(struct rte_eth_dev *eth_dev)\n {\n \tstruct avp_dev *avp = AVP_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);\n@@ -2169,9 +2169,11 @@ avp_dev_promiscuous_enable(struct rte_eth_dev *eth_dev)\n \t\t\t    eth_dev->data->port_id);\n \t}\n \trte_spinlock_unlock(&avp->lock);\n+\n+\treturn 0;\n }\n \n-static void\n+static int\n avp_dev_promiscuous_disable(struct rte_eth_dev *eth_dev)\n {\n \tstruct avp_dev *avp = AVP_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);\n@@ -2183,6 +2185,8 @@ avp_dev_promiscuous_disable(struct rte_eth_dev *eth_dev)\n \t\t\t    eth_dev->data->port_id);\n \t}\n \trte_spinlock_unlock(&avp->lock);\n+\n+\treturn 0;\n }\n \n static int\ndiff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c\nindex 5a7da75126..c43b5bfb6f 100644\n--- a/drivers/net/axgbe/axgbe_ethdev.c\n+++ b/drivers/net/axgbe/axgbe_ethdev.c\n@@ -15,8 +15,8 @@ static int  axgbe_dev_start(struct rte_eth_dev *dev);\n static void axgbe_dev_stop(struct rte_eth_dev *dev);\n static void axgbe_dev_interrupt_handler(void *param);\n static void axgbe_dev_close(struct rte_eth_dev *dev);\n-static void axgbe_dev_promiscuous_enable(struct rte_eth_dev *dev);\n-static void axgbe_dev_promiscuous_disable(struct rte_eth_dev *dev);\n+static int axgbe_dev_promiscuous_enable(struct rte_eth_dev *dev);\n+static int axgbe_dev_promiscuous_disable(struct rte_eth_dev *dev);\n static void axgbe_dev_allmulticast_enable(struct rte_eth_dev *dev);\n static void axgbe_dev_allmulticast_disable(struct rte_eth_dev *dev);\n static int axgbe_dev_link_update(struct rte_eth_dev *dev,\n@@ -236,7 +236,7 @@ axgbe_dev_close(struct rte_eth_dev *dev)\n \taxgbe_dev_clear_queues(dev);\n }\n \n-static void\n+static int\n axgbe_dev_promiscuous_enable(struct rte_eth_dev *dev)\n {\n \tstruct axgbe_port *pdata = dev->data->dev_private;\n@@ -244,9 +244,11 @@ axgbe_dev_promiscuous_enable(struct rte_eth_dev *dev)\n \tPMD_INIT_FUNC_TRACE();\n \n \tAXGMAC_IOWRITE_BITS(pdata, MAC_PFR, PR, 1);\n+\n+\treturn 0;\n }\n \n-static void\n+static int\n axgbe_dev_promiscuous_disable(struct rte_eth_dev *dev)\n {\n \tstruct axgbe_port *pdata = dev->data->dev_private;\n@@ -254,6 +256,8 @@ axgbe_dev_promiscuous_disable(struct rte_eth_dev *dev)\n \tPMD_INIT_FUNC_TRACE();\n \n \tAXGMAC_IOWRITE_BITS(pdata, MAC_PFR, PR, 0);\n+\n+\treturn 0;\n }\n \n static void\ndiff --git a/drivers/net/bnx2x/bnx2x_ethdev.c b/drivers/net/bnx2x/bnx2x_ethdev.c\nindex b7359514e5..07168e9a8a 100644\n--- a/drivers/net/bnx2x/bnx2x_ethdev.c\n+++ b/drivers/net/bnx2x/bnx2x_ethdev.c\n@@ -292,7 +292,7 @@ bnx2x_dev_close(struct rte_eth_dev *dev)\n \tbnx2x_free_ilt_mem(sc);\n }\n \n-static void\n+static int\n bnx2x_promisc_enable(struct rte_eth_dev *dev)\n {\n \tstruct bnx2x_softc *sc = dev->data->dev_private;\n@@ -302,9 +302,11 @@ bnx2x_promisc_enable(struct rte_eth_dev *dev)\n \tif (rte_eth_allmulticast_get(dev->data->port_id) == 1)\n \t\tsc->rx_mode = BNX2X_RX_MODE_ALLMULTI_PROMISC;\n \tbnx2x_set_rx_mode(sc);\n+\n+\treturn 0;\n }\n \n-static void\n+static int\n bnx2x_promisc_disable(struct rte_eth_dev *dev)\n {\n \tstruct bnx2x_softc *sc = dev->data->dev_private;\n@@ -314,6 +316,8 @@ bnx2x_promisc_disable(struct rte_eth_dev *dev)\n \tif (rte_eth_allmulticast_get(dev->data->port_id) == 1)\n \t\tsc->rx_mode = BNX2X_RX_MODE_ALLMULTI;\n \tbnx2x_set_rx_mode(sc);\n+\n+\treturn 0;\n }\n \n static void\ndiff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c\nindex b521a72963..7fff5d5b8f 100644\n--- a/drivers/net/bnxt/bnxt_ethdev.c\n+++ b/drivers/net/bnxt/bnxt_ethdev.c\n@@ -1006,32 +1006,46 @@ int bnxt_link_update_op(struct rte_eth_dev *eth_dev, int wait_to_complete)\n \treturn rc;\n }\n \n-static void bnxt_promiscuous_enable_op(struct rte_eth_dev *eth_dev)\n+static int bnxt_promiscuous_enable_op(struct rte_eth_dev *eth_dev)\n {\n \tstruct bnxt *bp = eth_dev->data->dev_private;\n \tstruct bnxt_vnic_info *vnic;\n+\tuint32_t old_flags;\n+\tint rc;\n \n \tif (bp->vnic_info == NULL)\n-\t\treturn;\n+\t\treturn 0;\n \n \tvnic = &bp->vnic_info[0];\n \n+\told_flags = vnic->flags;\n \tvnic->flags |= BNXT_VNIC_INFO_PROMISC;\n-\tbnxt_hwrm_cfa_l2_set_rx_mask(bp, vnic, 0, NULL);\n+\trc = bnxt_hwrm_cfa_l2_set_rx_mask(bp, vnic, 0, NULL);\n+\tif (rc != 0)\n+\t\tvnic->flags = old_flags;\n+\n+\treturn rc;\n }\n \n-static void bnxt_promiscuous_disable_op(struct rte_eth_dev *eth_dev)\n+static int bnxt_promiscuous_disable_op(struct rte_eth_dev *eth_dev)\n {\n \tstruct bnxt *bp = eth_dev->data->dev_private;\n \tstruct bnxt_vnic_info *vnic;\n+\tuint32_t old_flags;\n+\tint rc;\n \n \tif (bp->vnic_info == NULL)\n-\t\treturn;\n+\t\treturn 0;\n \n \tvnic = &bp->vnic_info[0];\n \n+\told_flags = vnic->flags;\n \tvnic->flags &= ~BNXT_VNIC_INFO_PROMISC;\n-\tbnxt_hwrm_cfa_l2_set_rx_mask(bp, vnic, 0, NULL);\n+\trc = bnxt_hwrm_cfa_l2_set_rx_mask(bp, vnic, 0, NULL);\n+\tif (rc != 0)\n+\t\tvnic->flags = old_flags;\n+\n+\treturn rc;\n }\n \n static void bnxt_allmulticast_enable_op(struct rte_eth_dev *eth_dev)\ndiff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c\nindex edf660db34..f9b7b595df 100644\n--- a/drivers/net/bonding/rte_eth_bond_pmd.c\n+++ b/drivers/net/bonding/rte_eth_bond_pmd.c\n@@ -1915,7 +1915,7 @@ bond_ethdev_primary_set(struct bond_dev_private *internals,\n \t\t}\n }\n \n-static void\n+static int\n bond_ethdev_promiscuous_enable(struct rte_eth_dev *eth_dev);\n \n static int\n@@ -2482,7 +2482,7 @@ bond_ethdev_stats_reset(struct rte_eth_dev *dev)\n \t\trte_eth_stats_reset(internals->slaves[i].port_id);\n }\n \n-static void\n+static int\n bond_ethdev_promiscuous_enable(struct rte_eth_dev *eth_dev)\n {\n \tstruct bond_dev_private *internals = eth_dev->data->dev_private;\n@@ -2495,7 +2495,9 @@ bond_ethdev_promiscuous_enable(struct rte_eth_dev *eth_dev)\n \tcase BONDING_MODE_ROUND_ROBIN:\n \tcase BONDING_MODE_BALANCE:\n \tcase BONDING_MODE_BROADCAST:\n-\tcase BONDING_MODE_8023AD:\n+\tcase BONDING_MODE_8023AD: {\n+\t\tunsigned int slave_ok = 0;\n+\n \t\tfor (i = 0; i < internals->slave_count; i++) {\n \t\t\tport_id = internals->slaves[i].port_id;\n \n@@ -2504,8 +2506,17 @@ bond_ethdev_promiscuous_enable(struct rte_eth_dev *eth_dev)\n \t\t\t\tRTE_BOND_LOG(ERR,\n \t\t\t\t\t\"Failed to enable promiscuous mode for port %u: %s\",\n \t\t\t\t\tport_id, rte_strerror(-ret));\n+\t\t\telse\n+\t\t\t\tslave_ok++;\n \t\t}\n+\t\t/*\n+\t\t * Report success if operation is successful on at least\n+\t\t * on one slave. Otherwise return last error code.\n+\t\t */\n+\t\tif (slave_ok > 0)\n+\t\t\tret = 0;\n \t\tbreak;\n+\t}\n \t/* Promiscuous mode is propagated only to primary slave */\n \tcase BONDING_MODE_ACTIVE_BACKUP:\n \tcase BONDING_MODE_TLB:\n@@ -2521,14 +2532,16 @@ bond_ethdev_promiscuous_enable(struct rte_eth_dev *eth_dev)\n \t\t\t\t\"Failed to enable promiscuous mode for port %u: %s\",\n \t\t\t\tport_id, rte_strerror(-ret));\n \t}\n+\n+\treturn ret;\n }\n \n-static void\n+static int\n bond_ethdev_promiscuous_disable(struct rte_eth_dev *dev)\n {\n \tstruct bond_dev_private *internals = dev->data->dev_private;\n \tint i;\n-\tint ret;\n+\tint ret = 0;\n \tuint16_t port_id;\n \n \tswitch (internals->mode) {\n@@ -2536,21 +2549,34 @@ bond_ethdev_promiscuous_disable(struct rte_eth_dev *dev)\n \tcase BONDING_MODE_ROUND_ROBIN:\n \tcase BONDING_MODE_BALANCE:\n \tcase BONDING_MODE_BROADCAST:\n-\tcase BONDING_MODE_8023AD:\n+\tcase BONDING_MODE_8023AD: {\n+\t\tunsigned int slave_ok = 0;\n+\n \t\tfor (i = 0; i < internals->slave_count; i++) {\n \t\t\tport_id = internals->slaves[i].port_id;\n \n \t\t\tif (internals->mode == BONDING_MODE_8023AD &&\n \t\t\t    bond_mode_8023ad_ports[port_id].forced_rx_flags ==\n-\t\t\t\t\tBOND_8023AD_FORCED_PROMISC)\n+\t\t\t\t\tBOND_8023AD_FORCED_PROMISC) {\n+\t\t\t\tslave_ok++;\n \t\t\t\tcontinue;\n+\t\t\t}\n \t\t\tret = rte_eth_promiscuous_disable(port_id);\n \t\t\tif (ret != 0)\n \t\t\t\tRTE_BOND_LOG(ERR,\n \t\t\t\t\t\"Failed to disable promiscuous mode for port %u: %s\",\n \t\t\t\t\tport_id, rte_strerror(-ret));\n+\t\t\telse\n+\t\t\t\tslave_ok++;\n \t\t}\n+\t\t/*\n+\t\t * Report success if operation is successful on at least\n+\t\t * on one slave. Otherwise return last error code.\n+\t\t */\n+\t\tif (slave_ok > 0)\n+\t\t\tret = 0;\n \t\tbreak;\n+\t}\n \t/* Promiscuous mode is propagated only to primary slave */\n \tcase BONDING_MODE_ACTIVE_BACKUP:\n \tcase BONDING_MODE_TLB:\n@@ -2566,6 +2592,8 @@ bond_ethdev_promiscuous_disable(struct rte_eth_dev *dev)\n \t\t\t\t\"Failed to disable promiscuous mode for port %u: %s\",\n \t\t\t\tport_id, rte_strerror(-ret));\n \t}\n+\n+\treturn ret;\n }\n \n static void\ndiff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c\nindex 19c2a3c4db..be001a0d24 100644\n--- a/drivers/net/cxgbe/cxgbe_ethdev.c\n+++ b/drivers/net/cxgbe/cxgbe_ethdev.c\n@@ -150,22 +150,22 @@ int cxgbe_dev_info_get(struct rte_eth_dev *eth_dev,\n \treturn 0;\n }\n \n-void cxgbe_dev_promiscuous_enable(struct rte_eth_dev *eth_dev)\n+int cxgbe_dev_promiscuous_enable(struct rte_eth_dev *eth_dev)\n {\n \tstruct port_info *pi = eth_dev->data->dev_private;\n \tstruct adapter *adapter = pi->adapter;\n \n-\tt4_set_rxmode(adapter, adapter->mbox, pi->viid, -1,\n-\t\t      1, -1, 1, -1, false);\n+\treturn t4_set_rxmode(adapter, adapter->mbox, pi->viid, -1,\n+\t\t\t     1, -1, 1, -1, false);\n }\n \n-void cxgbe_dev_promiscuous_disable(struct rte_eth_dev *eth_dev)\n+int cxgbe_dev_promiscuous_disable(struct rte_eth_dev *eth_dev)\n {\n \tstruct port_info *pi = eth_dev->data->dev_private;\n \tstruct adapter *adapter = pi->adapter;\n \n-\tt4_set_rxmode(adapter, adapter->mbox, pi->viid, -1,\n-\t\t      0, -1, 1, -1, false);\n+\treturn t4_set_rxmode(adapter, adapter->mbox, pi->viid, -1,\n+\t\t\t     0, -1, 1, -1, false);\n }\n \n void cxgbe_dev_allmulticast_enable(struct rte_eth_dev *eth_dev)\ndiff --git a/drivers/net/cxgbe/cxgbe_pfvf.h b/drivers/net/cxgbe/cxgbe_pfvf.h\nindex 011ec13860..bfa07ba555 100644\n--- a/drivers/net/cxgbe/cxgbe_pfvf.h\n+++ b/drivers/net/cxgbe/cxgbe_pfvf.h\n@@ -12,8 +12,8 @@ void cxgbe_dev_stop(struct rte_eth_dev *eth_dev);\n void cxgbe_dev_close(struct rte_eth_dev *eth_dev);\n int cxgbe_dev_info_get(struct rte_eth_dev *eth_dev,\n \t\t       struct rte_eth_dev_info *device_info);\n-void cxgbe_dev_promiscuous_enable(struct rte_eth_dev *eth_dev);\n-void cxgbe_dev_promiscuous_disable(struct rte_eth_dev *eth_dev);\n+int cxgbe_dev_promiscuous_enable(struct rte_eth_dev *eth_dev);\n+int cxgbe_dev_promiscuous_disable(struct rte_eth_dev *eth_dev);\n void cxgbe_dev_allmulticast_enable(struct rte_eth_dev *eth_dev);\n void cxgbe_dev_allmulticast_disable(struct rte_eth_dev *eth_dev);\n int cxgbe_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *addr);\ndiff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c\nindex 25deadb949..ad28c110d7 100644\n--- a/drivers/net/dpaa/dpaa_ethdev.c\n+++ b/drivers/net/dpaa/dpaa_ethdev.c\n@@ -514,22 +514,26 @@ dpaa_xstats_get_names_by_id(\n \treturn limit;\n }\n \n-static void dpaa_eth_promiscuous_enable(struct rte_eth_dev *dev)\n+static int dpaa_eth_promiscuous_enable(struct rte_eth_dev *dev)\n {\n \tstruct dpaa_if *dpaa_intf = dev->data->dev_private;\n \n \tPMD_INIT_FUNC_TRACE();\n \n \tfman_if_promiscuous_enable(dpaa_intf->fif);\n+\n+\treturn 0;\n }\n \n-static void dpaa_eth_promiscuous_disable(struct rte_eth_dev *dev)\n+static int dpaa_eth_promiscuous_disable(struct rte_eth_dev *dev)\n {\n \tstruct dpaa_if *dpaa_intf = dev->data->dev_private;\n \n \tPMD_INIT_FUNC_TRACE();\n \n \tfman_if_promiscuous_disable(dpaa_intf->fif);\n+\n+\treturn 0;\n }\n \n static void dpaa_eth_multicast_enable(struct rte_eth_dev *dev)\ndiff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c\nindex 879bbc120d..d9cc2c3510 100644\n--- a/drivers/net/dpaa2/dpaa2_ethdev.c\n+++ b/drivers/net/dpaa2/dpaa2_ethdev.c\n@@ -987,7 +987,7 @@ dpaa2_dev_close(struct rte_eth_dev *dev)\n \trte_eth_linkstatus_set(dev, &link);\n }\n \n-static void\n+static int\n dpaa2_dev_promiscuous_enable(\n \t\tstruct rte_eth_dev *dev)\n {\n@@ -999,7 +999,7 @@ dpaa2_dev_promiscuous_enable(\n \n \tif (dpni == NULL) {\n \t\tDPAA2_PMD_ERR(\"dpni is NULL\");\n-\t\treturn;\n+\t\treturn -ENODEV;\n \t}\n \n \tret = dpni_set_unicast_promisc(dpni, CMD_PRI_LOW, priv->token, true);\n@@ -1009,9 +1009,11 @@ dpaa2_dev_promiscuous_enable(\n \tret = dpni_set_multicast_promisc(dpni, CMD_PRI_LOW, priv->token, true);\n \tif (ret < 0)\n \t\tDPAA2_PMD_ERR(\"Unable to enable M promisc mode %d\", ret);\n+\n+\treturn ret;\n }\n \n-static void\n+static int\n dpaa2_dev_promiscuous_disable(\n \t\tstruct rte_eth_dev *dev)\n {\n@@ -1023,7 +1025,7 @@ dpaa2_dev_promiscuous_disable(\n \n \tif (dpni == NULL) {\n \t\tDPAA2_PMD_ERR(\"dpni is NULL\");\n-\t\treturn;\n+\t\treturn -ENODEV;\n \t}\n \n \tret = dpni_set_unicast_promisc(dpni, CMD_PRI_LOW, priv->token, false);\n@@ -1037,6 +1039,8 @@ dpaa2_dev_promiscuous_disable(\n \t\t\tDPAA2_PMD_ERR(\"Unable to disable M promisc mode %d\",\n \t\t\t\t      ret);\n \t}\n+\n+\treturn ret;\n }\n \n static void\ndiff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c\nindex 305588f9b3..b23e840376 100644\n--- a/drivers/net/e1000/em_ethdev.c\n+++ b/drivers/net/e1000/em_ethdev.c\n@@ -35,8 +35,8 @@ static int eth_em_configure(struct rte_eth_dev *dev);\n static int eth_em_start(struct rte_eth_dev *dev);\n static void eth_em_stop(struct rte_eth_dev *dev);\n static void eth_em_close(struct rte_eth_dev *dev);\n-static void eth_em_promiscuous_enable(struct rte_eth_dev *dev);\n-static void eth_em_promiscuous_disable(struct rte_eth_dev *dev);\n+static int eth_em_promiscuous_enable(struct rte_eth_dev *dev);\n+static int eth_em_promiscuous_disable(struct rte_eth_dev *dev);\n static void eth_em_allmulticast_enable(struct rte_eth_dev *dev);\n static void eth_em_allmulticast_disable(struct rte_eth_dev *dev);\n static int eth_em_link_update(struct rte_eth_dev *dev,\n@@ -1263,7 +1263,7 @@ em_release_manageability(struct e1000_hw *hw)\n \t}\n }\n \n-static void\n+static int\n eth_em_promiscuous_enable(struct rte_eth_dev *dev)\n {\n \tstruct e1000_hw *hw =\n@@ -1273,9 +1273,11 @@ eth_em_promiscuous_enable(struct rte_eth_dev *dev)\n \trctl = E1000_READ_REG(hw, E1000_RCTL);\n \trctl |= (E1000_RCTL_UPE | E1000_RCTL_MPE);\n \tE1000_WRITE_REG(hw, E1000_RCTL, rctl);\n+\n+\treturn 0;\n }\n \n-static void\n+static int\n eth_em_promiscuous_disable(struct rte_eth_dev *dev)\n {\n \tstruct e1000_hw *hw =\n@@ -1289,6 +1291,8 @@ eth_em_promiscuous_disable(struct rte_eth_dev *dev)\n \telse\n \t\trctl &= (~E1000_RCTL_MPE);\n \tE1000_WRITE_REG(hw, E1000_RCTL, rctl);\n+\n+\treturn 0;\n }\n \n static void\ndiff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c\nindex 6172f9ac64..a9f6de5d52 100644\n--- a/drivers/net/e1000/igb_ethdev.c\n+++ b/drivers/net/e1000/igb_ethdev.c\n@@ -79,8 +79,8 @@ static int  eth_igb_dev_set_link_up(struct rte_eth_dev *dev);\n static int  eth_igb_dev_set_link_down(struct rte_eth_dev *dev);\n static void eth_igb_close(struct rte_eth_dev *dev);\n static int eth_igb_reset(struct rte_eth_dev *dev);\n-static void eth_igb_promiscuous_enable(struct rte_eth_dev *dev);\n-static void eth_igb_promiscuous_disable(struct rte_eth_dev *dev);\n+static int  eth_igb_promiscuous_enable(struct rte_eth_dev *dev);\n+static int  eth_igb_promiscuous_disable(struct rte_eth_dev *dev);\n static void eth_igb_allmulticast_enable(struct rte_eth_dev *dev);\n static void eth_igb_allmulticast_disable(struct rte_eth_dev *dev);\n static int  eth_igb_link_update(struct rte_eth_dev *dev,\n@@ -156,8 +156,8 @@ static int igbvf_dev_configure(struct rte_eth_dev *dev);\n static int igbvf_dev_start(struct rte_eth_dev *dev);\n static void igbvf_dev_stop(struct rte_eth_dev *dev);\n static void igbvf_dev_close(struct rte_eth_dev *dev);\n-static void igbvf_promiscuous_enable(struct rte_eth_dev *dev);\n-static void igbvf_promiscuous_disable(struct rte_eth_dev *dev);\n+static int igbvf_promiscuous_enable(struct rte_eth_dev *dev);\n+static int igbvf_promiscuous_disable(struct rte_eth_dev *dev);\n static void igbvf_allmulticast_enable(struct rte_eth_dev *dev);\n static void igbvf_allmulticast_disable(struct rte_eth_dev *dev);\n static int eth_igbvf_link_update(struct e1000_hw *hw);\n@@ -2519,7 +2519,7 @@ igb_release_manageability(struct e1000_hw *hw)\n \t}\n }\n \n-static void\n+static int\n eth_igb_promiscuous_enable(struct rte_eth_dev *dev)\n {\n \tstruct e1000_hw *hw =\n@@ -2529,9 +2529,11 @@ eth_igb_promiscuous_enable(struct rte_eth_dev *dev)\n \trctl = E1000_READ_REG(hw, E1000_RCTL);\n \trctl |= (E1000_RCTL_UPE | E1000_RCTL_MPE);\n \tE1000_WRITE_REG(hw, E1000_RCTL, rctl);\n+\n+\treturn 0;\n }\n \n-static void\n+static int\n eth_igb_promiscuous_disable(struct rte_eth_dev *dev)\n {\n \tstruct e1000_hw *hw =\n@@ -2545,6 +2547,8 @@ eth_igb_promiscuous_disable(struct rte_eth_dev *dev)\n \telse\n \t\trctl &= (~E1000_RCTL_MPE);\n \tE1000_WRITE_REG(hw, E1000_RCTL, rctl);\n+\n+\treturn 0;\n }\n \n static void\n@@ -3390,16 +3394,18 @@ igbvf_dev_close(struct rte_eth_dev *dev)\n \tigbvf_default_mac_addr_set(dev, &addr);\n }\n \n-static void\n+static int\n igbvf_promiscuous_enable(struct rte_eth_dev *dev)\n {\n \tstruct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n \n \t/* Set both unicast and multicast promisc */\n \te1000_promisc_set_vf(hw, e1000_promisc_enabled);\n+\n+\treturn 0;\n }\n \n-static void\n+static int\n igbvf_promiscuous_disable(struct rte_eth_dev *dev)\n {\n \tstruct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n@@ -3409,6 +3415,8 @@ igbvf_promiscuous_disable(struct rte_eth_dev *dev)\n \t\te1000_promisc_set_vf(hw, e1000_promisc_multicast);\n \telse\n \t\te1000_promisc_set_vf(hw, e1000_promisc_disabled);\n+\n+\treturn 0;\n }\n \n static void\ndiff --git a/drivers/net/enetc/enetc_ethdev.c b/drivers/net/enetc/enetc_ethdev.c\nindex dec42b9763..1ec66d0baf 100644\n--- a/drivers/net/enetc/enetc_ethdev.c\n+++ b/drivers/net/enetc/enetc_ethdev.c\n@@ -523,7 +523,7 @@ enetc_dev_close(struct rte_eth_dev *dev)\n \tdev->data->nb_tx_queues = 0;\n }\n \n-static void\n+static int\n enetc_promiscuous_enable(struct rte_eth_dev *dev)\n {\n \tstruct enetc_eth_hw *hw =\n@@ -537,9 +537,11 @@ enetc_promiscuous_enable(struct rte_eth_dev *dev)\n \tpsipmr |= ENETC_PSIPMR_SET_UP(0) | ENETC_PSIPMR_SET_MP(0);\n \n \tenetc_port_wr(enetc_hw, ENETC_PSIPMR, psipmr);\n+\n+\treturn 0;\n }\n \n-static void\n+static int\n enetc_promiscuous_disable(struct rte_eth_dev *dev)\n {\n \tstruct enetc_eth_hw *hw =\n@@ -555,6 +557,8 @@ enetc_promiscuous_disable(struct rte_eth_dev *dev)\n \t\tpsipmr &= (~ENETC_PSIPMR_SET_MP(0));\n \n \tenetc_port_wr(enetc_hw, ENETC_PSIPMR, psipmr);\n+\n+\treturn 0;\n }\n \n static void\ndiff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h\nindex 5a92508f00..72b1e7956b 100644\n--- a/drivers/net/enic/enic.h\n+++ b/drivers/net/enic/enic.h\n@@ -305,7 +305,7 @@ int enic_get_link_status(struct enic *enic);\n int enic_dev_stats_get(struct enic *enic,\n \t\t       struct rte_eth_stats *r_stats);\n void enic_dev_stats_clear(struct enic *enic);\n-void enic_add_packet_filter(struct enic *enic);\n+int enic_add_packet_filter(struct enic *enic);\n int enic_set_mac_address(struct enic *enic, uint8_t *mac_addr);\n int enic_del_mac_address(struct enic *enic, int mac_index);\n unsigned int enic_cleanup_wq(struct enic *enic, struct vnic_wq *wq);\ndiff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c\nindex 90fdeda901..5d48930a9d 100644\n--- a/drivers/net/enic/enic_ethdev.c\n+++ b/drivers/net/enic/enic_ethdev.c\n@@ -603,29 +603,39 @@ static const uint32_t *enicpmd_dev_supported_ptypes_get(struct rte_eth_dev *dev)\n \treturn NULL;\n }\n \n-static void enicpmd_dev_promiscuous_enable(struct rte_eth_dev *eth_dev)\n+static int enicpmd_dev_promiscuous_enable(struct rte_eth_dev *eth_dev)\n {\n \tstruct enic *enic = pmd_priv(eth_dev);\n+\tint ret;\n \n \tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n-\t\treturn;\n+\t\treturn -ENOTSUP;\n \n \tENICPMD_FUNC_TRACE();\n \n \tenic->promisc = 1;\n-\tenic_add_packet_filter(enic);\n+\tret = enic_add_packet_filter(enic);\n+\tif (ret != 0)\n+\t\tenic->promisc = 0;\n+\n+\treturn ret;\n }\n \n-static void enicpmd_dev_promiscuous_disable(struct rte_eth_dev *eth_dev)\n+static int enicpmd_dev_promiscuous_disable(struct rte_eth_dev *eth_dev)\n {\n \tstruct enic *enic = pmd_priv(eth_dev);\n+\tint ret;\n \n \tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n-\t\treturn;\n+\t\treturn -ENOTSUP;\n \n \tENICPMD_FUNC_TRACE();\n \tenic->promisc = 0;\n-\tenic_add_packet_filter(enic);\n+\tret = enic_add_packet_filter(enic);\n+\tif (ret != 0)\n+\t\tenic->promisc = 1;\n+\n+\treturn ret;\n }\n \n static void enicpmd_dev_allmulticast_enable(struct rte_eth_dev *eth_dev)\ndiff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c\nindex 40af3781b3..f4e76a057a 100644\n--- a/drivers/net/enic/enic_main.c\n+++ b/drivers/net/enic/enic_main.c\n@@ -1364,10 +1364,10 @@ int enic_set_vlan_strip(struct enic *enic)\n \t\t\t       enic->rss_enable);\n }\n \n-void enic_add_packet_filter(struct enic *enic)\n+int enic_add_packet_filter(struct enic *enic)\n {\n \t/* Args -> directed, multicast, broadcast, promisc, allmulti */\n-\tvnic_dev_packet_filter(enic->vdev, 1, 1, 1,\n+\treturn vnic_dev_packet_filter(enic->vdev, 1, 1, 1,\n \t\tenic->promisc, enic->allmulti);\n }\n \ndiff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c\nindex 114d6a09f6..fee783ad07 100644\n--- a/drivers/net/failsafe/failsafe_ops.c\n+++ b/drivers/net/failsafe/failsafe_ops.c\n@@ -654,7 +654,7 @@ fs_dev_free_queues(struct rte_eth_dev *dev)\n \tdev->data->nb_tx_queues = 0;\n }\n \n-static void\n+static int\n fs_promiscuous_enable(struct rte_eth_dev *dev)\n {\n \tstruct sub_device *sdev;\n@@ -682,9 +682,11 @@ fs_promiscuous_enable(struct rte_eth_dev *dev)\n \t\t}\n \t}\n \tfs_unlock(dev, 0);\n+\n+\treturn ret;\n }\n \n-static void\n+static int\n fs_promiscuous_disable(struct rte_eth_dev *dev)\n {\n \tstruct sub_device *sdev;\n@@ -712,6 +714,8 @@ fs_promiscuous_disable(struct rte_eth_dev *dev)\n \t\t}\n \t}\n \tfs_unlock(dev, 0);\n+\n+\treturn ret;\n }\n \n static void\ndiff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c\nindex 8cb7337ea5..f0f6290089 100644\n--- a/drivers/net/fm10k/fm10k_ethdev.c\n+++ b/drivers/net/fm10k/fm10k_ethdev.c\n@@ -44,8 +44,8 @@ int fm10k_logtype_init;\n int fm10k_logtype_driver;\n \n static void fm10k_close_mbx_service(struct fm10k_hw *hw);\n-static void fm10k_dev_promiscuous_enable(struct rte_eth_dev *dev);\n-static void fm10k_dev_promiscuous_disable(struct rte_eth_dev *dev);\n+static int fm10k_dev_promiscuous_enable(struct rte_eth_dev *dev);\n+static int fm10k_dev_promiscuous_disable(struct rte_eth_dev *dev);\n static void fm10k_dev_allmulticast_enable(struct rte_eth_dev *dev);\n static void fm10k_dev_allmulticast_disable(struct rte_eth_dev *dev);\n static inline int fm10k_glort_valid(struct fm10k_hw *hw);\n@@ -908,7 +908,7 @@ static inline int fm10k_glort_valid(struct fm10k_hw *hw)\n \t\t!= FM10K_DGLORTMAP_NONE);\n }\n \n-static void\n+static int\n fm10k_dev_promiscuous_enable(struct rte_eth_dev *dev)\n {\n \tstruct fm10k_hw *hw = FM10K_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n@@ -918,18 +918,22 @@ fm10k_dev_promiscuous_enable(struct rte_eth_dev *dev)\n \n \t/* Return if it didn't acquire valid glort range */\n \tif ((hw->mac.type == fm10k_mac_pf) && !fm10k_glort_valid(hw))\n-\t\treturn;\n+\t\treturn 0;\n \n \tfm10k_mbx_lock(hw);\n \tstatus = hw->mac.ops.update_xcast_mode(hw, hw->mac.dglort_map,\n \t\t\t\tFM10K_XCAST_MODE_PROMISC);\n \tfm10k_mbx_unlock(hw);\n \n-\tif (status != FM10K_SUCCESS)\n+\tif (status != FM10K_SUCCESS) {\n \t\tPMD_INIT_LOG(ERR, \"Failed to enable promiscuous mode\");\n+\t\treturn -EAGAIN;\n+\t}\n+\n+\treturn 0;\n }\n \n-static void\n+static int\n fm10k_dev_promiscuous_disable(struct rte_eth_dev *dev)\n {\n \tstruct fm10k_hw *hw = FM10K_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n@@ -940,7 +944,7 @@ fm10k_dev_promiscuous_disable(struct rte_eth_dev *dev)\n \n \t/* Return if it didn't acquire valid glort range */\n \tif ((hw->mac.type == fm10k_mac_pf) && !fm10k_glort_valid(hw))\n-\t\treturn;\n+\t\treturn 0;\n \n \tif (dev->data->all_multicast == 1)\n \t\tmode = FM10K_XCAST_MODE_ALLMULTI;\n@@ -952,8 +956,12 @@ fm10k_dev_promiscuous_disable(struct rte_eth_dev *dev)\n \t\t\t\tmode);\n \tfm10k_mbx_unlock(hw);\n \n-\tif (status != FM10K_SUCCESS)\n+\tif (status != FM10K_SUCCESS) {\n \t\tPMD_INIT_LOG(ERR, \"Failed to disable promiscuous mode\");\n+\t\treturn -EAGAIN;\n+\t}\n+\n+\treturn 0;\n }\n \n static void\ndiff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c\nindex 17a3625d63..c50cdd9f81 100644\n--- a/drivers/net/hinic/hinic_pmd_ethdev.c\n+++ b/drivers/net/hinic/hinic_pmd_ethdev.c\n@@ -1325,8 +1325,12 @@ static void hinic_deinit_mac_addr(struct rte_eth_dev *eth_dev)\n  *\n  * @param dev\n  *   Pointer to Ethernet device structure.\n+ *\n+ * @return\n+ *   0 on success,\n+ *   negative error value otherwise.\n  */\n-static void hinic_dev_promiscuous_enable(struct rte_eth_dev *dev)\n+static int hinic_dev_promiscuous_enable(struct rte_eth_dev *dev)\n {\n \tint rc = HINIC_OK;\n \tstruct hinic_nic_dev *nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev);\n@@ -1338,6 +1342,8 @@ static void hinic_dev_promiscuous_enable(struct rte_eth_dev *dev)\n \trc = hinic_set_dev_promiscuous(nic_dev, true);\n \tif (rc)\n \t\tPMD_DRV_LOG(ERR, \"Enable promiscuous failed\");\n+\n+\treturn rc;\n }\n \n /**\n@@ -1345,8 +1351,12 @@ static void hinic_dev_promiscuous_enable(struct rte_eth_dev *dev)\n  *\n  * @param dev\n  *   Pointer to Ethernet device structure.\n+ *\n+ * @return\n+ *   0 on success,\n+ *   negative error value otherwise.\n  */\n-static void hinic_dev_promiscuous_disable(struct rte_eth_dev *dev)\n+static int hinic_dev_promiscuous_disable(struct rte_eth_dev *dev)\n {\n \tint rc = HINIC_OK;\n \tstruct hinic_nic_dev *nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev);\n@@ -1358,6 +1368,8 @@ static void hinic_dev_promiscuous_disable(struct rte_eth_dev *dev)\n \trc = hinic_set_dev_promiscuous(nic_dev, false);\n \tif (rc)\n \t\tPMD_DRV_LOG(ERR, \"Disable promiscuous failed\");\n+\n+\treturn rc;\n }\n \n /**\ndiff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c\nindex 390cb21964..79bd3a70c9 100644\n--- a/drivers/net/i40e/i40e_ethdev.c\n+++ b/drivers/net/i40e/i40e_ethdev.c\n@@ -223,8 +223,8 @@ static int i40e_dev_start(struct rte_eth_dev *dev);\n static void i40e_dev_stop(struct rte_eth_dev *dev);\n static void i40e_dev_close(struct rte_eth_dev *dev);\n static int  i40e_dev_reset(struct rte_eth_dev *dev);\n-static void i40e_dev_promiscuous_enable(struct rte_eth_dev *dev);\n-static void i40e_dev_promiscuous_disable(struct rte_eth_dev *dev);\n+static int i40e_dev_promiscuous_enable(struct rte_eth_dev *dev);\n+static int i40e_dev_promiscuous_disable(struct rte_eth_dev *dev);\n static void i40e_dev_allmulticast_enable(struct rte_eth_dev *dev);\n static void i40e_dev_allmulticast_disable(struct rte_eth_dev *dev);\n static int i40e_dev_set_link_up(struct rte_eth_dev *dev);\n@@ -2564,7 +2564,7 @@ i40e_dev_reset(struct rte_eth_dev *dev)\n \treturn ret;\n }\n \n-static void\n+static int\n i40e_dev_promiscuous_enable(struct rte_eth_dev *dev)\n {\n \tstruct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);\n@@ -2574,17 +2574,25 @@ i40e_dev_promiscuous_enable(struct rte_eth_dev *dev)\n \n \tstatus = i40e_aq_set_vsi_unicast_promiscuous(hw, vsi->seid,\n \t\t\t\t\t\t     true, NULL, true);\n-\tif (status != I40E_SUCCESS)\n+\tif (status != I40E_SUCCESS) {\n \t\tPMD_DRV_LOG(ERR, \"Failed to enable unicast promiscuous\");\n+\t\treturn -EAGAIN;\n+\t}\n \n \tstatus = i40e_aq_set_vsi_multicast_promiscuous(hw, vsi->seid,\n \t\t\t\t\t\t\tTRUE, NULL);\n-\tif (status != I40E_SUCCESS)\n+\tif (status != I40E_SUCCESS) {\n \t\tPMD_DRV_LOG(ERR, \"Failed to enable multicast promiscuous\");\n+\t\t/* Rollback unicast promiscuous mode */\n+\t\ti40e_aq_set_vsi_unicast_promiscuous(hw, vsi->seid,\n+\t\t\t\t\t\t    false, NULL, true);\n+\t\treturn -EAGAIN;\n+\t}\n \n+\treturn 0;\n }\n \n-static void\n+static int\n i40e_dev_promiscuous_disable(struct rte_eth_dev *dev)\n {\n \tstruct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);\n@@ -2594,17 +2602,26 @@ i40e_dev_promiscuous_disable(struct rte_eth_dev *dev)\n \n \tstatus = i40e_aq_set_vsi_unicast_promiscuous(hw, vsi->seid,\n \t\t\t\t\t\t     false, NULL, true);\n-\tif (status != I40E_SUCCESS)\n+\tif (status != I40E_SUCCESS) {\n \t\tPMD_DRV_LOG(ERR, \"Failed to disable unicast promiscuous\");\n+\t\treturn -EAGAIN;\n+\t}\n \n \t/* must remain in all_multicast mode */\n \tif (dev->data->all_multicast == 1)\n-\t\treturn;\n+\t\treturn 0;\n \n \tstatus = i40e_aq_set_vsi_multicast_promiscuous(hw, vsi->seid,\n \t\t\t\t\t\t\tfalse, NULL);\n-\tif (status != I40E_SUCCESS)\n+\tif (status != I40E_SUCCESS) {\n \t\tPMD_DRV_LOG(ERR, \"Failed to disable multicast promiscuous\");\n+\t\t/* Rollback unicast promiscuous mode */\n+\t\ti40e_aq_set_vsi_unicast_promiscuous(hw, vsi->seid,\n+\t\t\t\t\t\t    true, NULL, true);\n+\t\treturn -EAGAIN;\n+\t}\n+\n+\treturn 0;\n }\n \n static void\ndiff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c\nindex eca418522f..2bbbacf00b 100644\n--- a/drivers/net/i40e/i40e_ethdev_vf.c\n+++ b/drivers/net/i40e/i40e_ethdev_vf.c\n@@ -92,8 +92,8 @@ static int i40evf_vlan_filter_set(struct rte_eth_dev *dev,\n static int i40evf_vlan_offload_set(struct rte_eth_dev *dev, int mask);\n static void i40evf_dev_close(struct rte_eth_dev *dev);\n static int  i40evf_dev_reset(struct rte_eth_dev *dev);\n-static void i40evf_dev_promiscuous_enable(struct rte_eth_dev *dev);\n-static void i40evf_dev_promiscuous_disable(struct rte_eth_dev *dev);\n+static int i40evf_dev_promiscuous_enable(struct rte_eth_dev *dev);\n+static int i40evf_dev_promiscuous_disable(struct rte_eth_dev *dev);\n static void i40evf_dev_allmulticast_enable(struct rte_eth_dev *dev);\n static void i40evf_dev_allmulticast_disable(struct rte_eth_dev *dev);\n static int i40evf_init_vlan(struct rte_eth_dev *dev);\n@@ -2156,7 +2156,7 @@ i40evf_dev_link_update(struct rte_eth_dev *dev,\n \treturn rte_eth_linkstatus_set(dev, &new_link);\n }\n \n-static void\n+static int\n i40evf_dev_promiscuous_enable(struct rte_eth_dev *dev)\n {\n \tstruct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);\n@@ -2164,14 +2164,18 @@ i40evf_dev_promiscuous_enable(struct rte_eth_dev *dev)\n \n \t/* If enabled, just return */\n \tif (vf->promisc_unicast_enabled)\n-\t\treturn;\n+\t\treturn 0;\n \n \tret = i40evf_config_promisc(dev, 1, vf->promisc_multicast_enabled);\n \tif (ret == 0)\n \t\tvf->promisc_unicast_enabled = TRUE;\n+\telse\n+\t\tret = -EAGAIN;\n+\n+\treturn ret;\n }\n \n-static void\n+static int\n i40evf_dev_promiscuous_disable(struct rte_eth_dev *dev)\n {\n \tstruct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);\n@@ -2179,11 +2183,15 @@ i40evf_dev_promiscuous_disable(struct rte_eth_dev *dev)\n \n \t/* If disabled, just return */\n \tif (!vf->promisc_unicast_enabled)\n-\t\treturn;\n+\t\treturn 0;\n \n \tret = i40evf_config_promisc(dev, 0, vf->promisc_multicast_enabled);\n \tif (ret == 0)\n \t\tvf->promisc_unicast_enabled = FALSE;\n+\telse\n+\t\tret = -EAGAIN;\n+\n+\treturn ret;\n }\n \n static void\ndiff --git a/drivers/net/i40e/i40e_vf_representor.c b/drivers/net/i40e/i40e_vf_representor.c\nindex 652f0accca..7f69e27a24 100644\n--- a/drivers/net/i40e/i40e_vf_representor.c\n+++ b/drivers/net/i40e/i40e_vf_representor.c\n@@ -274,22 +274,22 @@ i40e_vf_representor_stats_reset(struct rte_eth_dev *ethdev)\n \t\trepresentor->vf_id, &representor->stats_offset);\n }\n \n-static void\n+static int\n i40e_vf_representor_promiscuous_enable(struct rte_eth_dev *ethdev)\n {\n \tstruct i40e_vf_representor *representor = ethdev->data->dev_private;\n \n-\trte_pmd_i40e_set_vf_unicast_promisc(\n+\treturn rte_pmd_i40e_set_vf_unicast_promisc(\n \t\trepresentor->adapter->eth_dev->data->port_id,\n \t\trepresentor->vf_id, 1);\n }\n \n-static void\n+static int\n i40e_vf_representor_promiscuous_disable(struct rte_eth_dev *ethdev)\n {\n \tstruct i40e_vf_representor *representor = ethdev->data->dev_private;\n \n-\trte_pmd_i40e_set_vf_unicast_promisc(\n+\treturn rte_pmd_i40e_set_vf_unicast_promisc(\n \t\trepresentor->adapter->eth_dev->data->port_id,\n \t\trepresentor->vf_id, 0);\n }\ndiff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c\nindex 99b1f43b82..22a88c88dd 100644\n--- a/drivers/net/iavf/iavf_ethdev.c\n+++ b/drivers/net/iavf/iavf_ethdev.c\n@@ -43,8 +43,8 @@ static const uint32_t *iavf_dev_supported_ptypes_get(struct rte_eth_dev *dev);\n static int iavf_dev_stats_get(struct rte_eth_dev *dev,\n \t\t\t     struct rte_eth_stats *stats);\n static void iavf_dev_stats_reset(struct rte_eth_dev *dev);\n-static void iavf_dev_promiscuous_enable(struct rte_eth_dev *dev);\n-static void iavf_dev_promiscuous_disable(struct rte_eth_dev *dev);\n+static int iavf_dev_promiscuous_enable(struct rte_eth_dev *dev);\n+static int iavf_dev_promiscuous_disable(struct rte_eth_dev *dev);\n static void iavf_dev_allmulticast_enable(struct rte_eth_dev *dev);\n static void iavf_dev_allmulticast_disable(struct rte_eth_dev *dev);\n static int iavf_dev_add_mac_addr(struct rte_eth_dev *dev,\n@@ -634,7 +634,7 @@ iavf_dev_link_update(struct rte_eth_dev *dev,\n \treturn 0;\n }\n \n-static void\n+static int\n iavf_dev_promiscuous_enable(struct rte_eth_dev *dev)\n {\n \tstruct iavf_adapter *adapter =\n@@ -643,14 +643,18 @@ iavf_dev_promiscuous_enable(struct rte_eth_dev *dev)\n \tint ret;\n \n \tif (vf->promisc_unicast_enabled)\n-\t\treturn;\n+\t\treturn 0;\n \n \tret = iavf_config_promisc(adapter, TRUE, vf->promisc_multicast_enabled);\n \tif (!ret)\n \t\tvf->promisc_unicast_enabled = TRUE;\n+\telse\n+\t\tret = -EAGAIN;\n+\n+\treturn ret;\n }\n \n-static void\n+static int\n iavf_dev_promiscuous_disable(struct rte_eth_dev *dev)\n {\n \tstruct iavf_adapter *adapter =\n@@ -659,11 +663,15 @@ iavf_dev_promiscuous_disable(struct rte_eth_dev *dev)\n \tint ret;\n \n \tif (!vf->promisc_unicast_enabled)\n-\t\treturn;\n+\t\treturn 0;\n \n \tret = iavf_config_promisc(adapter, FALSE, vf->promisc_multicast_enabled);\n \tif (!ret)\n \t\tvf->promisc_unicast_enabled = FALSE;\n+\telse\n+\t\tret = -EAGAIN;\n+\n+\treturn ret;\n }\n \n static void\ndiff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c\nindex 9d0e339a5d..eecf9c86c2 100644\n--- a/drivers/net/ice/ice_ethdev.c\n+++ b/drivers/net/ice/ice_ethdev.c\n@@ -58,8 +58,8 @@ static int ice_rss_hash_update(struct rte_eth_dev *dev,\n \t\t\t       struct rte_eth_rss_conf *rss_conf);\n static int ice_rss_hash_conf_get(struct rte_eth_dev *dev,\n \t\t\t\t struct rte_eth_rss_conf *rss_conf);\n-static void ice_promisc_enable(struct rte_eth_dev *dev);\n-static void ice_promisc_disable(struct rte_eth_dev *dev);\n+static int ice_promisc_enable(struct rte_eth_dev *dev);\n+static int ice_promisc_disable(struct rte_eth_dev *dev);\n static void ice_allmulti_enable(struct rte_eth_dev *dev);\n static void ice_allmulti_disable(struct rte_eth_dev *dev);\n static int ice_vlan_filter_set(struct rte_eth_dev *dev,\n@@ -2973,7 +2973,7 @@ ice_rss_hash_conf_get(struct rte_eth_dev *dev,\n \treturn 0;\n }\n \n-static void\n+static int\n ice_promisc_enable(struct rte_eth_dev *dev)\n {\n \tstruct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);\n@@ -2981,18 +2981,26 @@ ice_promisc_enable(struct rte_eth_dev *dev)\n \tstruct ice_vsi *vsi = pf->main_vsi;\n \tenum ice_status status;\n \tuint8_t pmask;\n+\tint ret = 0;\n \n \tpmask = ICE_PROMISC_UCAST_RX | ICE_PROMISC_UCAST_TX |\n \t\tICE_PROMISC_MCAST_RX | ICE_PROMISC_MCAST_TX;\n \n \tstatus = ice_set_vsi_promisc(hw, vsi->idx, pmask, 0);\n-\tif (status == ICE_ERR_ALREADY_EXISTS)\n+\tswitch (status) {\n+\tcase ICE_ERR_ALREADY_EXISTS:\n \t\tPMD_DRV_LOG(DEBUG, \"Promisc mode has already been enabled\");\n-\telse if (status != ICE_SUCCESS)\n+\tcase ICE_SUCCESS:\n+\t\tbreak;\n+\tdefault:\n \t\tPMD_DRV_LOG(ERR, \"Failed to enable promisc, err=%d\", status);\n+\t\tret = -EAGAIN;\n+\t}\n+\n+\treturn ret;\n }\n \n-static void\n+static int\n ice_promisc_disable(struct rte_eth_dev *dev)\n {\n \tstruct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);\n@@ -3000,13 +3008,18 @@ ice_promisc_disable(struct rte_eth_dev *dev)\n \tstruct ice_vsi *vsi = pf->main_vsi;\n \tenum ice_status status;\n \tuint8_t pmask;\n+\tint ret = 0;\n \n \tpmask = ICE_PROMISC_UCAST_RX | ICE_PROMISC_UCAST_TX |\n \t\tICE_PROMISC_MCAST_RX | ICE_PROMISC_MCAST_TX;\n \n \tstatus = ice_clear_vsi_promisc(hw, vsi->idx, pmask, 0);\n-\tif (status != ICE_SUCCESS)\n+\tif (status != ICE_SUCCESS) {\n \t\tPMD_DRV_LOG(ERR, \"Failed to clear promisc, err=%d\", status);\n+\t\tret = -EAGAIN;\n+\t}\n+\n+\treturn ret;\n }\n \n static void\ndiff --git a/drivers/net/ipn3ke/ipn3ke_ethdev.h b/drivers/net/ipn3ke/ipn3ke_ethdev.h\nindex c7b336bbd1..830e717970 100644\n--- a/drivers/net/ipn3ke/ipn3ke_ethdev.h\n+++ b/drivers/net/ipn3ke/ipn3ke_ethdev.h\n@@ -539,9 +539,9 @@ ipn3ke_rpst_dev_set_link_down(struct rte_eth_dev *dev);\n int\n ipn3ke_rpst_link_update(struct rte_eth_dev *ethdev,\n \t__rte_unused int wait_to_complete);\n-void\n+int\n ipn3ke_rpst_promiscuous_enable(struct rte_eth_dev *ethdev);\n-void\n+int\n ipn3ke_rpst_promiscuous_disable(struct rte_eth_dev *ethdev);\n void\n ipn3ke_rpst_allmulticast_enable(struct rte_eth_dev *ethdev);\ndiff --git a/drivers/net/ipn3ke/ipn3ke_representor.c b/drivers/net/ipn3ke/ipn3ke_representor.c\nindex 476d5e52bd..9079073c95 100644\n--- a/drivers/net/ipn3ke/ipn3ke_representor.c\n+++ b/drivers/net/ipn3ke/ipn3ke_representor.c\n@@ -2618,7 +2618,7 @@ ipn3ke_rpst_scan_check(void)\n \treturn 0;\n }\n \n-void\n+int\n ipn3ke_rpst_promiscuous_enable(struct rte_eth_dev *ethdev)\n {\n \tstruct ipn3ke_hw *hw = IPN3KE_DEV_PRIVATE_TO_HW(ethdev);\n@@ -2641,9 +2641,11 @@ ipn3ke_rpst_promiscuous_enable(struct rte_eth_dev *ethdev)\n \t\t\t\trpst->port_id,\n \t\t\t\t0);\n \t}\n+\n+\treturn 0;\n }\n \n-void\n+int\n ipn3ke_rpst_promiscuous_disable(struct rte_eth_dev *ethdev)\n {\n \tstruct ipn3ke_hw *hw = IPN3KE_DEV_PRIVATE_TO_HW(ethdev);\n@@ -2666,6 +2668,8 @@ ipn3ke_rpst_promiscuous_disable(struct rte_eth_dev *ethdev)\n \t\t\t\trpst->port_id,\n \t\t\t\t0);\n \t}\n+\n+\treturn 0;\n }\n \n void\ndiff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c\nindex 0108db890b..023b267d74 100644\n--- a/drivers/net/ixgbe/ixgbe_ethdev.c\n+++ b/drivers/net/ixgbe/ixgbe_ethdev.c\n@@ -149,8 +149,8 @@ static int  ixgbe_dev_set_link_up(struct rte_eth_dev *dev);\n static int  ixgbe_dev_set_link_down(struct rte_eth_dev *dev);\n static void ixgbe_dev_close(struct rte_eth_dev *dev);\n static int  ixgbe_dev_reset(struct rte_eth_dev *dev);\n-static void ixgbe_dev_promiscuous_enable(struct rte_eth_dev *dev);\n-static void ixgbe_dev_promiscuous_disable(struct rte_eth_dev *dev);\n+static int ixgbe_dev_promiscuous_enable(struct rte_eth_dev *dev);\n+static int ixgbe_dev_promiscuous_disable(struct rte_eth_dev *dev);\n static void ixgbe_dev_allmulticast_enable(struct rte_eth_dev *dev);\n static void ixgbe_dev_allmulticast_disable(struct rte_eth_dev *dev);\n static int ixgbe_dev_link_update(struct rte_eth_dev *dev,\n@@ -270,8 +270,8 @@ static int ixgbevf_dev_rx_queue_intr_disable(struct rte_eth_dev *dev,\n static void ixgbevf_set_ivar_map(struct ixgbe_hw *hw, int8_t direction,\n \t\t\t\t uint8_t queue, uint8_t msix_vector);\n static void ixgbevf_configure_msix(struct rte_eth_dev *dev);\n-static void ixgbevf_dev_promiscuous_enable(struct rte_eth_dev *dev);\n-static void ixgbevf_dev_promiscuous_disable(struct rte_eth_dev *dev);\n+static int ixgbevf_dev_promiscuous_enable(struct rte_eth_dev *dev);\n+static int ixgbevf_dev_promiscuous_disable(struct rte_eth_dev *dev);\n static void ixgbevf_dev_allmulticast_enable(struct rte_eth_dev *dev);\n static void ixgbevf_dev_allmulticast_disable(struct rte_eth_dev *dev);\n \n@@ -4181,7 +4181,7 @@ ixgbevf_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete)\n \treturn ixgbe_dev_link_update_share(dev, wait_to_complete, 1);\n }\n \n-static void\n+static int\n ixgbe_dev_promiscuous_enable(struct rte_eth_dev *dev)\n {\n \tstruct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n@@ -4190,9 +4190,11 @@ ixgbe_dev_promiscuous_enable(struct rte_eth_dev *dev)\n \tfctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL);\n \tfctrl |= (IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE);\n \tIXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl);\n+\n+\treturn 0;\n }\n \n-static void\n+static int\n ixgbe_dev_promiscuous_disable(struct rte_eth_dev *dev)\n {\n \tstruct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n@@ -4205,6 +4207,8 @@ ixgbe_dev_promiscuous_disable(struct rte_eth_dev *dev)\n \telse\n \t\tfctrl &= (~IXGBE_FCTRL_MPE);\n \tIXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl);\n+\n+\treturn 0;\n }\n \n static void\n@@ -8402,20 +8406,46 @@ ixgbe_dev_udp_tunnel_port_del(struct rte_eth_dev *dev,\n \treturn ret;\n }\n \n-static void\n+static int\n ixgbevf_dev_promiscuous_enable(struct rte_eth_dev *dev)\n {\n \tstruct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tint ret;\n+\n+\tswitch (hw->mac.ops.update_xcast_mode(hw, IXGBEVF_XCAST_MODE_PROMISC)) {\n+\tcase IXGBE_SUCCESS:\n+\t\tret = 0;\n+\t\tbreak;\n+\tcase IXGBE_ERR_FEATURE_NOT_SUPPORTED:\n+\t\tret = -ENOTSUP;\n+\t\tbreak;\n+\tdefault:\n+\t\tret = -EAGAIN;\n+\t\tbreak;\n+\t}\n \n-\thw->mac.ops.update_xcast_mode(hw, IXGBEVF_XCAST_MODE_PROMISC);\n+\treturn ret;\n }\n \n-static void\n+static int\n ixgbevf_dev_promiscuous_disable(struct rte_eth_dev *dev)\n {\n \tstruct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tint ret;\n \n-\thw->mac.ops.update_xcast_mode(hw, IXGBEVF_XCAST_MODE_NONE);\n+\tswitch (hw->mac.ops.update_xcast_mode(hw, IXGBEVF_XCAST_MODE_NONE)) {\n+\tcase IXGBE_SUCCESS:\n+\t\tret = 0;\n+\t\tbreak;\n+\tcase IXGBE_ERR_FEATURE_NOT_SUPPORTED:\n+\t\tret = -ENOTSUP;\n+\t\tbreak;\n+\tdefault:\n+\t\tret = -EAGAIN;\n+\t\tbreak;\n+\t}\n+\n+\treturn ret;\n }\n \n static void\ndiff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c\nindex d97e357e3c..e1eaf9eb8a 100644\n--- a/drivers/net/liquidio/lio_ethdev.c\n+++ b/drivers/net/liquidio/lio_ethdev.c\n@@ -961,8 +961,12 @@ lio_dev_link_update(struct rte_eth_dev *eth_dev,\n /**\n  * \\brief Net device enable, disable allmulticast\n  * @param eth_dev Pointer to the structure rte_eth_dev\n+ *\n+ * @return\n+ *  On success return 0\n+ *  On failure return negative errno\n  */\n-static void\n+static int\n lio_change_dev_flag(struct rte_eth_dev *eth_dev)\n {\n \tstruct lio_device *lio_dev = LIO_DEV(eth_dev);\n@@ -987,14 +991,18 @@ lio_change_dev_flag(struct rte_eth_dev *eth_dev)\n \n \tif (lio_send_ctrl_pkt(lio_dev, &ctrl_pkt)) {\n \t\tlio_dev_err(lio_dev, \"Failed to send change flag message\\n\");\n-\t\treturn;\n+\t\treturn -EAGAIN;\n \t}\n \n-\tif (lio_wait_for_ctrl_cmd(lio_dev, &ctrl_cmd))\n+\tif (lio_wait_for_ctrl_cmd(lio_dev, &ctrl_cmd)) {\n \t\tlio_dev_err(lio_dev, \"Change dev flag command timed out\\n\");\n+\t\treturn -ETIMEDOUT;\n+\t}\n+\n+\treturn 0;\n }\n \n-static void\n+static int\n lio_dev_promiscuous_enable(struct rte_eth_dev *eth_dev)\n {\n \tstruct lio_device *lio_dev = LIO_DEV(eth_dev);\n@@ -1002,20 +1010,20 @@ lio_dev_promiscuous_enable(struct rte_eth_dev *eth_dev)\n \tif (strcmp(lio_dev->firmware_version, LIO_VF_TRUST_MIN_VERSION) < 0) {\n \t\tlio_dev_err(lio_dev, \"Require firmware version >= %s\\n\",\n \t\t\t    LIO_VF_TRUST_MIN_VERSION);\n-\t\treturn;\n+\t\treturn -EAGAIN;\n \t}\n \n \tif (!lio_dev->intf_open) {\n \t\tlio_dev_err(lio_dev, \"Port %d down, can't enable promiscuous\\n\",\n \t\t\t    lio_dev->port_id);\n-\t\treturn;\n+\t\treturn -EAGAIN;\n \t}\n \n \tlio_dev->ifflags |= LIO_IFFLAG_PROMISC;\n-\tlio_change_dev_flag(eth_dev);\n+\treturn lio_change_dev_flag(eth_dev);\n }\n \n-static void\n+static int\n lio_dev_promiscuous_disable(struct rte_eth_dev *eth_dev)\n {\n \tstruct lio_device *lio_dev = LIO_DEV(eth_dev);\n@@ -1023,17 +1031,17 @@ lio_dev_promiscuous_disable(struct rte_eth_dev *eth_dev)\n \tif (strcmp(lio_dev->firmware_version, LIO_VF_TRUST_MIN_VERSION) < 0) {\n \t\tlio_dev_err(lio_dev, \"Require firmware version >= %s\\n\",\n \t\t\t    LIO_VF_TRUST_MIN_VERSION);\n-\t\treturn;\n+\t\treturn -EAGAIN;\n \t}\n \n \tif (!lio_dev->intf_open) {\n \t\tlio_dev_err(lio_dev, \"Port %d down, can't disable promiscuous\\n\",\n \t\t\t    lio_dev->port_id);\n-\t\treturn;\n+\t\treturn -EAGAIN;\n \t}\n \n \tlio_dev->ifflags &= ~LIO_IFFLAG_PROMISC;\n-\tlio_change_dev_flag(eth_dev);\n+\treturn lio_change_dev_flag(eth_dev);\n }\n \n static void\ndiff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h\nindex 7730b530af..21517d70a2 100644\n--- a/drivers/net/mlx4/mlx4.h\n+++ b/drivers/net/mlx4/mlx4.h\n@@ -205,8 +205,8 @@ int mlx4_mtu_get(struct mlx4_priv *priv, uint16_t *mtu);\n int mlx4_mtu_set(struct rte_eth_dev *dev, uint16_t mtu);\n int mlx4_dev_set_link_down(struct rte_eth_dev *dev);\n int mlx4_dev_set_link_up(struct rte_eth_dev *dev);\n-void mlx4_promiscuous_enable(struct rte_eth_dev *dev);\n-void mlx4_promiscuous_disable(struct rte_eth_dev *dev);\n+int mlx4_promiscuous_enable(struct rte_eth_dev *dev);\n+int mlx4_promiscuous_disable(struct rte_eth_dev *dev);\n void mlx4_allmulticast_enable(struct rte_eth_dev *dev);\n void mlx4_allmulticast_disable(struct rte_eth_dev *dev);\n void mlx4_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index);\ndiff --git a/drivers/net/mlx4/mlx4_ethdev.c b/drivers/net/mlx4/mlx4_ethdev.c\nindex 623ebd88cb..c8a73bc1f4 100644\n--- a/drivers/net/mlx4/mlx4_ethdev.c\n+++ b/drivers/net/mlx4/mlx4_ethdev.c\n@@ -341,13 +341,17 @@ enum rxmode_toggle {\n  *   Pointer to Ethernet device structure.\n  * @param toggle\n  *   Toggle to set.\n+ *\n+ * @return\n+ *   0 on success, a negative errno value otherwise and rte_errno is set.\n  */\n-static void\n+static int\n mlx4_rxmode_toggle(struct rte_eth_dev *dev, enum rxmode_toggle toggle)\n {\n \tstruct mlx4_priv *priv = dev->data->dev_private;\n \tconst char *mode;\n \tstruct rte_flow_error error;\n+\tint ret;\n \n \tswitch (toggle) {\n \tcase RXMODE_TOGGLE_PROMISC_OFF:\n@@ -363,12 +367,16 @@ mlx4_rxmode_toggle(struct rte_eth_dev *dev, enum rxmode_toggle toggle)\n \tdefault:\n \t\tmode = \"undefined\";\n \t}\n-\tif (!mlx4_flow_sync(priv, &error))\n-\t\treturn;\n+\n+\tret = mlx4_flow_sync(priv, &error);\n+\tif (!ret)\n+\t\treturn 0;\n+\n \tERROR(\"cannot toggle %s mode (code %d, \\\"%s\\\"),\"\n \t      \" flow error type %d, cause %p, message: %s\",\n \t      mode, rte_errno, strerror(rte_errno), error.type, error.cause,\n \t      error.message ? error.message : \"(unspecified)\");\n+\treturn ret;\n }\n \n /**\n@@ -376,8 +384,11 @@ mlx4_rxmode_toggle(struct rte_eth_dev *dev, enum rxmode_toggle toggle)\n  *\n  * @param dev\n  *   Pointer to Ethernet device structure.\n+ *\n+ * @return\n+ *   0 on success, a negative errno value otherwise and rte_errno is set.\n  */\n-void\n+int\n mlx4_promiscuous_enable(struct rte_eth_dev *dev)\n {\n \tmlx4_rxmode_toggle(dev, RXMODE_TOGGLE_PROMISC_ON);\n@@ -388,8 +399,11 @@ mlx4_promiscuous_enable(struct rte_eth_dev *dev)\n  *\n  * @param dev\n  *   Pointer to Ethernet device structure.\n+ *\n+ * @return\n+ *   0 on success, a negative errno value otherwise and rte_errno is set.\n  */\n-void\n+int\n mlx4_promiscuous_disable(struct rte_eth_dev *dev)\n {\n \tmlx4_rxmode_toggle(dev, RXMODE_TOGGLE_PROMISC_OFF);\ndiff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h\nindex 8ddbb7a17c..11d540c3a5 100644\n--- a/drivers/net/mlx5/mlx5.h\n+++ b/drivers/net/mlx5/mlx5.h\n@@ -752,8 +752,8 @@ int mlx5_dev_rss_reta_update(struct rte_eth_dev *dev,\n \n /* mlx5_rxmode.c */\n \n-void mlx5_promiscuous_enable(struct rte_eth_dev *dev);\n-void mlx5_promiscuous_disable(struct rte_eth_dev *dev);\n+int mlx5_promiscuous_enable(struct rte_eth_dev *dev);\n+int mlx5_promiscuous_disable(struct rte_eth_dev *dev);\n void mlx5_allmulticast_enable(struct rte_eth_dev *dev);\n void mlx5_allmulticast_disable(struct rte_eth_dev *dev);\n \ndiff --git a/drivers/net/mlx5/mlx5_rxmode.c b/drivers/net/mlx5/mlx5_rxmode.c\nindex d5077db0db..c862fc9520 100644\n--- a/drivers/net/mlx5/mlx5_rxmode.c\n+++ b/drivers/net/mlx5/mlx5_rxmode.c\n@@ -28,8 +28,11 @@\n  *\n  * @param dev\n  *   Pointer to Ethernet device structure.\n+ *\n+ * @return\n+ *   0 on success, a negative errno value otherwise and rte_errno is set.\n  */\n-void\n+int\n mlx5_promiscuous_enable(struct rte_eth_dev *dev)\n {\n \tstruct mlx5_priv *priv = dev->data->dev_private;\n@@ -41,14 +44,24 @@ mlx5_promiscuous_enable(struct rte_eth_dev *dev)\n \t\t\t\"port %u cannot enable promiscuous mode\"\n \t\t\t\" in flow isolation mode\",\n \t\t\tdev->data->port_id);\n-\t\treturn;\n+\t\treturn 0;\n+\t}\n+\tif (priv->config.vf) {\n+\t\tret = mlx5_nl_promisc(dev, 1);\n+\t\tif (ret)\n+\t\t\tgoto error;\n \t}\n-\tif (priv->config.vf)\n-\t\tmlx5_nl_promisc(dev, 1);\n \tret = mlx5_traffic_restart(dev);\n \tif (ret)\n \t\tDRV_LOG(ERR, \"port %u cannot enable promiscuous mode: %s\",\n \t\t\tdev->data->port_id, strerror(rte_errno));\n+\n+error:\n+\t/*\n+\t * rte_eth_dev_promiscuous_enable() rollback\n+\t * dev->data->promiscuous in the case of failure.\n+\t */\n+\treturn ret;\n }\n \n /**\n@@ -56,20 +69,33 @@ mlx5_promiscuous_enable(struct rte_eth_dev *dev)\n  *\n  * @param dev\n  *   Pointer to Ethernet device structure.\n+ *\n+ * @return\n+ *   0 on success, a negative errno value otherwise and rte_errno is set.\n  */\n-void\n+int\n mlx5_promiscuous_disable(struct rte_eth_dev *dev)\n {\n \tstruct mlx5_priv *priv = dev->data->dev_private;\n \tint ret;\n \n \tdev->data->promiscuous = 0;\n-\tif (priv->config.vf)\n-\t\tmlx5_nl_promisc(dev, 0);\n+\tif (priv->config.vf) {\n+\t\tret = mlx5_nl_promisc(dev, 0);\n+\t\tif (ret)\n+\t\t\tgoto error;\n+\t}\n \tret = mlx5_traffic_restart(dev);\n \tif (ret)\n \t\tDRV_LOG(ERR, \"port %u cannot disable promiscuous mode: %s\",\n \t\t\tdev->data->port_id, strerror(rte_errno));\n+\n+error:\n+\t/*\n+\t * rte_eth_dev_promiscuous_disable() rollback\n+\t * dev->data->promiscuous in the case of failure.\n+\t */\n+\treturn ret;\n }\n \n /**\ndiff --git a/drivers/net/mvneta/mvneta_ethdev.c b/drivers/net/mvneta/mvneta_ethdev.c\nindex 3ba0ac76e2..1090af03b1 100644\n--- a/drivers/net/mvneta/mvneta_ethdev.c\n+++ b/drivers/net/mvneta/mvneta_ethdev.c\n@@ -534,25 +534,30 @@ mvneta_link_update(struct rte_eth_dev *dev, int wait_to_complete __rte_unused)\n  *\n  * @param dev\n  *   Pointer to Ethernet device structure.\n+ *\n+ * @return\n+ *   always 0\n  */\n-static void\n+static int\n mvneta_promiscuous_enable(struct rte_eth_dev *dev)\n {\n \tstruct mvneta_priv *priv = dev->data->dev_private;\n \tint ret, en;\n \n \tif (!priv->ppio)\n-\t\treturn;\n+\t\treturn 0;\n \n \tneta_ppio_get_promisc(priv->ppio, &en);\n \tif (en) {\n \t\tMVNETA_LOG(INFO, \"Promiscuous already enabled\");\n-\t\treturn;\n+\t\treturn 0;\n \t}\n \n \tret = neta_ppio_set_promisc(priv->ppio, 1);\n \tif (ret)\n \t\tMVNETA_LOG(ERR, \"Failed to enable promiscuous mode\");\n+\n+\treturn 0;\n }\n \n /**\n@@ -560,25 +565,30 @@ mvneta_promiscuous_enable(struct rte_eth_dev *dev)\n  *\n  * @param dev\n  *   Pointer to Ethernet device structure.\n+ *\n+ * @return\n+ *   always 0\n  */\n-static void\n+static int\n mvneta_promiscuous_disable(struct rte_eth_dev *dev)\n {\n \tstruct mvneta_priv *priv = dev->data->dev_private;\n \tint ret, en;\n \n \tif (!priv->ppio)\n-\t\treturn;\n+\t\treturn 0;\n \n \tneta_ppio_get_promisc(priv->ppio, &en);\n \tif (!en) {\n \t\tMVNETA_LOG(INFO, \"Promiscuous already disabled\");\n-\t\treturn;\n+\t\treturn 0;\n \t}\n \n \tret = neta_ppio_set_promisc(priv->ppio, 0);\n \tif (ret)\n \t\tMVNETA_LOG(ERR, \"Failed to disable promiscuous mode\");\n+\n+\treturn 0;\n }\n \n /**\ndiff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c\nindex 345c24404d..7babc891ae 100644\n--- a/drivers/net/mvpp2/mrvl_ethdev.c\n+++ b/drivers/net/mvpp2/mrvl_ethdev.c\n@@ -994,22 +994,29 @@ mrvl_link_update(struct rte_eth_dev *dev, int wait_to_complete __rte_unused)\n  *\n  * @param dev\n  *   Pointer to Ethernet device structure.\n+ *\n+ * @return\n+ *   0 on success, negative error value otherwise.\n  */\n-static void\n+static int\n mrvl_promiscuous_enable(struct rte_eth_dev *dev)\n {\n \tstruct mrvl_priv *priv = dev->data->dev_private;\n \tint ret;\n \n \tif (!priv->ppio)\n-\t\treturn;\n+\t\treturn 0;\n \n \tif (priv->isolated)\n-\t\treturn;\n+\t\treturn 0;\n \n \tret = pp2_ppio_set_promisc(priv->ppio, 1);\n-\tif (ret)\n+\tif (ret) {\n \t\tMRVL_LOG(ERR, \"Failed to enable promiscuous mode\");\n+\t\treturn -EAGAIN;\n+\t}\n+\n+\treturn 0;\n }\n \n /**\n@@ -1040,19 +1047,26 @@ mrvl_allmulticast_enable(struct rte_eth_dev *dev)\n  *\n  * @param dev\n  *   Pointer to Ethernet device structure.\n+ *\n+ * @return\n+ *   0 on success, negative error value otherwise.\n  */\n-static void\n+static int\n mrvl_promiscuous_disable(struct rte_eth_dev *dev)\n {\n \tstruct mrvl_priv *priv = dev->data->dev_private;\n \tint ret;\n \n \tif (!priv->ppio)\n-\t\treturn;\n+\t\treturn 0;\n \n \tret = pp2_ppio_set_promisc(priv->ppio, 0);\n-\tif (ret)\n+\tif (ret) {\n \t\tMRVL_LOG(ERR, \"Failed to disable promiscuous mode\");\n+\t\treturn -EAGAIN;\n+\t}\n+\n+\treturn 0;\n }\n \n /**\ndiff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c\nindex 7353211c12..d04a6c8acb 100644\n--- a/drivers/net/netvsc/hn_ethdev.c\n+++ b/drivers/net/netvsc/hn_ethdev.c\n@@ -416,16 +416,16 @@ static int hn_rss_hash_conf_get(struct rte_eth_dev *dev,\n \treturn 0;\n }\n \n-static void\n+static int\n hn_dev_promiscuous_enable(struct rte_eth_dev *dev)\n {\n \tstruct hn_data *hv = dev->data->dev_private;\n \n \thn_rndis_set_rxfilter(hv, NDIS_PACKET_TYPE_PROMISCUOUS);\n-\thn_vf_promiscuous_enable(dev);\n+\treturn hn_vf_promiscuous_enable(dev);\n }\n \n-static void\n+static int\n hn_dev_promiscuous_disable(struct rte_eth_dev *dev)\n {\n \tstruct hn_data *hv = dev->data->dev_private;\n@@ -435,7 +435,7 @@ hn_dev_promiscuous_disable(struct rte_eth_dev *dev)\n \tif (dev->data->all_multicast)\n \t\tfilter |= NDIS_PACKET_TYPE_ALL_MULTICAST;\n \thn_rndis_set_rxfilter(hv, filter);\n-\thn_vf_promiscuous_disable(dev);\n+\treturn hn_vf_promiscuous_disable(dev);\n }\n \n static void\ndiff --git a/drivers/net/netvsc/hn_var.h b/drivers/net/netvsc/hn_var.h\nindex e0ebe4e1c8..01f2276482 100644\n--- a/drivers/net/netvsc/hn_var.h\n+++ b/drivers/net/netvsc/hn_var.h\n@@ -214,8 +214,8 @@ void\thn_vf_close(struct rte_eth_dev *dev);\n \n void\thn_vf_allmulticast_enable(struct rte_eth_dev *dev);\n void\thn_vf_allmulticast_disable(struct rte_eth_dev *dev);\n-void\thn_vf_promiscuous_enable(struct rte_eth_dev *dev);\n-void\thn_vf_promiscuous_disable(struct rte_eth_dev *dev);\n+int\thn_vf_promiscuous_enable(struct rte_eth_dev *dev);\n+int\thn_vf_promiscuous_disable(struct rte_eth_dev *dev);\n int\thn_vf_mc_addr_list(struct rte_eth_dev *dev,\n \t\t\t   struct rte_ether_addr *mc_addr_set,\n \t\t\t   uint32_t nb_mc_addr);\ndiff --git a/drivers/net/netvsc/hn_vf.c b/drivers/net/netvsc/hn_vf.c\nindex d53d27bb73..d133438bbd 100644\n--- a/drivers/net/netvsc/hn_vf.c\n+++ b/drivers/net/netvsc/hn_vf.c\n@@ -362,6 +362,20 @@ void hn_vf_stop(struct rte_eth_dev *dev)\n \t\trte_spinlock_unlock(&hv->vf_lock);\t\t\\\n \t}\n \n+/* If VF is present, then cascade configuration down */\n+#define VF_ETHDEV_FUNC_RET_STATUS(dev, func)\t\t\t\\\n+\t{\t\t\t\t\t\t\t\\\n+\t\tstruct hn_data *hv = (dev)->data->dev_private;\t\\\n+\t\tstruct rte_eth_dev *vf_dev;\t\t\t\\\n+\t\tint ret = 0;\t\t\t\t\t\\\n+\t\trte_spinlock_lock(&hv->vf_lock);\t\t\\\n+\t\tvf_dev = hn_get_vf_dev(hv);\t\t\t\\\n+\t\tif (vf_dev)\t\t\t\t\t\\\n+\t\t\tret = func(vf_dev->data->port_id);\t\\\n+\t\trte_spinlock_unlock(&hv->vf_lock);\t\t\\\n+\t\treturn ret;\t\t\t\t\t\\\n+\t}\n+\n void hn_vf_reset(struct rte_eth_dev *dev)\n {\n \tVF_ETHDEV_FUNC(dev, rte_eth_dev_reset);\n@@ -396,14 +410,14 @@ void hn_vf_allmulticast_disable(struct rte_eth_dev *dev)\n \tVF_ETHDEV_FUNC(dev, rte_eth_allmulticast_disable);\n }\n \n-void hn_vf_promiscuous_enable(struct rte_eth_dev *dev)\n+int hn_vf_promiscuous_enable(struct rte_eth_dev *dev)\n {\n-\tVF_ETHDEV_FUNC(dev, rte_eth_promiscuous_enable);\n+\tVF_ETHDEV_FUNC_RET_STATUS(dev, rte_eth_promiscuous_enable);\n }\n \n-void hn_vf_promiscuous_disable(struct rte_eth_dev *dev)\n+int hn_vf_promiscuous_disable(struct rte_eth_dev *dev)\n {\n-\tVF_ETHDEV_FUNC(dev, rte_eth_promiscuous_disable);\n+\tVF_ETHDEV_FUNC_RET_STATUS(dev, rte_eth_promiscuous_disable);\n }\n \n int hn_vf_mc_addr_list(struct rte_eth_dev *dev,\ndiff --git a/drivers/net/nfb/nfb_rxmode.c b/drivers/net/nfb/nfb_rxmode.c\nindex 97bfcb238d..17708c84c6 100644\n--- a/drivers/net/nfb/nfb_rxmode.c\n+++ b/drivers/net/nfb/nfb_rxmode.c\n@@ -7,7 +7,7 @@\n #include \"nfb_rxmode.h\"\n #include \"nfb.h\"\n \n-void\n+int\n nfb_eth_promiscuous_enable(struct rte_eth_dev *dev)\n {\n \tstruct pmd_internals *internals = (struct pmd_internals *)\n@@ -20,9 +20,11 @@ nfb_eth_promiscuous_enable(struct rte_eth_dev *dev)\n \t\tnc_rxmac_mac_filter_enable(internals->rxmac[i],\n \t\t\tRXMAC_MAC_FILTER_PROMISCUOUS);\n \t}\n+\n+\treturn 0;\n }\n \n-void\n+int\n nfb_eth_promiscuous_disable(struct rte_eth_dev *dev)\n {\n \tstruct pmd_internals *internals = (struct pmd_internals *)\n@@ -33,12 +35,14 @@ nfb_eth_promiscuous_disable(struct rte_eth_dev *dev)\n \n \t/* if promisc is not enabled, do nothing */\n \tif (!nfb_eth_promiscuous_get(dev))\n-\t\treturn;\n+\t\treturn 0;\n \n \tfor (i = 0; i < internals->max_rxmac; ++i) {\n \t\tnc_rxmac_mac_filter_enable(internals->rxmac[i],\n \t\t\tRXMAC_MAC_FILTER_TABLE);\n \t}\n+\n+\treturn 0;\n }\n \n int\ndiff --git a/drivers/net/nfb/nfb_rxmode.h b/drivers/net/nfb/nfb_rxmode.h\nindex 4c59651d66..1d5bafa98a 100644\n--- a/drivers/net/nfb/nfb_rxmode.h\n+++ b/drivers/net/nfb/nfb_rxmode.h\n@@ -26,8 +26,10 @@ nfb_eth_promiscuous_get(struct rte_eth_dev *dev);\n  *\n  * @param dev\n  *   Pointer to Ethernet device structure.\n+ *\n+ * @return always 0\n  */\n-void\n+int\n nfb_eth_promiscuous_enable(struct rte_eth_dev *dev);\n \n /**\n@@ -35,8 +37,10 @@ nfb_eth_promiscuous_enable(struct rte_eth_dev *dev);\n  *\n  * @param dev\n  *   Pointer to Ethernet device structure.\n+ *\n+ * @return always 0\n  */\n-void\n+int\n nfb_eth_promiscuous_disable(struct rte_eth_dev *dev);\n \n /**\ndiff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c\nindex 3d5b99c943..a9858036a9 100644\n--- a/drivers/net/nfp/nfp_net.c\n+++ b/drivers/net/nfp/nfp_net.c\n@@ -85,8 +85,8 @@ static int nfp_net_infos_get(struct rte_eth_dev *dev,\n \t\t\t     struct rte_eth_dev_info *dev_info);\n static int nfp_net_init(struct rte_eth_dev *eth_dev);\n static int nfp_net_link_update(struct rte_eth_dev *dev, int wait_to_complete);\n-static void nfp_net_promisc_enable(struct rte_eth_dev *dev);\n-static void nfp_net_promisc_disable(struct rte_eth_dev *dev);\n+static int nfp_net_promisc_enable(struct rte_eth_dev *dev);\n+static int nfp_net_promisc_disable(struct rte_eth_dev *dev);\n static int nfp_net_rx_fill_freelist(struct nfp_net_rxq *rxq);\n static uint32_t nfp_net_rx_queue_count(struct rte_eth_dev *dev,\n \t\t\t\t       uint16_t queue_idx);\n@@ -931,11 +931,12 @@ nfp_net_close(struct rte_eth_dev *dev)\n \t */\n }\n \n-static void\n+static int\n nfp_net_promisc_enable(struct rte_eth_dev *dev)\n {\n \tuint32_t new_ctrl, update = 0;\n \tstruct nfp_net_hw *hw;\n+\tint ret;\n \n \tPMD_DRV_LOG(DEBUG, \"Promiscuous mode enable\");\n \n@@ -943,12 +944,12 @@ nfp_net_promisc_enable(struct rte_eth_dev *dev)\n \n \tif (!(hw->cap & NFP_NET_CFG_CTRL_PROMISC)) {\n \t\tPMD_INIT_LOG(INFO, \"Promiscuous mode not supported\");\n-\t\treturn;\n+\t\treturn -ENOTSUP;\n \t}\n \n \tif (hw->ctrl & NFP_NET_CFG_CTRL_PROMISC) {\n \t\tPMD_DRV_LOG(INFO, \"Promiscuous mode already enabled\");\n-\t\treturn;\n+\t\treturn 0;\n \t}\n \n \tnew_ctrl = hw->ctrl | NFP_NET_CFG_CTRL_PROMISC;\n@@ -958,23 +959,27 @@ nfp_net_promisc_enable(struct rte_eth_dev *dev)\n \t * DPDK sets promiscuous mode on just after this call assuming\n \t * it can not fail ...\n \t */\n-\tif (nfp_net_reconfig(hw, new_ctrl, update) < 0)\n-\t\treturn;\n+\tret = nfp_net_reconfig(hw, new_ctrl, update);\n+\tif (ret < 0)\n+\t\treturn ret;\n \n \thw->ctrl = new_ctrl;\n+\n+\treturn 0;\n }\n \n-static void\n+static int\n nfp_net_promisc_disable(struct rte_eth_dev *dev)\n {\n \tuint32_t new_ctrl, update = 0;\n \tstruct nfp_net_hw *hw;\n+\tint ret;\n \n \thw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n \n \tif ((hw->ctrl & NFP_NET_CFG_CTRL_PROMISC) == 0) {\n \t\tPMD_DRV_LOG(INFO, \"Promiscuous mode already disabled\");\n-\t\treturn;\n+\t\treturn 0;\n \t}\n \n \tnew_ctrl = hw->ctrl & ~NFP_NET_CFG_CTRL_PROMISC;\n@@ -984,10 +989,13 @@ nfp_net_promisc_disable(struct rte_eth_dev *dev)\n \t * DPDK sets promiscuous mode off just before this call\n \t * assuming it can not fail ...\n \t */\n-\tif (nfp_net_reconfig(hw, new_ctrl, update) < 0)\n-\t\treturn;\n+\tret = nfp_net_reconfig(hw, new_ctrl, update);\n+\tif (ret < 0)\n+\t\treturn ret;\n \n \thw->ctrl = new_ctrl;\n+\n+\treturn 0;\n }\n \n /*\ndiff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c\nindex 1faa7b7c6b..47cea4e9b2 100644\n--- a/drivers/net/octeontx/octeontx_ethdev.c\n+++ b/drivers/net/octeontx/octeontx_ethdev.c\n@@ -174,7 +174,7 @@ octeontx_port_stop(struct octeontx_nic *nic)\n \treturn octeontx_bgx_port_stop(nic->port_id);\n }\n \n-static void\n+static int\n octeontx_port_promisc_set(struct octeontx_nic *nic, int en)\n {\n \tstruct rte_eth_dev *dev;\n@@ -185,15 +185,19 @@ octeontx_port_promisc_set(struct octeontx_nic *nic, int en)\n \tdev = nic->dev;\n \n \tres = octeontx_bgx_port_promisc_set(nic->port_id, en);\n-\tif (res < 0)\n+\tif (res < 0) {\n \t\tocteontx_log_err(\"failed to set promiscuous mode %d\",\n \t\t\t\tnic->port_id);\n+\t\treturn res;\n+\t}\n \n \t/* Set proper flag for the mode */\n \tdev->data->promiscuous = (en != 0) ? 1 : 0;\n \n \tocteontx_log_dbg(\"port %d : promiscuous mode %s\",\n \t\t\tnic->port_id, en ? \"set\" : \"unset\");\n+\n+\treturn 0;\n }\n \n static int\n@@ -444,22 +448,22 @@ octeontx_dev_stop(struct rte_eth_dev *dev)\n \t}\n }\n \n-static void\n+static int\n octeontx_dev_promisc_enable(struct rte_eth_dev *dev)\n {\n \tstruct octeontx_nic *nic = octeontx_pmd_priv(dev);\n \n \tPMD_INIT_FUNC_TRACE();\n-\tocteontx_port_promisc_set(nic, 1);\n+\treturn octeontx_port_promisc_set(nic, 1);\n }\n \n-static void\n+static int\n octeontx_dev_promisc_disable(struct rte_eth_dev *dev)\n {\n \tstruct octeontx_nic *nic = octeontx_pmd_priv(dev);\n \n \tPMD_INIT_FUNC_TRACE();\n-\tocteontx_port_promisc_set(nic, 0);\n+\treturn octeontx_port_promisc_set(nic, 0);\n }\n \n static int\ndiff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h\nindex 5de0a1d4d1..8814622e43 100644\n--- a/drivers/net/octeontx2/otx2_ethdev.h\n+++ b/drivers/net/octeontx2/otx2_ethdev.h\n@@ -379,8 +379,8 @@ int otx2_nix_rx_descriptor_done(void *rxq, uint16_t offset);\n int otx2_nix_rx_descriptor_status(void *rx_queue, uint16_t offset);\n \n void otx2_nix_promisc_config(struct rte_eth_dev *eth_dev, int en);\n-void otx2_nix_promisc_enable(struct rte_eth_dev *eth_dev);\n-void otx2_nix_promisc_disable(struct rte_eth_dev *eth_dev);\n+int otx2_nix_promisc_enable(struct rte_eth_dev *eth_dev);\n+int otx2_nix_promisc_disable(struct rte_eth_dev *eth_dev);\n void otx2_nix_allmulticast_enable(struct rte_eth_dev *eth_dev);\n void otx2_nix_allmulticast_disable(struct rte_eth_dev *eth_dev);\n int otx2_nix_tx_queue_start(struct rte_eth_dev *eth_dev, uint16_t qidx);\ndiff --git a/drivers/net/octeontx2/otx2_ethdev_ops.c b/drivers/net/octeontx2/otx2_ethdev_ops.c\nindex 024c295aa6..5a97a090ae 100644\n--- a/drivers/net/octeontx2/otx2_ethdev_ops.c\n+++ b/drivers/net/octeontx2/otx2_ethdev_ops.c\n@@ -129,18 +129,22 @@ otx2_nix_promisc_config(struct rte_eth_dev *eth_dev, int en)\n \totx2_nix_vlan_update_promisc(eth_dev, en);\n }\n \n-void\n+int\n otx2_nix_promisc_enable(struct rte_eth_dev *eth_dev)\n {\n \totx2_nix_promisc_config(eth_dev, 1);\n \tnix_cgx_promisc_config(eth_dev, 1);\n+\n+\treturn 0;\n }\n \n-void\n+int\n otx2_nix_promisc_disable(struct rte_eth_dev *eth_dev)\n {\n \totx2_nix_promisc_config(eth_dev, 0);\n \tnix_cgx_promisc_config(eth_dev, 0);\n+\n+\treturn 0;\n }\n \n static void\ndiff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c\nindex 9eb57fd78e..cfca6c4bc7 100644\n--- a/drivers/net/qede/qede_ethdev.c\n+++ b/drivers/net/qede/qede_ethdev.c\n@@ -1383,33 +1383,39 @@ qede_link_update(struct rte_eth_dev *eth_dev, __rte_unused int wait_to_complete)\n \treturn rte_eth_linkstatus_set(eth_dev, &link);\n }\n \n-static void qede_promiscuous_enable(struct rte_eth_dev *eth_dev)\n+static int qede_promiscuous_enable(struct rte_eth_dev *eth_dev)\n {\n \tstruct qede_dev *qdev = eth_dev->data->dev_private;\n \tstruct ecore_dev *edev = &qdev->edev;\n \tenum qed_filter_rx_mode_type type = QED_FILTER_RX_MODE_TYPE_PROMISC;\n+\tenum _ecore_status_t ecore_status;\n \n \tPMD_INIT_FUNC_TRACE(edev);\n \n \tif (rte_eth_allmulticast_get(eth_dev->data->port_id) == 1)\n \t\ttype |= QED_FILTER_RX_MODE_TYPE_MULTI_PROMISC;\n \n-\tqed_configure_filter_rx_mode(eth_dev, type);\n+\tecore_status = qed_configure_filter_rx_mode(eth_dev, type);\n+\n+\treturn ecore_status >= ECORE_SUCCESS ? 0 : -EAGAIN;\n }\n \n-static void qede_promiscuous_disable(struct rte_eth_dev *eth_dev)\n+static int qede_promiscuous_disable(struct rte_eth_dev *eth_dev)\n {\n \tstruct qede_dev *qdev = eth_dev->data->dev_private;\n \tstruct ecore_dev *edev = &qdev->edev;\n+\tenum _ecore_status_t ecore_status;\n \n \tPMD_INIT_FUNC_TRACE(edev);\n \n \tif (rte_eth_allmulticast_get(eth_dev->data->port_id) == 1)\n-\t\tqed_configure_filter_rx_mode(eth_dev,\n+\t\tecore_status = qed_configure_filter_rx_mode(eth_dev,\n \t\t\t\tQED_FILTER_RX_MODE_TYPE_MULTI_PROMISC);\n \telse\n-\t\tqed_configure_filter_rx_mode(eth_dev,\n+\t\tecore_status = qed_configure_filter_rx_mode(eth_dev,\n \t\t\t\tQED_FILTER_RX_MODE_TYPE_REGULAR);\n+\n+\treturn ecore_status >= ECORE_SUCCESS ? 0 : -EAGAIN;\n }\n \n static void qede_poll_sp_sb_cb(void *param)\ndiff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c\nindex 013b6bbd63..5faf14b674 100644\n--- a/drivers/net/sfc/sfc_ethdev.c\n+++ b/drivers/net/sfc/sfc_ethdev.c\n@@ -366,7 +366,7 @@ sfc_dev_close(struct rte_eth_dev *dev)\n \tfree(sa);\n }\n \n-static void\n+static int\n sfc_dev_filter_set(struct rte_eth_dev *dev, enum sfc_dev_filter_mode mode,\n \t\t   boolean_t enabled)\n {\n@@ -375,6 +375,7 @@ sfc_dev_filter_set(struct rte_eth_dev *dev, enum sfc_dev_filter_mode mode,\n \tstruct sfc_adapter *sa = sfc_adapter_by_eth_dev(dev);\n \tboolean_t allmulti = (mode == SFC_DEV_FILTER_MODE_ALLMULTI);\n \tconst char *desc = (allmulti) ? \"all-multi\" : \"promiscuous\";\n+\tint rc = 0;\n \n \tsfc_adapter_lock(sa);\n \n@@ -390,7 +391,7 @@ sfc_dev_filter_set(struct rte_eth_dev *dev, enum sfc_dev_filter_mode mode,\n \t\t\t\t     \"start provided that isolated mode is \"\n \t\t\t\t     \"disabled prior the next start\");\n \t\t} else if ((sa->state == SFC_ADAPTER_STARTED) &&\n-\t\t\t   (sfc_set_rx_mode(sa) != 0)) {\n+\t\t\t   ((rc = sfc_set_rx_mode(sa)) != 0)) {\n \t\t\t*toggle = !(enabled);\n \t\t\tsfc_warn(sa, \"Failed to %s %s mode\",\n \t\t\t\t ((enabled) ? \"enable\" : \"disable\"), desc);\n@@ -398,18 +399,19 @@ sfc_dev_filter_set(struct rte_eth_dev *dev, enum sfc_dev_filter_mode mode,\n \t}\n \n \tsfc_adapter_unlock(sa);\n+\treturn rc;\n }\n \n-static void\n+static int\n sfc_dev_promisc_enable(struct rte_eth_dev *dev)\n {\n-\tsfc_dev_filter_set(dev, SFC_DEV_FILTER_MODE_PROMISC, B_TRUE);\n+\treturn sfc_dev_filter_set(dev, SFC_DEV_FILTER_MODE_PROMISC, B_TRUE);\n }\n \n-static void\n+static int\n sfc_dev_promisc_disable(struct rte_eth_dev *dev)\n {\n-\tsfc_dev_filter_set(dev, SFC_DEV_FILTER_MODE_PROMISC, B_FALSE);\n+\treturn sfc_dev_filter_set(dev, SFC_DEV_FILTER_MODE_PROMISC, B_FALSE);\n }\n \n static void\ndiff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c\nindex ca066a3d3d..2f3811b67f 100644\n--- a/drivers/net/szedata2/rte_eth_szedata2.c\n+++ b/drivers/net/szedata2/rte_eth_szedata2.c\n@@ -1344,18 +1344,20 @@ eth_mac_addr_set(struct rte_eth_dev *dev __rte_unused,\n \treturn 0;\n }\n \n-static void\n+static int\n eth_promiscuous_enable(struct rte_eth_dev *dev __rte_unused)\n {\n \tPMD_DRV_LOG(WARNING, \"Enabling promiscuous mode is not supported. \"\n \t\t\t\"The card is always in promiscuous mode.\");\n+\treturn 0;\n }\n \n-static void\n+static int\n eth_promiscuous_disable(struct rte_eth_dev *dev __rte_unused)\n {\n \tPMD_DRV_LOG(WARNING, \"Disabling promiscuous mode is not supported. \"\n \t\t\t\"The card is always in promiscuous mode.\");\n+\treturn -ENOTSUP;\n }\n \n static void\ndiff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c\nindex f85458c3cd..41612ce838 100644\n--- a/drivers/net/tap/rte_eth_tap.c\n+++ b/drivers/net/tap/rte_eth_tap.c\n@@ -1100,28 +1100,60 @@ tap_link_update(struct rte_eth_dev *dev, int wait_to_complete __rte_unused)\n \treturn 0;\n }\n \n-static void\n+static int\n tap_promisc_enable(struct rte_eth_dev *dev)\n {\n \tstruct pmd_internals *pmd = dev->data->dev_private;\n \tstruct ifreq ifr = { .ifr_flags = IFF_PROMISC };\n+\tint ret;\n \n-\tdev->data->promiscuous = 1;\n-\ttap_ioctl(pmd, SIOCSIFFLAGS, &ifr, 1, LOCAL_AND_REMOTE);\n-\tif (pmd->remote_if_index && !pmd->flow_isolate)\n-\t\ttap_flow_implicit_create(pmd, TAP_REMOTE_PROMISC);\n+\tret = tap_ioctl(pmd, SIOCSIFFLAGS, &ifr, 1, LOCAL_AND_REMOTE);\n+\tif (ret != 0)\n+\t\treturn ret;\n+\n+\tif (pmd->remote_if_index && !pmd->flow_isolate) {\n+\t\tdev->data->promiscuous = 1;\n+\t\tret = tap_flow_implicit_create(pmd, TAP_REMOTE_PROMISC);\n+\t\tif (ret != 0) {\n+\t\t\t/* Rollback promisc flag */\n+\t\t\ttap_ioctl(pmd, SIOCSIFFLAGS, &ifr, 0, LOCAL_AND_REMOTE);\n+\t\t\t/*\n+\t\t\t * rte_eth_dev_promiscuous_enable() rollback\n+\t\t\t * dev->data->promiscuous in the case of failure.\n+\t\t\t */\n+\t\t\treturn ret;\n+\t\t}\n+\t}\n+\n+\treturn 0;\n }\n \n-static void\n+static int\n tap_promisc_disable(struct rte_eth_dev *dev)\n {\n \tstruct pmd_internals *pmd = dev->data->dev_private;\n \tstruct ifreq ifr = { .ifr_flags = IFF_PROMISC };\n+\tint ret;\n \n-\tdev->data->promiscuous = 0;\n-\ttap_ioctl(pmd, SIOCSIFFLAGS, &ifr, 0, LOCAL_AND_REMOTE);\n-\tif (pmd->remote_if_index && !pmd->flow_isolate)\n-\t\ttap_flow_implicit_destroy(pmd, TAP_REMOTE_PROMISC);\n+\tret = tap_ioctl(pmd, SIOCSIFFLAGS, &ifr, 0, LOCAL_AND_REMOTE);\n+\tif (ret != 0)\n+\t\treturn ret;\n+\n+\tif (pmd->remote_if_index && !pmd->flow_isolate) {\n+\t\tdev->data->promiscuous = 0;\n+\t\tret = tap_flow_implicit_destroy(pmd, TAP_REMOTE_PROMISC);\n+\t\tif (ret != 0) {\n+\t\t\t/* Rollback promisc flag */\n+\t\t\ttap_ioctl(pmd, SIOCSIFFLAGS, &ifr, 1, LOCAL_AND_REMOTE);\n+\t\t\t/*\n+\t\t\t * rte_eth_dev_promiscuous_disable() rollback\n+\t\t\t * dev->data->promiscuous in the case of failure.\n+\t\t\t */\n+\t\t\treturn ret;\n+\t\t}\n+\t}\n+\n+\treturn 0;\n }\n \n static void\ndiff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c\nindex f3ba07ae37..edc956bb3d 100644\n--- a/drivers/net/thunderx/nicvf_ethdev.c\n+++ b/drivers/net/thunderx/nicvf_ethdev.c\n@@ -401,9 +401,10 @@ nicvf_dev_stats_reset(struct rte_eth_dev *dev)\n }\n \n /* Promiscuous mode enabled by default in LMAC to VF 1:1 map configuration */\n-static void\n+static int\n nicvf_dev_promisc_enable(struct rte_eth_dev *dev __rte_unused)\n {\n+\treturn 0;\n }\n \n static inline uint64_t\ndiff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c\nindex 8fe9dcebda..1ba4aa37e8 100644\n--- a/drivers/net/virtio/virtio_ethdev.c\n+++ b/drivers/net/virtio/virtio_ethdev.c\n@@ -41,8 +41,8 @@ static int eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev);\n static int  virtio_dev_configure(struct rte_eth_dev *dev);\n static int  virtio_dev_start(struct rte_eth_dev *dev);\n static void virtio_dev_stop(struct rte_eth_dev *dev);\n-static void virtio_dev_promiscuous_enable(struct rte_eth_dev *dev);\n-static void virtio_dev_promiscuous_disable(struct rte_eth_dev *dev);\n+static int virtio_dev_promiscuous_enable(struct rte_eth_dev *dev);\n+static int virtio_dev_promiscuous_disable(struct rte_eth_dev *dev);\n static void virtio_dev_allmulticast_enable(struct rte_eth_dev *dev);\n static void virtio_dev_allmulticast_disable(struct rte_eth_dev *dev);\n static int virtio_dev_info_get(struct rte_eth_dev *dev,\n@@ -746,7 +746,7 @@ virtio_dev_close(struct rte_eth_dev *dev)\n \t}\n }\n \n-static void\n+static int\n virtio_dev_promiscuous_enable(struct rte_eth_dev *dev)\n {\n \tstruct virtio_hw *hw = dev->data->dev_private;\n@@ -756,7 +756,7 @@ virtio_dev_promiscuous_enable(struct rte_eth_dev *dev)\n \n \tif (!vtpci_with_feature(hw, VIRTIO_NET_F_CTRL_RX)) {\n \t\tPMD_INIT_LOG(INFO, \"host does not support rx control\");\n-\t\treturn;\n+\t\treturn -ENOTSUP;\n \t}\n \n \tctrl.hdr.class = VIRTIO_NET_CTRL_RX;\n@@ -765,11 +765,15 @@ virtio_dev_promiscuous_enable(struct rte_eth_dev *dev)\n \tdlen[0] = 1;\n \n \tret = virtio_send_command(hw->cvq, &ctrl, dlen, 1);\n-\tif (ret)\n+\tif (ret) {\n \t\tPMD_INIT_LOG(ERR, \"Failed to enable promisc\");\n+\t\treturn -EAGAIN;\n+\t}\n+\n+\treturn 0;\n }\n \n-static void\n+static int\n virtio_dev_promiscuous_disable(struct rte_eth_dev *dev)\n {\n \tstruct virtio_hw *hw = dev->data->dev_private;\n@@ -779,7 +783,7 @@ virtio_dev_promiscuous_disable(struct rte_eth_dev *dev)\n \n \tif (!vtpci_with_feature(hw, VIRTIO_NET_F_CTRL_RX)) {\n \t\tPMD_INIT_LOG(INFO, \"host does not support rx control\");\n-\t\treturn;\n+\t\treturn -ENOTSUP;\n \t}\n \n \tctrl.hdr.class = VIRTIO_NET_CTRL_RX;\n@@ -788,8 +792,12 @@ virtio_dev_promiscuous_disable(struct rte_eth_dev *dev)\n \tdlen[0] = 1;\n \n \tret = virtio_send_command(hw->cvq, &ctrl, dlen, 1);\n-\tif (ret)\n+\tif (ret) {\n \t\tPMD_INIT_LOG(ERR, \"Failed to disable promisc\");\n+\t\treturn -EAGAIN;\n+\t}\n+\n+\treturn 0;\n }\n \n static void\ndiff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c\nindex 551c511943..8bfe16c482 100644\n--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c\n+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c\n@@ -65,8 +65,8 @@ static int vmxnet3_dev_start(struct rte_eth_dev *dev);\n static void vmxnet3_dev_stop(struct rte_eth_dev *dev);\n static void vmxnet3_dev_close(struct rte_eth_dev *dev);\n static void vmxnet3_dev_set_rxmode(struct vmxnet3_hw *hw, uint32_t feature, int set);\n-static void vmxnet3_dev_promiscuous_enable(struct rte_eth_dev *dev);\n-static void vmxnet3_dev_promiscuous_disable(struct rte_eth_dev *dev);\n+static int vmxnet3_dev_promiscuous_enable(struct rte_eth_dev *dev);\n+static int vmxnet3_dev_promiscuous_disable(struct rte_eth_dev *dev);\n static void vmxnet3_dev_allmulticast_enable(struct rte_eth_dev *dev);\n static void vmxnet3_dev_allmulticast_disable(struct rte_eth_dev *dev);\n static int __vmxnet3_dev_link_update(struct rte_eth_dev *dev,\n@@ -1262,7 +1262,7 @@ vmxnet3_dev_set_rxmode(struct vmxnet3_hw *hw, uint32_t feature, int set)\n }\n \n /* Promiscuous supported only if Vmxnet3_DriverShared is initialized in adapter */\n-static void\n+static int\n vmxnet3_dev_promiscuous_enable(struct rte_eth_dev *dev)\n {\n \tstruct vmxnet3_hw *hw = dev->data->dev_private;\n@@ -1273,10 +1273,12 @@ vmxnet3_dev_promiscuous_enable(struct rte_eth_dev *dev)\n \n \tVMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD,\n \t\t\t       VMXNET3_CMD_UPDATE_VLAN_FILTERS);\n+\n+\treturn 0;\n }\n \n /* Promiscuous supported only if Vmxnet3_DriverShared is initialized in adapter */\n-static void\n+static int\n vmxnet3_dev_promiscuous_disable(struct rte_eth_dev *dev)\n {\n \tstruct vmxnet3_hw *hw = dev->data->dev_private;\n@@ -1290,6 +1292,8 @@ vmxnet3_dev_promiscuous_disable(struct rte_eth_dev *dev)\n \tvmxnet3_dev_set_rxmode(hw, VMXNET3_RXM_PROMISC, 0);\n \tVMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD,\n \t\t\t       VMXNET3_CMD_UPDATE_VLAN_FILTERS);\n+\n+\treturn 0;\n }\n \n /* Allmulticast supported only if Vmxnet3_DriverShared is initialized in adapter */\ndiff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c\nindex b97dd8aa85..f2e6b4c83b 100644\n--- a/lib/librte_ethdev/rte_ethdev.c\n+++ b/lib/librte_ethdev/rte_ethdev.c\n@@ -1892,30 +1892,38 @@ int\n rte_eth_promiscuous_enable(uint16_t port_id)\n {\n \tstruct rte_eth_dev *dev;\n+\tuint8_t old_promiscuous;\n+\tint diag;\n \n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n \tdev = &rte_eth_devices[port_id];\n \n \tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->promiscuous_enable, -ENOTSUP);\n-\t(*dev->dev_ops->promiscuous_enable)(dev);\n-\tdev->data->promiscuous = 1;\n+\told_promiscuous = dev->data->promiscuous;\n+\tdiag = (*dev->dev_ops->promiscuous_enable)(dev);\n+\tdev->data->promiscuous = (diag == 0) ? 1 : old_promiscuous;\n \n-\treturn 0;\n+\treturn eth_err(port_id, diag);\n }\n \n int\n rte_eth_promiscuous_disable(uint16_t port_id)\n {\n \tstruct rte_eth_dev *dev;\n+\tuint8_t old_promiscuous;\n+\tint diag;\n \n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n \tdev = &rte_eth_devices[port_id];\n \n \tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->promiscuous_disable, -ENOTSUP);\n+\told_promiscuous = dev->data->promiscuous;\n \tdev->data->promiscuous = 0;\n-\t(*dev->dev_ops->promiscuous_disable)(dev);\n+\tdiag = (*dev->dev_ops->promiscuous_disable)(dev);\n+\tif (diag != 0)\n+\t\tdev->data->promiscuous = old_promiscuous;\n \n-\treturn 0;\n+\treturn eth_err(port_id, diag);\n }\n \n int\ndiff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h\nindex 2394b32c83..6322348d17 100644\n--- a/lib/librte_ethdev/rte_ethdev_core.h\n+++ b/lib/librte_ethdev/rte_ethdev_core.h\n@@ -52,10 +52,10 @@ typedef int (*eth_dev_reset_t)(struct rte_eth_dev *dev);\n typedef int (*eth_is_removed_t)(struct rte_eth_dev *dev);\n /**< @internal Function used to detect an Ethernet device removal. */\n \n-typedef void (*eth_promiscuous_enable_t)(struct rte_eth_dev *dev);\n+typedef int (*eth_promiscuous_enable_t)(struct rte_eth_dev *dev);\n /**< @internal Function used to enable the RX promiscuous mode of an Ethernet device. */\n \n-typedef void (*eth_promiscuous_disable_t)(struct rte_eth_dev *dev);\n+typedef int (*eth_promiscuous_disable_t)(struct rte_eth_dev *dev);\n /**< @internal Function used to disable the RX promiscuous mode of an Ethernet device. */\n \n typedef void (*eth_allmulticast_enable_t)(struct rte_eth_dev *dev);\n",
    "prefixes": [
        "v2",
        "04/13"
    ]
}