[dpdk-dev] [PATCH 1/1] ena: fix SIGFPE with 0 rx queues

Michał Krawczyk mk at semihalf.com
Tue Jun 26 09:29:12 CEST 2018


Hi Daria,

please see my comments below and answer on them or apply fix and send
2nd version of the patch. You can do that by adding -v2 flag to git
format-patch command.

Please also sent the new version in response to this  email. You can
do that by adding --in-reply-to 'msgid' to git send-email. The message
ID can be read from the raw version of the email.

Thanks,
Michal

2018-06-25 15:40 GMT+02:00 Daria Kolistratova <daria.kolistratova at intel.com>:
> When  he number of rx queues is 0
Please fix the typo (' he' -> 'the').
Please also add information that it happens when the application is
also requesting ETH_MQ_RX_RSS_FLAG in the
rte_dev->data->dev_conf.rxmode.mq_mode.

> (what can be when application does not receive)
> failed with SIGFPE.
> Fixed adding zero check before division.
>
> Signed-off-by: Daria Kolistratova <daria.kolistratova at intel.com>
> ---
>  drivers/net/ena/ena_ethdev.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>  mode change 100644 => 100755 drivers/net/ena/ena_ethdev.c
>
> diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
> old mode 100644
> new mode 100755
> index 9ae73e331..89004c903
> --- a/drivers/net/ena/ena_ethdev.c
> +++ b/drivers/net/ena/ena_ethdev.c
> @@ -684,7 +684,11 @@ static int ena_rss_init_default(struct ena_adapter *adapter)
>         }
>
>         for (i = 0; i < ENA_RX_RSS_TABLE_SIZE; i++) {
> -               val = i % nb_rx_queues;
> +               if (nb_rx_queues != 0)
> +                       val = i % nb_rx_queues;
> +               else
> +                       val = 0;
> +
This change is not needed if you are adding the below change. This
function should not be called if the nb_rx_queues == 0, so there is no
need to perform additional check.

>                 rc = ena_com_indirect_table_fill_entry(ena_dev, i,
>                                                        ENA_IO_RXQ_IDX(val));
>                 if (unlikely(rc && (rc != ENA_COM_UNSUPPORTED))) {
> @@ -1052,7 +1056,7 @@ static int ena_start(struct rte_eth_dev *dev)
>                 return rc;
>
>         if (adapter->rte_dev->data->dev_conf.rxmode.mq_mode &
> -           ETH_MQ_RX_RSS_FLAG) {
> +           ETH_MQ_RX_RSS_FLAG && adapter->rte_dev->data->nb_rx_queues > 0) {
>                 rc = ena_rss_init_default(adapter);
>                 if (rc)
>                         return rc;
> --
> 2.14.4
>


More information about the dev mailing list