From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1FEB8A0C41; Wed, 15 Sep 2021 11:19:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A9B824003F; Wed, 15 Sep 2021 11:19:53 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id D6CF84003C; Wed, 15 Sep 2021 11:19:52 +0200 (CEST) Received: by shelob.oktetlabs.ru (Postfix, from userid 122) id 7EB8F7F6D3; Wed, 15 Sep 2021 12:19:52 +0300 (MSK) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shelob.oktetlabs.ru X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=ALL_TRUSTED, DKIM_ADSP_DISCARD, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from aros.oktetlabs.ru (aros.oktetlabs.ru [192.168.38.17]) by shelob.oktetlabs.ru (Postfix) with ESMTP id 968F97F4FE; Wed, 15 Sep 2021 12:19:48 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 968F97F4FE Authentication-Results: shelob.oktetlabs.ru/968F97F4FE; dkim=none; dkim-atps=neutral From: Andrew Rybchenko To: Maxime Coquelin , Chenbo Xia , Jens Freimann , Tiwei Bie Cc: dev@dpdk.org, Ivan Ilchenko , stable@dpdk.org Date: Wed, 15 Sep 2021 12:19:41 +0300 Message-Id: <20210915091942.3604998-1-andrew.rybchenko@oktetlabs.ru> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210818141329.2842686-1-andrew.rybchenko@oktetlabs.ru> References: <20210818141329.2842686-1-andrew.rybchenko@oktetlabs.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 1/2] net/virtio: fix Tx cleanup functions to have same signature X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Ivan Ilchenko There is a family of cleanup from completed transmits functions. Fix packed virtqueues cleanup functions to have the same signature as split virtqueues have. This lets all functions of the family to match the same callback prototype. Fixes: 892dc798fa9 ("net/virtio: implement Tx path for packed queues") Cc: stable@dpdk.org Signed-off-by: Ivan Ilchenko Signed-off-by: Andrew Rybchenko --- drivers/net/virtio/virtqueue.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h index 03957b2bd0..d0c48ca415 100644 --- a/drivers/net/virtio/virtqueue.h +++ b/drivers/net/virtio/virtqueue.h @@ -803,25 +803,26 @@ vq_ring_free_id_packed(struct virtqueue *vq, uint16_t id) } static void -virtio_xmit_cleanup_inorder_packed(struct virtqueue *vq, int num) +virtio_xmit_cleanup_inorder_packed(struct virtqueue *vq, uint16_t num) { uint16_t used_idx, id, curr_id, free_cnt = 0; uint16_t size = vq->vq_nentries; struct vring_packed_desc *desc = vq->vq_packed.ring.desc; struct vq_desc_extra *dxp; + int nb = num; used_idx = vq->vq_used_cons_idx; /* desc_is_used has a load-acquire or rte_io_rmb inside * and wait for used desc in virtqueue. */ - while (num > 0 && desc_is_used(&desc[used_idx], vq)) { + while (nb > 0 && desc_is_used(&desc[used_idx], vq)) { id = desc[used_idx].id; do { curr_id = used_idx; dxp = &vq->vq_descx[used_idx]; used_idx += dxp->ndescs; free_cnt += dxp->ndescs; - num -= dxp->ndescs; + nb -= dxp->ndescs; if (used_idx >= size) { used_idx -= size; vq->vq_packed.used_wrap_counter ^= 1; @@ -837,7 +838,7 @@ virtio_xmit_cleanup_inorder_packed(struct virtqueue *vq, int num) } static void -virtio_xmit_cleanup_normal_packed(struct virtqueue *vq, int num) +virtio_xmit_cleanup_normal_packed(struct virtqueue *vq, uint16_t num) { uint16_t used_idx, id; uint16_t size = vq->vq_nentries; @@ -867,7 +868,7 @@ virtio_xmit_cleanup_normal_packed(struct virtqueue *vq, int num) /* Cleanup from completed transmits. */ static inline void -virtio_xmit_cleanup_packed(struct virtqueue *vq, int num, int in_order) +virtio_xmit_cleanup_packed(struct virtqueue *vq, uint16_t num, int in_order) { if (in_order) virtio_xmit_cleanup_inorder_packed(vq, num); -- 2.30.2