From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id A5EEBA0679 for ; Tue, 30 Apr 2019 20:01:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 30D25293B; Tue, 30 Apr 2019 20:01:12 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80075.outbound.protection.outlook.com [40.107.8.75]) by dpdk.org (Postfix) with ESMTP id E9FED293B; Tue, 30 Apr 2019 20:01:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6hfkBFq2ue3PBgUY4vUXPuaXNeyfeIiUIJTlC368YwE=; b=WZ6A+WbxkThA+BQSOUB6kF5aQoyQDl3z+GItQTCwoYQaWgJj59+W044JsvsQ4qmOiXAvFIURL0m7GIuPedHA/taH5T3UZp1JEMsbCJpBhNi+CaNJkvWdiMqs4gq4uoDK+sh538gel35c7Dnfz43UZe1y9Bf5OJRS2ahEARtI3AM= Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) by DB3PR0502MB4009.eurprd05.prod.outlook.com (52.134.72.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1835.13; Tue, 30 Apr 2019 18:01:09 +0000 Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::e8d5:4aff:902d:6e98]) by DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::e8d5:4aff:902d:6e98%5]) with mapi id 15.20.1856.008; Tue, 30 Apr 2019 18:01:07 +0000 From: Yongseok Koh To: "Burakov, Anatoly" , Bruce Richardson , Thomas Monjalon CC: dev , dpdk stable Thread-Topic: [dpdk-stable] [PATCH v2] examples/multi_process: fix buffer underrun Thread-Index: AQHU/36u092ulAPUa0a9lt7bqD5ClQ== Date: Tue, 30 Apr 2019 18:01:06 +0000 Message-ID: <4CD96011-26C5-438E-B962-BBFE4F16EB0D@mellanox.com> References: <20190409225937.9269-1-yskoh@mellanox.com> <20190410194154.43758-1-yskoh@mellanox.com> <2BF52021-45E5-4E8B-A98F-AEF2EDC1C25E@mellanox.com> In-Reply-To: <2BF52021-45E5-4E8B-A98F-AEF2EDC1C25E@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; x-originating-ip: [209.116.155.178] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f70c97e3-6284-47ca-d670-08d6cd95d1cf x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:DB3PR0502MB4009; x-ms-traffictypediagnostic: DB3PR0502MB4009: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3826; x-forefront-prvs: 00235A1EEF x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(366004)(396003)(136003)(346002)(199004)(189003)(102836004)(97736004)(99286004)(4326008)(305945005)(5660300002)(6512007)(53546011)(33656002)(7736002)(25786009)(6506007)(82746002)(53936002)(6246003)(68736007)(478600001)(229853002)(26005)(76176011)(316002)(86362001)(186003)(6436002)(256004)(36756003)(3846002)(6116002)(8936002)(110136005)(66946007)(71190400001)(446003)(76116006)(2906002)(81156014)(476003)(83716004)(66066001)(64756008)(54906003)(66476007)(73956011)(66556008)(91956017)(81166006)(11346002)(71200400001)(14454004)(6486002)(2616005)(66446008)(486006); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB4009; H:DB3PR0502MB3980.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 0R6jnThmWweDoKDiU4oLKnf7HPn3GqsUSuci+luyqaIQ2Zb72h+frQSaqL2vuZmQaPQLgHFyP2CdY5qygxTzNMGKah27ZMvFs2wIJHPJr630sIRpOaX+hg2k3dIEy1prN7vESFfTq1Q5fXL6ShXWTduF5xvCWt/JrG+pWl7+6IaaoJQ+um+ReyrRCZk9jLdfCjRZrNwVX+fMTm7B2z869pLtNvIH9yceC4N3yXXPghhGiGbdZDFC6IqZX+eMBg44WM0tfds2sXR730PW1ER+OLk9eiDLW39Wxovc+pf30NSP9z+AkjXilKF5mYdZWcep+uAIlRExbClvvdrvgFBIuh9Jm8r8h8O3GrDDzvDidLNvOa18W9shmVrOB+a2mBdzmJ3SOEt3M4hcMHUBBdipZ7cbpv2De/xNm9LRLV3hMP4= Content-Type: text/plain; charset="us-ascii" Content-ID: <40235786C2021844B778415285B18A5D@eurprd05.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: f70c97e3-6284-47ca-d670-08d6cd95d1cf X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Apr 2019 18:01:06.6239 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0502MB4009 Subject: Re: [dpdk-stable] [PATCH v2] examples/multi_process: fix buffer underrun X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" > On Apr 11, 2019, at 12:18 AM, Yongseok Koh wrote: >=20 >> On Apr 10, 2019, at 12:41 PM, Yongseok Koh wrote: >>=20 >> For client_server_mp, the total number of buffers for the mbuf mempool >> should be correctly calculated. Otherwise, having more clients will stop >> traffic. >>=20 >> Fixes: af75078fece3 ("first public release") >> Cc: stable@dpdk.org >>=20 >> Signed-off-by: Yongseok Koh >> --- >>=20 >> v2: >> * split up the calculation >=20 > Sorry, I forgot to specify 'v2' in the title of this email. No ack? No merge? Yongseok >=20 >> examples/multi_process/client_server_mp/mp_server/init.c | 13 +++++++++-= --- >> 1 file changed, 9 insertions(+), 4 deletions(-) >>=20 >> diff --git a/examples/multi_process/client_server_mp/mp_server/init.c b/= examples/multi_process/client_server_mp/mp_server/init.c >> index 30c8e44bc0..3af5dc6994 100644 >> --- a/examples/multi_process/client_server_mp/mp_server/init.c >> +++ b/examples/multi_process/client_server_mp/mp_server/init.c >> @@ -37,8 +37,6 @@ >> #include "args.h" >> #include "init.h" >>=20 >> -#define MBUFS_PER_CLIENT 1536 >> -#define MBUFS_PER_PORT 1536 >> #define MBUF_CACHE_SIZE 512 >>=20 >> #define RTE_MP_RX_DESC_DEFAULT 1024 >> @@ -63,8 +61,15 @@ struct port_info *ports; >> static int >> init_mbuf_pools(void) >> { >> - const unsigned num_mbufs =3D (num_clients * MBUFS_PER_CLIENT) \ >> - + (ports->num_ports * MBUFS_PER_PORT); >> + const unsigned int num_mbufs_server =3D >> + RTE_MP_RX_DESC_DEFAULT * ports->num_ports; >> + const unsigned int num_mbufs_client =3D >> + num_clients * (CLIENT_QUEUE_RINGSIZE + >> + RTE_MP_TX_DESC_DEFAULT * ports->num_ports); >> + const unsigned int num_mbufs_mp_cache =3D >> + (num_clients + 1) * MBUF_CACHE_SIZE; >> + const unsigned int num_mbufs =3D >> + num_mbufs_server + num_mbufs_client + num_mbufs_mp_cache; >>=20 >> /* don't pass single-producer/single-consumer flags to mbuf create as i= t >> * seems faster to use a cache instead */ >> --=20 >> 2.11.0 >>=20 >=20