* [dpdk-dev] [PATCH] net/ixgbe: fix coverity issue
@ 2020-02-10 4:15 Guinan Sun
2020-02-10 6:57 ` Ye Xiaolong
0 siblings, 1 reply; 4+ messages in thread
From: Guinan Sun @ 2020-02-10 4:15 UTC (permalink / raw)
To: dev; +Cc: Wenzhuo Lu, Qiming Yang, Guinan Sun
This patch fixes (Logically dead code) coverity issue.
Coverity issue: 353613
Fixes: 3c4270187518 ("net/ixgbe: support VF MAC address add/remove")
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
---
drivers/net/ixgbe/ixgbe_pf.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c
index 493f0f2b9..afae21f81 100644
--- a/drivers/net/ixgbe/ixgbe_pf.c
+++ b/drivers/net/ixgbe/ixgbe_pf.c
@@ -772,9 +772,6 @@ ixgbe_set_vf_macvlan_msg(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf)
IXGBE_VT_MSGINFO_SHIFT;
if (index) {
- if (new_mac == NULL)
- return -1;
-
if (!rte_is_valid_assigned_ether_addr(
(struct rte_ether_addr *)new_mac)) {
PMD_DRV_LOG(ERR, "set invalid mac vf:%d\n", vf);
--
2.17.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] net/ixgbe: fix coverity issue
2020-02-10 4:15 [dpdk-dev] [PATCH] net/ixgbe: fix coverity issue Guinan Sun
@ 2020-02-10 6:57 ` Ye Xiaolong
0 siblings, 0 replies; 4+ messages in thread
From: Ye Xiaolong @ 2020-02-10 6:57 UTC (permalink / raw)
To: Guinan Sun; +Cc: dev, Wenzhuo Lu, Qiming Yang
On 02/10, Guinan Sun wrote:
>This patch fixes (Logically dead code) coverity issue.
>
>Coverity issue: 353613
>Fixes: 3c4270187518 ("net/ixgbe: support VF MAC address add/remove")
>
>Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
>---
> drivers/net/ixgbe/ixgbe_pf.c | 3 ---
> 1 file changed, 3 deletions(-)
>
>diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c
>index 493f0f2b9..afae21f81 100644
>--- a/drivers/net/ixgbe/ixgbe_pf.c
>+++ b/drivers/net/ixgbe/ixgbe_pf.c
>@@ -772,9 +772,6 @@ ixgbe_set_vf_macvlan_msg(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf)
> IXGBE_VT_MSGINFO_SHIFT;
>
> if (index) {
>- if (new_mac == NULL)
>- return -1;
>-
> if (!rte_is_valid_assigned_ether_addr(
> (struct rte_ether_addr *)new_mac)) {
> PMD_DRV_LOG(ERR, "set invalid mac vf:%d\n", vf);
>--
>2.17.1
>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
Applied to dpdk-next-net-intel, Thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-dev] [PATCH] net/ixgbe: fix coverity issue
@ 2020-02-11 7:13 Shougang Wang
2020-02-11 8:27 ` Ye Xiaolong
0 siblings, 1 reply; 4+ messages in thread
From: Shougang Wang @ 2020-02-11 7:13 UTC (permalink / raw)
To: dev; +Cc: qiming.yang, xiaolong.ye, Shougang Wang
This patch fixes (Logically dead code ) coverity issue.
Coverity issue: 353624
Fixes: ba7b12dd64e4 ("net/ixgbe: fix link up in FreeBSD")
Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
---
drivers/net/ixgbe/ixgbe_ethdev.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 7ea1962f6..b19f47f50 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -4128,15 +4128,11 @@ static int
ixgbe_wait_for_link_up(struct ixgbe_hw *hw)
{
#ifdef RTE_EXEC_ENV_FREEBSD
- const int nb_iter = 25;
-#else
- const int nb_iter = 0;
-#endif
int err, i;
bool link_up = false;
uint32_t speed = 0;
- for (i = 0; i < nb_iter; i++) {
+ for (i = 0; i < 25; i++) {
err = ixgbe_check_link(hw, &speed, &link_up, 0);
if (err)
return err;
@@ -4144,7 +4140,12 @@ ixgbe_wait_for_link_up(struct ixgbe_hw *hw)
return 0;
msec_delay(200);
}
+
return 0;
+#else
+ RTE_SET_USED(hw);
+ return 0;
+#endif
}
/* return 0 means link status changed, -1 means not changed */
--
2.17.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] net/ixgbe: fix coverity issue
2020-02-11 7:13 Shougang Wang
@ 2020-02-11 8:27 ` Ye Xiaolong
0 siblings, 0 replies; 4+ messages in thread
From: Ye Xiaolong @ 2020-02-11 8:27 UTC (permalink / raw)
To: Shougang Wang; +Cc: dev, qiming.yang
On 02/11, Shougang Wang wrote:
>This patch fixes (Logically dead code ) coverity issue.
>
>Coverity issue: 353624
>Fixes: ba7b12dd64e4 ("net/ixgbe: fix link up in FreeBSD")
>
>Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
>---
> drivers/net/ixgbe/ixgbe_ethdev.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
>diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
>index 7ea1962f6..b19f47f50 100644
>--- a/drivers/net/ixgbe/ixgbe_ethdev.c
>+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
>@@ -4128,15 +4128,11 @@ static int
> ixgbe_wait_for_link_up(struct ixgbe_hw *hw)
> {
> #ifdef RTE_EXEC_ENV_FREEBSD
>- const int nb_iter = 25;
>-#else
>- const int nb_iter = 0;
>-#endif
> int err, i;
> bool link_up = false;
> uint32_t speed = 0;
>
>- for (i = 0; i < nb_iter; i++) {
>+ for (i = 0; i < 25; i++) {
Better to keep the constant nb_iter instead of using magic number.
> err = ixgbe_check_link(hw, &speed, &link_up, 0);
> if (err)
> return err;
>@@ -4144,7 +4140,12 @@ ixgbe_wait_for_link_up(struct ixgbe_hw *hw)
> return 0;
> msec_delay(200);
> }
>+
Unrelated change.
Thanks,
Xiaolong
> return 0;
>+#else
>+ RTE_SET_USED(hw);
>+ return 0;
>+#endif
> }
>
> /* return 0 means link status changed, -1 means not changed */
>--
>2.17.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-02-11 8:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-10 4:15 [dpdk-dev] [PATCH] net/ixgbe: fix coverity issue Guinan Sun
2020-02-10 6:57 ` Ye Xiaolong
2020-02-11 7:13 Shougang Wang
2020-02-11 8:27 ` Ye Xiaolong
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).