From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 371C1B62 for ; Mon, 7 Nov 2016 17:03:11 +0100 (CET) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP; 07 Nov 2016 08:03:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,606,1473145200"; d="scan'208";a="28627394" Received: from irsmsx152.ger.corp.intel.com ([163.33.192.66]) by orsmga004.jf.intel.com with ESMTP; 07 Nov 2016 08:03:10 -0800 Received: from irsmsx112.ger.corp.intel.com (10.108.20.5) by IRSMSX152.ger.corp.intel.com (163.33.192.66) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 7 Nov 2016 16:02:32 +0000 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.226]) by irsmsx112.ger.corp.intel.com ([169.254.1.81]) with mapi id 14.03.0248.002; Mon, 7 Nov 2016 16:02:31 +0000 From: "Kulasek, TomaszX" To: Robert Sanford , "dev@dpdk.org" CC: "Doherty, Declan" , "De Lara Guarch, Pablo" , "olivier.matz@6wind.com" Thread-Topic: [dpdk-dev] [PATCH 3/4] net/bonding: another fix to LACP mempool size Thread-Index: AQHR7DWx5GaKzFoGq0qPiKpjIMXZuqDOR/Mw Date: Mon, 7 Nov 2016 16:02:31 +0000 Message-ID: <3042915272161B4EB253DA4D77EB373A14F46B11@IRSMSX102.ger.corp.intel.com> References: <1470084176-79932-1-git-send-email-rsanford@akamai.com> <1470084176-79932-4-git-send-email-rsanford@akamai.com> In-Reply-To: <1470084176-79932-4-git-send-email-rsanford@akamai.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 3/4] net/bonding: another fix to LACP mempool size X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 16:03:12 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Robert Sanford > Sent: Monday, August 1, 2016 22:43 > To: dev@dpdk.org > Cc: Doherty, Declan ; De Lara Guarch, Pablo > ; olivier.matz@6wind.com > Subject: [dpdk-dev] [PATCH 3/4] net/bonding: another fix to LACP mempool > size >=20 > The following log message may appear after a slave is idle (or nearly > idle) for a few minutes: "PMD: Failed to allocate LACP packet from pool". >=20 > Problem: All mbufs from a slave's private pool (used exclusively for > transmitting LACPDUs) have been allocated and are still sitting in the > device's tx descriptor ring and other cores' mempool caches. >=20 > Solution: Ensure that each slaves' tx (LACPDU) mempool owns more than n- > tx-queues * (n-tx-descriptors + per-core-mempool-flush-threshold) mbufs. >=20 > Note that the LACP tx machine function is the only code that allocates > from a slave's private pool. It runs in the context of the interrupt > thread, and thus it has no mempool cache of its own. >=20 > Signed-off-by: Robert Sanford > --- > drivers/net/bonding/rte_eth_bond_8023ad.c | 10 +++++++--- > 1 files changed, 7 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c > b/drivers/net/bonding/rte_eth_bond_8023ad.c > index 2f7ae70..1207896 100644 > --- a/drivers/net/bonding/rte_eth_bond_8023ad.c > +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c > @@ -854,6 +854,8 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev > *bond_dev, uint8_t slave_id) > char mem_name[RTE_ETH_NAME_MAX_LEN]; > int socket_id; > unsigned element_size; > + unsigned cache_size; > + unsigned cache_flushthresh; > uint32_t total_tx_desc; > struct bond_tx_queue *bd_tx_q; > uint16_t q_id; > @@ -890,19 +892,21 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev > *bond_dev, uint8_t slave_id) >=20 > element_size =3D sizeof(struct slow_protocol_frame) + sizeof(struct > rte_mbuf) > + RTE_PKTMBUF_HEADROOM; > + cache_size =3D RTE_MEMPOOL_CACHE_MAX_SIZE >=3D 32 ? > + 32 : RTE_MEMPOOL_CACHE_MAX_SIZE; > + cache_flushthresh =3D RTE_MEMPOOL_CALC_CACHE_FLUSHTHRESH(cache_size); >=20 > /* The size of the mempool should be at least: > * the sum of the TX descriptors + BOND_MODE_8023AX_SLAVE_TX_PKTS */ > total_tx_desc =3D BOND_MODE_8023AX_SLAVE_TX_PKTS; > for (q_id =3D 0; q_id < bond_dev->data->nb_tx_queues; q_id++) { > bd_tx_q =3D (struct bond_tx_queue*)bond_dev->data- > >tx_queues[q_id]; > - total_tx_desc +=3D bd_tx_q->nb_tx_desc; > + total_tx_desc +=3D bd_tx_q->nb_tx_desc + cache_flushthresh; > } >=20 > snprintf(mem_name, RTE_DIM(mem_name), "slave_port%u_pool", > slave_id); > port->mbuf_pool =3D rte_mempool_create(mem_name, > - total_tx_desc, element_size, > - RTE_MEMPOOL_CACHE_MAX_SIZE >=3D 32 ? 32 : > RTE_MEMPOOL_CACHE_MAX_SIZE, > + total_tx_desc, element_size, cache_size, > sizeof(struct rte_pktmbuf_pool_private), rte_pktmbuf_pool_init, > NULL, rte_pktmbuf_init, NULL, socket_id, MEMPOOL_F_NO_SPREAD); >=20 > -- > 1.7.1 Reviewed-by: Tomasz Kulasek