From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vk0-f68.google.com (mail-vk0-f68.google.com [209.85.213.68]) by dpdk.org (Postfix) with ESMTP id EE70E5F13 for ; Tue, 26 Jun 2018 09:29:13 +0200 (CEST) Received: by mail-vk0-f68.google.com with SMTP id n81-v6so3354121vke.6 for ; Tue, 26 Jun 2018 00:29:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=gL8P/rcmE2iedICrWniCB0nEM4CUCUMpf/bkMycBgy0=; b=aqQ5vk5mT6iU+Q5lQK8Gow22OP9TCg+7AZRCopbCWyA5Zr6r9YdigyUjkz4vT9Hip/ sHwsS3bioUWp3nVsY4LZa7i3cRfSqQyRkr0E8rIaz1B6oMNM/pNtZ95+cftzuRJICShh V1eu+csWgUQ5DUhb68wr1R+pxWqv843q4kU1apMrPmja4MH7LdURFpxRMSZXffjAmg0D v0CH1AOlLd4UAS7OrzMwgKCzGLoTtXOJdqJt2VkRTMG7ERu5cJ1pjLFa4usyOV7CynWx RugyQ+O+wu1trciUxAli2GVjObVhaXPD8SNwhwbGtLhu9sQJ+MKaNyCY4mRmt6rTQ28U nagA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=gL8P/rcmE2iedICrWniCB0nEM4CUCUMpf/bkMycBgy0=; b=qAr4Si4lUGX7O6t3fWhBSweCSdiMfTHNsC9rbv8Io4jeWQQ4oG54I3ngPG+zxlFzdC c9RWPgN2sl8PZlP0oHfQlCQDNkOvBQpJN/qUHEnLiKyPLYuqvnSoXhXQP11yW0m2dzMl rzL9pxvTykJJrMMY9W+UWGdzm4KjPrbqCB0UIT2R0IIO13cGaqUpkkTb5zotvIhbhaP8 0VYLIKO0VB+Dhzx4wmvOexYY+4xetocm5JSYJmRQSL9RSjCQRefGQTbi+QnDYJVPcoEq J0WgzsQtnIzOYOU4aUXWd/k19fnpHAHc4vkiyFdIWDa1u7zLAuH8gjcWhEazDZJkqbBw SJtw== X-Gm-Message-State: APt69E2craV+MV0EB55o6Kf+0SjIr2+Si9Giaf+lJOORStOGczjOlUWG lGqvUYevn4H8nC2k64gCEcMBbXKcRsEsyReUPfQkmw== X-Google-Smtp-Source: AAOMgpd4y0uiyJf2M45M4HQwH7oXbaiHTpqKdWCaBc+gGEZMyRuStp+ybzE3w3dqgPnzld2wWgK285/xn0yynXiiF5E= X-Received: by 2002:a1f:6b1d:: with SMTP id g29-v6mr200880vkc.173.1529998153349; Tue, 26 Jun 2018 00:29:13 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a67:62c7:0:0:0:0:0 with HTTP; Tue, 26 Jun 2018 00:29:12 -0700 (PDT) In-Reply-To: <20180625134046.12448-1-daria.kolistratova@intel.com> References: <20180625134046.12448-1-daria.kolistratova@intel.com> From: =?UTF-8?Q?Micha=C5=82_Krawczyk?= Date: Tue, 26 Jun 2018 09:29:12 +0200 Message-ID: To: Daria Kolistratova Cc: Ferruh Yigit , Marcin Wojtas , "Tzalik, Guy" , "Schmeilin, Evgeny" , dev@dpdk.org Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH 1/1] ena: fix SIGFPE with 0 rx queues X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jun 2018 07:29:14 -0000 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 : > 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 > --- > 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 >