From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4D02EA2E8D for ; Thu, 5 Sep 2019 18:05:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 738181EFB2; Thu, 5 Sep 2019 18:05:03 +0200 (CEST) Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) by dpdk.org (Postfix) with ESMTP id F13A41EDB2 for ; Thu, 5 Sep 2019 18:05:01 +0200 (CEST) Received: by mail-lj1-f194.google.com with SMTP id j16so3088430ljg.6 for ; Thu, 05 Sep 2019 09:05:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=3et5ed41l52laQMmrJxDyVKUFXF6qsrG7H2eVK86lNY=; b=gZZIBN2vPHQYzNvjP74eqQZD8e1pwl8RrNuRtr/qNmv6YBeR+rfjPvozlqvzJb/oGm +88c5bTUK2aHirGoHN3QOGca/rOyUkMYMLmr7XBJDrfEeUvXJZqRkMRBlN06KJMSwQwJ OKokoTq6nvv/u+pJEbmmlXmagVlfTZNa7VZZgztCfrfEO0cQryVjPVwwus8kpICOD+Cn ugmTDkxx3FFREkYR/DFFw8QHvfSF/Qx85x7Yj0wQeYN3InZSYFpZ0lhCqVwBKbcPuYIS J0L9opocrLkbMx95WwFMSVrCFZ0A+4BWk7nFVk7FbeXlayriNxhHMz/mAhS5fUIMFsi6 53gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=3et5ed41l52laQMmrJxDyVKUFXF6qsrG7H2eVK86lNY=; b=jS/qTYTGKKQ7BPobWhoxTb8LXshn335iW2hXiIydQ6mVd5IFM73uGTPK1JXpwI8L9f dvJr3Z6QMQ/buDyAyO//MU8itPhBOf6cYHMF0W1GATP588tt9+Roji+qiH7MuBbXEvps jzjo+MVn6ny6T4QxbfdmHX/nkUAu2Qqf1QosHCejlROYnTZgXzM3CzrscfnSq+y7cuKx LTtSMRVqJKzX+NDHrhwNBxgZ0Ikb4IlRYy1rcTtC2jTuiTwxEDHLluoVGK9C5s7Yph82 VOJC3iBEDNluj9YrUJ2o6wg1h3XX3svPxbgjAQq1btlruGXHXGOIRUdfDJ1pL3Aab/0V m1GA== X-Gm-Message-State: APjAAAXJ/0lsF29IzUOxC7y7/xJ9tovkxe3tr4ewUhrBxNYpVspONHxw PhEYXJpq7ynKQnRZOHqyvu2+gw== X-Google-Smtp-Source: APXvYqzck5DWBA07/lHM2ZigmdjrTc5DURtBliZ6yfQwliAMgR5bKC1pZSqDmmmTpZeDv+hNO/MvHA== X-Received: by 2002:a2e:9ac4:: with SMTP id p4mr2496036ljj.206.1567699501568; Thu, 05 Sep 2019 09:05:01 -0700 (PDT) Received: from [10.0.0.72] (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id y22sm516115lfb.75.2019.09.05.09.05.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Sep 2019 09:05:00 -0700 (PDT) To: Hemant Agrawal , "dev@dpdk.org" , Sachin Saxena Cc: "mattias.ronnblom@ericsson.com" , "stephen@networkplumber.org" , Andrzej Ostruszka References: <20190905092001.26011-1-amo@semihalf.com> <20190905092001.26011-7-amo@semihalf.com> From: Andrzej Ostruszka Message-ID: Date: Thu, 5 Sep 2019 18:04:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 06/10] net/dpaa2: fix possible use of uninitialized vars 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 9/5/19 4:10 PM, Hemant Agrawal wrote: > Hi Andrzei, > >> -----Original Message----- > >> diff --git a/drivers/net/dpaa2/mc/dpni.c b/drivers/net/dpaa2/mc/dpni.c >> index 362cd476f..b74a1a317 100644 >> --- a/drivers/net/dpaa2/mc/dpni.c >> +++ b/drivers/net/dpaa2/mc/dpni.c >> @@ -1803,10 +1803,13 @@ int dpni_set_congestion_notification(struct >> fsl_mc_io *mc_io, >> cmd_params->qtype = qtype; >> cmd_params->tc = tc_id; >> cmd_params->congestion_point = cfg->cg_point; >> - cmd_params->cgid = (uint8_t)cfg->cgid; >> - cmd_params->dest_id = cpu_to_le32(cfg->dest_cfg.dest_id); >> + if (cfg->cg_point == DPNI_CP_CONGESTION_GROUP) >> + cmd_params->cgid = (uint8_t)cfg->cgid; >> + if (cfg->dest_cfg.dest_type != DPNI_DEST_NONE) { >> + cmd_params->dest_id = cpu_to_le32(cfg- >>> dest_cfg.dest_id); >> + cmd_params->dest_priority = cfg->dest_cfg.priority; >> + } > > [Hemant] what was the exact issues you are facing in this piece of code? > Please share your compiler and other env details. > >> cmd_params->notification_mode = cpu_to_le16(cfg- >>> notification_mode); >> - cmd_params->dest_priority = cfg->dest_cfg.priority; That was warning from compiler that neither of these: - cfg->cgid - cfg->dest_cfg.dest_id - cfg->dest_cfg.dest_priority is initialized in dpaa2_dev_tx_queue_setup() where this function is called and they are used here. This might be non issue - I've changed the function here however since I though it would be better - but I don't know this code, I'm just guessing that: - cgid is meaningful only when cg_point is DPNI_CP_CONGESTION_GROUP - dest_id/dest_priority are meaningful when dest_type is not DPNI_DEST_NONE. That was developed on 19.05 and rebased to 19.11 and I was using gcc (7.4) however today when I commented out those 'if' I did not got the warning which I wanted to send here. I'll try to figure out what has changed that this is no longer reported (I think the compiler should still report this). Best regards Andrzej BTW. In my original submission I've made a mistake with DPDK dev e-mail, so I'm replying now with it corrected.