[dpdk-dev] [PATCH v6 17/17] ethdev: get rid of device type

Jan Viktorin viktorin at rehivetech.com
Thu Jul 14 18:33:12 CEST 2016


On Tue, 12 Jul 2016 11:31:22 +0530
Shreyansh Jain <shreyansh.jain at nxp.com> wrote:

> Now that hotplug has been moved to eal, there is no reason to keep the device
> type in this layer.
> 
> Signed-off-by: David Marchand <david.marchand at 6wind.com>
> Signed-off-by: Shreyansh Jain <shreyansh.jain at nxp.com>
> ---
>  app/test/virtual_pmd.c                    |  2 +-
>  drivers/net/af_packet/rte_eth_af_packet.c |  2 +-
>  drivers/net/bonding/rte_eth_bond_api.c    |  2 +-
>  drivers/net/cxgbe/cxgbe_main.c            |  2 +-
>  drivers/net/mlx4/mlx4.c                   |  2 +-
>  drivers/net/mlx5/mlx5.c                   |  2 +-
>  drivers/net/mpipe/mpipe_tilegx.c          |  2 +-
>  drivers/net/null/rte_eth_null.c           |  2 +-
>  drivers/net/pcap/rte_eth_pcap.c           |  2 +-
>  drivers/net/ring/rte_eth_ring.c           |  2 +-
>  drivers/net/vhost/rte_eth_vhost.c         |  2 +-
>  drivers/net/virtio/virtio_user_ethdev.c   |  2 +-
>  drivers/net/xenvirt/rte_eth_xenvirt.c     |  2 +-
>  examples/ip_pipeline/init.c               | 22 ----------------------
>  lib/librte_ether/rte_ethdev.c             |  5 ++---
>  lib/librte_ether/rte_ethdev.h             | 15 +--------------
>  16 files changed, 16 insertions(+), 52 deletions(-)
> 

[...]

>  
> -static int
> -app_link_is_virtual(struct app_link_params *p)
> -{
> -	uint32_t pmd_id = p->pmd_id;
> -	struct rte_eth_dev *dev = &rte_eth_devices[pmd_id];
> -
> -	if (dev->dev_type == RTE_ETH_DEV_VIRTUAL)
> -		return 1;
> -
> -	return 0;
> -}
> -
>  void
>  app_link_up_internal(struct app_params *app, struct app_link_params *cp)
>  {
>  	uint32_t i;
>  	int status;
>  
> -	if (app_link_is_virtual(cp)) {
> -		cp->state = 1;
> -		return;
> -	}
> -
>  	/* For each link, add filters for IP of current link */
>  	if (cp->ip != 0) {
>  		for (i = 0; i < app->n_links; i++) {
> @@ -736,11 +719,6 @@ app_link_down_internal(struct app_params *app, struct app_link_params *cp)
>  	uint32_t i;
>  	int status;
>  
> -	if (app_link_is_virtual(cp)) {
> -		cp->state = 0;
> -		return;
> -	}
> -
>  	/* PMD link down */

I understand that app_link_is_virtual is useless. However, it changes
semantics. What is the behaviour of the app_link_up_internal after this
change?

>  	status = rte_eth_dev_set_link_down(cp->pmd_id);
>  	if (status < 0)

[...]


More information about the dev mailing list