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 A0B5CA00C5; Mon, 6 Jul 2020 10:35:00 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 238D11DA9F; Mon, 6 Jul 2020 10:32:58 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2077.outbound.protection.outlook.com [40.107.21.77]) by dpdk.org (Postfix) with ESMTP id 48D461DA92 for ; Mon, 6 Jul 2020 10:32:57 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XFWbtAyi+97EWj+LYDzaioalfWHGTbWL/7kuO5icTqpm02jzcgZy/CBHcrsFay3v4WBivQcQbY5ZFEOMguWEetu6NOfQJNI8vZs2OOMhbT36519URT+HfzUrYmRzuUDHEFJw5QFS4Ee3OWrCRxDm1ab8Gj0iZVYQsmlLG0Bm2FcKvs+oqy7/4SKUF1p8HA7nrSjnTp8lzmqIJ7Kt811+ytC2a3fA9qwuJ1/AMEIwYx7Ghs9yDaf56DsXsX3wZVTXw725VAUzFcwJK+PfAeerqbvrKMZ3BoIy83TZMu6wow2a8NMwN5pe22CrbViS9PG2KusmFuZnv8+bw9K7zy9HRQ== 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=05SmV+yRs7Di0xYAcw+MlXBzelBgZTLfhy6xq/B8bGo=; b=B2sOH9VbZ4NoVVmsD7tHscB/oD4u5hVn9fy4TvTueK6b1wlm1JwntBz47IpLtj34TYLqd7aztKboeCJKrFPdfAFVvAuVi1TRmYNFLkQ+pqvmH9AysLtAFJv9hL3R/cJ2SGsUKY16iv8277oYjtW+uUescTL8z862Wwrz5acnUeCfyHou3w5U9hNLV9Ur9m7o38e7dWreJsiyBAGkQ7pVQPw4yFqCL6Z0f7TiaYSb9yaS/iMadpNhmIetLvFrTVdswhkBVP9EOu/9JAerhwgnr3HcxFUG45WtQBxivjLsOnoBh5DzP2gHb9R1Ehf2wxd7ivP4VcgqeS0PTgPaglMNjw== 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=05SmV+yRs7Di0xYAcw+MlXBzelBgZTLfhy6xq/B8bGo=; b=MwtyTNfZP5eR2hjre5onD39hqPOUaReaXO1mQYJnqGL8XlAhITTeIQm2vcOQmUADhzSGgTfTt35XF9SGrf4oWHm+2ESBs3DyJx7PZsRwW+vKVoyfUNjuQoa1EuCZAHa2HIyFZNz9EO4xhAQMv+0EzTBuWDTIk0i10TFrbYVuN+8= 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 AM0PR0502MB3764.eurprd05.prod.outlook.com (2603:10a6:208:1e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.20; Mon, 6 Jul 2020 08:32:54 +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 08:32:54 +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 08:32:41 +0000 Message-Id: <20200706083241.9073-1-wisamm@mellanox.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200706075318.8048-1-wisamm@mellanox.com> References: <20200706075318.8048-1-wisamm@mellanox.com> Content-Type: text/plain X-ClientProxiedBy: FR2P281CA0007.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::17) 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 FR2P281CA0007.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.15 via Frontend Transport; Mon, 6 Jul 2020 08:32:53 +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: c48ad7ad-321f-4d6e-f4b8-08d821872d79 X-MS-TrafficTypeDiagnostic: AM0PR0502MB3764: 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: 6I30tLGw0nK5avjkxIsWUHJl2TAWQwWF+fsjzcqZ00iGjqhu5u8cf7fDOUXJdXKMxirr2CNbldjdDEcPrtiFe+rWPgbSqvUTgI75b9qvy0bYrs7eZjDB3IRpIXbj/roPPyOXgZlwZe+6R7mhl+5XIfrPTUpazBvynJFWUtorgWeNHat7rVlxMiGPtKbBSIQlQ5clZjFBabKiz0opyLJGV9IDYuc/YT7H7MaAyc4pjNnutJbyYA9PJdEgUbg8jCtln3UxOIW1du6GsggMm0eUZlANV1MWTSv3IZqYaPjYSJsDIHVcOYhURnULexboQuMyec71p9EGbYoKpvuFxocEfw== 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)(366004)(39860400002)(396003)(376002)(346002)(136003)(478600001)(86362001)(5660300002)(6666004)(26005)(2616005)(956004)(52116002)(1076003)(8886007)(316002)(7696005)(186003)(66476007)(66556008)(66946007)(16526019)(8936002)(4326008)(107886003)(36756003)(8676002)(2906002)(55016002)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: qxUpY7OeSmwdR5JE0QAWBg6Sxr+OH8WfhMjNQJjYVefFq9iihTdpdsG1ZfqBCAh0/+1ZnG6U+upUF19ro7/NUbpM63R2tyUgkmYGMoFdYNCTySfwBzWIyagdyBnw4YHTO//7gy6+8EeYZbGXNBc3gGvLELXF5oB+VPPj6Jmm3egcEGo3vZv3NA+3/cJYgM2iBq/AInirV40iUB1mJdwfoyHXWRXOVlngCGP42s+s0is9kYlHPBnJBW1NAKm5Z+2IDGvhPyiXh8SW1CzZ2321T/9hVXhSQXeFuf6GjHhvt2vHl/bW6j0/Vi3715fR1KBR3CZiNXCR+K9ywNiMAtnREvE3na1U5Re5wYNyw1aE7F8zYQEpvqrP0fyOjSKRx5Js3pwFJZZIjy7nJQ+LL1dUT+GaOOOcz9O+Fe7Uy5Bh4x3fdiHJHKZAc86zm0ZdcHCsIRw6wLUHllEJ8DUrLlIuF1TMu49EMtYE1oseofekufQ= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: c48ad7ad-321f-4d6e-f4b8-08d821872d79 X-MS-Exchange-CrossTenant-AuthSource: AM0PR05MB6610.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2020 08:32:54.1803 (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: 5h/feODu0zRVHeLkL1Btp3Udc7Cj1E0/D6CSixl3QkcZ4RT9NYXPEG2eBddr4vfEbNlX7KckSAD75hCg3yQbfw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3764 Subject: [dpdk-dev] [PATCH v3] 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 --- v3: * Add variable documentation variable declaration. v2: * Add documentation of hairpin peering and allocating logic. * Add documentation for some variables. --- app/test-flow-perf/main.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c index e155e49c37..2200767e0d 100644 --- a/app/test-flow-perf/main.c +++ b/app/test-flow-perf/main.c @@ -59,6 +59,13 @@ static struct rte_mempool *mbuf_mp; static uint32_t nb_lcores; static uint32_t flows_count; static uint32_t iterations_number; +/* + * hairpinq: represent the number of hairpin queues needed + * to be initialized. + * + * In 0 case means no hairpin queues needed which is the + * default. + */ static uint32_t hairpinq; static uint32_t nb_lcores; @@ -929,6 +936,7 @@ init_port(void) { int ret; uint16_t std_queue; + /* hairpin_q represent hairpin queue id to be initialized. */ uint16_t hairpin_q; uint16_t port_id; uint16_t nr_ports; @@ -1012,8 +1020,19 @@ 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. + */ 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 +1047,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