From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH] rte_sched: release enqueued mbufs on rte_sched_port_free() Date: Wed, 4 Nov 2015 10:14:26 -0800 Message-ID: <20151104101426.2f771b45@xeon-e3> References: <20151028105633.6a507c98@miho> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: Simon Kagstrom Return-path: Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by dpdk.org (Postfix) with ESMTP id 4EDB68E91 for ; Wed, 4 Nov 2015 19:14:16 +0100 (CET) Received: by pacdm15 with SMTP id dm15so35410343pac.3 for ; Wed, 04 Nov 2015 10:14:15 -0800 (PST) In-Reply-To: <20151028105633.6a507c98@miho> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, 28 Oct 2015 10:56:33 +0100 Simon Kagstrom wrote: > Otherwise mbufs will leak when the port is destroyed. The > rte_sched_port_qbase() and rte_sched_port_qsize() functions are used > in free now, so move them up. > > Signed-off-by: Simon Kagstrom Overall it looks good, and fixes a long standing bug. Maybe good to expose it as a API function rte_sched_port_flush to allow use from applications. > +static inline struct rte_mbuf ** > +rte_sched_port_qbase(struct rte_sched_port *port, uint32_t qindex) > +{ > + uint32_t pindex = qindex >> 4; > + uint32_t qpos = qindex & 0xF; > + > + return (port->queue_array + pindex * port->qsize_sum + port->qsize_add[qpos]); Please long expression over 80 characters onto multiple lines. > static int > rte_sched_port_check_params(struct rte_sched_port_params *params) > { > @@ -717,11 +734,21 @@ rte_sched_port_config(struct rte_sched_port_params *params) > void > rte_sched_port_free(struct rte_sched_port *port) > { > + unsigned int queue; > /* Check user parameters */ > if (port == NULL){ > return; > } Please add blank line after declaration. Ps: the rte_sched needs to be run through a reformatter. lots of whitespace issues.