ring: add link up/down
authorTomasz Kulasek <tomaszx.kulasek@intel.com>
Mon, 19 Jan 2015 11:56:39 +0000 (12:56 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 18 Feb 2015 17:58:55 +0000 (18:58 +0100)
Link up and down implementation.

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
lib/librte_pmd_ring/rte_eth_ring.c

index d5b1686..9a00524 100644 (file)
@@ -120,6 +120,20 @@ eth_dev_stop(struct rte_eth_dev *dev)
        dev->data->dev_link.link_status = 0;
 }
 
+static int
+eth_dev_set_link_down(struct rte_eth_dev *dev)
+{
+       dev->data->dev_link.link_status = 0;
+       return 0;
+}
+
+static int
+eth_dev_set_link_up(struct rte_eth_dev *dev)
+{
+       dev->data->dev_link.link_status = 1;
+       return 0;
+}
+
 static int
 eth_rx_queue_setup(struct rte_eth_dev *dev,uint16_t rx_queue_id,
                                    uint16_t nb_rx_desc __rte_unused,
@@ -206,6 +220,8 @@ eth_link_update(struct rte_eth_dev *dev __rte_unused,
 static struct eth_dev_ops ops = {
                .dev_start = eth_dev_start,
                .dev_stop = eth_dev_stop,
+               .dev_set_link_up = eth_dev_set_link_up,
+               .dev_set_link_down = eth_dev_set_link_down,
                .dev_configure = eth_dev_configure,
                .dev_infos_get = eth_dev_info,
                .rx_queue_setup = eth_rx_queue_setup,