* [PATCH] crypto/virtio: fix virtio desc flags virtq info
@ 2025-06-26 9:18 Rajesh Mudimadugula
2025-07-08 19:44 ` Akhil Goyal
0 siblings, 1 reply; 2+ messages in thread
From: Rajesh Mudimadugula @ 2025-06-26 9:18 UTC (permalink / raw)
To: dev; +Cc: jianjay.zhou, gakhil, Rajesh Mudimadugula
This patch corrects virtio descriptor flags and updates
virtqueue metadata.
Fixes: 796429e72a6d ("crypto/virtio: add packed ring support")
Signed-off-by: Rajesh Mudimadugula <rmudimadugul@marvell.com>
---
drivers/crypto/virtio/virtio_rxtx.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/crypto/virtio/virtio_rxtx.c b/drivers/crypto/virtio/virtio_rxtx.c
index 00988e18b1..4204e1f77e 100644
--- a/drivers/crypto/virtio/virtio_rxtx.c
+++ b/drivers/crypto/virtio/virtio_rxtx.c
@@ -479,6 +479,7 @@ virtqueue_crypto_sym_enqueue_xmit_packed(
struct rte_crypto_op *cop)
{
uint16_t idx = 0;
+ uint16_t num_entry;
uint16_t needed = 1;
uint16_t head_idx;
struct vq_desc_extra *dxp;
@@ -598,13 +599,20 @@ virtqueue_crypto_sym_enqueue_xmit_packed(
/* packed vring: last part, status returned */
desc[idx].addr = op_data_req_phys_addr + req_data_len;
desc[idx].len = sizeof(struct virtio_crypto_inhdr);
- desc[idx++].flags = flags | VRING_DESC_F_WRITE;
+ desc[idx++].flags = txvq->vq_packed.cached_flags | VRING_DESC_F_WRITE;
+
+ num_entry = idx;
+ txvq->vq_avail_idx += num_entry;
+ if (txvq->vq_avail_idx >= txvq->vq_nentries) {
+ txvq->vq_avail_idx -= txvq->vq_nentries;
+ txvq->vq_packed.cached_flags ^= VRING_PACKED_DESC_F_AVAIL_USED;
+ }
/* save the infos to use when receiving packets */
dxp->crypto_op = (void *)cop;
dxp->ndescs = needed;
- txvq->vq_desc_head_idx += idx & (txvq->vq_nentries - 1);
+ txvq->vq_desc_head_idx = (txvq->vq_desc_head_idx + idx) & (txvq->vq_nentries - 1);
if (txvq->vq_desc_head_idx == VQ_RING_DESC_CHAIN_END)
txvq->vq_desc_tail_idx = idx;
txvq->vq_free_cnt = (uint16_t)(txvq->vq_free_cnt - needed);
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: [PATCH] crypto/virtio: fix virtio desc flags virtq info
2025-06-26 9:18 [PATCH] crypto/virtio: fix virtio desc flags virtq info Rajesh Mudimadugula
@ 2025-07-08 19:44 ` Akhil Goyal
0 siblings, 0 replies; 2+ messages in thread
From: Akhil Goyal @ 2025-07-08 19:44 UTC (permalink / raw)
To: Rajesh Mudimadugula [C], dev; +Cc: jianjay.zhou, Rajesh Mudimadugula [C]
> -----Original Message-----
> From: Rajesh Mudimadugula <rmudimadugul@marvell.com>
> Sent: Thursday, June 26, 2025 2:49 PM
> To: dev@dpdk.org
> Cc: jianjay.zhou@huawei.com; Akhil Goyal <gakhil@marvell.com>; Rajesh
> Mudimadugula [C] <rmudimadugul@marvell.com>
> Subject: [PATCH] crypto/virtio: fix virtio desc flags virtq info
>
> This patch corrects virtio descriptor flags and updates
> virtqueue metadata.
>
> Fixes: 796429e72a6d ("crypto/virtio: add packed ring support")
>
> Signed-off-by: Rajesh Mudimadugula <rmudimadugul@marvell.com>
> ---
Acked-by: Akhil Goyal <gakhil@marvell.com>
Applied to dpdk-next-crypto
Thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-07-08 19:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-26 9:18 [PATCH] crypto/virtio: fix virtio desc flags virtq info Rajesh Mudimadugula
2025-07-08 19:44 ` Akhil Goyal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).