[PATCH v5 1/1] nvme-tcp: expose per-queue socket addresses via sysfs

Nilay Shroff nilay at linux.ibm.com
Wed Dec 2 05:52:26 PST 2026


On 12/2/26 12:07 PM, Christoph Hellwig wrote:
> 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?
> 
Yes I just responded to that comment from sashiko add all the reviewers
in Cc. I think we shall discuss or comment on the issue raised by Sashiko
in that email thread.

>> +	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?
> 
Sure, makes sense. I will reformat the code in the next revision.

Thanks,
--Nilay



More information about the Linux-nvme mailing list