From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id E76FB2C37 for ; Thu, 2 Feb 2017 17:18:26 +0100 (CET) Received: from 6wind.com (unknown [10.16.0.184]) by proxy.6wind.com (Postfix) with SMTP id 94F6F24A91; Thu, 2 Feb 2017 17:18:21 +0100 (CET) Received: by 6wind.com (sSMTP sendmail emulation); Thu, 02 Feb 2017 17:18:20 +0100 From: Pascal Mazon To: keith.wiles@intel.com Cc: dev@dpdk.org, Pascal Mazon Date: Thu, 2 Feb 2017 17:18:04 +0100 Message-Id: <469a0868a0517d92bfb99091084802689944aa38.1486026370.git.pascal.mazon@6wind.com> X-Mailer: git-send-email 2.8.0.rc0 In-Reply-To: <1485855778-15496-1-git-send-email-pascal.mazon@6wind.com> References: <1485855778-15496-1-git-send-email-pascal.mazon@6wind.com> In-Reply-To: <050aa06c03aa4b56f703d74a8d8a792de5e075f4.1486026370.git.pascal.mazon@6wind.com> References: <050aa06c03aa4b56f703d74a8d8a792de5e075f4.1486026370.git.pascal.mazon@6wind.com> Subject: [dpdk-dev] [PATCH v2 7/7] net/tap: support promiscuous and allmulti setting X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 16:18:27 -0000 Signed-off-by: Pascal Mazon --- drivers/net/tap/rte_eth_tap.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index 275af9df2252..3f179c3dfb3c 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -460,6 +460,42 @@ tap_link_update(struct rte_eth_dev *dev __rte_unused, return 0; } +static void +tap_promisc_enable(struct rte_eth_dev *dev) +{ + struct pmd_internals *pmd = dev->data->dev_private; + + dev->data->promiscuous = 1; + tap_link_set_flags(pmd, IFF_PROMISC, 1); +} + +static void +tap_promisc_disable(struct rte_eth_dev *dev) +{ + struct pmd_internals *pmd = dev->data->dev_private; + + dev->data->promiscuous = 0; + tap_link_set_flags(pmd, IFF_PROMISC, 0); +} + +static void +tap_allmulti_enable(struct rte_eth_dev *dev) +{ + struct pmd_internals *pmd = dev->data->dev_private; + + dev->data->all_multicast = 1; + tap_link_set_flags(pmd, IFF_ALLMULTI, 1); +} + +static void +tap_allmulti_disable(struct rte_eth_dev *dev) +{ + struct pmd_internals *pmd = dev->data->dev_private; + + dev->data->all_multicast = 0; + tap_link_set_flags(pmd, IFF_ALLMULTI, 0); +} + static int tap_setup_queue(struct rte_eth_dev *dev, struct pmd_internals *internals, @@ -589,6 +625,10 @@ static const struct eth_dev_ops ops = { .link_update = tap_link_update, .dev_set_link_up = tap_link_set_up, .dev_set_link_down = tap_link_set_down, + .promiscuous_enable = tap_promisc_enable, + .promiscuous_disable = tap_promisc_disable, + .allmulticast_enable = tap_allmulti_enable, + .allmulticast_disable = tap_allmulti_disable, .stats_get = tap_stats_get, .stats_reset = tap_stats_reset, }; -- 2.8.0.rc0