From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-f66.google.com (mail-it0-f66.google.com [209.85.214.66]) by dpdk.org (Postfix) with ESMTP id 207531BB20 for ; Thu, 21 Jun 2018 12:14:50 +0200 (CEST) Received: by mail-it0-f66.google.com with SMTP id j135-v6so3995344itj.1 for ; Thu, 21 Jun 2018 03:14:50 -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=nEmWIKP//eepVkyx7frvPNEtoSflHrCgg68is7qLlxE=; b=OU6DBourZl9C4uijRoAA6rxwrAzgDaD7Nv5OOVjfRtn9IATyFByGePYkPbv3rC2QiH oxaAWLDEBpjF6giMWG8sWiZludLpnKHJAqG57WDjE9TOlERGHnBqZKI0BLMTuEbQLbEx vlibfSn5krjpnZ1KQu3Kj77bCsEbParUGnudJ0ipBJFLkGwyBctp98nkaepAAeCAxxNr 9tdQImgXqEz3AfewtQZ7AiOAuFk4yz+eKj5jQnkKdNU0x89kOKujPFThAiYU1SsdhPp/ 8vDqgiuUJP5/lzWdnVT2IXdo2HlpnXU9NIdKqQfWx8Eba+saXuo91VDWAADuNurLTR5w Xelg== 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=nEmWIKP//eepVkyx7frvPNEtoSflHrCgg68is7qLlxE=; b=e1ocs1Y5n0gs3CcumuX/v/V2RhFgJO0j5ywYMr2LbrJN1PBeL88AOKLVtrJZfecqd1 9KpAjMf+GxJmFdKLwkhD/E5UW1Sc22IwAphZWGXeQSMqo0dUavUXXjFE2QwJr7l3YFZg o2Mj61qGkiYBK1wCu9fdqqwEXnpveVsGaNZo1uX4W+zqbfaAWXd4ZLwprfHC1wElJK8l UAJvImDReFFIafjui+xNHMkcKsC8RO0ho001hBvGcem73gn7DjtU6Dqyh9wiluGpBJ2Z YL6o0D0EVGCMZhp3Q4jAtYGn4jbAlV3nbyyDYBdYZiEyr2tDLf8UCuL8DoF1Nqm5AHAd 268A== X-Gm-Message-State: APt69E0ogqf0mp81iErUMTyxAGJk3j8VMRDZ9xvd6Gzth1Fp5+GBWmdr rY3+gOTzJ3s4UQUNllDxm7LY+K6Fi4rfNGZY0zP7/A== X-Google-Smtp-Source: ADUXVKLZK4+mBQl48d0q5h7PNIV6FfxZjZWXFhKyAspLfZnjvbz/c9lk48dfodcmSrKrV3LlzxNk7VutQmT7deqnNKk= X-Received: by 2002:a24:1848:: with SMTP id 69-v6mr4335836itr.57.1529576089434; Thu, 21 Jun 2018 03:14:49 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:c6cc:0:0:0:0:0 with HTTP; Thu, 21 Jun 2018 03:14:48 -0700 (PDT) In-Reply-To: <20180620163217.3770-1-daria.kolistratova@intel.com> References: <20180620163217.3770-1-daria.kolistratova@intel.com> From: Marcin Wojtas Date: Thu, 21 Jun 2018 12:14:48 +0200 Message-ID: To: Daria Kolistratova Cc: "Tzalik, Guy" , Evgeny Schemeilin , dev@dpdk.org, Ferruh Yigit , =?UTF-8?Q?Micha=C5=82_Krawczyk?= 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: Thu, 21 Jun 2018 10:14:50 -0000 + Ferruh and Michal 2018-06-20 18:32 GMT+02:00 Daria Kolistratova : > When he number of rx queues is 0 > (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 | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c > index 9ae73e331..76c483921 100644 > --- 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; > + > rc = ena_com_indirect_table_fill_entry(ena_dev, i, > ENA_IO_RXQ_IDX(val)); > if (unlikely(rc && (rc != ENA_COM_UNSUPPORTED))) { > -- > 2.14.4 >