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 E4BE4A04A8; Wed, 26 Jan 2022 14:21:39 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D63FA42736; Wed, 26 Jan 2022 14:21:39 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 366AE42734 for ; Wed, 26 Jan 2022 14:21:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643203298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=92s/Z7mN6+54YTEHZUVbbY2O29EcYGGHPq7L3FjMBC4=; b=TCZbvde0yswBsM5sD+vLu/dD25T+lcB7nIsJdgeGxUvFOF2QxwtTs5I0pGJFFwjoQ1ca14 QSizl8WvfrIeEND6osnOoqx5pbcPL7yFn4t8QtzDY9rw+1HvBYk8pNcuS4IUTn07VR+Hi5 MmPcfrJWU4OWGY3DRlrXvMkjbqB57Gk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-526-38KbwZzVPriv9oRkBNJiwg-1; Wed, 26 Jan 2022 08:21:35 -0500 X-MC-Unique: 38KbwZzVPriv9oRkBNJiwg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7B26283DEA6; Wed, 26 Jan 2022 13:21:34 +0000 (UTC) Received: from [10.39.208.28] (unknown [10.39.208.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 662ED6E1FA; Wed, 26 Jan 2022 13:21:33 +0000 (UTC) Message-ID: Date: Wed, 26 Jan 2022 14:21:31 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [PATCH] net/virtio: fix Tx queue 0 override by queue 128 To: Xueming Li , dev@dpdk.org Cc: stable@dpdk.org, Chenbo Xia References: <20211202135045.194092-1-xuemingl@nvidia.com> From: Maxime Coquelin In-Reply-To: <20211202135045.194092-1-xuemingl@nvidia.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 On 12/2/21 14:50, Xueming Li wrote: > Both Rx queue and Tx queue are VirtQ in virtio, VQ index is 256 for Tx > queue 128. Uint8 type of TxQ VQ index overflows and overrides Tx queue 0 > data. > > This patch fixes VQ index type with uint16 type. > > Fixes: c1f86306a026 ("virtio: add new driver") > Cc: stable@dpdk.org > > Signed-off-by: Xueming Li > --- > drivers/net/virtio/virtio_rxtx.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c > index 2e115ded023..f0eafd29dc1 100644 > --- a/drivers/net/virtio/virtio_rxtx.c > +++ b/drivers/net/virtio/virtio_rxtx.c > @@ -814,7 +814,7 @@ virtio_dev_tx_queue_setup(struct rte_eth_dev *dev, > unsigned int socket_id __rte_unused, > const struct rte_eth_txconf *tx_conf) > { > - uint8_t vq_idx = 2 * queue_idx + VTNET_SQ_TQ_QUEUE_IDX; > + uint16_t vq_idx = 2 * queue_idx + VTNET_SQ_TQ_QUEUE_IDX; > struct virtio_hw *hw = dev->data->dev_private; > struct virtqueue *vq = hw->vqs[vq_idx]; > struct virtnet_tx *txvq; > @@ -858,7 +858,7 @@ int > virtio_dev_tx_queue_setup_finish(struct rte_eth_dev *dev, > uint16_t queue_idx) > { > - uint8_t vq_idx = 2 * queue_idx + VTNET_SQ_TQ_QUEUE_IDX; > + uint16_t vq_idx = 2 * queue_idx + VTNET_SQ_TQ_QUEUE_IDX; > struct virtio_hw *hw = dev->data->dev_private; > struct virtqueue *vq = hw->vqs[vq_idx]; > Reviewed-by: Maxime Coquelin Thanks for the fix! Maxime