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 16EB6A059B; Fri, 10 Apr 2020 11:29:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 71FD61D50C; Fri, 10 Apr 2020 11:29:24 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 502781D416 for ; Fri, 10 Apr 2020 11:29:23 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03A9ArCY023956; Fri, 10 Apr 2020 02:29:22 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=date : from : to : cc : subject : message-id : references : content-type : in-reply-to : mime-version; s=pfpt0818; bh=nM56axCP1aIueBGY1f+Y5EYBarxwBOO8GN52MhAY168=; b=ifNgepm1sB4OYLbhr2/efFm5SgXbwrfsVSnZgdQtfRxy82agT5BXfIaRnpzH3pUXbQDn QVyeAd+XUCdCW5lRVJSbzQXkjrQScjSRUu/Gas4PNQ4YT8a/ZKoy7FSbGpSkzS8XC8Ov rd84tD97DVdHjc+uLv/dMVNRui2SMHRGTUANEzcMiHyk2QRRTXN62KFkNvUXi1dIu4R4 qLd0CILVbLGQ2cZ1l1hmCf3W7wotqSwwiDv129B8aPqGUA2PeXjoA0y6vUkYLsTUH2qJ Nr7PTOwXoYkUshiEaYeQI0g0KiOYAtmjUqKulBIezQwz7S7YM8vGhuhmuxqG9MHzNHzm lg== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 3091mechr7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 10 Apr 2020 02:29:22 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 10 Apr 2020 02:29:20 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.176) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Fri, 10 Apr 2020 02:29:20 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d39AkBlHBmW/E4Xr/w2kJVcNjGijtwVIhP4zYH2Zwef8TYiiUZ3hF25tzFejf6Ipi+y+VbE1/Doa8v8kU24fKPsdaVWk10YqHcznOAsBU7h2u4vAdk8cyHXOE3Q92XzDBlRdE9UyMnTcNKf0SHSYkPCMtiuEC1jwCbj1pVttBcHCy+CoFHZUAx38/RgpbG6g9IygfTHiino2NcTjDWx8M2CCbkw2sNbYDM+Se/I2zVhdylfNHqvS6phIj9nvoed3UlDBtZBX28Mjbj8vRzQuh3xgJZhwTo8gxZ3D+2Yz9wU9veBI2ofZY8AU9GEkt7h+F7d9tBDIx1WOX5W+Wa1DDw== 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=nM56axCP1aIueBGY1f+Y5EYBarxwBOO8GN52MhAY168=; b=COM4eNb59j6HD19OIbAE+AY76+AbZJZEDbarKZTXWS+SACh3FpkxZnDl12KjvimYm4TuPbUdQwdXuS1L/1itQi+KkqJSdl2TZtj7SFmQJHH5+m2Ff2/A9qOHHtGflJfu40szeKwQOWwQs6xmbjRno/FhcBXBfhSK0Yn9d42LnWrQQWG6BTGwv1wtOheD2NHZnf5NP9KmmSj9bG93sGttUon4eyDeDDr5QB6OVJW/SurZA4NiLO+ZTPZXfYMglaeSEO60NC3jy9HJOh+kP5qADmBC6mnN+GNKl/TCmN2p0y5vFE+WvF+nMSc+4dmuDHPUPfcIlw+5+fgRd3YFYqlBLQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nM56axCP1aIueBGY1f+Y5EYBarxwBOO8GN52MhAY168=; b=kpbrHoEqy9edR5nD11raJPCKIQsumYXE1+hNPUiDWVGhDLyahEXgySQOvBbOzGNn2glzbzXjD0Xi5PagdSQPz9asndkYkwj+WjvBJy32f7jlZ5jcD53jfqxY1dYQkCZm7rdpcoUCmWP3FdD1UyS2CaQX5mp5JPl1yg/sAFb8plU= Received: from MWHPR1801MB2063.namprd18.prod.outlook.com (2603:10b6:301:6a::11) by MWHPR1801MB1998.namprd18.prod.outlook.com (2603:10b6:301:6c::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.19; Fri, 10 Apr 2020 09:29:17 +0000 Received: from MWHPR1801MB2063.namprd18.prod.outlook.com ([fe80::380f:5ca1:ce60:6586]) by MWHPR1801MB2063.namprd18.prod.outlook.com ([fe80::380f:5ca1:ce60:6586%7]) with mapi id 15.20.2856.027; Fri, 10 Apr 2020 09:29:17 +0000 Date: Fri, 10 Apr 2020 14:59:06 +0530 From: Nithin Dabilpuram To: Andrzej Ostruszka CC: Message-ID: <20200410092906.GE23867@outlook.office365.com> References: <20200331192945.2466880-1-jerinj@marvell.com> <20200405085613.1336841-1-jerinj@marvell.com> <20200405085613.1336841-28-jerinj@marvell.com> <8b4a122f-9d59-ddb3-8187-63f1e57e3d25@semihalf.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8b4a122f-9d59-ddb3-8187-63f1e57e3d25@semihalf.com> User-Agent: Mutt/1.12.2 (34cd43c) (2019-09-21) X-ClientProxiedBy: BM1PR01CA0082.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1::22) To MWHPR1801MB2063.namprd18.prod.outlook.com (2603:10b6:301:6a::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from outlook.office365.com (115.113.156.2) by BM1PR01CA0082.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.17 via Frontend Transport; Fri, 10 Apr 2020 09:29:15 +0000 X-Originating-IP: [115.113.156.2] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ed360513-9bbc-4470-642a-08d7dd31a3dc X-MS-TrafficTypeDiagnostic: MWHPR1801MB1998: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:612; X-Forefront-PRVS: 0369E8196C X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR1801MB2063.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(366004)(39860400002)(376002)(346002)(136003)(396003)(956004)(55016002)(6916009)(7696005)(33656002)(52116002)(478600001)(16526019)(9686003)(2906002)(55236004)(26005)(316002)(186003)(5660300002)(66556008)(66946007)(6666004)(8676002)(6506007)(8936002)(4326008)(1076003)(86362001)(53546011)(66476007)(81156014)(32563001); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JQyirxa4w1SqICS7HzaCgMmnIQH0CiCqpa0ATxvEYShMYNwUTrdyMqQA9eeHMisxEzMSW2EpNHqVlOkZiQkz1XyNtw043RClKfRgd/2H9ON54ZNTCm1sjZPDS0hS8VBxwKne8/MXO+/e3AaJZEDWX0GOJBLskNWbulGiEaeTcYoRtAucPqw9MEh4lOlByr6Nt+Ob9qSlAYJDfhw5XBErvSPDOelHJ1Zvxo6hQMEtTXplPySGp3XXNQAm0vdFMhlZGnOSaTHrrkyDGNrDB4V5CIeZqblD/TkTe0sTo98+A43PKvUhYLWmw57cyhs7lyN48o1Lv5JmK5bxM0PrQhEhWK97u3vW27aafX/0/uVZLzousnMmLv46tUWcuv6zbXcNd/9FUGPTJsvHz9bumv2KSsk2njc26xXzOCpJzOh4Pqvt7ViyzxKZYxRNVi2WBkoU00JMHU/2d54MvHDqCLI8n8lYI8yCZ1SN8B1NZehka+1xIzlCd7cqrk6t1RtqYDmS X-MS-Exchange-AntiSpam-MessageData: tK9sK005rGo8Qr6gcXC4zKa3T9q8ZcHP4cYVt8Ffwna7wa6X9BxQm1C7wP5ifQTRorZpPtVusRGNMK22/mlW1vZyH33FiQyhb9xQuVZvPXOIpYpD2n94+kn49PoMoKJagTvVMa2lN7tGKLbQMJrxUA== X-MS-Exchange-CrossTenant-Network-Message-Id: ed360513-9bbc-4470-642a-08d7dd31a3dc X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Apr 2020 09:29:17.0908 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: gaQOlNw8HSIiWC2wiNCMU9Ge2ld26654JpEAskJxf4XdHoGx3oZqWLQB9Bc9jzOJrtfNCDU0mKSKc4eH+SXu7w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1801MB1998 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-10_03:2020-04-07, 2020-04-10 signatures=0 Subject: Re: [dpdk-dev] [PATCH v4 27/29] l3fwd-graph: add graph config and main loop 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" On Fri, Apr 10, 2020 at 01:04:00AM +0200, Andrzej Ostruszka wrote: > On 4/5/20 10:56 AM, jerinj@marvell.com wrote: > > From: Nithin Dabilpuram > > > > Add graph creation, configuration logic and graph main loop. > > This graph main loop is run on every slave lcore and calls > > rte_graph_walk() to walk over lcore specific rte_graph. > > Master core accumulates and prints graph walk stats of all the > > lcore's graph's. > > > > Signed-off-by: Nithin Dabilpuram > > --- > [...] > > @@ -826,11 +936,26 @@ main(int argc, char **argv) > > "port=%d\n", > > ret, portid); > > > > + /* Add this queue node to its graph */ > > + snprintf(qconf->rx_queue_list[queue].node_name, > > + RTE_NODE_NAMESIZE, "ethdev_rx-%u-%u", portid, > > + queueid); > > + } > > + > > + /* Alloc a graph to this lcore only if source exists */ > > + if (qconf->n_rx_queue) { > > + qconf->graph_id = nb_graphs; > > See below for a comment related to that. > > > + nb_graphs++; > > } > > } > > > > printf("\n"); > > > > + /* Ethdev node config, skip rx queue mapping */ > > + ret = rte_node_eth_config(ethdev_conf, nb_conf, nb_graphs); > > + if (ret) > > + rte_exit(EXIT_FAILURE, "rte_node_eth_config: err=%d\n", ret); > > + > > /* Start ports */ > > RTE_ETH_FOREACH_DEV(portid) > > { > > @@ -858,6 +983,119 @@ main(int argc, char **argv) > > > > check_all_ports_link_status(enabled_port_mask); > > > > + /* Graph Initialization */ > > + memset(&graph_conf, 0, sizeof(graph_conf)); > > + graph_conf.node_patterns = node_patterns; > > + nb_patterns = RTE_DIM(node_patterns); > > + > > + for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) { > > + rte_graph_t graph_id; > > + rte_edge_t i; > > + > > + if (rte_lcore_is_enabled(lcore_id) == 0) > > + continue; > > + > > + qconf = &lcore_conf[lcore_id]; > > + > > + /* Skip graph creation if no source exists */ > > + if (!qconf->n_rx_queue) > > + continue; > > + > > + /* Add rx node patterns of this lcore */ > > + for (i = 0; i < qconf->n_rx_queue; i++) { > > + graph_conf.node_patterns[nb_patterns + i] = > > + qconf->rx_queue_list[i].node_name; > > + } > > + > > + graph_conf.nb_node_patterns = nb_patterns + i; > > + graph_conf.socket_id = rte_lcore_to_socket_id(lcore_id); > > + > > + snprintf(qconf->name, sizeof(qconf->name), "worker_%u", > > + lcore_id); > > + > > + graph_id = rte_graph_create(qconf->name, &graph_conf); > > + if (graph_id != qconf->graph_id) > > + rte_exit(EXIT_FAILURE, > > + "rte_graph_create(): graph_id=%d not " > > + " as expected for lcore %u(%u\n", > > + graph_id, lcore_id, qconf->graph_id); > > Should application be checking graph implementation? Maybe just check > that it is not "invalid" and here store it to qconf->graph_id? Ack, will fix it in V5. > > > + > > + qconf->graph = rte_graph_lookup(qconf->name); > > + if (!qconf->graph) > > + rte_exit(EXIT_FAILURE, > > + "rte_graph_lookup(): graph %s not found\n", > > + qconf->name); > > + } > > + > > + memset(&rewrite_data, 0, sizeof(rewrite_data)); > > + rewrite_len = sizeof(rewrite_data); > > + > > + /* Add route to ip4 graph infra */ > > + for (i = 0; i < IPV4_L3FWD_LPM_NUM_ROUTES; i++) { > > + char route_str[INET6_ADDRSTRLEN * 4]; > > + char abuf[INET6_ADDRSTRLEN]; > > + struct in_addr in; > > + uint32_t dst_port; > > + uint16_t next_hop; > > + > > + /* Skip unused ports */ > > + if ((1 << ipv4_l3fwd_lpm_route_array[i].if_out & > > + enabled_port_mask) == 0) > > + continue; > > + > > + dst_port = ipv4_l3fwd_lpm_route_array[i].if_out; > > + next_hop = i; > > What is the difference between next_hop and i? It looks to me like they > both have the same type and value. So maybe instead of another object > just add comment to route_add() below? No strong feeling here so you > can ignore this comment. Here there is no difference, but just wanted to say that next_hop is a user choosen identifier to add rewrite data and use the same id to link a route added to that next hop. There could be multiple routes pointing to same next hop(gateway) in reality. I'll change that to 'i' and add comment describing it in V5. > > > + > > + in.s_addr = htonl(ipv4_l3fwd_lpm_route_array[i].ip); > > + snprintf(route_str, sizeof(route_str), "%s / %d (%d)", > > + inet_ntop(AF_INET, &in, abuf, sizeof(abuf)), > > + ipv4_l3fwd_lpm_route_array[i].depth, > > + ipv4_l3fwd_lpm_route_array[i].if_out); > > + > > + ret = rte_node_ip4_route_add( > > + ipv4_l3fwd_lpm_route_array[i].ip, > > + ipv4_l3fwd_lpm_route_array[i].depth, next_hop, > > + RTE_NODE_IP4_LOOKUP_NEXT_REWRITE); > > + > > With regards > Andrzej Ostruszka