The queue level QoS callback can fail (eg. EINVAL for a queue that is
not configured on a trtcm-policer port) without filling the statistics
structure. But netdev_dpdk_get_queue_stats() dropped the callback return
value, so ofproto would then serialize an uninitialized stack structure
into OpenFlow queue statistics replies, and the qos/show appctl print
garbage values.
Propagate the error, so that the caller can report an invalid queue.
Fixes: 23c01b196ff7 ("netdev-dpdk: Add support for multi-queue QoS to the DPDK
datapath")
Signed-off-by: David Marchand <[email protected]>
---
lib/netdev-dpdk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index de3e5c1c5..e9c84982f 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -5622,7 +5622,7 @@ netdev_dpdk_get_queue_stats(const struct netdev *netdev,
uint32_t queue_id,
qos_conf = ovsrcu_get_protected(struct qos_conf *, &dev->qos_conf);
if (qos_conf && qos_conf->ops && qos_conf->ops->qos_queue_get_stats) {
- qos_conf->ops->qos_queue_get_stats(qos_conf, queue_id, stats);
+ error = qos_conf->ops->qos_queue_get_stats(qos_conf, queue_id, stats);
} else {
error = EOPNOTSUPP;
}
--
2.56.1
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev