From patchwork Thu Sep 5 09:32:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Ostruszka X-Patchwork-Id: 58631 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 14D591EF3E; Thu, 5 Sep 2019 11:32:57 +0200 (CEST) Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by dpdk.org (Postfix) with ESMTP id 836111EDED for ; Thu, 5 Sep 2019 11:32:45 +0200 (CEST) Received: by mail-lj1-f195.google.com with SMTP id a4so1697032ljk.8 for ; Thu, 05 Sep 2019 02:32:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=bK9nl/qV04wjIKeztaLOLubH2UF/0ajtfJqFha0o/9s=; b=ARDOlnys48Lb+0hMvm7qqu8QlowKGjcOdiP3knBHbW+sn1mJOdVzRBYovpLXWOxZ+9 /wYBTlfkk+i1hXRmiSEENiU3Lgm3xmkbBhkJSGwuv4RdwQgmaGMHY+63ncBvmm0sazGk hh9fBMs4o1AO0/W6bF7swWww3RGTPtzdlvD1UnBg1KNI7qSBNcTVhwWapoayPOJTnuu+ 3rK/UIVJa/nNNbrlbfUUyf7ZcWXUSfGkOTSDg/VhBqJpRLuqZvFZkGx6scLXr1P30CJ6 khxwAa1oexXFs9R15sR2a7fn2WOa9AYkfJlUy/FUDha8WmCTDlRVGnwza1QJmKoCIT/J nDaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=bK9nl/qV04wjIKeztaLOLubH2UF/0ajtfJqFha0o/9s=; b=LSqlxFulL4AcAAVsKIEP3shR4OJbDpR4jMcagjb5AzqEm8qRh7bbkDczKHfbybCSRB dxK/FfzAnwsT5tVcN3hBoybLTGImN6KsA6IS6G6LaK8MilOjYTCtprXEVTF8Ojv/Q5Wj SUqGteX+lTvnu57LrsZ1iWdF7ZAEGZ9o4NuT1QmuQSlc1o+OPmhRQAQ+SyFm/9Ve2jLc fFicuOc5mevLXftOhnaUkQMIQuZWQqDCswH33Og+ay0kxZ1u4ooCkuSUi9zx0rypT8im xaGiHMIwn0jH6wnXvxzB4SQuefq9x3Ph5tZNj/SDKZsCp8k/vcyY5fNp0zotgFIUoXbM 6WZw== X-Gm-Message-State: APjAAAU15e7sAWBuPb92o75c43ZTgLqV4Wq21j1gAaWl/8+DOAKH83Xk E75LWOip/WaFxFJMYKKFxWJgkQwG+fgS0g== X-Google-Smtp-Source: APXvYqzPkdwFIYUNzdFG7/poSvhFzGegjOsQA9cPX6sIa2w+vHI+wQqJMd1sJWTsoOZYLYAGIQSqWw== X-Received: by 2002:a2e:7502:: with SMTP id q2mr1360853ljc.202.1567675965100; Thu, 05 Sep 2019 02:32:45 -0700 (PDT) Received: from localhost.localdomain (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.googlemail.com with ESMTPSA id b25sm363060lfa.90.2019.09.05.02.32.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2019 02:32:44 -0700 (PDT) From: Andrzej Ostruszka To: dev@dpdk.org Cc: Andrzej Ostruszka Date: Thu, 5 Sep 2019 11:32:35 +0200 Message-Id: <20190905093239.27187-7-amo@semihalf.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190905093239.27187-1-amo@semihalf.com> References: <20190905093239.27187-1-amo@semihalf.com> Subject: [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" This patch fixes 'maybe-uninitialized' warnings reported by compiler when using LTO. Signed-off-by: Andrzej Ostruszka --- drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 1 + drivers/net/dpaa2/mc/dpkg.c | 2 +- drivers/net/dpaa2/mc/dpni.c | 9 ++++++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c index 56e2e56a3..2f6534a31 100644 --- a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c +++ b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c @@ -51,6 +51,7 @@ rte_pmd_dpaa2_set_custom_hash(uint16_t port_id, kg_cfg.extracts[0].type = DPKG_EXTRACT_FROM_DATA; kg_cfg.extracts[0].extract.from_data.offset = offset; kg_cfg.extracts[0].extract.from_data.size = size; + kg_cfg.extracts[0].num_of_byte_masks = 0; kg_cfg.num_extracts = 1; ret = dpkg_prepare_key_cfg(&kg_cfg, p_params); diff --git a/drivers/net/dpaa2/mc/dpkg.c b/drivers/net/dpaa2/mc/dpkg.c index 80f94f40e..7aa63ea12 100644 --- a/drivers/net/dpaa2/mc/dpkg.c +++ b/drivers/net/dpaa2/mc/dpkg.c @@ -63,7 +63,7 @@ dpkg_prepare_key_cfg(const struct dpkg_profile_cfg *cfg, uint8_t *key_cfg_buf) dpkg_set_field(extr->extract_type, EXTRACT_TYPE, cfg->extracts[i].type); - for (j = 0; j < DPKG_NUM_OF_MASKS; j++) { + for (j = 0; j < extr->num_of_byte_masks; j++) { extr->masks[j].mask = cfg->extracts[i].masks[j].mask; extr->masks[j].offset = cfg->extracts[i].masks[j].offset; 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; + } cmd_params->notification_mode = cpu_to_le16(cfg->notification_mode); - cmd_params->dest_priority = cfg->dest_cfg.priority; cmd_params->message_iova = cpu_to_le64(cfg->message_iova); cmd_params->message_ctx = cpu_to_le64(cfg->message_ctx); cmd_params->threshold_entry = cpu_to_le32(cfg->threshold_entry);