[dpdk-dev,1/2] net/enic: fix setting MAC address when a port is restarted

Message ID 1467940221-11341-1-git-send-email-neescoba@cisco.com (mailing list archive)
State Accepted, archived
Delegated to: Bruce Richardson
Headers

Commit Message

Nelson Escobar July 8, 2016, 1:10 a.m. UTC
  enic_disable() removed the MAC address when a port was shut down but
enic_enable() didn't add the MAC address back when the port was
started again. Move where we set the MAC address for the adapter from
enic_setup_finish() to a enic_enable() so that port restarting works
properly.

Fixes: fefed3d1e62c ("enic: new driver")

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
---
 drivers/net/enic/enic_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Bruce Richardson July 8, 2016, 9 p.m. UTC | #1
On Thu, Jul 07, 2016 at 06:10:21PM -0700, Nelson Escobar wrote:
> enic_disable() removed the MAC address when a port was shut down but
> enic_enable() didn't add the MAC address back when the port was
> started again. Move where we set the MAC address for the adapter from
> enic_setup_finish() to a enic_enable() so that port restarting works
> properly.
> 
> Fixes: fefed3d1e62c ("enic: new driver")
> 
> Signed-off-by: Nelson Escobar <neescoba@cisco.com>
> Reviewed-by: John Daley <johndale@cisco.com>
> ---

Patchset applied to dpdk-next-net/rel_16_07

/Bruce
  

Patch

diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 8eacf2d..1f3d14e 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -455,6 +455,8 @@  int enic_enable(struct enic *enic)
 	for (index = 0; index < enic->rq_count; index++)
 		enic_start_rq(enic, index);
 
+	vnic_dev_add_addr(enic->vdev, enic->mac_addr);
+
 	vnic_dev_enable_wait(enic->vdev);
 
 	/* Register and enable error interrupt */
@@ -971,8 +973,6 @@  int enic_setup_finish(struct enic *enic)
 		return -1;
 	}
 
-	vnic_dev_add_addr(enic->vdev, enic->mac_addr);
-
 	/* Default conf */
 	vnic_dev_packet_filter(enic->vdev,
 		1 /* directed  */,