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 81241A0352; Wed, 19 Jan 2022 08:44:03 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 08E0540DF5; Wed, 19 Jan 2022 08:44:03 +0100 (CET) Received: from corp-ob07.yahoo-corp.jp (corp-ob07.yahoo-corp.jp [183.79.94.94]) by mails.dpdk.org (Postfix) with ESMTP id 9ECB14013F for ; Wed, 19 Jan 2022 08:43:59 +0100 (CET) Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01lp2174.outbound.protection.outlook.com [104.47.23.174]) by corp-ob07.yahoo-corp.jp (Postfix) with ESMTPS id B46CF19FB18B; Wed, 19 Jan 2022 16:43:57 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo-corp.jp; s=default; t=1642578237; bh=4nQITb72oUQhqH72TG076hKkSUnwkObafa6f3I4Ew0o=; h=From:To:Cc:Subject:Date; b=iCEYAnB0ZeyXaBlegy3mhKQyVapTRzuu++Fd4MPqkLLn+/ndkRpb8fCl63keaTV/A r7aQVSjsoRqSHph7pUA2FlwIYgG1jI5DU6i/ma+/L+GoOCeumgi69comjq/yIitSo1 692uyeeef5+aIN0Skv7Z4u1PGJ+o68CaoXppJyAQ= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h2VHvmFFFHwSoFcckHPI69qWCrwsNIPIIel83WZlYrajswobbNb1lxgGVFfA3+R17mn+qlRJxaUUWpuoqWDNYqVDDK+5zhy71s8V5lxzDt97DLZsRL7mZjqgMu88Fg2DzjKBQHBH6WdXOB7o+zNGcZYzGkHxFUEavlu/w6CZiICNP7YnPnR1uywZwoGb8GdJciRTteYdYstg/LEGrTLWHNdySmk52/wnuzKPU5Zgvo3NPMDyuVpOtOumEPv2zHqs5q8MivqM5h5gNXb5WcdW6txr1d9zSTMrXuevEYxTOgcvi10M4Fh209li4apW/ysbAN60h2Do11AD88dLhn7HOA== 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=4nQITb72oUQhqH72TG076hKkSUnwkObafa6f3I4Ew0o=; b=RcG0BCKfXUvLoVsMmg0oWd8+44bbHC2/XHBYE/lNKiz5iHMazRItEIFEsMjHDqgCiVRWU0qcbNVWi9L2VeXsvzIKiETIKrWrSUBkEsFR/mbJaPIILjKC+5w3k7KpSgxwEvj8FPHSWzwdP+hlhUvFxrORw2ZaAYQlXcST4g4v8x5xh+IjWCLsqjnC/g8v8GhJ/bdheWOk/GxJpSq6013is0yFHbTYQbFutNq41VVRKx2Mh3YEeKGHzziTwm1so5VesnIx+kLOr5rLQjqIwf2Oawe+f9IBY0EgOSZzxzxmWYKmVB2a8dAdg+5tbsCR3bypC+z4lRub3v9ARa/LKZviyg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=yahoo-corp.jp; dmarc=pass action=none header.from=yahoo-corp.jp; dkim=pass header.d=yahoo-corp.jp; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yjcorp.onmicrosoft.com; s=selector1-yjcorp-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4nQITb72oUQhqH72TG076hKkSUnwkObafa6f3I4Ew0o=; b=Wwow1j60vH6NzDQdLlW6YP9ZKYhhrs7Ok8lpod+9MKveq3jW5GbwqQLWqPcuujiYLUAXy44O0wk5oYWa+kMfYtD8Ozqa/S5k95vat01pwJ4HxGGULF+iNuZkXOfYcAme7zVZAX+ga2vwOi8oxgNIlIoQVNgvEAPaW/SfMpp5qIo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=yahoo-corp.jp; Received: from TY2PR01MB4107.jpnprd01.prod.outlook.com (2603:1096:404:d8::23) by TYAPR01MB5355.jpnprd01.prod.outlook.com (2603:1096:404:803f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.11; Wed, 19 Jan 2022 07:43:54 +0000 Received: from TY2PR01MB4107.jpnprd01.prod.outlook.com ([fe80::b40a:3819:991e:706b]) by TY2PR01MB4107.jpnprd01.prod.outlook.com ([fe80::b40a:3819:991e:706b%4]) with mapi id 15.20.4888.014; Wed, 19 Jan 2022 07:43:54 +0000 From: Nobuhiro MIKI To: ferruh.yigit@intel.com, keith.wiles@intel.com Cc: dev@dpdk.org, i.maximets@ovn.org, dmarchan@redhat.com, Nobuhiro MIKI Subject: [PATCH v3 1/1] net/tap: add a check that Rx/Tx have the same num of queues Date: Wed, 19 Jan 2022 16:43:16 +0900 Message-Id: <20220119074316.1094-1-nmiki@yahoo-corp.jp> X-Mailer: git-send-email 2.24.4 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: OS0PR01CA0193.jpnprd01.prod.outlook.com (2603:1096:604:1c5::12) To TY2PR01MB4107.jpnprd01.prod.outlook.com (2603:1096:404:d8::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6cde1ec7-43fd-4218-05d0-08d9db1f7156 X-MS-TrafficTypeDiagnostic: TYAPR01MB5355:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FtYtwRsJETYlSfMv/1vLwatNmKnaku1l9fSqq8WKXrJn8nfEXaNILep6jDWyP44bDmcZT0djSFrZUcwX70MmfflxjWZ4rz3MNd+xRmKYhxYXL9owV5gcceJrSdGMeujZIiDZ6rWHDTOoGxTmtD0HBtR/k8psGnuTUf4ikuU5IpCh7f4b5jeVjAQrPLjsOZX3oKUngwj4oAD2hTI6x4ay+duklGFWERFcaeFdAfI0RYRVZL14/BcjeM3Mrr+LIuV5TG0fSk1XpgWLFkKZ40Khz3pTrV5gJOx1t0Vou3OG/TrKvJovwdNiD+tO/21gHyprvIXRH1DHqbH2totzs7mRZYEz+JPmY/K8F2Qh5XkhXE/dezWf6dTufa+8jYtO95KtZn6gFcUTrcTYcqn2gkjMt+VeQFbpVrRNzzfdzI3QNlI6ONTXMflSrE3YDdEyO8EWlIiY7zp4Zhamic+oV++DgrnCYQEZbAk/rDA4l2KLt8Uk2Vy1KZTLndsUGXVYf9BMk/ZHkypvaFFs6WzlJTplgKOORAAOaSCcpmIUI9HTw+DqjWdclVxiKmoi3/MtWoJO0Fhymnu7yGN4VbzDdxK+dcMk+lgLcsO78RibTyEYSEadcIL5g8nd5dk9hNnZ5Z4mW0cicoFXv0xZSGSqxlRkUaHK/Q0LCOzqIxnNiCpl4TjBBCVt/JVOLFb6MgC3xtyEI8XvOyV6OizQvg8FKouqMpolY4+SXcydn+sEKeOw2Hr9qTRK7Eq2/SmweZWH2g+kkPiQdKI4psSJi1sdWhuZGmY60kfQ1IVsYXJlfeWlXdQ= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TY2PR01MB4107.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(2616005)(6506007)(82960400001)(1076003)(66946007)(52116002)(107886003)(4326008)(66476007)(8676002)(66556008)(508600001)(2906002)(8936002)(316002)(966005)(83380400001)(36756003)(26005)(186003)(5660300002)(38350700002)(6666004)(86362001)(38100700002)(6486002)(6512007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-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?amu9e9XkVjsCDOXFthOgklmXJq7PxI48PSNtTw+WNeheq1p2OwQqXBNkejWS?= =?us-ascii?Q?SNwP01dqkIQBbtG8fn9x1WOnpQTmaAi6hoUJj1+4k7cPpoZR+UYeTtx4RbY5?= =?us-ascii?Q?I9cdnPojlk9jbtZCVcKh21JTEDMAcEH7X+zz20SuNhX42D/2o0DLeqZwGapP?= =?us-ascii?Q?39MspZcAqr1XTReYGRkT8DC3WpEgrjpZGSStxPvJUd5ESb6zxVQi/uzqF1cu?= =?us-ascii?Q?dAHtfwqbz9m9ZnswpskJVVqKP0FucSwsjlzCxU0ExSqjVg3pgUOt3W0jsMtV?= =?us-ascii?Q?HsGpAWFMtbfcHGKj9H6GvqIaThpwtQYo6O9JdZ9lCh0xNW3ze4y/8dmS/yFX?= =?us-ascii?Q?LdZz8MpdwnkqsL1oA65fCoWQuqXgY+ftR/ZFovg7tLuoNbCDF3agQ71sH/CN?= =?us-ascii?Q?HyOkAs7d4okC0AqlUKJriRdVJ1DwACdvdpMBzKHtMPJ+Wk/ooDs2Y9mVlV63?= =?us-ascii?Q?JDPcCvgKR31i/Ht2Fo5GBn4Rw7JI38N8I0ZMLhwbO7n3ATt+Osqzti8j18wD?= =?us-ascii?Q?+BEOoaiTrNtsMxj4pXhHDqCSZK3MTwuC0Vx3J+q1enxWN4+HzXKlpSmC9qrW?= =?us-ascii?Q?vgyXENOrQMMMko7K5cTlI/XOsavrcadIMlSPv4PFkOageCtqVzNF69+5iyEo?= =?us-ascii?Q?rrpBgce6AfIVFKVML4VNRqIYvNyt1wIl+9sASU7YQsWKABo9eF6dqOPku2Vh?= =?us-ascii?Q?GWDdYtK8nTC2xGkyACZ571zriYqSOLxgFMOvfE4P9YypW2FJ0VmPtWimQvj6?= =?us-ascii?Q?Fl+pN+fgeAEklflKqAVj0EI=3D?= X-OriginatorOrg: yahoo-corp.jp X-MS-Exchange-CrossTenant-Network-Message-Id: 6cde1ec7-43fd-4218-05d0-08d9db1f7156 X-MS-Exchange-CrossTenant-AuthSource: TY2PR01MB4107.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2022 07:43:54.3286 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a208d369-cd4e-4f87-b119-98eaf31df2c3 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: eM2LuHBxvUpK/uUvEov66wol1pSXf2tcn3HLFis4nNtKwEDd/aAveBpdQJJqdZ9BCMi4UCdC7WD3DmXgJjQAAQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYAPR01MB5355 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 Users can create the desired number of RxQ and TxQ in DPDK. For example, if the number of RxQ = 2 and the number of TxQ = 5, a total of 8 file descriptors will be created for a tap device, including RxQ, TxQ, and one for keepalive. The RxQ and TxQ with the same ID are paired by dup(2). In this scenario, Kernel will have 3 RxQ where packets are incoming but not read. The reason for this is that there are only 2 RxQ that are polled by DPDK, while there are 5 queues in Kernel. This patch add a checking if DPDK has appropriate numbers of queues to avoid unexpected packet drop. Signed-off-by: Nobuhiro MIKI --- v3: add doc for this limitation in doc/guides/nics/tap.rst v2: fix commit message I had first discussed this issue in OVS [1], but changed my mind that a fix in DPDK would be more appropriate. [1]: https://mail.openvswitch.org/pipermail/ovs-dev/2021-November/389690.html --- doc/guides/nics/tap.rst | 5 +++++ drivers/net/tap/rte_eth_tap.c | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/doc/guides/nics/tap.rst b/doc/guides/nics/tap.rst index 681010d9ed..3d4564b046 100644 --- a/doc/guides/nics/tap.rst +++ b/doc/guides/nics/tap.rst @@ -298,3 +298,8 @@ Systems supporting flow API | Azure Ubuntu 16.04,| No limitation | | kernel 4.13 | | +--------------------+-----------------------+ + +Limitations +----------- + +* Rx/Tx must have the same number of queues. diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index 5bb472f1a6..02eb311e09 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -940,6 +940,14 @@ tap_dev_configure(struct rte_eth_dev *dev) RTE_PMD_TAP_MAX_QUEUES); return -1; } + if (dev->data->nb_rx_queues != dev->data->nb_tx_queues) { + TAP_LOG(ERR, + "%s: number of rx queues %d must be equal to number of tx queues %d", + dev->device->name, + dev->data->nb_rx_queues, + dev->data->nb_tx_queues); + return -1; + } TAP_LOG(INFO, "%s: %s: TX configured queues number: %u", dev->device->name, pmd->name, dev->data->nb_tx_queues); -- 2.24.4