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 7E760A034D; Wed, 12 Jan 2022 08:23:38 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 41D144120A; Wed, 12 Jan 2022 08:23:38 +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 16489411EE for ; Wed, 12 Jan 2022 08:23:36 +0100 (CET) Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01lp2169.outbound.protection.outlook.com [104.47.23.169]) by corp-ob09.yahoo-corp.jp (Postfix) with ESMTPS id AEB3919FB184; Wed, 12 Jan 2022 16:23:33 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo-corp.jp; s=default; t=1641972213; bh=xKy3G1g1cSp2ZkQaNEmOTanpXGfBQQGkXYykpa9AlmQ=; h=From:To:Cc:Subject:Date; b=kVAVt9h3kbJLhIQNnYzuw4kM1gAUwDebuFhC2JiUsOEySpLssGvc9eLfJJYj5ycAu MFi5zxJUKZ8Gd2noxGbGlWWwVQX/ney3HDrWfc56kOaSUZR9ElH4Rqx9T0u62B6p14 j85uM9K4ThqTlS8hKn7rfGbAqaGbMEBJibiKoQEo= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RrUbspMxffFhsshZh9/n/LtjT7DPRxz0+h3A4dlFZd0j7FHO+YKkmOVrpPbBLymvfqwJeLgMVoCzUOoj9wpWxyJ1aymfOEVezpVlUGYkjdG6Io6Aoh9Nyg2kKKbzD5TtfODz8m1XZxSgkpxM9DO1mrdQfqkLr5xnqGozZf90INqc7LxvI2pNQopGpepWxJovSDfd29rhbjU1T5Te1AGJYcyeAoezXloqpqIp7WmnxvBaywSx562KFZgQqAZIR+Fx0lt4hOXpn0RLSS7yuVlY1zrK5wPiqCKhFc+VwUL8xPpw6rrZtyrUr9p88iZ2yGOLFQyJFzKdQYWa5Xtlch5P9Q== 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=xKy3G1g1cSp2ZkQaNEmOTanpXGfBQQGkXYykpa9AlmQ=; b=KSokQvf2EwMyswsfzJIF/sqRxWZsksqrtEeN8JCbRddc1zAhOXXIv5uXTammahA6YuauARni0ok9AiZvLizJbtJfGLidh2RgdHveX1s3wjkf5sR1YWHV23QfLvb8TM3V+pC8+ydd+h6ZOxqKkQI6+Ra5hYaoNOzKmA2qXax8YxPnyjyhHZsJShTPURqcrx6GCJdIUzO9mURIVWz2WY1aoEiA9VdDhx6QLU13oJVgvh77aUMIVDO+t8cjq8i6ugaLHxsXhjlCJbESzFDxi0ilYlDXfYg2hIJCiqPuc9NME3iCC02rOdim/WL8pFR3ck/U8mqB2iVffMF7fYMZe7Mz4w== 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=xKy3G1g1cSp2ZkQaNEmOTanpXGfBQQGkXYykpa9AlmQ=; b=evqYsdz/i/HPfr3ZOCdA421dx/IiARJQMsdEbDx++G4mDNrw4kadhVaRAwYJlyhIy6mqqqnLHSmWj35Avmn4F/bFhGJqQJMrYwsCheegTuDKiGl3Licgn/oJHoj7TnXWZiMhjA5TZJTG0ECrc8jGrDwelun0kZ+X88+LymQjupU= 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 TY2PR01MB3386.jpnprd01.prod.outlook.com (2603:1096:404:d0::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4867.11; Wed, 12 Jan 2022 07:23:32 +0000 Received: from TY2PR01MB4107.jpnprd01.prod.outlook.com ([fe80::cb7:31ef:6496:cd9e]) by TY2PR01MB4107.jpnprd01.prod.outlook.com ([fe80::cb7:31ef:6496:cd9e%6]) with mapi id 15.20.4867.012; Wed, 12 Jan 2022 07:23:32 +0000 From: Nobuhiro MIKI To: keith.wiles@intel.com Cc: dev@dpdk.org, i.maximets@ovn.org, dmarchan@redhat.com, Nobuhiro MIKI Subject: [PATCH v2 1/1] net/tap: add a check that Rx/Tx have the same num of queues Date: Wed, 12 Jan 2022 16:23:24 +0900 Message-Id: <20220112072324.30601-1-nmiki@yahoo-corp.jp> X-Mailer: git-send-email 2.24.4 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: OS3PR01CA0022.jpnprd01.prod.outlook.com (2603:1096:604:db::9) 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: 2a964559-45d1-43e2-9b7c-08d9d59c706f X-MS-TrafficTypeDiagnostic: TY2PR01MB3386: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: NJFGwaiSiDKmUDMkEpBNp6CUNaMnGeeRV+z4pnFimZtRibd/Ac+qNs4mUoMAsgsZ/zhtxa1TJpfvU2KMWgveE4tk6d24y6WuSZnPOZaxkXIO0HbDGymJ1dseUh5UwTOXeuh5d9XypgU4mf1IVZvS8xzjuXsyUPmySM6h+T282+XaEIs7w25CYp6iW0XNUvhTfkj7MHRhtUm0gJ+RAb5BNMou9Dn8zNq0h6epJG36BtHwqlGdruPDgXG6/xjV0BQgTdQNXTDWSQQ+vVepS3Xu3mtp3iDlztwzogFYyvNjrvFxD0JG7Ez24+t86HqhDFu8PJWUcwpu83iTc178zXR8uWlzcIdcB8pQz19cjSD7JIh8lN/dGDJ59kq/kbBbdGufUVokfGp/Gc8kVDisnj6TUftQgWXmA8FTia34WUj+SVXjA8GzcffvSOXIf5j53bqofH8Vx/0Wng0JPTmCo2vO5SMFbucsmsDZeeH9WF4EuLqZaMQYpJfgj/2hXBadQe1MsNSO3eoCj6ceo1Mg33n0b9JOKo2An8GEtm9oWHtZkrZtvC/N1j0H22H0UycTvVC1P0p9/jH1HBDbBE/y83NYA5LpwUr8hGkUq8A0TdY3fyZZ5sprC4YVWAjAdPiLXjaI8P86HPbzrkQW6/AZoixpYTzcpC5FC5wxTSk31Nrrr1jF5l0bxsB7LsVjsuw3Zy6pUVayKFBFwiFnOlZrqMqaVx3WAhyRSainZ2+0hVWgfhGwldVuyqgPpW/z5BHFGkV6M8LBkCG3eRGua3fWTSweEo05J0OQJWybCwsnqXhU1Ug= 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)(186003)(107886003)(5660300002)(66946007)(6512007)(38100700002)(4326008)(66556008)(38350700002)(2906002)(6666004)(66476007)(2616005)(6486002)(6916009)(8936002)(8676002)(6506007)(86362001)(83380400001)(82960400001)(966005)(26005)(36756003)(52116002)(1076003)(508600001)(316002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkC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Q?HPnQfEx3B8G7c+lsWG2RBYXx6DlDjgoRCQ6JsituoUJn1PSlUZW6yz/xk7pf?= =?us-ascii?Q?xTrUuhj7SgCMf15cRWK/4cFQxpXNFM9u4gFcg0Moo4Mn4BarUyZ0bCyL9oEL?= =?us-ascii?Q?/DCH2Iw4cqSsc+W5o0b7V/tzmgURqTa+IR78L+LIKxrkcYnhJ7/Tq3ytMXgQ?= =?us-ascii?Q?iR1zykKTX/qu9ymmGeV3QyExm/90+adh1J0kzOG5tqeGVSSJ9bkIziFPetY/?= =?us-ascii?Q?OegXuTlDhmNoWn9Ct4PH/Sr1fUNLxDjAsDZuMQWrqPnSOEqgRmr7M1hColNI?= =?us-ascii?Q?m2L0W+SwXjMVvH5nAheCFQ/Hs4mJZOjc9XmrPax9kRkGiu8S0VOInog27Qfr?= =?us-ascii?Q?NGs8PnAF2O22+Tl5vEYo+TjhDRFfWAEUs9lWE84jrrF4yCjAKXBSC+zEQX1m?= =?us-ascii?Q?TKrjb4J3JnXX+3UZYJx9S0mytyyhbq324rH+eTB03isw66DRUOtpM40lTVoG?= =?us-ascii?Q?YijG9s4zzkezzTTRoDD0GN9ZB07qAjqEuNayI++SuG7zMx41R3Na0fx8UXka?= =?us-ascii?Q?XBb6VwqrCIh8c0IzTP3ynkzWOmiin271n/2ryvGLa1rj5H1sOHj5LVXbw2g3?= =?us-ascii?Q?5RJV+53HYiP+OnjxmBAgyHcpPTIxB+0QEQsNzA+4xTV6SYC0eyXx07guY6V3?= =?us-ascii?Q?8Pivr331C5NKbzNfQ3+5Yv5lXcR2M1tu/V66gCLEL35eXehyo6+wPCsvMvja?= =?us-ascii?Q?tUbwd1gl1vmANDSdF9pnbm84jGK8jLXYyLIwlP336BfGMpU7C42ySPT0EUCQ?= =?us-ascii?Q?uGQgfpDxcYfeDDQKfNZKxxA=3D?= X-OriginatorOrg: yahoo-corp.jp X-MS-Exchange-CrossTenant-Network-Message-Id: 2a964559-45d1-43e2-9b7c-08d9d59c706f X-MS-Exchange-CrossTenant-AuthSource: TY2PR01MB4107.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2022 07:23:32.8706 (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: grcwemQ9+siu7dEmKTCwrhyiYVRvX7uD1vLmsdHvtPsLopx1m9oHVrWc8IpacDmNbWeIedpwb1gGUtr1sjpxZA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY2PR01MB3386 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 --- 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 --- 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 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