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 6468FA00C3; Tue, 14 Dec 2021 05:52:09 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D9A2E40395; Tue, 14 Dec 2021 05:52:08 +0100 (CET) Received: from corp-ob09.yahoo-corp.jp (corp-ob09.yahoo-corp.jp [182.22.125.216]) by mails.dpdk.org (Postfix) with ESMTP id C3CEA40042 for ; Tue, 14 Dec 2021 05:52:06 +0100 (CET) Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01lp2110.outbound.protection.outlook.com [104.47.23.110]) by corp-ob09.yahoo-corp.jp (Postfix) with ESMTPS id 300441A22287; Tue, 14 Dec 2021 13:52:05 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo-corp.jp; s=default; t=1639457525; bh=WwFlW0j2YpFDx5t6gpo5266+X/qkj2WjyI30BUkrWIA=; h=From:To:Cc:Subject:Date; b=oSvmQ3taR79AFdu2sJ5jSCN2BusyFXTE4EqhOYs8/Vdg7cw+2F+ry3MmadQTg4Ruj /MgnHrQ9msMFHfWX+RmXE+gZa9A51VGm6gLarnkL93Gr3SzlohUtZ+I+lOPuxizi4o ZVgXtzPFtsW+QS9OXpMm8ev/+xyKov2GNUns5YRU= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MShaXEGA8/i4tPiRASgqyb9PEKStAbePmSEfU+ILjxpj5IS7aq+BOuDEVUs8M9gq0HsXrP4OAI35K4hECxATUWTfUMmolJLUhs0DwcTvrTJNcGlKTDqmMTtFalTnzzAl88kN0NmY/1y3cKo2TnRT0XmGxEVGs2JUm7vBsAIxwKjzd37PlLB5WEJMQLeD81CMRaJ3z/6IMnGw3skvcTHyoz6zRx9QTR4brNs1dX1HaTmpCd1EDgvHgDEJUXNBta3gyku4oqoeOSxWvUc6gP/qjRXGAMMFzasvaq0GH1m1X+VNDyhWMcEh9R8RM97LjSeGeJDU8XVwjc0UgNJWbG+acg== 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=WwFlW0j2YpFDx5t6gpo5266+X/qkj2WjyI30BUkrWIA=; b=R+FYk5an43KQYILeV7uMXjqXubbW+qq29VdtR/LMJEtvAKw0QX2Kf3t1ZpcfP2Eq7FAQFddSlGdhvdnVVWsOal0tXJ3jx6tUhWvR+664rkZ9C9OF72MHHXREm0R07+SxM0fYCdnSFmM4azPo4fIGpFWLkrsQiEGIJ4hRZmPdWgPjvOINiv+jcliYlqThZEeqtXmyifF4FyLWcHwIF/udxO9Vum9fpk5RPuRlVJseRnrJy12yECDX7ng7Axxyuddo5x/C3dqYceLWidX5zIxDi28jGhPmD5KE8/hAp7o56IkY3OwxqNDpom7N6wkTBlTvyLM4dVFMSeG+cDMC1t2egQ== 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=WwFlW0j2YpFDx5t6gpo5266+X/qkj2WjyI30BUkrWIA=; b=s4IXfxKXZvCyOH+RjV0RWt4zJnhtp56WvZGrXSsYbHzRAZqSnd82VX4pvn1TtH9DySAJ8AsAyyr8Mqd2lDvQHh/i5MH6WNbGXjmRsoTm10Cb62jmeRS44OD82ykl5tLuqo6LqXQ+xzSKsdlqoKfLnqfVjsCHKEHuvh0Ru5cvu6A= 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 TY2PR01MB2108.jpnprd01.prod.outlook.com (2603:1096:404:c::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.12; Tue, 14 Dec 2021 04:52:04 +0000 Received: from TY2PR01MB4107.jpnprd01.prod.outlook.com ([fe80::e0b2:d66a:8cd4:c96c]) by TY2PR01MB4107.jpnprd01.prod.outlook.com ([fe80::e0b2:d66a:8cd4:c96c%5]) with mapi id 15.20.4778.018; Tue, 14 Dec 2021 04:52:04 +0000 From: Nobuhiro MIKI To: keith.wiles@intel.com Cc: dev@dpdk.org, i.maximets@ovn.org, dmarchan@redhat.com, Nobuhiro MIKI Subject: [PATCH 1/1] net/tap: add a check that Rx/Tx have the same num of queues Date: Tue, 14 Dec 2021 13:51:57 +0900 Message-Id: <20211214045157.17658-1-nmiki@yahoo-corp.jp> X-Mailer: git-send-email 2.24.4 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: OS2PR01CA0115.jpnprd01.prod.outlook.com (2603:1096:602:1::33) 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: 2cfe4dbc-ae06-4bf8-e00f-08d9bebd791f X-MS-TrafficTypeDiagnostic: TY2PR01MB2108: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: xWAMKBB2PwXIZ31TKeBpVg+IyPHxmAr16++vj4B6xoUpI2EgCdGe4phsHLduqlmmKCxNQpwMYp//Ebs6ex3qpJ8Esx3ieqq2d9LhAhtUie5HdvSz9CxsGxOBQXhcFhDZe8GeRB0KnLHWLBxRkzzxy66u8Q4H3LUULL/1asb1T8ckcrzB2+K7FfEFgTdu4fQP5OZzpgTWKMY8ZiojFofcIlCSn8loyDLHuX3uRWTFO17RhYWfnG7BqAtJVHmm9QTPAX3e8tyCDWfdwB5xMotJpHyObvzGvXUOD2sm8cVyCe6hgFPKTZity8k3Uh7YTUATt8W4K/QlPRE21NS/Opy+2wXKix4Sh9n7QhJ89+59x/AKHI6QABUgngAxtJ4XIQvnjY3ShSB8ZXRIF02wcSCjOywskAhmdRRR7x6ZDDBN/yID4ziQ8yXbGJb0Gj5abB13N33QZDrHuEBaKyHF8M+KbEftJFtAWaTsE/3DCs4WbGZvs83WJLUqVF9+lKeCqgsZOpTZnYTQvjSrElhQBGNqLo73oUjgtW5U9lD5tJKKcvgZYvRxdgZEDXnMUIPTQV8cs5aYJxjuqFYozxAG7BtUTToHeJVs+U9hBNtHljo4UkeIviHwJBA3rdNC7tHgCjLtx0DVWlmAh0dqJ5gqgHNIN6IYiQoeIvQP5ZQAR7fMJMe1h0F0rfqG5ruz0xwqkNEs6ZgIn0iCZdpIPaPAFAJZMQo1dwOzCn84vr4EgvezoD6gt/axJSkuFeO8GwcaqlcCIbjem32/C8I/pZeQkIGNETzYKoXvWL2BXCUUrAjDf6300WiMPWbkS1eYB+rnkJXiDi1eQ4UwDok8Zvn5PkmgaA== 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)(4326008)(186003)(5660300002)(1076003)(2616005)(86362001)(38100700002)(508600001)(966005)(6506007)(6512007)(66946007)(66556008)(66476007)(38350700002)(107886003)(6666004)(52116002)(82960400001)(36756003)(6916009)(6486002)(26005)(8936002)(8676002)(316002)(2906002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?xyionuEMWTd+eXSZmgj1RuTI+fyaIU6hOva7nHnF01LJ7UBs/QFZEQBAdZ9P?= =?us-ascii?Q?oSJTLIvpzujJ/yP6yOSV1uSImGhlyASx/wIR8x27PZw68tsz4Yy4OF8lznAT?= =?us-ascii?Q?twZqkNaom3KvbunoM5/o7Y2BP8kdskl4iPuMRcknexACP6X8uO8sGCZVHt6w?= =?us-ascii?Q?NkEKO9noWh2lz84DlM5zNV2A8IQlDKc9HgissJ75Dtvu501AIbwd4g2w4gZ4?= =?us-ascii?Q?O9yGtu0nmwHJvKhlPlEMv2A6cWZwf9c18l0dyY6qMYmM+tYP4w4RHuj6LssA?= =?us-ascii?Q?KKPzlq+F1CiymJaqmVwiM2ak48tCFAC1DQ9DIDYJZHJ29py29e4ufnZYu+cD?= =?us-ascii?Q?UCRo2fJzmjtaPS35bVi9mGqQWTmUfBTvj3P6NEj0vU5jj0FqyMt7KZm9sN8U?= =?us-ascii?Q?pvqcQDlS/JuirtNmlFSM3ZO9Jd3ZL+Dg2aS7D1V3+aXyrHIH+ixNi4PSDdiX?= =?us-ascii?Q?6+7v5N2Tn1i1BXwCx5NLulXYko/q++5PdVJtySndb5K0LS67S4GR/TJ8WVZV?= =?us-ascii?Q?Sm65Hunim+vcxhUlV/kMiL7rVOAncZN7iiAKxSS6QicqQ9vcAx9pc09AjkXa?= =?us-ascii?Q?wyRiLli/H2Z+hKRi83iandKDmdcMogE3uOekGbhXKEL3IKuTmQko6sD5A6R5?= =?us-ascii?Q?u49IE8z7vL2rlEUPWgd+1c+hSLohCgVDiLmjRIxqHa5h2/Z375dHKYCbwrqi?= =?us-ascii?Q?OAJahj4EOJPLJtT8ahN7HYohccwF6k9rhlvHYBBUnn9W12ZThOA9quCbKrjZ?= =?us-ascii?Q?84D5Wqas0Tf1I3KAjri1fAZcM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enant-Network-Message-Id: 2cfe4dbc-ae06-4bf8-e00f-08d9bebd791f X-MS-Exchange-CrossTenant-AuthSource: TY2PR01MB4107.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2021 04:52:04.1223 (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: ebKR9h7XRMhmkDjOP/lv4/NrQO09N/eidDjd0kIKYzkRi6VxZ/FIZvjB8D2jwfcT4KXG7vGcIOuMMTVMNV8m8A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY2PR01MB2108 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 [1]. The RxQ and TxQ with the same ID are paired by dup(2) [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 the kernel. This patch add a checking if DPDK has appropriate numbers of queues to avoid unexpected packet drop. I had first discussed this issue in OVS [3], but changed my mind that a fix in DPDK would be more appropriate. [1]: https://github.com/DPDK/dpdk/blob/0c6e27549c/drivers/net/tap/rte_eth_tap.c#L1967-L1973 [2]: https://github.com/DPDK/dpdk/blob/0c6e27549c/drivers/net/tap/rte_eth_tap.c#L1465-L1466 [3]: https://mail.openvswitch.org/pipermail/ovs-dev/2021-November/389690.html Signed-off-by: Nobuhiro MIKI --- drivers/net/tap/rte_eth_tap.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index f1b48cae82..f0090a604d 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