From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1020E606A334 for ; Tue, 1 Dec 2026 10:04:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=ES7QW7nd; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=HIMG47pP DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Date: Content-Transfer-Encoding:Content-Type:References:In-Reply-To:Cc:To:Subject: From:Message-ID:MIME-Version:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=TckEKlPgLZWjuvAGOoLK1YsgR8Q1HCyKhNMwoZuNwTo=; b=ES7QW7ndqSgeb+UpWWzL4BFuuN ZlGtjRcGX1gJLM8GEYP31mnJMnV/mlFQyUpE7Y1dTC04OKenqgcbupWINVXCM2hjIrmBx9OwoiH5V wc3MpHR8xyW+pYonji+Q92iXa9XFr1S34v6H+RhJrmNlsKHelgzzeBE3lMM/z86/ksyYHMrlT/J/n SewC0wtqH2zA2bEScHE2zQHyJoJQ9B1GkI0U32/5x4J630GoPMqe46GWg7oYX89p00hycY/ZFZswE zIpfDKoV77EBkVFnyWfhvpOzlpF1oWKapkCa6gnvAXAKo/evIPCPw53HqEp7mvSGW0nguklyMakNj hpPNYFmA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYKiY-00000007IT2-29vx; Tue, 01 Dec 2026 10:04:10 +0000 Received: from tor.source.kernel.org ([172.105.4.254]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYKiU-00000007IRK-0OVY for linux-nvme@lists.infradead.org; Tue, 01 Dec 2026 10:04:08 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 8A30F61172; Tue, 1 Dec 2026 10:04:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD0941F00898; Tue, 1 Dec 2026 10:04:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796119444; bh=TckEKlPgLZWjuvAGOoLK1YsgR8Q1HCyKhNMwoZuNwTo=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=HIMG47pPO8U8lFRA2Atun2obMFZk8jIyjeqe95FSI9wZLkOKfcv7HRfFZI/n5+EFN c4Um/9iSUfT2efXzBLC8gZSMs+Izf2WpbzcWZm3Zj+f/jXltMfN44YZW6pFhzCnrR6 Az6UuHIj6a+1SyZXILy2pZdpKENhLawJ10GGyuO3bfQqSTgFJHdVtA7N7o+Qo1QXtb ErIvJUVZSjmNhfERl8mM1VQ7yIL0ZAHudID9SW+lv+D4msJczkBkLdMLpm7TB3YlAy 6vrtZSCjSsA3ejto21d8ZepFrwPRIYhN7NZv46kNYq9/3vkAUKoa/0n9X15uHTKPRu 4S2NBmORJDgCw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v5 1/1] nvme-tcp: expose per-queue socket addresses via sysfs To: "Nilay Shroff" Cc: linux-nvme@lists.infradead.org In-Reply-To: <20261201095146.510810-4-nilay@linux.ibm.com> References: <20261201095146.510810-3-nilay@linux.ibm.com> <20261201095146.510810-4-nilay@linux.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 10:04:04 +0000 X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "Linux-nvme" X-Spam-Status: No, score=-10.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] nvme-tcp: address_show() emits %0 scope ID when one IPv6 endpoint is unscoped -- commit cef888fe89d146daf5915c1274fff0343c037eb2 Author: Nilay Shroff nvme-tcp: expose per-queue socket addresses via sysfs This commit adds a read-only per-queue sysfs attribute named "address" to expose the local and peer socket endpoint addresses for each NVMe/TCP I/O queue, and documents it in Documentation/ABI/stable/sysfs-nvme. > diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c > index cf3c98b188bd1..05cf7000ef678 100644 > --- a/drivers/nvme/host/tcp.c > +++ b/drivers/nvme/host/tcp.c > @@ -2127,14 +2127,73 @@ static ssize_t managed_show(struct kobject *kobj,= struct kobj_attribute *attr, > !test_bit(NVME_TCP_Q_IO_CPU_USER, &queue->flags)); > } > =20 > +static ssize_t address_show(struct kobject *kobj, struct kobj_attribute = *attr, > + char *buf) > +{ > + struct nvme_tcp_queue *queue =3D nvme_queue_info_data(kobj); > + struct sockaddr_storage src, dst; > + int ret =3D 0; > + > + mutex_lock(&queue->queue_lock); > + > + if (!test_bit(NVME_TCP_Q_LIVE, &queue->flags)) > + goto out; > + > + ret =3D kernel_getsockname(queue->sock, (struct sockaddr *)&src); > + if (ret <=3D 0) > + goto out; > + > + ret =3D kernel_getpeername(queue->sock, (struct sockaddr *)&dst); > + if (ret <=3D 0) > + goto out; > + > + if (src.ss_family !=3D dst.ss_family) { > + ret =3D -EAFNOSUPPORT; > + goto out; > + } > + > + if (src.ss_family =3D=3D AF_INET) { > + struct sockaddr_in *sip =3D (struct sockaddr_in *)&src; > + struct sockaddr_in *dip =3D (struct sockaddr_in *)&dst; > + > + ret =3D sysfs_emit(buf, "sip=3D%pI4,sport=3D%hu,dip=3D%pI4,dport=3D%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 =3D=3D AF_INET6) { > + struct sockaddr_in6 *sip6 =3D (struct sockaddr_in6 *)&src; > + struct sockaddr_in6 *dip6 =3D (struct sockaddr_in6 *)&dst; > + > + if (sip6->sin6_scope_id || dip6->sin6_scope_id) > + ret =3D sysfs_emit(buf, "sip=3D%pI6c%%%u,sport=3D%hu,dip=3D%pI6c%%%u,= dport=3D%hu\n", > + &sip6->sin6_addr, sip6->sin6_scope_id, > + ntohs(sip6->sin6_port), > + &dip6->sin6_addr, dip6->sin6_scope_id, > + ntohs(dip6->sin6_port)); [Severity: Medium] Does this emit a "%0" suffix on the unscoped endpoint when only one of sip6->sin6_scope_id or dip6->sin6_scope_id is non-zero? inet6_getname() sets sin6_scope_id via ipv6_iface_scope_id(), which only returns sk->sk_bound_dev_if for addresses that need a scope ID (such as link-local addresses) and returns 0 for global or unique-local addresses. If one side of the connection uses a link-local address and the other uses a global or unique-local address, formatting both with "%%%u" appends "%0" to the unscoped address. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201095146.5108= 10-3-nilay@linux.ibm.com?part=3D1