* [PATCH 0/2] net/ionic: fix up minor coverity issues
@ 2022-11-03 13:49 Andrew Boyer
2022-11-03 13:49 ` [PATCH 1/2] net/ionic: fix up minor coverity issue in queue allocation Andrew Boyer
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Andrew Boyer @ 2022-11-03 13:49 UTC (permalink / raw)
To: dev; +Cc: Andrew Boyer
These patches will make no functional difference, but should
eliminate four coverity issues.
Alternatively, we could just mark them as False Positive or
Ignored in coverity.
Signed-off-by: Andrew Boyer <andrew.boyer@amd.com>
Andrew Boyer (2):
net/ionic: fix up minor coverity issue in queue allocation
net/ionic: fix up minor coverity issue in packet transmit
drivers/net/ionic/ionic_lif.c | 4 ++--
drivers/net/ionic/ionic_rxtx_sg.c | 2 +-
drivers/net/ionic/ionic_rxtx_simple.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
--
2.17.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] net/ionic: fix up minor coverity issue in queue allocation
2022-11-03 13:49 [PATCH 0/2] net/ionic: fix up minor coverity issues Andrew Boyer
@ 2022-11-03 13:49 ` Andrew Boyer
2022-11-03 13:49 ` [PATCH 2/2] net/ionic: fix up minor coverity issue in packet transmit Andrew Boyer
2022-11-06 9:28 ` [PATCH 0/2] net/ionic: fix up minor coverity issues Andrew Rybchenko
2 siblings, 0 replies; 4+ messages in thread
From: Andrew Boyer @ 2022-11-03 13:49 UTC (permalink / raw)
To: dev; +Cc: Andrew Boyer
(uint16_t * uint16_t) promoted to uint64_t has a sign extension
problem reported by Coverity. Cast one arg to uint64_t first
to eliminate the sign extension.
Coverity issue: 381617
Coverity issue: 381618
Fixes: 7b20fc2f3c06 ("net/ionic: overhaul Rx for performance")
Signed-off-by: Andrew Boyer <andrew.boyer@amd.com>
---
drivers/net/ionic/ionic_lif.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ionic/ionic_lif.c b/drivers/net/ionic/ionic_lif.c
index 63635a4b19..25b490deb6 100644
--- a/drivers/net/ionic/ionic_lif.c
+++ b/drivers/net/ionic/ionic_lif.c
@@ -610,8 +610,8 @@ ionic_qcq_alloc(struct ionic_lif *lif,
/* Most queue types will store 1 ptr per descriptor */
new->q.info = rte_calloc_socket("ionic",
- num_descs * num_segs, sizeof(void *),
- page_size, socket_id);
+ (uint64_t)num_descs * num_segs,
+ sizeof(void *), page_size, socket_id);
if (!new->q.info) {
IONIC_PRINT(ERR, "Cannot allocate queue info");
err = -ENOMEM;
--
2.17.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/2] net/ionic: fix up minor coverity issue in packet transmit
2022-11-03 13:49 [PATCH 0/2] net/ionic: fix up minor coverity issues Andrew Boyer
2022-11-03 13:49 ` [PATCH 1/2] net/ionic: fix up minor coverity issue in queue allocation Andrew Boyer
@ 2022-11-03 13:49 ` Andrew Boyer
2022-11-06 9:28 ` [PATCH 0/2] net/ionic: fix up minor coverity issues Andrew Rybchenko
2 siblings, 0 replies; 4+ messages in thread
From: Andrew Boyer @ 2022-11-03 13:49 UTC (permalink / raw)
To: dev; +Cc: Andrew Boyer
If tx_pkts is NULL, nb_pkts must be 0. Coverity doesn't know
this so it thinks this is a forward-NULL violation.
Make things more clear by checking for nb_pkts instead.
Coverity issue: 381614
Coverity issue: 381619
Fixes: e86a6fcc7cf3 ("net/ionic: add optimized non-scattered Rx/Tx")
Signed-off-by: Andrew Boyer <andrew.boyer@amd.com>
---
drivers/net/ionic/ionic_rxtx_sg.c | 2 +-
drivers/net/ionic/ionic_rxtx_simple.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ionic/ionic_rxtx_sg.c b/drivers/net/ionic/ionic_rxtx_sg.c
index 2752ba2acd..ab8e56e91c 100644
--- a/drivers/net/ionic/ionic_rxtx_sg.c
+++ b/drivers/net/ionic/ionic_rxtx_sg.c
@@ -175,7 +175,7 @@ ionic_xmit_pkts_sg(void *tx_queue, struct rte_mbuf **tx_pkts,
rte_prefetch0(&desc_base[q->head_idx]);
rte_prefetch0(IONIC_INFO_PTR(q, q->head_idx));
- if (tx_pkts) {
+ if (nb_pkts) {
rte_mbuf_prefetch_part1(tx_pkts[0]);
rte_mbuf_prefetch_part2(tx_pkts[0]);
}
diff --git a/drivers/net/ionic/ionic_rxtx_simple.c b/drivers/net/ionic/ionic_rxtx_simple.c
index 0421fb32b2..5f81856256 100644
--- a/drivers/net/ionic/ionic_rxtx_simple.c
+++ b/drivers/net/ionic/ionic_rxtx_simple.c
@@ -148,7 +148,7 @@ ionic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
rte_prefetch0(&desc_base[q->head_idx]);
rte_prefetch0(&q->info[q->head_idx]);
- if (tx_pkts) {
+ if (nb_pkts) {
rte_mbuf_prefetch_part1(tx_pkts[0]);
rte_mbuf_prefetch_part2(tx_pkts[0]);
}
--
2.17.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] net/ionic: fix up minor coverity issues
2022-11-03 13:49 [PATCH 0/2] net/ionic: fix up minor coverity issues Andrew Boyer
2022-11-03 13:49 ` [PATCH 1/2] net/ionic: fix up minor coverity issue in queue allocation Andrew Boyer
2022-11-03 13:49 ` [PATCH 2/2] net/ionic: fix up minor coverity issue in packet transmit Andrew Boyer
@ 2022-11-06 9:28 ` Andrew Rybchenko
2 siblings, 0 replies; 4+ messages in thread
From: Andrew Rybchenko @ 2022-11-06 9:28 UTC (permalink / raw)
To: Andrew Boyer, dev
On 11/3/22 16:49, Andrew Boyer wrote:
> These patches will make no functional difference, but should
> eliminate four coverity issues.
>
> Alternatively, we could just mark them as False Positive or
> Ignored in coverity.
>
> Signed-off-by: Andrew Boyer <andrew.boyer@amd.com>
>
> Andrew Boyer (2):
> net/ionic: fix up minor coverity issue in queue allocation
> net/ionic: fix up minor coverity issue in packet transmit
>
> drivers/net/ionic/ionic_lif.c | 4 ++--
> drivers/net/ionic/ionic_rxtx_sg.c | 2 +-
> drivers/net/ionic/ionic_rxtx_simple.c | 2 +-
> 3 files changed, 4 insertions(+), 4 deletions(-)
>
Applied to dpdk-next-net/main, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-11-06 9:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-03 13:49 [PATCH 0/2] net/ionic: fix up minor coverity issues Andrew Boyer
2022-11-03 13:49 ` [PATCH 1/2] net/ionic: fix up minor coverity issue in queue allocation Andrew Boyer
2022-11-03 13:49 ` [PATCH 2/2] net/ionic: fix up minor coverity issue in packet transmit Andrew Boyer
2022-11-06 9:28 ` [PATCH 0/2] net/ionic: fix up minor coverity issues Andrew Rybchenko
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).