[PATCH v5 1/1] nvme-tcp: expose per-queue socket addresses via sysfs
Christoph Hellwig
hch at lst.de
Tue Dec 1 22:37:53 PST 2026
I think the Sashiko nit on the output format has merit, but it's not
really my area of expertise. Can you look into that?
> + if (src.ss_family == AF_INET) {
> + struct sockaddr_in *sip = (struct sockaddr_in *)&src;
> + struct sockaddr_in *dip = (struct sockaddr_in *)&dst;
> +
> + ret = sysfs_emit(buf, "sip=%pI4,sport=%hu,dip=%pI4,dport=%hu\n",
> + &sip->sin_addr.s_addr, ntohs(sip->sin_port),
> + &dip->sin_addr.s_addr, ntohs(dip->sin_port));
> + } else if (src.ss_family == AF_INET6) {
> + struct sockaddr_in6 *sip6 = (struct sockaddr_in6 *)&src;
> + struct sockaddr_in6 *dip6 = (struct sockaddr_in6 *)&dst;
And another cosmetic nit, what about doing a switch on src.ss_family
and then having a helper for each address family to give this a bit
more structure?
More information about the Linux-nvme
mailing list