On 11/1/2024 6:21 AM, Junlong Wang wrote:
> configure zxdh intr include risc,dtb. and release intr.
> 
> Signed-off-by: Junlong Wang <wang.junlo...@zte.com.cn>
> 

<...>

> +static int32_t zxdh_configure_intr(struct rte_eth_dev *dev)
> +{
> +    struct zxdh_hw *hw = dev->data->dev_private;
> +    int32_t ret = 0;
> +
> +    if (!rte_intr_cap_multiple(dev->intr_handle)) {
> +        PMD_INIT_LOG(ERR, "Multiple intr vector not supported");
> +        return -ENOTSUP;
> +    }
> +    zxdh_intr_release(dev);
> +    uint8_t nb_efd = ZXDH_MSIX_INTR_DTB_VEC_NUM + ZXDH_MSIX_INTR_MSG_VEC_NUM;
> +
> +    if (dev->data->dev_conf.intr_conf.rxq)
> +        nb_efd += dev->data->nb_rx_queues;
> +
> +    if (rte_intr_efd_enable(dev->intr_handle, nb_efd)) {
> +        PMD_INIT_LOG(ERR, "Fail to create eventfd");
> +        return -1;
> +    }
> +
> +    if (rte_intr_vec_list_alloc(dev->intr_handle, "intr_vec",
> +                    hw->max_queue_pairs + ZXDH_INTR_NONQUE_NUM)) {
> +        PMD_INIT_LOG(ERR, "Failed to allocate %u rxq vectors",
> +                    hw->max_queue_pairs + ZXDH_INTR_NONQUE_NUM);
> +        return -ENOMEM;
> +    }
> +    PMD_INIT_LOG(DEBUG, "allocate %u rxq vectors", dev->intr_handle-
>>vec_list_size);
> +    if (zxdh_setup_risc_interrupts(dev) != 0) {
> +        PMD_INIT_LOG(ERR, "Error setting up rsic_v interrupts!");
> +        ret = -1;
> +        goto free_intr_vec;
> +    }
> +    if (zxdh_setup_dtb_interrupts(dev) != 0) {
> +        PMD_INIT_LOG(ERR, "Error setting up dtb interrupts!");
> +        ret = -1;
> +        goto free_intr_vec;
> +    }
> +
> +    if (zxdh_queues_bind_intr(dev) < 0) {
> +        PMD_INIT_LOG(ERR, "Failed to bind queue/interrupt");
> +        ret = -1;
> +        goto free_intr_vec;
> +    }
> +
> +    if (zxdh_intr_enable(dev) < 0) {
> +        PMD_DRV_LOG(ERR, "interrupt enable failed");
> +        ret = -1;
> +        goto free_intr_vec;
> +    }
>

One of the above log use 'PMD_INIT_LOG()' and other 'PMD_DRV_LOG()', how
do you diffrentiate?
Do you really need two different log type, init and driver? (I
understand need for others, Rx, Tx & msg, but still less is easier)


Reply via email to