[v2,2/2] drivers/net: set enabled promiscuous and multicast

Message ID 20191021122238.58852-3-ciara.power@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series enable virtual PMD promiscuous and multicast |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/travis-robot success Travis build: passed

Commit Message

Power, Ciara Oct. 21, 2019, 12:22 p.m. UTC
  The promiscuous and multicast fields are now initialised as enabled for
some virtual PMDs. This allows the devices to be used when running
applications that attempt to enable promiscuous or multicast mode.

Signed-off-by: Ciara Power <ciara.power@intel.com>
---
 drivers/net/kni/rte_eth_kni.c   | 2 ++
 drivers/net/null/rte_eth_null.c | 2 ++
 drivers/net/pcap/rte_eth_pcap.c | 2 ++
 drivers/net/ring/rte_eth_ring.c | 2 ++
 4 files changed, 8 insertions(+)
  

Comments

Ferruh Yigit Oct. 21, 2019, 6:40 p.m. UTC | #1
On 10/21/2019 1:22 PM, Ciara Power wrote:
> The promiscuous and multicast fields are now initialised as enabled for
> some virtual PMDs. This allows the devices to be used when running
> applications that attempt to enable promiscuous or multicast mode.
> 
> Signed-off-by: Ciara Power <ciara.power@intel.com>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
  
Andrew Rybchenko Oct. 22, 2019, 7:12 a.m. UTC | #2
On 10/21/19 3:22 PM, Ciara Power wrote:
> The promiscuous and multicast fields are now initialised as enabled for
> some virtual PMDs. This allows the devices to be used when running
> applications that attempt to enable promiscuous or multicast mode.
>
> Signed-off-by: Ciara Power <ciara.power@intel.com>

Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
  

Patch

diff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c
index 547e08c3d..7cba92e2e 100644
--- a/drivers/net/kni/rte_eth_kni.c
+++ b/drivers/net/kni/rte_eth_kni.c
@@ -377,6 +377,8 @@  eth_kni_create(struct rte_vdev_device *vdev,
 	data->nb_tx_queues = 1;
 	data->dev_link = pmd_link;
 	data->mac_addrs = &internals->eth_addr;
+	data->promiscuous = 1;
+	data->all_multicast = 1;
 
 	data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
 
diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c
index e2ff41a22..35920cd1e 100644
--- a/drivers/net/null/rte_eth_null.c
+++ b/drivers/net/null/rte_eth_null.c
@@ -514,6 +514,8 @@  eth_dev_null_create(struct rte_vdev_device *dev,
 	data->nb_tx_queues = (uint16_t)nb_tx_queues;
 	data->dev_link = pmd_link;
 	data->mac_addrs = &internals->eth_addr;
+	data->promiscuous = 1;
+	data->all_multicast = 1;
 
 	eth_dev->dev_ops = &ops;
 
diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c
index 5801915a8..5186d8fe5 100644
--- a/drivers/net/pcap/rte_eth_pcap.c
+++ b/drivers/net/pcap/rte_eth_pcap.c
@@ -1129,6 +1129,8 @@  pmd_init_internals(struct rte_vdev_device *vdev,
 	data->nb_tx_queues = (uint16_t)nb_tx_queues;
 	data->dev_link = pmd_link;
 	data->mac_addrs = &(*internals)->eth_addr;
+	data->promiscuous = 1;
+	data->all_multicast = 1;
 
 	/*
 	 * NOTE: we'll replace the data element, of originally allocated
diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
index c6733ee2b..41acbc513 100644
--- a/drivers/net/ring/rte_eth_ring.c
+++ b/drivers/net/ring/rte_eth_ring.c
@@ -318,6 +318,8 @@  do_eth_dev_ring_create(const char *name,
 	data->nb_tx_queues = (uint16_t)nb_tx_queues;
 	data->dev_link = pmd_link;
 	data->mac_addrs = &internals->address;
+	data->promiscuous = 1;
+	data->all_multicast = 1;
 
 	eth_dev->dev_ops = &ops;
 	data->kdrv = RTE_KDRV_NONE;