All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/enic: move link checking init to probe time
@ 2016-08-09 21:42 Nelson Escobar
  2016-09-21 10:59 ` Bruce Richardson
  0 siblings, 1 reply; 2+ messages in thread
From: Nelson Escobar @ 2016-08-09 21:42 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson, Nelson Escobar

The enic DMAs link status information to the host and this requires a
little setup.  This setup was being done as a result of calling
rte_eth_dev_start().  But applications expect to be able to check link
status before calling rte_eth_dev_start().

This patch moves he link status setup to enic_init() which is called
at device probe time so that link status can be checked anytime.

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 | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index b4ca371..eb32ac1 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -430,7 +430,6 @@ int enic_enable(struct enic *enic)
 
 	eth_dev->data->dev_link.link_speed = vnic_dev_port_speed(enic->vdev);
 	eth_dev->data->dev_link.link_duplex = ETH_LINK_FULL_DUPLEX;
-	vnic_dev_notify_set(enic->vdev, -1); /* No Intr for notify */
 
 	if (enic_clsf_init(enic))
 		dev_warning(enic, "Init of hash table for clsf failed."\
@@ -820,7 +819,6 @@ int enic_disable(struct enic *enic)
 	}
 
 	vnic_dev_set_reset_flag(enic->vdev, 1);
-	vnic_dev_notify_unset(enic->vdev);
 
 	for (i = 0; i < enic->wq_count; i++)
 		vnic_wq_clean(&enic->wq[i], enic_free_wq_buf);
@@ -1022,6 +1020,9 @@ static void enic_dev_deinit(struct enic *enic)
 {
 	struct rte_eth_dev *eth_dev = enic->rte_dev;
 
+	/* stop link status checking */
+	vnic_dev_notify_unset(enic->vdev);
+
 	rte_free(eth_dev->data->mac_addrs);
 }
 
@@ -1137,6 +1138,9 @@ static int enic_dev_init(struct enic *enic)
 
 	vnic_dev_set_reset_flag(enic->vdev, 0);
 
+	/* set up link status checking */
+	vnic_dev_notify_set(enic->vdev, -1); /* No Intr for notify */
+
 	return 0;
 
 }
-- 
2.7.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net/enic: move link checking init to probe time
  2016-08-09 21:42 [PATCH] net/enic: move link checking init to probe time Nelson Escobar
@ 2016-09-21 10:59 ` Bruce Richardson
  0 siblings, 0 replies; 2+ messages in thread
From: Bruce Richardson @ 2016-09-21 10:59 UTC (permalink / raw)
  To: Nelson Escobar; +Cc: dev

On Tue, Aug 09, 2016 at 02:42:04PM -0700, Nelson Escobar wrote:
> The enic DMAs link status information to the host and this requires a
> little setup.  This setup was being done as a result of calling
> rte_eth_dev_start().  But applications expect to be able to check link
> status before calling rte_eth_dev_start().
> 
> This patch moves he link status setup to enic_init() which is called
> at device probe time so that link status can be checked anytime.
> 
> Fixes: fefed3d1e62c ("enic: new driver")
> 
> Signed-off-by: Nelson Escobar <neescoba@cisco.com>
> Reviewed-by: John Daley <johndale@cisco.com>

Applied to dpdk-next-net/rel_16_11

/Bruce

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-21 10:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-09 21:42 [PATCH] net/enic: move link checking init to probe time Nelson Escobar
2016-09-21 10:59 ` Bruce Richardson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.