* Re: [dpdk-dev] [PATCH 06/10] net/dpaa2: fix possible use of uninitialized vars
[not found] ` <VI1PR0401MB25419AE95E8E6BCE90FE8F0C89BB0@VI1PR0401MB2541.eurprd04.prod.outlook.com>
@ 2019-09-05 16:04 ` Andrzej Ostruszka
0 siblings, 0 replies; 2+ messages in thread
From: Andrzej Ostruszka @ 2019-09-05 16:04 UTC (permalink / raw)
To: Hemant Agrawal, dev, Sachin Saxena
Cc: mattias.ronnblom, stephen, Andrzej Ostruszka
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
* [dpdk-dev] [PATCH 00/10] Add an option to use LTO for DPDK build
@ 2019-09-05 9:32 Andrzej Ostruszka
2019-09-05 9:32 ` [dpdk-dev] [PATCH 06/10] net/dpaa2: fix possible use of uninitialized vars Andrzej Ostruszka
0 siblings, 1 reply; 2+ messages in thread
From: Andrzej Ostruszka @ 2019-09-05 9:32 UTC (permalink / raw)
To: dev
This patch series adds an option to make use of link time optimization
(if compiler has support for it). It is split as follows:
- 1st patch (build) is the enablement
- remaining patches are fixes for the warnings produced by the compiler
and they are split by directory/subsystem so their maintainers can
easily find and verify the changes - please note that there are two
groups:
* errors (or possible errors) - with title "fix possible use ..."
* false positives - warnings that _I_ think are not valid and the
changes are made only to silence the compiler.
Andrzej Ostruszka (10):
build: add an option to enable LTO build
eventdev: fix possible use of uninitialized var
app/eventdev: fix maybe-uninitialized warnings for LTO build
event/octeontx2: fix maybe-uninitialized warnings for LTO build
app/test: fix maybe-uninitialized warnings for LTO build
net/dpaa2: fix possible use of uninitialized vars
net/e1000: fix maybe-uninitialized warnings for LTO build
net/i40e: fix maybe-uninitialized warnings for LTO build
net/ifc: fix maybe-uninitialized warnings for LTO build
net/qede: fix maybe-uninitialized warnings for LTO build
.travis.yml | 7 ++++
app/test-eventdev/test_perf_common.c | 2 +-
app/test-eventdev/test_pipeline_common.c | 4 +--
app/test/test_hash_readwrite.c | 2 +-
app/test/test_link_bonding_mode4.c | 6 ++--
app/test/test_memzone.c | 3 +-
config/common_base | 5 +++
config/meson.build | 9 +++++
doc/guides/prog_guide/lto.rst | 36 +++++++++++++++++++
doc/guides/rel_notes/release_19_11.rst | 8 +++++
drivers/event/octeontx2/otx2_tim_worker.h | 2 +-
drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 1 +
drivers/net/dpaa2/mc/dpkg.c | 2 +-
drivers/net/dpaa2/mc/dpni.c | 9 +++--
drivers/net/e1000/base/e1000_82543.c | 2 +-
drivers/net/e1000/base/e1000_ich8lan.c | 2 +-
drivers/net/e1000/base/e1000_phy.c | 2 +-
drivers/net/i40e/i40e_ethdev.c | 2 +-
drivers/net/ifc/ifcvf_vdpa.c | 14 +++++---
drivers/net/qede/base/ecore_mcp.c | 13 +++----
lib/librte_eventdev/rte_event_timer_adapter.c | 8 ++---
meson_options.txt | 2 ++
mk/toolchain/clang/rte.toolchain-compat.mk | 4 +++
mk/toolchain/clang/rte.vars.mk | 8 +++++
mk/toolchain/gcc/rte.toolchain-compat.mk | 4 +++
mk/toolchain/gcc/rte.vars.mk | 12 +++++++
mk/toolchain/icc/rte.vars.mk | 8 +++++
27 files changed, 146 insertions(+), 31 deletions(-)
create mode 100644 doc/guides/prog_guide/lto.rst
--
2.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* [dpdk-dev] [PATCH 06/10] net/dpaa2: fix possible use of uninitialized vars
2019-09-05 9:32 [dpdk-dev] [PATCH 00/10] Add an option to use LTO for DPDK build Andrzej Ostruszka
@ 2019-09-05 9:32 ` Andrzej Ostruszka
0 siblings, 0 replies; 2+ messages in thread
From: Andrzej Ostruszka @ 2019-09-05 9:32 UTC (permalink / raw)
To: dev; +Cc: Andrzej Ostruszka
This patch fixes 'maybe-uninitialized' warnings reported by compiler
when using LTO.
Signed-off-by: Andrzej Ostruszka <aostruszka@marvell.com>
---
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);
--
2.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-09-05 16:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20190905092001.26011-1-amo@semihalf.com>
[not found] ` <20190905092001.26011-7-amo@semihalf.com>
[not found] ` <VI1PR0401MB25419AE95E8E6BCE90FE8F0C89BB0@VI1PR0401MB2541.eurprd04.prod.outlook.com>
2019-09-05 16:04 ` [dpdk-dev] [PATCH 06/10] net/dpaa2: fix possible use of uninitialized vars Andrzej Ostruszka
2019-09-05 9:32 [dpdk-dev] [PATCH 00/10] Add an option to use LTO for DPDK build Andrzej Ostruszka
2019-09-05 9:32 ` [dpdk-dev] [PATCH 06/10] net/dpaa2: fix possible use of uninitialized vars Andrzej Ostruszka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).