Thread (175 messages) 175 messages, 4 authors, 2017-03-27
STALE3411d

[PATCH 47/50] net/liquidio: add API for dev stop

From: Shijith Thotton <hidden>
Date: 2017-02-21 09:30:32
Subsystem: networking drivers, the rest · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

Signed-off-by: Shijith Thotton <redacted>
Signed-off-by: Jerin Jacob <redacted>
Signed-off-by: Derek Chickles <redacted>
Signed-off-by: Venkat Koppula <redacted>
Signed-off-by: Mallesham Jatharakonda <redacted>
---
 drivers/net/liquidio/lio_ethdev.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index 17448fe..d28ded8 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -1360,6 +1360,25 @@ struct rte_lio_xstats_name_off {
 	return ret;
 }
 
+/* Stop device and disable input/output functions */
+static void
+lio_dev_stop(struct rte_eth_dev *eth_dev)
+{
+	struct lio_device *lio_dev = LIO_DEV(eth_dev);
+
+	lio_dev_info(lio_dev, "Stopping port %d\n", eth_dev->data->port_id);
+	lio_dev->intf_open = 0;
+	rte_mb();
+
+	/* Cancel callback if still running. */
+	rte_eal_alarm_cancel(lio_sync_link_state_check, eth_dev);
+
+	lio_send_rx_ctrl_cmd(eth_dev, 0);
+
+	/* Clear recorded link status */
+	lio_dev->linfo.link.link_status64 = 0;
+}
+
 static int
 lio_dev_set_link_up(struct rte_eth_dev *eth_dev)
 {
@@ -1657,6 +1676,7 @@ static int lio_dev_configure(struct rte_eth_dev *eth_dev)
 static const struct eth_dev_ops liovf_eth_dev_ops = {
 	.dev_configure		= lio_dev_configure,
 	.dev_start		= lio_dev_start,
+	.dev_stop		= lio_dev_stop,
 	.dev_set_link_up	= lio_dev_set_link_up,
 	.dev_set_link_down	= lio_dev_set_link_down,
 	.allmulticast_enable	= lio_dev_allmulticast_enable,
-- 
1.8.3.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help