From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber_org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=hIIAHo7C54Jmy9LpNdRYOMwH7fVpUgiYiSsyMZ7tl3Y=; b=qDrl3qee2fZ7pAkzTpFyFMHxyxlCWj1bcrkQSClHNueB2hh/23OuVQYoCWRji8PJV1 ps44c/CWEMQRdkjQEjhhCwZU7Joz2ik9484tR1OBbPhj4rbwzAc9Su80jmEWjBdklmVG kSrmxT7zEateLA6AqkbJy7j2QOR7RV4R0rf561tdmcQI3coCUdwXjQgQWzpgDDUf3knV Hb/7U33YOBlZ+4HUCFMcniR/CxKaaI8ZTlDMNKvGvbYkER8/dehA+o1eebBRQ7mX/kHV fexEBaYZZlvSUFHpqEQ11QDsTSY8d8eUT2nevpCIrHHWszSBi5PAhyV5K8wEPaJwj5ca 7E4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=hIIAHo7C54Jmy9LpNdRYOMwH7fVpUgiYiSsyMZ7tl3Y=; b=BMvUo+NCTkBruHGdIgZhkiNo0IujTPQbshmRpskpt9A7raKQBLqxSrJXjSdRfA19uk 8/JhlSrY8PtQ2J3qa+mxCNH/uGzk8g3yh4gg781nOfmPkNazhgKxXGqcxZyq8BpFPd79 a28TQKUq5BMUDrnr+4It2s1KCov7eJ4Gn/7McEl72QCN6tUY9t8zwQjhkxHBnlkxkdbg QEFDJaCRk9mUr3RYu6J0wn9qwsorp/WgwPdjw1U/99ejRCj+qoQ467mA1ICEPZwkRJob yZeipjXtuyoK4eEzMt8YAG+ojj0FuLOdb2NBEKJMfrDzbSRbS/bDReW04ZfNMWECvbbf gRtQ== X-Gm-Message-State: ALoCoQlo7hjoOALLaYkX2Ovq2XWee9Ws2e/c00Sye5X59jIL+3U0SkuTmo+P1Hld1bj02mDYyBwP X-Received: by 10.66.147.67 with SMTP id ti3mr3452129pab.146.1446660855625; Wed, 04 Nov 2015 10:14:15 -0800 (PST) Received: from xeon-e3 (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by smtp.gmail.com with ESMTPSA id ck9sm3288874pad.28.2015.11.04.10.14.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Nov 2015 10:14:15 -0800 (PST) Date: Wed, 4 Nov 2015 10:14:26 -0800 From: Stephen Hemminger To: Simon Kagstrom Message-ID: <20151104101426.2f771b45@xeon-e3> In-Reply-To: <20151028105633.6a507c98@miho> References: <20151028105633.6a507c98@miho> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] rte_sched: release enqueued mbufs on rte_sched_port_free() 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: Wed, 04 Nov 2015 18:14:16 -0000 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.