From: Tomasz Duszynski Date: Mon, 9 Oct 2017 15:00:36 +0000 (+0200) Subject: net/mrvl: support for promiscuous and allmulticast X-Git-Tag: spdx-start~1489 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=b8b8c9962e65e68091f817714b4b00a802ba3de4;p=dpdk.git net/mrvl: support for promiscuous and allmulticast Add support for promiscuous and allmulticast modes. Signed-off-by: Jacek Siuda Signed-off-by: Tomasz Duszynski --- diff --git a/doc/guides/nics/features/mrvl.ini b/doc/guides/nics/features/mrvl.ini index 2ddabfbcb5..c2df52595b 100644 --- a/doc/guides/nics/features/mrvl.ini +++ b/doc/guides/nics/features/mrvl.ini @@ -8,3 +8,5 @@ Speed capabilities = Y Link status = Y MTU update = Y Jumbo frame = Y +Promiscuous mode = Y +Allmulticast mode = Y diff --git a/drivers/net/mrvl/mrvl_ethdev.c b/drivers/net/mrvl/mrvl_ethdev.c index 3a5f6a0bf5..519aa19888 100644 --- a/drivers/net/mrvl/mrvl_ethdev.c +++ b/drivers/net/mrvl/mrvl_ethdev.c @@ -588,6 +588,74 @@ mrvl_link_update(struct rte_eth_dev *dev, int wait_to_complete __rte_unused) return 0; } +/** + * DPDK callback to enable promiscuous mode. + * + * @param dev + * Pointer to Ethernet device structure. + */ +static void +mrvl_promiscuous_enable(struct rte_eth_dev *dev) +{ + struct mrvl_priv *priv = dev->data->dev_private; + int ret; + + ret = pp2_ppio_set_uc_promisc(priv->ppio, 1); + if (ret) + RTE_LOG(ERR, PMD, "Failed to enable promiscuous mode\n"); +} + +/** + * DPDK callback to enable allmulti mode. + * + * @param dev + * Pointer to Ethernet device structure. + */ +static void +mrvl_allmulticast_enable(struct rte_eth_dev *dev) +{ + struct mrvl_priv *priv = dev->data->dev_private; + int ret; + + ret = pp2_ppio_set_mc_promisc(priv->ppio, 1); + if (ret) + RTE_LOG(ERR, PMD, "Failed enable all-multicast mode\n"); +} + +/** + * DPDK callback to disable promiscuous mode. + * + * @param dev + * Pointer to Ethernet device structure. + */ +static void +mrvl_promiscuous_disable(struct rte_eth_dev *dev) +{ + struct mrvl_priv *priv = dev->data->dev_private; + int ret; + + ret = pp2_ppio_set_uc_promisc(priv->ppio, 0); + if (ret) + RTE_LOG(ERR, PMD, "Failed to disable promiscuous mode\n"); +} + +/** + * DPDK callback to disable allmulticast mode. + * + * @param dev + * Pointer to Ethernet device structure. + */ +static void +mrvl_allmulticast_disable(struct rte_eth_dev *dev) +{ + struct mrvl_priv *priv = dev->data->dev_private; + int ret; + + ret = pp2_ppio_set_mc_promisc(priv->ppio, 0); + if (ret) + RTE_LOG(ERR, PMD, "Failed to disable all-multicast mode\n"); +} + /** * DPDK callback to set the primary MAC address. * @@ -934,6 +1002,10 @@ static const struct eth_dev_ops mrvl_ops = { .dev_set_link_down = mrvl_dev_set_link_down, .dev_close = mrvl_dev_close, .link_update = mrvl_link_update, + .promiscuous_enable = mrvl_promiscuous_enable, + .allmulticast_enable = mrvl_allmulticast_enable, + .promiscuous_disable = mrvl_promiscuous_disable, + .allmulticast_disable = mrvl_allmulticast_disable, .mac_addr_set = mrvl_mac_addr_set, .mtu_set = mrvl_mtu_set, .dev_infos_get = mrvl_dev_infos_get,