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 307C3A0597; Fri, 10 Apr 2020 01:04:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0529A1D14D; Fri, 10 Apr 2020 01:04:23 +0200 (CEST) Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) by dpdk.org (Postfix) with ESMTP id 068491D14C for ; Fri, 10 Apr 2020 01:04:22 +0200 (CEST) Received: by mail-lf1-f68.google.com with SMTP id w145so151609lff.3 for ; Thu, 09 Apr 2020 16:04:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=6PDM/6kK3t/UvfX6uHVFziJLZBd04B5LnNgQgM5JaVc=; b=MFs0hT6c0VZ9brxQ2BJNboRMSV5N3JDG2NIALv3RiBAATXjZcN/+utcZTXXBsAgzRF 5BBKhz0tt1DsVRW2ZlVjRXuq117TZfzBY3KO1I/fZNvvziEbN8CJQaAMuF8JN6W5dElh J9+iHYSb7IeBKdw2MCH0g0yP75n7laErmO70woyeIzY6LEqQF1+3XVH0OPYbaNGHLYTK DeCFLxs8bc87LdI38KfXhNMTnBt4KYeplIqXLJg6G0iFy/ZjuyBbegJFyG6wT95XQPfD 2UuJfxqFhasr7H0/2E5ynVRj2LgoZ+1oV1hxQYw34vgF8yTa96vqVYpA2AySjtUipRbK TmuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=6PDM/6kK3t/UvfX6uHVFziJLZBd04B5LnNgQgM5JaVc=; b=F9yrmTkyjqHzsX6zzO1K9XTfk9lWdJX6VR9otfigL9ZUzHYLDtTihBhrlBb3Qq0UW4 zrpmTnhNvDBv3OIRQwND2R6wwVoWKXZxFmx8bKsT2L6zXSQciU7LrDn4dvwXwvAa1Le8 S328PsZmqfwD9ikDGAK+WyBxUTxeJBeZ2ahuOsNoIfDpgYvMFzlc6HHIdtVoHnre+YKt fjiPIPeTuoJwSjtgZW6XLgimhCwngi6QFehts+bPmq/FS12QwAp28VBhPA2Qzo1UrpB5 PTH/797ceBtQUSPWUv4SulEaqJsoqJDjxroe22yXbxJurSBBFwXL/RjnDx6TrNspXeAN A7uw== X-Gm-Message-State: AGi0PuZPHFEeKV/9108TxPo2GvHaPSAvblYjR2E354nOpPmQ4y47Zflw RTxjXofMDsRg2dA35KkCdWO7FeWsCGA= X-Google-Smtp-Source: APiQypL7igPyEgNhSxFsiS5YOddh4+zKNI4RlhGMw2ROki+jUsnHpRTZNpIaCa6VE9XKEVIDoRbpcQ== X-Received: by 2002:ac2:5109:: with SMTP id q9mr874238lfb.145.1586473461351; Thu, 09 Apr 2020 16:04:21 -0700 (PDT) Received: from [192.168.8.100] (user-5-173-33-152.play-internet.pl. [5.173.33.152]) by smtp.gmail.com with ESMTPSA id m21sm88912ljj.56.2020.04.09.16.04.20 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Apr 2020 16:04:20 -0700 (PDT) To: dev@dpdk.org References: <20200331192945.2466880-1-jerinj@marvell.com> <20200405085613.1336841-1-jerinj@marvell.com> <20200405085613.1336841-26-jerinj@marvell.com> From: Andrzej Ostruszka Message-ID: Date: Fri, 10 Apr 2020 01:04:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200405085613.1336841-26-jerinj@marvell.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v4 25/29] l3fwd-graph: add graph based l3fwd skeleton 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 4/5/20 10:56 AM, jerinj@marvell.com wrote: > From: Nithin Dabilpuram > > Add graph based l3fwd application skeleton with cmdline > parsing support inline with normal l3fwd. > > Signed-off-by: Nithin Dabilpuram [...] > +static int > +parse_config(const char *q_arg) > +{ > + enum fieldnames { FLD_PORT = 0, FLD_QUEUE, FLD_LCORE, _NUM_FLD }; > + unsigned long int_fld[_NUM_FLD]; > + const char *p, *p0 = q_arg; > + char *str_fld[_NUM_FLD]; > + uint32_t size; > + char s[256]; > + char *end; > + int i; > + > + nb_lcore_params = 0; > + > + while ((p = strchr(p0, '(')) != NULL) { > + ++p; > + p0 = strchr(p, ')'); > + if (p0 == NULL) > + return -1; > + > + size = p0 - p; > + if (size >= sizeof(s)) > + return -1; > + > + snprintf(s, sizeof(s), "%.*s", size, p); Could I ask to make this function to be the same as final versions of l2fwd and l2fwd-event that were recently under review? There were couple simple comments there and they apply here also. > + if (rte_strsplit(s, sizeof(s), str_fld, _NUM_FLD, ',') != > + _NUM_FLD) > + return -1; > + for (i = 0; i < _NUM_FLD; i++) { > + errno = 0; > + int_fld[i] = strtoul(str_fld[i], &end, 0); > + if (errno != 0 || end == str_fld[i] || int_fld[i] > 255) > + return -1; > + } > + if (nb_lcore_params >= MAX_LCORE_PARAMS) { > + printf("Exceeded max number of lcore params: %hu\n", > + nb_lcore_params); > + return -1; > + } > + lcore_params_array[nb_lcore_params].port_id = > + (uint8_t)int_fld[FLD_PORT]; > + lcore_params_array[nb_lcore_params].queue_id = > + (uint8_t)int_fld[FLD_QUEUE]; > + lcore_params_array[nb_lcore_params].lcore_id = > + (uint8_t)int_fld[FLD_LCORE]; > + ++nb_lcore_params; > + } > + lcore_params = lcore_params_array; > + > + return 0; > +} With regards Andrzej Ostruszka