[dpdk-dev,30/38] net/dpaa: add support for multicast toggle

Message ID 1497591668-3320-31-git-send-email-shreyansh.jain@nxp.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK

Commit Message

Shreyansh Jain June 16, 2017, 5:41 a.m. UTC
  Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
 doc/guides/nics/features/dpaa.ini |  2 ++
 drivers/net/dpaa/dpaa_ethdev.c    | 21 +++++++++++++++++++++
 2 files changed, 23 insertions(+)
  

Comments

Ferruh Yigit June 28, 2017, 3:47 p.m. UTC | #1
On 6/16/2017 6:41 AM, Shreyansh Jain wrote:
> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>

<...>

> diff --git a/doc/guides/nics/features/dpaa.ini b/doc/guides/nics/features/dpaa.ini
> index a6984a4..80dd3ca 100644
> --- a/doc/guides/nics/features/dpaa.ini
> +++ b/doc/guides/nics/features/dpaa.ini
> @@ -10,5 +10,7 @@ Queue start/stop     = Y
>  Jumbo frame          = Y
>  MTU update           = Y
>  Promiscuous mode     = Y
> +Allmulticast mode    = Y
> +Unicast MAC filter   = Y

"Unicast MAC filter" means implementing "mac_addr_set, mac_addr_add,
mac_addr_remove" dev_ops

>  ARMv8                = Y
>  Usage doc            = Y

<...>
  
Shreyansh Jain June 29, 2017, 2:58 p.m. UTC | #2
On Wednesday 28 June 2017 09:17 PM, Ferruh Yigit wrote:
> On 6/16/2017 6:41 AM, Shreyansh Jain wrote:
>> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
>> Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
> 
> <...>
> 
>> diff --git a/doc/guides/nics/features/dpaa.ini b/doc/guides/nics/features/dpaa.ini
>> index a6984a4..80dd3ca 100644
>> --- a/doc/guides/nics/features/dpaa.ini
>> +++ b/doc/guides/nics/features/dpaa.ini
>> @@ -10,5 +10,7 @@ Queue start/stop     = Y
>>   Jumbo frame          = Y
>>   MTU update           = Y
>>   Promiscuous mode     = Y
>> +Allmulticast mode    = Y
>> +Unicast MAC filter   = Y
> 
> "Unicast MAC filter" means implementing "mac_addr_set, mac_addr_add,
> mac_addr_remove" dev_ops

I will fix this as well - I am not sure why I set it this way (too less 
or too much coffee). Sorry.

> 
>>   ARMv8                = Y
>>   Usage doc            = Y
> 
> <...>
>
  

Patch

diff --git a/doc/guides/nics/features/dpaa.ini b/doc/guides/nics/features/dpaa.ini
index a6984a4..80dd3ca 100644
--- a/doc/guides/nics/features/dpaa.ini
+++ b/doc/guides/nics/features/dpaa.ini
@@ -10,5 +10,7 @@  Queue start/stop     = Y
 Jumbo frame          = Y
 MTU update           = Y
 Promiscuous mode     = Y
+Allmulticast mode    = Y
+Unicast MAC filter   = Y
 ARMv8                = Y
 Usage doc            = Y
diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index b3e6437..b0c60bb 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -201,6 +201,25 @@  static void dpaa_eth_promiscuous_disable(struct rte_eth_dev *dev)
 	fman_if_promiscuous_disable(dpaa_intf->fif);
 }
 
+static void dpaa_eth_multicast_enable(struct rte_eth_dev *dev)
+{
+	struct dpaa_if *dpaa_intf = dev->data->dev_private;
+
+	PMD_INIT_FUNC_TRACE();
+
+	fman_if_set_mcast_filter_table(dpaa_intf->fif);
+}
+
+static void dpaa_eth_multicast_disable(struct rte_eth_dev *dev)
+{
+	struct dpaa_if *dpaa_intf = dev->data->dev_private;
+
+	PMD_INIT_FUNC_TRACE();
+
+	fman_if_reset_mcast_filter_table(dpaa_intf->fif);
+
+}
+
 static
 int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 			    uint16_t nb_desc __rte_unused,
@@ -306,6 +325,8 @@  static struct eth_dev_ops dpaa_devops = {
 	.link_update		  = dpaa_eth_link_update,
 	.promiscuous_enable	  = dpaa_eth_promiscuous_enable,
 	.promiscuous_disable	  = dpaa_eth_promiscuous_disable,
+	.allmulticast_enable	  = dpaa_eth_multicast_enable,
+	.allmulticast_disable	  = dpaa_eth_multicast_disable,
 	.mtu_set		  = dpaa_mtu_set,
 	.dev_set_link_down	  = dpaa_link_down,
 	.dev_set_link_up	  = dpaa_link_up,