From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id CD52DA0567;
	Fri, 13 Mar 2020 04:07:48 +0100 (CET)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 062181C010;
	Fri, 13 Mar 2020 04:07:48 +0100 (CET)
Received: from mga03.intel.com (mga03.intel.com [134.134.136.65])
 by dpdk.org (Postfix) with ESMTP id 2D1E11C00F;
 Fri, 13 Mar 2020 04:07:44 +0100 (CET)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from orsmga001.jf.intel.com ([10.7.209.18])
 by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 12 Mar 2020 20:07:43 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.70,546,1574150400"; d="scan'208";a="322672258"
Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206])
 by orsmga001.jf.intel.com with ESMTP; 12 Mar 2020 20:07:43 -0700
Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by
 FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS)
 id 14.3.439.0; Thu, 12 Mar 2020 20:07:42 -0700
Received: from cdsmsx151.ccr.corp.intel.com (172.17.4.38) by
 FMSMSX102.amr.corp.intel.com (10.18.124.200) with Microsoft SMTP Server (TLS)
 id 14.3.439.0; Thu, 12 Mar 2020 20:07:42 -0700
Received: from cdsmsx102.ccr.corp.intel.com ([169.254.2.134]) by
 CDSMSX151.ccr.corp.intel.com ([169.254.3.50]) with mapi id 14.03.0439.000;
 Fri, 13 Mar 2020 11:07:41 +0800
From: "Jiang, MaoX" <maox.jiang@intel.com>
To: "Kilheeney, Louise" <louise.kilheeney@intel.com>, "dev@dpdk.org"
 <dev@dpdk.org>
CC: "Kilheeney, Louise" <louise.kilheeney@intel.com>, "stable@dpdk.org"
 <stable@dpdk.org>
Thread-Topic: [dpdk-stable] [PATCH] examples/l2fwd-keepalive: fix packet
 drops	limited mbufs
Thread-Index: AQHV951i+17M3V/hrkKkO37SSt2t+ahF2OPg
Date: Fri, 13 Mar 2020 03:07:40 +0000
Message-ID: <79BEEF5375D8C04B84B9FF07CBE5ED8716510C87@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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

Tested-by:xix.zhang@intel.com

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 <louise.kilheeney@intel.com>; 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 <louise.kilheeney@intel.com>
> ---
>  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