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 81DD1A0096 for ; Thu, 11 Apr 2019 09:18:15 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4017B5B26; Thu, 11 Apr 2019 09:18:15 +0200 (CEST) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10074.outbound.protection.outlook.com [40.107.1.74]) by dpdk.org (Postfix) with ESMTP id AA9C45B26; Thu, 11 Apr 2019 09:18:13 +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=giWGxZgb6oExjRE0EUWyDaYW+S6nfqaj/VZqt+MWxDM=; b=vGFFZt3fx/R2ybnqqxj12dwzvfKZ3ezE3yAJ+convaYalYb0ACwYXluEgJPF9gzK0ufMABsTDR4LBRyCmVY5tEzLD3KKXvQN3EaCH5z+muRe6ov0hrKIGodEqsRuYoiuc0feTton/DPke86vtScPvrm+DvRfipGjjH1kUZfm+j8= Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) by DB3PR0502MB3945.eurprd05.prod.outlook.com (52.134.65.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1792.16; Thu, 11 Apr 2019 07:18:12 +0000 Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::6072:43be:7c2d:103a]) by DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::6072:43be:7c2d:103a%3]) with mapi id 15.20.1792.009; Thu, 11 Apr 2019 07:18:12 +0000 From: Yongseok Koh To: "Burakov, Anatoly" , Bruce Richardson CC: dev , dpdk stable Thread-Topic: [PATCH v2] examples/multi_process: fix buffer underrun Thread-Index: AQHU8Da411FDqHurFkOdISqM6sv5OA== Date: Thu, 11 Apr 2019 07:18:12 +0000 Message-ID: <2BF52021-45E5-4E8B-A98F-AEF2EDC1C25E@mellanox.com> References: <20190409225937.9269-1-yskoh@mellanox.com> <20190410194154.43758-1-yskoh@mellanox.com> In-Reply-To: <20190410194154.43758-1-yskoh@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: [69.181.245.183] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2e0009f2-66f9-48ac-6db2-08d6be4ddb90 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600139)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:DB3PR0502MB3945; x-ms-traffictypediagnostic: DB3PR0502MB3945: x-microsoft-antispam-prvs: x-forefront-prvs: 00046D390F x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(346002)(366004)(136003)(39860400002)(376002)(189003)(199004)(3846002)(110136005)(97736004)(54906003)(76176011)(305945005)(7736002)(5660300002)(82746002)(6116002)(33656002)(71190400001)(71200400001)(83716004)(66066001)(99286004)(6512007)(68736007)(316002)(81156014)(86362001)(8936002)(8676002)(81166006)(2906002)(14454004)(53936002)(36756003)(53546011)(256004)(102836004)(4326008)(6506007)(6246003)(25786009)(486006)(2616005)(476003)(106356001)(478600001)(105586002)(11346002)(186003)(446003)(6436002)(6486002)(229853002)(26005); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB3945; H:DB3PR0502MB3980.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: sMXjFXOZrsE9swraBcjqDOZOvLfKNQdFIiD3x0JehKvb+fvuGW+yUN+EFPO1hQ+zw8sh31IYk+4GbWahCdYg15YEjufA1RmODVO/lJWLJQnYNDrUB+FQ9pfA4K12nu54GVoyHTG/1SydKwuGhAbuKag7q012/Tw5QBFtdeP4tXoUxV7D53TYcAixXwtpU23qQsuKK0uHKZEHefQNjHPzLLUYMFHrc1sgEkIk0HLxpVaYW8qAL74IdcIFuOqQfLLqkFvPKuk0rxVhb5IyjcLOlAmnwyCxk742IRfk5p5Y9nTSvRL13iscKLufrTclCZ+pMBithL35FwtNRVnE27sxdUs+BZ66qP9AoY6B3KRuNicrvqHf+/m7jFWWQRPDEBBBIe53zDhcANy0HUILd9H44fkf90yiGKo47k8m2lxZK5k= Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2e0009f2-66f9-48ac-6db2-08d6be4ddb90 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Apr 2019 07:18:12.3287 (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: DB3PR0502MB3945 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 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 Sorry, I forgot to specify 'v2' in the title of this email. Thanks, Yongseok > 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/e= xamples/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 it > * seems faster to use a cache instead */ > --=20 > 2.11.0 >=20