We have a ENODEV log for the upcall failure in handler threads.
It is possible to have this error with kernel datapath under normal
conditions, because port removal and upcall handling are happening
in different threads and also upcalls can be queued before the port
was removed.
The same condition in userspace though should not really happen,
because port deletion is synchronous - it involves userspace datapath
reconfiguration, i.e. pausing and re-starting PMD threads, and the
OpenFlow port is deallocated after the datapath port is destroyed.
So, ENODEV in userspace datapath is very likely to indicate actual
bug in the flow translation. For example, we had packets silently
dropped on ENODEV due to a bug we had before commit 154e4299de6a
("ofproto-dpif-xlate: Fix recirculation with patch port and controller.")
Add a log message, similar to one we have in handler threads, to
the upcall callback for userspace datapath, but at a WARN level to
highlight potential problems.
Signed-off-by: Ilya Maximets <[email protected]>
---
ofproto/ofproto-dpif-upcall.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c
index cde03abc6..ed2c5ff69 100644
--- a/ofproto/ofproto-dpif-upcall.c
+++ b/ofproto/ofproto-dpif-upcall.c
@@ -1385,14 +1385,22 @@ upcall_cb(const struct dp_packet *packet, const struct
flow *flow, ovs_u128 *ufi
{
struct udpif *udpif = aux;
struct upcall upcall;
+ char *errorp = NULL;
bool megaflow;
int error;
atomic_read_relaxed(&enable_megaflows, &megaflow);
error = upcall_receive(&upcall, udpif->backer, packet, type, userdata,
- flow, 0, ufid, pmd_id, NULL);
+ flow, 0, ufid, pmd_id, &errorp);
if (error) {
+ if (error == ENODEV) {
+ VLOG_WARN_RL(&rl, "received packet on unassociated datapath "
+ "port %"PRIu32"%s%s%s", flow->in_port.odp_port,
+ errorp ? " (" : "", errorp ? errorp : "",
+ errorp ? ")" : "");
+ }
+ free(errorp);
return error;
}
--
2.41.0
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev