[ovs-dev] [PATCH v4] netlink-socket: Exit NL transaction loop when EINVAL is returned

Eitan Eliahu eliahue at vmware.com
Wed Apr 15 20:49:13 UTC 2015


If we remove the increment of the transaction than the whole sequence of transaction will be lost. This should be done only after we change the driver to never fail in case the transaction fail. The current driver fails also when there are transaction level erros and when there are some other "temporary" errors. I would prefer to move to the next transaction in that case rather than dump the whole sequence. 
Thanks,
Eitan

-----Original Message-----
From: dev [mailto:dev-bounces at openvswitch.org] On Behalf Of Sorin Vinturis
Sent: Wednesday, April 15, 2015 1:22 PM
To: dev at openvswitch.org
Subject: [ovs-dev] [PATCH v4] netlink-socket: Exit NL transaction loop when EINVAL is returned

The nl_sock_transact_multiple function enters in an infinite loop, when invalid error, EINVAL, is returned by nl_sock_transact_multiple__.
EINVAL is the error returned by the latter function when a driver request fails.

v2: Any error returned by nl_sock_transact_multiple__, except EAGAIN, causes the rest of NL transactions to be aborted.
An error response from the driver is considered a successful transaction and the 'done' transactions counter is incremented.

v3: Removed the incrementation of the transactions counter in case of driver request failure.

Signed-off-by: Sorin Vinturis <svinturis at cloudbasesolutions.com>
Reported-by: Alin Gabriel Serdean <aserdean at cloudbasesolutions.com>
Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_57&d=AwIGaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCY&m=SoJBySQ9Ab0iZ66kD5oQW1lNQi2mdEyB-hkYI_568PY&s=qlfxf-x6rCbgRjcbZqeI1d7oSV9FpZDsQr1jdgHz_wI&e=
Acked-by: Eitan Eliahu <eliahue at vmware.com>
Acked-by: Nithin Raju <nithin at vmware.com>
---
 lib/netlink-socket.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lib/netlink-socket.c b/lib/netlink-socket.c index fab2a66..b73d843 100644
--- a/lib/netlink-socket.c
+++ b/lib/netlink-socket.c
@@ -797,8 +797,12 @@ nl_sock_transact_multiple__(struct nl_sock *sock,
                              txn->request->size,
                              reply_buf, sizeof reply_buf,
                              &reply_len, NULL)) {
             /* XXX: Map to a more appropriate error. */
             error = EINVAL;
+            VLOG_DBG_RL(&rl, "fatal driver failure: %s",
+                ovs_lasterror_to_string());
             break;
         }
 
@@ -909,6 +913,11 @@ nl_sock_transact_multiple(struct nl_sock *sock,
         } else if (error) {
             VLOG_ERR_RL(&rl, "transaction error (%s)", ovs_strerror(error));
             nl_sock_record_errors__(transactions, n, error);
+            if (error != EAGAIN) {
+                /* A fatal error has occured. Abort the rest of
+                 * transactions. */
+                break;
+            }
         }
     }
 }
--
1.9.0.msysgit.0
_______________________________________________
dev mailing list
dev at openvswitch.org
https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_dev&d=AwIGaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCY&m=SoJBySQ9Ab0iZ66kD5oQW1lNQi2mdEyB-hkYI_568PY&s=CJsqfRiyJVs7TlbH5t9Cuugwakz_9cloFcKkSdXxxKk&e= 


More information about the dev mailing list