Thread (26 messages) flat view 26 messages, 8 authors, 2021-08-26

Re: [dpdk-dev] [PATCH 2/3] net/bonding: fix not checked return value

From: Min Hu (Connor) <hidden>
Date: 2021-07-09 00:09:13


在 2021/7/8 21:20, Havlík Martin 写道:
Dne 2021-07-08 14:43, Min Hu (Connor) napsal:
quoted
在 2021/6/22 17:25, Martin Havlik 写道:
quoted
Return value from bond_ethdev_8023ad_flow_set() is now checked
and appropriate message is logged on error.

Fixes: 112891cd27e5 ("net/bonding: add dedicated HW queues for LACP 
control")
Cc: tomaszx.kulasek@intel.com

Signed-off-by: Martin Havlik <redacted>
Cc: Jan Viktorin <redacted>
---
  drivers/net/bonding/rte_eth_bond_pmd.c | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c 
b/drivers/net/bonding/rte_eth_bond_pmd.c
index 4c43bf916..a6755661c 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -1819,8 +1819,14 @@ slave_configure(struct rte_eth_dev 
*bonded_eth_dev,
                    
internals->mode4.dedicated_queues.flow[slave_eth_dev->data->port_id],
                      &flow_error);
  -        bond_ethdev_8023ad_flow_set(bonded_eth_dev,
+        errval = bond_ethdev_8023ad_flow_set(bonded_eth_dev,
                  slave_eth_dev->data->port_id);
+        if (errval != 0) {
+            RTE_BOND_LOG(ERR,
+                "bond_ethdev_8023ad_flow_set: port=%d, err (%d)",
+                slave_eth_dev->data->port_id, errval);
+            return errval;
+        }
      }
Firstly, I think your patch is OK,
But I want to know what is your standard to decide which function
should check return value or not(of course, they are none-void)?
I encountered the problem with dedicated queues on mlx5, I looked into 
the source code and I saw the cause, so I fixed it. If I had seen any 
other issue, I would've fixed it too. That, for example, applies to the 
log message fix I included. My standard is to check all non-void return 
values.
Got it.
quoted
While, I noticed "bond_ethdev_lsc_event_callback" nearby was not
checked, but you ignored it.
Not ignored, just didn't properly review more code than what closely 
surrounded the problematic lines.
quoted
quoted
      /* Start device */
Acked by: Min Hu (Connor) [off-list ref]
.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help