From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3E504A00C5; Mon, 6 Jul 2020 09:53:45 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A90D51D685; Mon, 6 Jul 2020 09:53:44 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70050.outbound.protection.outlook.com [40.107.7.50]) by dpdk.org (Postfix) with ESMTP id 35B921D684 for ; Mon, 6 Jul 2020 09:53:43 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ECn55BwDiILXTX4Hu4Ha/2zVzQF9kOnsir7uNAf4VnxsZFvLfx4qyFi8SQTZWESqkipPIOssf6iyuy5t3MvGysspB7yLsR+M2PXGzGnUftfwQJoSkyLhBOb+8OZ+vV5d1bdstbkNgVtQHdMVDRCk++zBlpA+72JcEtm7f5CeAY+L6YAdiPZ9OsO7KRQOvnt26C/Vui+V+hDn01xPJ3dbQg2s3Jk5ik3x/tTtbue/Qaso5uxlWN6GQXpfOnZF+aOOwweaUeXw+qr6ELtWDJAcAVqYoUZypzrDJ50pPXb8vYOxDLMQA2GtnXInzyTtg6OtztN+3Dkb4lc6wew4ZldhqQ== 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-SenderADCheck; bh=/2U5d+7QMirhBraCOqSy40nRyl4vtYWxtwQ35oDrZXo=; b=gCwCKdTFpY+F+Y8lnjTe8PLW/uUXJF7NiFqwd3H454WFhxNJEjzUKLh/7bx0/w8hPUO/yqYo9r6UEKswwBBpMnGpGsBS1AVv917gKx53pH1lqGpC/enZzbgTUII0qFz053SMw4DqoakZEE/R8QoYoyto0+R5su8XoySnkJ00h7bZ1infnNotHA287mrpUx4C647iJYKSOPuelraD89HKK+fF3Ob77eAt8lEGqKzTrw2weNVuWXbLSGRbECrEf7DYzXv+1A26xWd9nlO9JvUGlJbGBcZqcnhYurvaTD3mmMm6qU/HPy0csKWJfVgmgoGwI1gv1N5GWEzg672J77xgfw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/2U5d+7QMirhBraCOqSy40nRyl4vtYWxtwQ35oDrZXo=; b=aoNVPqfa24ws75BV/XdEm8bBF+73SEuDaUb+1C2EiWFSgLpTpgCOfm1GuArv/LGzh2pEaNM93M76BdeEkikGt3jJQbHI8uygYjprnZIU4mB9AJUbq35W5R7WNpgU4MchdWettznGfEo5A3/CYREJKwGZ8UvencDSGGNsDij8fyw= Authentication-Results: monjalon.net; dkim=none (message not signed) header.d=none;monjalon.net; dmarc=none action=none header.from=mellanox.com; Received: from AM0PR05MB6610.eurprd05.prod.outlook.com (2603:10a6:208:12f::18) by AM0PR05MB4098.eurprd05.prod.outlook.com (2603:10a6:208:56::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.23; Mon, 6 Jul 2020 07:53:42 +0000 Received: from AM0PR05MB6610.eurprd05.prod.outlook.com ([fe80::103:d46f:87df:6525]) by AM0PR05MB6610.eurprd05.prod.outlook.com ([fe80::103:d46f:87df:6525%7]) with mapi id 15.20.3153.029; Mon, 6 Jul 2020 07:53:42 +0000 From: Wisam Jaddo To: thomas@monjalon.net, jackmin@mellanox.com, david.marchand@redhat.com Cc: dev@dpdk.org, wisamm@mellanox.com Date: Mon, 6 Jul 2020 07:53:18 +0000 Message-Id: <20200706075318.8048-1-wisamm@mellanox.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200630081028.21339-1-wisamm@mellanox.com> References: <20200630081028.21339-1-wisamm@mellanox.com> Content-Type: text/plain X-ClientProxiedBy: AM4P190CA0017.EURP190.PROD.OUTLOOK.COM (2603:10a6:200:56::27) To AM0PR05MB6610.eurprd05.prod.outlook.com (2603:10a6:208:12f::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mellanox.com (37.142.13.130) by AM4P190CA0017.EURP190.PROD.OUTLOOK.COM (2603:10a6:200:56::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.22 via Frontend Transport; Mon, 6 Jul 2020 07:53:41 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [37.142.13.130] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 8f51ea53-d822-493c-c95b-08d82181b378 X-MS-TrafficTypeDiagnostic: AM0PR05MB4098: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-Forefront-PRVS: 04569283F9 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1dFU5o+XrUKVcE0yy4kY4QTq81P6yRjfqjPBbJ3D31sRpSGm9Im1e/EHmhKrdvBJXPrFBiK7k7fbpveGZgu07EOoQ/G/LsH0QQEWHDinz6oVgd/+EoHQWmPK8nzF9mxBOpsDplSqtl5OnBHuOBrTvpwq5TaDxewJPMtsDTVqRIyGidFYXDicHSwlU/3QYn7ypG5tJGtI6Z8sJL1wFDjxMwI1wALgldE8EmkMt5RFN2JRR3JcLjw/9/XLUH/Q+dts8PoM/acDw7SzEu5ByysX5ED97aMjE1F9MPSffTZYtXfJOU+1iJ7pzsp79J5y3vtq3vYs/E9fkstgVicts5Rn2Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR05MB6610.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(136003)(346002)(366004)(376002)(396003)(4326008)(66946007)(66476007)(956004)(66556008)(55016002)(1076003)(107886003)(83380400001)(2616005)(36756003)(8886007)(478600001)(86362001)(8936002)(6666004)(8676002)(316002)(52116002)(5660300002)(7696005)(26005)(16526019)(186003)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: k9Q9dlVjspgWkY/cY/O2wl8wkAtjjsjsJp/iY4tGQ9PB0Chl8CLnKCq7/vyNAL1Saz4o/XEgclY9FYUekiISkLoi0ZSjrwvVbKXOMKlQMc7ofO6Y/vPRS7eNE4WvEU5bxxZPUhigmQ4LN+dNTuIl7gUBzP25KALfI3ArzNyZFMTVgfIAF8LnOjf4eeY4bfZ4W18Riad0BWqLfrepMW6sGOP5kJqH422F+8XWzCUidklTGwB7/iL98bHa9s0LnzlKMyyuJfVpwy/Ygpx5eVaRFId9sYgbMLKyN+nezA13ikGEkEMP0qZt/zfU8yUIv9Y8K3nEIUQFEZNnQDqfaDXbHUIN/tjyxlnvLfgHvSdlgdLRPz+rcEdxxqzSiiAQMWBdUM1G2hDvD2IqMJV5Bpxhrj4V28iM9406BFhEW/7DP8u2dwbivS6qo8IZkhbHEZMjAUHK5gwoZbLgeaZKlg6uCy7/A3Tsq97Hs6s9IzjwMMI= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8f51ea53-d822-493c-c95b-08d82181b378 X-MS-Exchange-CrossTenant-AuthSource: AM0PR05MB6610.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2020 07:53:42.2058 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: KiH0vtCFVTIDAucmoJAlc3D09XutOp6S8KQOtlLYg/uTa9ZfwvhyHr3zWqDLdbL99WaHfaITHKycMYTDbOdLhg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB4098 Subject: [dpdk-dev] [PATCH v2] app/flow-perf: fix condition of hairpin queues setup X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The hairpin queue is the one that start from normal rxq, and will be less than nr_queues where nr_queues is the sum of normal and hairpin Fixes: bf3688f1e816 ("app/flow-perf: add insertion rate calculation") Cc: wisamm@mellanox.com Signed-off-by: Wisam Jaddo Reviewed-by: Asaf Penso --- v2: * Add documentation of hairpin peering and allocating logic. * Add documentation for some variables. --- app/test-flow-perf/main.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c index e155e49c37..8f12ee10f1 100644 --- a/app/test-flow-perf/main.c +++ b/app/test-flow-perf/main.c @@ -1012,8 +1012,26 @@ init_port(void) rte_strerror(-ret), port_id); if (hairpinq != 0) { + /* Each hairpin queue setup need a hairpin configuration + * object, which determine the TX path for hairpin. + * + * The peering here represent the TX side, which mean the + * peer.port represent TX port, and peer.queue represent + * tx_queue. + * + * So if RXQ=4 and TXQ=4, and first hairpin_q is 4 after + * [0, 1, 2, 3], then tx_queue is TXQ+i which is 4 as well. + * + * hairpinq: represent the number of hairpin queues needed + * to be initialized. + * + * In 0 case means no hairpin queues needed which is the + * default. + * + * hairpin_q: represent hairpin queue id to be initialized. + */ for (hairpin_q = RXQ_NUM, std_queue = 0; - std_queue < nr_queues; + hairpin_q < nr_queues; hairpin_q++, std_queue++) { hairpin_conf.peers[0].port = port_id; hairpin_conf.peers[0].queue = @@ -1028,7 +1046,7 @@ init_port(void) } for (hairpin_q = TXQ_NUM, std_queue = 0; - std_queue < nr_queues; + hairpin_q < nr_queues; hairpin_q++, std_queue++) { hairpin_conf.peers[0].port = port_id; hairpin_conf.peers[0].queue = -- 2.17.1