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 AE8BEA00BE; Mon, 27 Apr 2020 03:44:02 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 51C211C11B; Mon, 27 Apr 2020 03:44:01 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id F3CE21C119; Mon, 27 Apr 2020 03:43:58 +0200 (CEST) IronPort-SDR: Bm9vFk8kBEA27M/xRtygCYx9jIOqJNtMCSghiR/tAVgY1PP4kglrajvmvFa160nps6bbVNsRDP 6Wh8bRyRo0qQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2020 18:43:57 -0700 IronPort-SDR: bBhMSASLoVapSxDHRrlayjnPm7RAa9hgecVYCc5E7ZyClVefiFcEpRZs85r62IPW8gcyf2XOeY GCLM/oghtFeA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,321,1583222400"; d="scan'208";a="366985982" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga001.fm.intel.com with ESMTP; 26 Apr 2020 18:43:56 -0700 Received: from cdsmsx103.ccr.corp.intel.com (172.17.3.37) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 26 Apr 2020 18:43:56 -0700 Received: from cdsmsx102.ccr.corp.intel.com ([169.254.2.104]) by CDSMSX103.ccr.corp.intel.com ([169.254.5.221]) with mapi id 14.03.0439.000; Mon, 27 Apr 2020 09:38:52 +0800 From: "Jiang, MaoX" To: "Kilheeney, Louise" , "dev@dpdk.org" CC: "Kilheeney, Louise" , "stable@dpdk.org" Thread-Topic: [dpdk-stable] [PATCH] examples/l2fwd-keepalive: fix packet drops limited mbufs Thread-Index: AQHV951i+17M3V/hrkKkO37SSt2t+aiMeNMg Date: Mon, 27 Apr 2020 01:38:52 +0000 Message-ID: <79BEEF5375D8C04B84B9FF07CBE5ED871652417C@CDSMSX102.ccr.corp.intel.com> References: <20200311120456.36510-1-louise.kilheeney@intel.com> In-Reply-To: <20200311120456.36510-1-louise.kilheeney@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.17.6.105] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH] examples/l2fwd-keepalive: fix packet drops limited mbufs 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" Tested-by:zhang,xi Best regards, Jiang Mao > -----Original Message----- > From: stable [mailto:stable-bounces@dpdk.org] On Behalf Of Louise > Kilheeney > Sent: Wednesday, March 11, 2020 8:05 PM > To: dev@dpdk.org > Cc: Kilheeney, Louise ; stable@dpdk.org > Subject: [dpdk-stable] [PATCH] examples/l2fwd-keepalive: fix packet drops > limited mbufs >=20 > MBUF pool of size 8192 was causing packet loss when using four ports. To = fix > this issue this patch specifies the number of MBUF's per port instead of > having one set MBUF pool size, this way it will adapt to any number of po= rts. >=20 > Fixes: e64833f2273a ("examples/l2fwd-keepalive: add sample application") >=20 > Cc: stable@dpdk.org >=20 > Signed-off-by: Louise Kilheeney > --- > examples/l2fwd-keepalive/main.c | 17 ++++++++++------- > 1 file changed, 10 insertions(+), 7 deletions(-) >=20 > diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd- > keepalive/main.c index b36834974..0f0010d51 100644 > --- a/examples/l2fwd-keepalive/main.c > +++ b/examples/l2fwd-keepalive/main.c > @@ -44,7 +44,7 @@ >=20 > #define RTE_LOGTYPE_L2FWD RTE_LOGTYPE_USER1 >=20 > -#define NB_MBUF 8192 > +#define NB_MBUF_PER_PORT 3000 >=20 > #define MAX_PKT_BURST 32 > #define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ @@ -561,16 > +561,19 @@ main(int argc, char **argv) > if (ret < 0) > rte_exit(EXIT_FAILURE, "Invalid L2FWD arguments\n"); >=20 > - /* create the mbuf pool */ > - l2fwd_pktmbuf_pool =3D rte_pktmbuf_pool_create("mbuf_pool", > NB_MBUF, 32, > - 0, RTE_MBUF_DEFAULT_BUF_SIZE, rte_socket_id()); > - if (l2fwd_pktmbuf_pool =3D=3D NULL) > - rte_exit(EXIT_FAILURE, "Cannot init mbuf pool\n"); > - > nb_ports =3D rte_eth_dev_count_avail(); > if (nb_ports =3D=3D 0) > rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n"); >=20 > + /* create the mbuf pool */ > + unsigned int total_nb_mbufs =3D NB_MBUF_PER_PORT * nb_ports; > + > + l2fwd_pktmbuf_pool =3D rte_pktmbuf_pool_create("mbuf_pool", > + total_nb_mbufs, 32, 0, > RTE_MBUF_DEFAULT_BUF_SIZE, > + rte_socket_id()); > + if (l2fwd_pktmbuf_pool =3D=3D NULL) > + rte_exit(EXIT_FAILURE, "Cannot init mbuf pool\n"); > + > /* reset l2fwd_dst_ports */ > for (portid =3D 0; portid < RTE_MAX_ETHPORTS; portid++) > l2fwd_dst_ports[portid] =3D 0; > -- > 2.17.1