From: Tanmay Shah <tanmay.shah@amd.com>
To: <andersson@kernel.org>, <mathieu.poirier@linaro.org>,
<corbet@lwn.net>, <skhan@linuxfoundation.org>,
<arnaud.pouliquen@foss.st.com>
Cc: <linux-remoteproc@vger.kernel.org>, <linux-doc@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, Tanmay Shah <tanmay.shah@amd.com>
Subject: [PATCH v4 1/5] rpmsg: virtio_rpmsg_bus: rename rbufs and sbufs
Date: Mon, 15 Jun 2026 13:20:03 -0700 [thread overview]
Message-ID: <20260615202007.3484668-2-tanmay.shah@amd.com> (raw)
In-Reply-To: <20260615202007.3484668-1-tanmay.shah@amd.com>
rename variables with clear names.
%s/rbufs/rx_bufs/
%s/sbufs/tx_bufs/
%s/last_sbuf/last_tx_buf/
Signed-off-by: Tanmay Shah <tanmay.shah@amd.com>
---
drivers/rpmsg/virtio_rpmsg_bus.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c
index 5ae15111fb4f..773547479d15 100644
--- a/drivers/rpmsg/virtio_rpmsg_bus.c
+++ b/drivers/rpmsg/virtio_rpmsg_bus.c
@@ -35,13 +35,13 @@
* @vdev: the virtio device
* @rvq: rx virtqueue
* @svq: tx virtqueue
- * @rbufs: kernel address of rx buffers
- * @sbufs: kernel address of tx buffers
- * @num_bufs: total number of buffers for rx and tx
+ * @rx_bufs: kernel address of rx buffers
+ * @tx_bufs: kernel address of tx buffers
+ * @num_bufs: total number of buffers for rx and tx
* @buf_size: size of one rx or tx buffer
- * @last_sbuf: index of last tx buffer used
+ * @last_tx_buf: index of last tx buffer used
* @bufs_dma: dma base addr of the buffers
- * @tx_lock: protects svq and sbufs, to allow concurrent senders.
+ * @tx_lock: protects svq and tx_bufs, to allow concurrent senders.
* sending a message might require waking up a dozing remote
* processor, which involves sleeping, hence the mutex.
* @endpoints: idr of local endpoints, allows fast retrieval
@@ -55,10 +55,10 @@
struct virtproc_info {
struct virtio_device *vdev;
struct virtqueue *rvq, *svq;
- void *rbufs, *sbufs;
+ void *rx_bufs, *tx_bufs;
unsigned int num_bufs;
unsigned int buf_size;
- int last_sbuf;
+ int last_tx_buf;
dma_addr_t bufs_dma;
struct mutex tx_lock;
struct idr endpoints;
@@ -444,8 +444,8 @@ static void *get_a_tx_buf(struct virtproc_info *vrp)
* either pick the next unused tx buffer
* (half of our buffers are used for sending messages)
*/
- if (vrp->last_sbuf < vrp->num_bufs / 2)
- ret = vrp->sbufs + vrp->buf_size * vrp->last_sbuf++;
+ if (vrp->last_tx_buf < vrp->num_bufs / 2)
+ ret = vrp->tx_bufs + vrp->buf_size * vrp->last_tx_buf++;
/* or recycle a used one */
else
ret = virtqueue_get_buf(vrp->svq, &len);
@@ -635,7 +635,7 @@ static __poll_t virtio_rpmsg_poll(struct rpmsg_endpoint *ept, struct file *filp,
* allocated buffers are used for transmit, hence num_bufs / 2), or,
* - we ask the virtqueue if there's a buffer available
*/
- if (vrp->last_sbuf < vrp->num_bufs / 2 ||
+ if (vrp->last_tx_buf < vrp->num_bufs / 2 ||
!virtqueue_enable_cb(vrp->svq))
mask |= EPOLLOUT;
@@ -873,15 +873,15 @@ static int rpmsg_probe(struct virtio_device *vdev)
bufs_va, &vrp->bufs_dma);
/* half of the buffers is dedicated for RX */
- vrp->rbufs = bufs_va;
+ vrp->rx_bufs = bufs_va;
/* and half is dedicated for TX */
- vrp->sbufs = bufs_va + total_buf_space / 2;
+ vrp->tx_bufs = bufs_va + total_buf_space / 2;
/* set up the receive buffers */
for (i = 0; i < vrp->num_bufs / 2; i++) {
struct scatterlist sg;
- void *cpu_addr = vrp->rbufs + i * vrp->buf_size;
+ void *cpu_addr = vrp->rx_bufs + i * vrp->buf_size;
rpmsg_sg_init(&sg, cpu_addr, vrp->buf_size);
@@ -980,7 +980,7 @@ static void rpmsg_remove(struct virtio_device *vdev)
vdev->config->del_vqs(vrp->vdev);
dma_free_coherent(vdev->dev.parent, total_buf_space,
- vrp->rbufs, vrp->bufs_dma);
+ vrp->rx_bufs, vrp->bufs_dma);
kfree(vrp);
}
--
2.34.1
next prev parent reply other threads:[~2026-06-15 20:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-15 20:20 [PATCH v4 0/5] Enhance RPMsg buffer management Tanmay Shah
2026-06-15 20:20 ` Tanmay Shah [this message]
2026-06-15 20:20 ` [PATCH v4 2/5] rpmsg: virtio_rpmsg_bus: allow different size of tx and rx bufs Tanmay Shah
2026-06-15 20:20 ` [PATCH v4 3/5] rpmsg: virtio_rpmsg_bus: get buffer size from config space Tanmay Shah
2026-06-17 9:15 ` Arnaud POULIQUEN
2026-06-15 20:20 ` [PATCH v4 4/5] docs: rpmsg: add virtio config space details Tanmay Shah
2026-06-15 20:20 ` [PATCH v4 5/5] samples: rpmsg: add MTU size info Tanmay Shah
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260615202007.3484668-2-tanmay.shah@amd.com \
--to=tanmay.shah@amd.com \
--cc=andersson@kernel.org \
--cc=arnaud.pouliquen@foss.st.com \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=skhan@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox