On 6/26/20 4:31 PM, David Miller wrote:
From: rao.sho...@oracle.com
Date: Fri, 26 Jun 2020 11:34:38 -0700

+/* Check connectivity of all paths
+ */
+void rds_check_all_paths(struct rds_connection *conn)
+{
+       int i = 0;
+
+       do {
+               rds_conn_path_connect_if_down(&conn->c_path[i]);
+       } while (++i < conn->c_npaths);
+}
Please code this loop in a more canonial way:

        int i;

        for (i = 0; i < conn->c_npaths, i++)
                rds_conn_path_connect_if_down(&conn->c_path[i]);

Thank you.

This was coded in this unusual way because the code is agnostic to the underlying transport. Unfortunately, IB transport does not initialize/use this field where as TCP does and counts starting from one.

If this is not acceptable, I would have to introduce a check for the transport or deal with zero count separately.

Let me know.

Regards,

Shoaib



Reply via email to