Skip to contentSkip to conversation

net/iavf: fix dead store on reset path

PATCH In review Ciara Loftus 3 participants 4 messages Sep 25 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/iavf: fix dead store on reset path

When dev_start fails during reset recovery, the code defers the start to the next link-up event and resets ret to 0 to avoid treating this as an error. This is redundant since ret is unconditionally overwritten by the return value of iavf_post_reset_reconfig() immediately after. Remove the dead assignment.

Fixes 9aac2219dc2a ("net/iavf: defer device start when PF VSI not ready")
---
 drivers/net/intel/iavf/iavf_ethdev.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/intel/iavf/iavf_ethdev.c +0 -1
index a8daa507bb..7915aef348 100644
@@ -3513,7 +3513,6 @@ iavf_handle_hw_reset(struct rte_eth_dev *dev, bool vf_initiated_reset)
 				    ret);
 			vf->start_pending = true;
 			dev->data->dev_started = 0;
-			ret = 0;
 		}
 	}
 
Signature · 1 line
2.43.0
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Ciara Loftus

When dev_start fails during reset recovery, the code defers the start to the next link-up event and resets ret to 0 to avoid treating this as an error. This is redundant since ret is unconditionally overwritten by the return value of iavf_post_reset_reconfig() immediately after. Remove the dead assignment.

Fixes 9aac2219dc2a ("net/iavf: defer device start when PF VSI not ready")

---

I wouldn't really qualify this as a bug fix except maybe static analysis tools might flag it so perhaps having a Fixes tag is worth it.

Signature · 2 lines
Thanks,
Anatoly
#2 lore raw
Quoted 9 lines

Subject: Re: [PATCH] net/iavf: fix dead store on reset path

Quoted 6 lines · Ciara Loftus

When dev_start fails during reset recovery, the code defers the start to the next link-up event and resets ret to 0 to avoid treating this as an error. This is redundant since ret is unconditionally overwritten by the return value of iavf_post_reset_reconfig() immediately after. Remove the dead assignment.

Quoted 7 lines
Quoted 4 lines
Fixes 9aac2219dc2a ("net/iavf: defer device start when PF VSI not ready")

---

I wouldn't really qualify this as a bug fix except maybe static analysis tools might flag it so perhaps having a Fixes tag is worth it.

Apologies this was indeed found by static analysis and should have included the following tag, if it can be added on apply:

Coverity issue: 506150

Quoted 6 lines

--
Thanks,
Anatoly

#3 lore raw
Quoted 14 lines · Ciara
Quoted 14 lines

Subject: Re: [PATCH] net/iavf: fix dead store on reset path

Quoted 10 lines · Ciara Loftus

When dev_start fails during reset recovery, the code defers the start to the next link-up event and resets ret to 0 to avoid treating this as an error. This is redundant since ret is unconditionally overwritten by the return value of iavf_post_reset_reconfig() immediately after. Remove the dead assignment.

Fixes 9aac2219dc2a ("net/iavf: defer device start when PF VSI not ready")

---

Quoted 11 lines
Quoted 2 lines

I wouldn't really qualify this as a bug fix except maybe static analysis tools might flag it so perhaps having a Fixes tag is worth it.

Apologies this was indeed found by static analysis and should have included the following tag, if it can be added on apply:

Coverity issue: 506150

Quoted 3 lines

Added the coverity issue tag - because otherwise I was wondering why we were bothering with this - and applied patch to dpdk-next-net-intel

Thanks,
/Bruce