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 070B1A0613 for ; Thu, 26 Sep 2019 19:29:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C783E3195; Thu, 26 Sep 2019 19:29:10 +0200 (CEST) Received: from mail-io1-f65.google.com (mail-io1-f65.google.com [209.85.166.65]) by dpdk.org (Postfix) with ESMTP id CFF292C60 for ; Thu, 26 Sep 2019 19:29:09 +0200 (CEST) Received: by mail-io1-f65.google.com with SMTP id v2so8573467iob.10 for ; Thu, 26 Sep 2019 10:29:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KhzYgDwjB/uFZc2q+nNXiHLqVVS31q990kptcKlXHqI=; b=qb5+4fGIMlI6HV0GOhs9zF2TqPIPCLDbtTCadBr2Kchb4l3oFtwncmWnUrY9LgCB8A 6x2fXckB7LWXcB+wCfi0lrDKa4ylWP2s5fk2IEKf7x/6OmkTsVnvR1ylTqoHMd5S3his aJFB/OTXjYWy18G2ubYj8ET0cONAhA9IXxG2ho1wMWv/9k32WTXs5fSew8X0J8KxDWUV RxkFFiZmzl8k/KDeF1Pm+v7vOIcFT2oUXA7+6rDyvAzbTpe+v7lga9hBB7gbbYV+2jXb dvmnvbOza1XdGO1c4XqtiSNhIqGRIGJPsg65Is5A2ogF1ja5Kv4FP6qHlsRQAdLC+lwY SxTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KhzYgDwjB/uFZc2q+nNXiHLqVVS31q990kptcKlXHqI=; b=Y/Mtk8c4QBhipz7Umo1DrV0Liz5sFEaup6ceeiuBA9wnuZQxlt4MVkt2bYKveqMQVj hCcdOghLLl4C5gEE2DXsRhyKaU7xagO8PoSj7Jlh7MHDVx9RzIVZVYLNQdSkRKlw5MQI uQYWzj07EJfAezRTtcqg+ApjA3V0bSxdYIglvqmm9+pd/Sr1BOcIuySwo4RkmiB5o1+9 7WUkoqbKQTfwvUTmovJA45ptP3majjTW34Y4ol1VEtzu/GsXqDiwlqvJrIvrHMZLJPSb WvO1ySnfi+M5tm1RnIEgTRGZ8h7Xyi/AEX8UlRkS1DERrglb9b88XTVh1Bo1hZn1fn45 AtGw== X-Gm-Message-State: APjAAAUB8g/CBgDd5aANAanMNTvuEjn8H1SBJbFVLGI/Tk2XjtM34cTs o6Wqz/iOEptd/Llp2wtch6MWj42OrTTlunyGEto= X-Google-Smtp-Source: APXvYqyt7jixAPwdu69Uo8CfPXx4ycz/TOEetSlLpwJM9IlK0MjxBVLiY+Jmo4ueCn4neAad2RcndEPVEz9eI0WDDLo= X-Received: by 2002:a92:1559:: with SMTP id v86mr3842490ilk.130.1569518949002; Thu, 26 Sep 2019 10:29:09 -0700 (PDT) MIME-Version: 1.0 References: <20190919101346.8832-1-pbhagavatula@marvell.com> <20190924094209.3827-1-pbhagavatula@marvell.com> <20190924094209.3827-2-pbhagavatula@marvell.com> In-Reply-To: <20190924094209.3827-2-pbhagavatula@marvell.com> From: Jerin Jacob Date: Thu, 26 Sep 2019 22:58:57 +0530 Message-ID: To: Pavan Nikhilesh Cc: Jerin Jacob , "Richardson, Bruce" , akhil.goyal@nxp.com, Marko Kovacevic , Ori Kam , Radu Nicolau , Tomasz Kantecki , Sunil Kumar Kori , dpdk-dev Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v4 01/10] examples/l2fwd-event: add default poll mode routines 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 Tue, Sep 24, 2019 at 3:12 PM wrote: > > From: Sunil Kumar Kori > > Add the default l2fwd poll mode routines similar to examples/l2fwd. > > Signed-off-by: Sunil Kumar Kori > --- > +#ifndef __L2FWD_COMMON_H__ > +#define __L2FWD_COMMON_H__ > + > +#define MAX_PKT_BURST 32 > +#define MAX_RX_QUEUE_PER_LCORE 16 > +#define MAX_TX_QUEUE_PER_PORT 16 > + > +#define RTE_LOGTYPE_L2FWD RTE_LOGTYPE_USER1 IMO, Application does not need log type, normal printf will be enough as it is not a subsystem. > + > +#define RTE_TEST_RX_DESC_DEFAULT 1024 > +#define RTE_TEST_TX_DESC_DEFAULT 1024 > + > +/* Per-port statistics struct */ > +struct l2fwd_port_statistics { > + uint64_t dropped; > + uint64_t tx; > + uint64_t rx; > +} __rte_cache_aligned; > + > +void print_stats(void); > + > +#endif /* __L2FWD_COMMON_H__ */ > diff --git a/examples/l2fwd-event/main.c b/examples/l2fwd-event/main.c > new file mode 100644 > index 000000000..cc47fa203 > --- /dev/null > +++ b/examples/l2fwd-event/main.c > @@ -0,0 +1,737 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(C) 2019 Marvell International Ltd. > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include Sort in alphabetical order. > + > +#include "l2fwd_common.h" > + > +static volatile bool force_quit; > + > +/* MAC updating enabled by default */ > +static int mac_updating = 1; > + > +#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ > +#define MEMPOOL_CACHE_SIZE 256 > + > +/* > + * Configurable number of RX/TX ring descriptors > + */ > +static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; > +static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; > + > +/* ethernet addresses of ports */ > +static struct rte_ether_addr l2fwd_ports_eth_addr[RTE_MAX_ETHPORTS]; > + > +/* mask of enabled ports */ > +static uint32_t l2fwd_enabled_port_mask; > + > +/* list of enabled ports */ > +static uint32_t l2fwd_dst_ports[RTE_MAX_ETHPORTS]; > + > +static unsigned int l2fwd_rx_queue_per_lcore = 1; I think, we move this global variable to structures.