Define a new xprt_ops callback named dump_info. This can be used to
extend MUX debug string with infos from the lower layer.
Implement dump_info for QUIC stack. For now, only minimal info are
reported : bytes in flight and size of the sending window. This should
allow to detect if the congestion controller is fine. These info are
reported via QUIC MUX debug string sample.
(cherry picked from commit
663416b4ef2fafcffa61c04aa09056853d9674f7)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
int (*add_xprt)(struct connection *conn, void *xprt_ctx, void *toadd_ctx, const struct xprt_ops *toadd_ops, void **oldxprt_ctx, const struct xprt_ops **oldxprt_ops); /* Add a new XPRT as the new xprt, and return the old one */
struct ssl_sock_ctx *(*get_ssl_sock_ctx)(struct connection *); /* retrieve the ssl_sock_ctx in use, or NULL if none */
int (*show_fd)(struct buffer *, const struct connection *, const void *ctx); /* append some data about xprt for "show fd"; returns non-zero if suspicious */
+ void (*dump_info)(struct buffer *, const struct connection *);
};
/* mux_ops describes the mux operations, which are to be performed at the
#include <haproxy/quic_trace-t.h>
+#include <haproxy/buf-t.h>
+
+struct quic_conn;
+
#define TRACE_SOURCE &trace_quic
/* Initializes a enc_debug_info struct (only for debug purpose) */
edi->pn = pn;
}
+void quic_dump_qc_info(struct buffer *msg, const struct quic_conn *qc);
+
#endif /* _HAPROXY_QUIC_TRACE_H */
if (dbg_ctx->arg.debug_flags & MUX_SCTL_DBG_STR_L_CONN)
chunk_appendf(buf, " conn.flg=%#08x", qcc->conn->flags);
+ if (dbg_ctx->arg.debug_flags & MUX_SCTL_DBG_STR_L_XPRT)
+ qcc->conn->xprt->dump_info(buf, qcc->conn);
+
dbg_ctx->ret.buf = *buf;
return ret;
#include <inttypes.h>
+#include <haproxy/api-t.h>
+#include <haproxy/chunk.h>
#include <haproxy/quic_conn.h>
#include <haproxy/quic_ssl.h>
#include <haproxy/quic_tls.h>
}
}
+
+void quic_dump_qc_info(struct buffer *msg, const struct quic_conn *qc)
+{
+ chunk_appendf(msg, " qc.wnd=%llu/%llu", (ullong)qc->path->in_flight,
+ (ullong)qc->path->cwnd);
+}
*/
#include <haproxy/api.h>
+#include <haproxy/buf.h>
#include <haproxy/connection.h>
#include <haproxy/quic_conn.h>
#include <haproxy/ssl_sock.h>
return conn->handle.qc->xprt_ctx;
}
+static void qc_xprt_dump_info(struct buffer *msg, const struct connection *conn)
+{
+ quic_dump_qc_info(msg, conn->handle.qc);
+}
+
/* transport-layer operations for QUIC connections. */
static struct xprt_ops ssl_quic = {
.close = quic_close,
.destroy_bind_conf = ssl_sock_destroy_bind_conf,
.get_alpn = ssl_sock_get_alpn,
.get_ssl_sock_ctx = qc_get_ssl_sock_ctx,
+ .dump_info = qc_xprt_dump_info,
.name = "QUIC",
};