[dpdk-dev] [PATCH 02/13] net/bnxt: prevent device access when device is in reset

Ferruh Yigit ferruh.yigit at intel.com
Tue Aug 27 17:00:10 CEST 2019


On 8/22/2019 6:53 AM, Ajit Khaparde wrote:
> From: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
> 
> Refactor init and uninit functions so that the driver can fail
> the eth_dev_ops callbacks and accessing Tx and Rx queues
> when device is in reset or in error state.
> 
> Transmit and receive queues are freed during reset cleanup and
> reallocated during recovery. So we block all data path handling
> in this state. The eth_dev dev_started field is updated depending
> on the status of the device.
> 
> Signed-off-by: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
> Reviewed-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
> Reviewed-by: Santoshkumar Karanappa Rastapur <santosh.rastapur at broadcom.com>
> Reviewed-by: Somnath Kotur <somnath.kotur at broadcom.com>

<...>

> @@ -167,6 +167,16 @@ static void bnxt_print_link_info(struct rte_eth_dev *eth_dev);
>  static int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu);
>  static int bnxt_dev_uninit(struct rte_eth_dev *eth_dev);
>  
> +int is_bnxt_in_error(struct bnxt *bp)
> +{
> +	if (bp->flags & BNXT_FLAG_FATAL_ERROR)
> +		return -EIO;
> +	if (bp->flags & BNXT_FLAG_FW_RESET)
> +		return -EBUSY;
> +
> +	return 0;
> +}

In this patch 'BNXT_FLAG_FATAL_ERROR' & 'BNXT_FLAG_FW_RESET' are not defined
yet, causing build error [1], can you please move the definitions in this patch?

[1]
.../dpdk/drivers/net/bnxt/bnxt_ethdev.c:172:18: error: use of undeclared
identifier 'BNXT_FLAG_FATAL_ERROR'
        if (bp->flags & BNXT_FLAG_FATAL_ERROR)
                        ^
.../dpdk/drivers/net/bnxt/bnxt_ethdev.c:174:18: error: use of undeclared
identifier 'BNXT_FLAG_FW_RESET'
        if (bp->flags & BNXT_FLAG_FW_RESET)
                        ^



More information about the dev mailing list