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 48908A0548; Thu, 2 Dec 2021 14:51:19 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CCEF240692; Thu, 2 Dec 2021 14:51:18 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2075.outbound.protection.outlook.com [40.107.236.75]) by mails.dpdk.org (Postfix) with ESMTP id 6520A4067B; Thu, 2 Dec 2021 14:51:17 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=czaDuoPZpQpGZOXkT6riEpJqmNtq6Yq681mwjU+bDaODPQQ/P3jLNlbr93F7ckhFBePJd6Ertdd1Pp+fRteyqLTani5a3vISwA9QAOWEhDJPU+ofAPYOwyou67rjRVVKaYvfSG4s17QWv0vNBe/KejHxMT08IbeFf6N8IT4qI9jeuq5q4jC8BBavnqsbRFIL63WCC5l2NLleRBbZlrjUy7EK0sh4//Xx++uQLYCSqQK548wkRjNR763KlBEPAvg+dJCAbcsQ3DXTWzKQJmrBZFExtWip1JB6g3ooiXDRZ+1zKVvBg/hflYAIBJbDQa86EESe/NgZY5n5U85khiQk/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OKZGK1FL6MDJBpMy0kPzh46s+ZqUUivCUKEw7GjbKqM=; b=IZc8Z5+PZhf3fACKeySfD/+Ohuow+fcmUKpwTBcQRTquMGlGCVqEyHGneqlO0XGJO0+ngEchlvz1ULK61Qb3euJAhczwvHtlbAOMlzcMXjKh/vTAKRQpAY/G2fs+Jq2rRE0ulNTsEgU1MUbrfLMHDBHkBo/b5uW2H/SzUScPEd6U897HSIeFqtEZZqlzafavlQK4EmFvAYoMJPrc0aMQJ73CYEeYsNx1xIkNNVB1KbP9O/C0NoFFDl11Xmgpiwksf+pYBTOU4gcGMPPPDDYV9WWRrXQsLUieyU7o5k/YWBLd8k41mtQc8KSznaH2OyQosgBA2Kfg8b1RTH9XKVgvbw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OKZGK1FL6MDJBpMy0kPzh46s+ZqUUivCUKEw7GjbKqM=; b=Ydro043eBUdUTlxgXTspTvvM/H4PZth5P3yDnEzhCGtenoTMmsoQYY6KNoEl6VCQTCC/eVQyeZ8ETfggQ8JqzozQJA69CPoXp7Euj2Wtvb3x3u7+8UxbhUoG0r94vsUqIHxR+fTYvBbeLjuPzOHK8H7GpocuC1QzmtLmNHLZBY/JEuDzmR7xvOPby8twWMorm2UwJTIFYU7xeY4y2+TXgJOaL2hdwBCwGNSwsmUF3MFd85xVTHW2nG7/FHtd0deT/2w3zS48Ss5OmlLpoWHUABRTGszwe7DDnUcRYkcE1saf/lPt0f7LzbcQB0gSmWB+MW85LgsZFil/mYHoE/VI7Q== Received: from BN9PR03CA0919.namprd03.prod.outlook.com (2603:10b6:408:107::24) by MWHPR12MB1391.namprd12.prod.outlook.com (2603:10b6:300:10::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.23; Thu, 2 Dec 2021 13:51:15 +0000 Received: from BN8NAM11FT010.eop-nam11.prod.protection.outlook.com (2603:10b6:408:107:cafe::12) by BN9PR03CA0919.outlook.office365.com (2603:10b6:408:107::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.14 via Frontend Transport; Thu, 2 Dec 2021 13:51:15 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT010.mail.protection.outlook.com (10.13.177.53) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4755.13 via Frontend Transport; Thu, 2 Dec 2021 13:51:15 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 2 Dec 2021 13:51:11 +0000 Received: from nvidia.com (172.20.187.5) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.986.9; Thu, 2 Dec 2021 05:51:09 -0800 From: Xueming Li To: CC: , , Maxime Coquelin , Chenbo Xia Subject: [PATCH] net/virtio: fix Tx queue 0 override by queue 128 Date: Thu, 2 Dec 2021 21:50:45 +0800 Message-ID: <20211202135045.194092-1-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 30e90635-4d4b-40ce-7639-08d9b59acf2d X-MS-TrafficTypeDiagnostic: MWHPR12MB1391: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:660; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9Zggb2aFUAnP+bH1d1MDCeMmurVBm6cBg2RBpMs/jMLeURvTnVsbElOctOf34qTbLZDWLyxx4tZafTvJNHQa91gbfBbbjY0TO/rtrUiLt2wgFsEbydADRNERw4VuAKkiT7JfjuQVDLwScWmASx4j3mQSjiajI3BBUFnJQkCpv/hTj8GIW2Dxvtfizru2Mcm7yRmjCNKnHIbsLPU4jeio3zDfR63e+seSsu3JxJM9mOg+qtm92vD2C/z833Zx+zreULELd3tUEbSni2/7RWOvw/ChSFNMqSXdRGqhqTHCAAhH+NXPjesbbrGjUUMurU2/FHnem4iEHFIJjl9NopbkEDtcUwHnxb6b22MJmrjkHL2i87511Wi2kZMsJRKylLgOyFC9uxZzKdZGWpBjqXP3VPW11EwcZuiaMFcTDEaUOpvs9F4l5WEPuKj94CobYoOdSIhARUIPGX8Sg7OcpzycwFnEAxHuOUFiAvfqZQmRdHY13FIzPjyae4WII/ovMYNrvfWuv8ET2FBQ/PcCJuIo01yoQQ9sMWniSkDjjUYyA9dKuH5V34NXA3qPIsMi2JDu9zvIG5zF7RgSPZfnyi8NrCBZTMRhnspeztSo8NiL0+D5pCvJbuDiylYRahlhHEUsQFGVo1Ea3WxWRuHrrcndTuuLJNTgo3JaHaPngpNdxKUIjriIPzdW/0RilgDTUZrVjQM0uZ1PELCY9+aS1vjYcQAO3hitKNmh7AajqUxo4bD4JHQ7SMUuFoBL2nVWeQPzpDwv28+fDzh9dptj5ejUbA== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(40470700001)(83380400001)(26005)(186003)(6666004)(86362001)(70586007)(70206006)(16526019)(356005)(1076003)(4326008)(508600001)(7696005)(7636003)(6286002)(336012)(6916009)(54906003)(8676002)(36756003)(2616005)(82310400004)(55016003)(316002)(5660300002)(2906002)(8936002)(426003)(36860700001)(47076005)(40460700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2021 13:51:15.3215 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 30e90635-4d4b-40ce-7639-08d9b59acf2d X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT010.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1391 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 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]; -- 2.34.0