From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796174180; b=nZqSovrLmCvnv7+fq/UKzfPXktiAYnxBTTJvdpOJjpzFTxeZmlL5VSq4hywYRh/yaWgL DwZAAhuRETx1eTb5nXRi/sXXVuYgSzbUIomYB/8SA3jHIckVQ+i3o8o3ccHFqgci1ZHir fvTz4qrHS/s6HGz1lv0StNa3pyFoP1whZEjzIs68Z0dBGGlDSYiDxooaBoBFMXHwxAB43 bJOm0o+hLvITcUr1baXYPdQF6KqqGfL0yoY1EdPzH9hN7PXuMOPDpj9TbwlJ3droTaSXY uCQ+Z1PrIwGcEGXYkqmhrUHdTHBBNdoOq1NACaXNx5EZL6CeIPJzFxda6dok9Opynnw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796174180; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=Z7sGwuOTYVQC/gEKr1ulnfyqCmwUlIFeIcxrQJzgvy0=; b=d99+ug/BnYNIRFokg6+v9eNN6IE4kQw7eDRVCJTWoz18znqBmCiPxuQc6Ie73Rwq06mW KjfFB9y377hs1GWDSYN2aJFnjBICqv24mPV26q3mzAB6eiim6Iw8olq+BGZoK2IEEfyEL DVTJbGI4eZXx/r+xM+XxNoNEc4kwME6PWTvQjQeApHjej4XL3UkMRmbQHYCDP1JstH1am j4Qs7QWQEGQmx1ciaJPBOWat+u3bPjcEhzN/vzzhVuZ7EmrCh8BuaurfibXpeErxKTtjy AeQCXtqR4Zk3kbnHFJzY4lPsYb52pZyVWjhHLaIrYoJvdZq7CY7lxo+6B5IvejVyhRA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=XOagL2Qq; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E3D75606A330 for ; Wed, 2 Dec 2026 01:16:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=XOagL2Qq Received: by smtp.kernel.org (Postfix) with ESMTPSA id 885651F00893; Wed, 2 Dec 2026 01:16:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796174179; bh=Z7sGwuOTYVQC/gEKr1ulnfyqCmwUlIFeIcxrQJzgvy0=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=XOagL2Qqx1UahuEAnnq7QlHi6c4i51TfA/mCdYSBIfBZo2PEBsJW5cfxIVoZnQd0X 9ccXbO8796hVz8X9gciApOee2P2ipBhRm8rgia11ZeIVjdMxHUNTm1y9e+OZ5oqJRc CxSahlXKJPD/RZxLYgpJ7RtrnmAM9isoourXZuCB5MHBaGJo5SgzeHN7oavWYsFTXU fVM2JDr2QkTnwvKxcLpTMtDmon/ZPGanZYizVG5COUBqUoq2gPF+gIV3vrK3Vnih9l skEZzOiO2AavgiYj/IsKDrjsgTBOfMrONcokYUnnhAtG12F4jGJ6ypgphrh1e2sf07 SsJAlAjm9Qx9Q== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH RFC net-next 07/12] net: enic: publish partial receive descriptor batches Reply-To: sashiko-reviews@lists.linux.dev To: "Satish Kharat" Cc: bpf@vger.kernel.org In-Reply-To: <20261130-enic-xdp-rfc-p1-20261130-v1-7-3be5458c9118@cisco.com> References: <20261130-enic-xdp-rfc-p1-20261130-v1-0-3be5458c9118@cisco.com> <20261130-enic-xdp-rfc-p1-20261130-v1-7-3be5458c9118@cisco.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 01:16:19 +0000 X-Mailing-List: bpf@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] net: enic: vnic_rq_publish_tail() defeats RX posted_index MMIO batching -- commit 03c983008b4dfdb0aae778c95dfa0b6e84d91445 Author: Satish Kharat net: enic: publish partial receive descriptor batches This commit adds vnic_rq_publish_tail() and calls it at the end of vnic_rq_fill() and enic_admin_rq_fill() so partial batches of fewer than 16 receive descriptors are published to the device. > diff --git a/drivers/net/ethernet/cisco/enic/vnic_rq.h b/drivers/net/ethe= rnet/cisco/enic/vnic_rq.h > index 9fc2090eac447..6c347599d233d 100644 > --- a/drivers/net/ethernet/cisco/enic/vnic_rq.h > +++ b/drivers/net/ethernet/cisco/enic/vnic_rq.h > @@ -140,6 +140,19 @@ static inline void vnic_rq_post(struct vnic_rq *rq, > } > } > =20 > +static inline void vnic_rq_publish_tail(struct vnic_rq *rq, > + struct vnic_rq_buf *first) > +{ > + /* A full batch was already published by vnic_rq_post(). */ > + if (rq->to_use =3D=3D first || > + !(rq->to_use->index & VNIC_RQ_RETURN_RATE)) > + return; > + > + /* Make descriptor contents visible before advancing the device index. = */ > + wmb(); > + iowrite32(rq->to_use->index, &rq->ctrl->posted_index); > +} > + > static inline void vnic_rq_return_descs(struct vnic_rq *rq, unsigned int= count) > { > rq->ring.desc_avail +=3D count; > @@ -181,16 +194,18 @@ static inline void vnic_rq_service(struct vnic_rq *= rq, > static inline int vnic_rq_fill(struct vnic_rq *rq, > int (*buf_fill)(struct vnic_rq *rq)) > { > - int err; > + struct vnic_rq_buf *first =3D rq->to_use; > + int err =3D 0; > =20 > while (vnic_rq_desc_avail(rq) > 0) { > =20 > err =3D (*buf_fill)(rq); > if (err) > - return err; > + break; > } > =20 > - return 0; > + vnic_rq_publish_tail(rq, first); > + return err; > } [Severity: Medium] Does calling vnic_rq_publish_tail() unconditionally at the end of vnic_rq_fill() defeat the 16-descriptor posted_index batching in vnic_rq_post() on the NAPI RX path? vnic_dev_alloc_desc_ring() aligns ring->desc_count to a multiple of 32 and initializes ring->desc_avail to ring->desc_count - 1. When the ring is completely filled during enic_open(), rq->to_use->index ends at desc_count - 1 (15 mod 16) and vnic_rq_publish_tail() writes it to posted_index. Because vnic_rq_post() still flushes whenever (buf->index & 0xf) =3D=3D 0, = the very first descriptor refilled on the next NAPI poll wraps buf->index to a multiple of 16 and triggers an immediate wmb() and iowrite32() for a single descriptor, and the end of the poll leaves rq->to_use->index unaligned again so vnic_rq_publish_tail() issues another write. Every full-budget 64-packet NAPI poll permanently performs 5 posted_index MMIO writes (batches of 1, 16, 16, 16, and 15) instead of 4, and a 16-packet poll performs 2 writes instead of 1. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261130-enic-xdp-r= fc-p1-20261130-v1-0-3be5458c9118@cisco.com?part=3D7