From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <bruce.richardson@intel.com>
Received: from mga14.intel.com (mga14.intel.com [192.55.52.115])
 by dpdk.org (Postfix) with ESMTP id CBD4C530F
 for <dev@dpdk.org>; Fri,  6 May 2016 15:04:00 +0200 (CEST)
Received: from fmsmga004.fm.intel.com ([10.253.24.48])
 by fmsmga103.fm.intel.com with ESMTP; 06 May 2016 06:02:32 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.24,587,1455004800"; d="scan'208";a="98396794"
Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.220.75])
 by fmsmga004.fm.intel.com with SMTP; 06 May 2016 06:02:32 -0700
Received: by  (sSMTP sendmail emulation); Fri, 06 May 2016 14:02:30 +0025
Date: Fri, 6 May 2016 14:02:30 +0100
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Message-ID: <20160506130229.GA9864@bricha3-MOBL3>
References: <1462539092-24389-1-git-send-email-bruce.richardson@intel.com>
 <1462539092-24389-4-git-send-email-bruce.richardson@intel.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <1462539092-24389-4-git-send-email-bruce.richardson@intel.com>
Organization: Intel Shannon Ltd.
User-Agent: Mutt/1.5.23 (2014-03-12)
Subject: Re: [dpdk-dev] [RFC PATCH 3/4] test: change lpm test to use routes
	as resource
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 06 May 2016 13:04:01 -0000

On Fri, May 06, 2016 at 01:51:31PM +0100, Bruce Richardson wrote:
> Change the lpm autotest to use the routes data from the resource data
> stored in the binary rather than including it directly into the C file
> as a C header. This speeds up compile and link time, without changing
> the test results.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>  app/test/test_lpm.c | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 69 insertions(+), 1 deletion(-)
> 
> diff --git a/app/test/test_lpm.c b/app/test/test_lpm.c
> index d2aa5de..4234a52 100644
> --- a/app/test/test_lpm.c
> +++ b/app/test/test_lpm.c
> @@ -34,6 +34,7 @@
>  #include <stdio.h>
>  #include <stdint.h>
>  #include <stdlib.h>
> +#include <string.h>
>  #include <errno.h>
>  #include <sys/queue.h>
>  
> @@ -44,16 +45,23 @@
>  #include <rte_branch_prediction.h>
>  #include <rte_ip.h>
>  #include <time.h>
> +#include <rte_malloc.h>
>  
>  #include "test.h"
>  #include "resource.h"
>  
>  #include "rte_lpm.h"
> -#include "test_lpm_routes.h"
>  #include "test_xmmt_ops.h"
>  
>  REGISTER_LINKED_RESOURCE(test_lpm_data)
>  
> +struct route_rule {
> +	uint32_t ip;
> +	uint8_t depth;
> +};
> +static struct route_rule *large_route_table;
> +static unsigned int NUM_ROUTE_ENTRIES;
> +
Just as an extra note, I had planned a 5th and final patch to rename this variable
to have a lower-case name, but I forgot to do so when preparing this RFC. If this
patchset seems good to people, I'll include that cleanup in a proper V1 submission.

/Bruce