> 
> The call to rte_eth_dev_count() was added as workaround
> for rte_eth_dev_get_port_by_name() not handling cases
> when there was no DPDK ports. In recent versions of DPDK,
> rte_eth_dev_get_port_by_name() does handle this
> case, so the rte_eth_dev_count() call can be removed.
> 
> CC: Ciara Loftus <ciara.lof...@intel.com>
> Signed-off-by: Kevin Traynor <ktray...@redhat.com>
> ---
>  lib/netdev-dpdk.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
> index faff842..0436ff0 100644
> --- a/lib/netdev-dpdk.c
> +++ b/lib/netdev-dpdk.c
> @@ -1192,6 +1192,5 @@ netdev_dpdk_process_devargs(struct
> netdev_dpdk *dev,
>      dpdk_port_t new_port_id = DPDK_ETH_PORT_ID_INVALID;
> 
> -    if (!rte_eth_dev_count()
> -            || rte_eth_dev_get_port_by_name(name, &new_port_id)
> +    if (rte_eth_dev_get_port_by_name(name, &new_port_id)
>              || !rte_eth_dev_is_valid_port(new_port_id)) {
>          /* Device not found in DPDK, attempt to attach it */
> @@ -2526,6 +2525,5 @@ netdev_dpdk_detach(struct unixctl_conn *conn,
> int argc OVS_UNUSED,
>      ovs_mutex_lock(&dpdk_mutex);
> 
> -    if (!rte_eth_dev_count() || rte_eth_dev_get_port_by_name(argv[1],
> -                                                             &port_id)) {
> +    if (rte_eth_dev_get_port_by_name(argv[1], &port_id)) {

LGTM. DPDK commit f9ae888b1e19 removes the need for the call to count().

Acked-by: Ciara Loftus <ciara.lof...@intel.com>

Thanks,
Ciara

>          response = xasprintf("Device '%s' not found in DPDK", argv[1]);
>          goto error;
> --
> 1.8.3.1

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to