DPDK patches and discussions
 help / color / mirror / Atom feed
From: Mallesh Koujalagi <malleshx.koujalagi@intel.com>
To: dev@dpdk.org
Cc: mtetsuyah@gmail.com, ferruh.yigit@intel.com,
	stephen@networkplumber.org,
	Mallesh Koujalagi <malleshx.koujalagi@intel.com>
Subject: [dpdk-dev] [PATCH v3] net/null:Different mac address support
Date: Tue,  6 Mar 2018 19:31:54 -0800	[thread overview]
Message-ID: <1520393514-25882-1-git-send-email-malleshx.koujalagi@intel.com> (raw)
In-Reply-To: <1517623898-53443-1-git-send-email-malleshx.koujalagi@intel.com>

After attaching two Null device to ovs, seeing "00.00.00.00.00.00" mac
address for both null devices. Fix this issue, by setting different mac
address.

Signed-off-by: Mallesh Koujalagi <malleshx.koujalagi@intel.com>
---
 drivers/net/null/rte_eth_null.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c
index 9385ffd..42e3a77 100644
--- a/drivers/net/null/rte_eth_null.c
+++ b/drivers/net/null/rte_eth_null.c
@@ -73,6 +73,7 @@ struct pmd_internals {
 	struct null_queue rx_null_queues[RTE_MAX_QUEUES_PER_PORT];
 	struct null_queue tx_null_queues[RTE_MAX_QUEUES_PER_PORT];
 
+	struct ether_addr eth_addr;
 	/** Bit mask of RSS offloads, the bit offset also means flow type */
 	uint64_t flow_type_rss_offloads;
 
@@ -84,9 +85,6 @@ struct pmd_internals {
 
 	uint8_t rss_key[40];                /**< 40-byte hash key. */
 };
-
-
-static struct ether_addr eth_addr = { .addr_bytes = {0} };
 static struct rte_eth_link pmd_link = {
 	.link_speed = ETH_SPEED_NUM_10G,
 	.link_duplex = ETH_LINK_FULL_DUPLEX,
@@ -519,7 +517,6 @@ eth_dev_null_create(struct rte_vdev_device *dev,
 		rte_free(data);
 		return -ENOMEM;
 	}
-
 	/* now put it all together
 	 * - store queue data in internals,
 	 * - store numa_node info in ethdev data
@@ -533,6 +530,7 @@ eth_dev_null_create(struct rte_vdev_device *dev,
 	internals->packet_size = packet_size;
 	internals->packet_copy = packet_copy;
 	internals->port_id = eth_dev->data->port_id;
+	eth_random_addr(internals->eth_addr.addr_bytes);
 
 	internals->flow_type_rss_offloads =  ETH_RSS_PROTO_MASK;
 	internals->reta_size = RTE_DIM(internals->reta_conf) * RTE_RETA_GROUP_SIZE;
@@ -543,7 +541,7 @@ eth_dev_null_create(struct rte_vdev_device *dev,
 	data->nb_rx_queues = (uint16_t)nb_rx_queues;
 	data->nb_tx_queues = (uint16_t)nb_tx_queues;
 	data->dev_link = pmd_link;
-	data->mac_addrs = &eth_addr;
+	data->mac_addrs = &internals->eth_addr;
 
 	eth_dev->data = data;
 	eth_dev->dev_ops = &ops;
-- 
2.7.4

  parent reply	other threads:[~2018-03-07  3:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-03  2:11 [dpdk-dev] [PATCH] " Mallesh Koujalagi
2018-03-05 14:21 ` Ferruh Yigit
2018-03-06  3:35 ` [dpdk-dev] [PATCH v2] " Mallesh Koujalagi
2018-03-06  4:26   ` Stephen Hemminger
2018-03-06 11:40   ` Ferruh Yigit
2018-03-07  3:31 ` Mallesh Koujalagi [this message]
2018-03-07 10:45   ` [dpdk-dev] [PATCH v3] " Ferruh Yigit
2018-03-07 18:11     ` Koujalagi, MalleshX
2018-03-16 13:57     ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1520393514-25882-1-git-send-email-malleshx.koujalagi@intel.com \
    --to=malleshx.koujalagi@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=mtetsuyah@gmail.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).