From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Fastabend Subject: Re: "lockless" qdisc breaks tx_queue_len change too? Date: Wed, 3 Jan 2018 10:09:22 -0800 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Linux Kernel Network Developers To: Cong Wang Return-path: Received: from mail-pg0-f48.google.com ([74.125.83.48]:46981 "EHLO mail-pg0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750938AbeACSJe (ORCPT ); Wed, 3 Jan 2018 13:09:34 -0500 Received: by mail-pg0-f48.google.com with SMTP id r2so966408pgq.13 for ; Wed, 03 Jan 2018 10:09:33 -0800 (PST) In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 01/02/2018 08:41 PM, Cong Wang wrote: > Hi, John > > While reviewing your ptr_ring fix again today, it looks like your > "lockless" qdisc patchset breaks dev->tx_queue_len behavior. > > Before your patchset, dev->tx_queue_len is merely an integer to read, > after your patchset, the skb array has to be resized when > dev->tx_queue_len changes, but I don't see any qdisc code handles > this... > > Also, because of that, I doubt __skb_array_empty() in > pfifo_fast_dequeue() can be safe any more even with your ptr_ring fix. > > What am I missing? > I dropped support for tx_queue_len changes after qdisc has been created. The only check is at init time when building the qdisc. Before this series teql and pfifo_fast were the only qdiscs that used tx_queue_len other qdiscs used other mechanisms or copied tx_queue_len at init time. So the API is inconsistent. OK, but arguably its kAPI now and needs to be supported on live qdiscs. So couple options drop the __skb_array_empty() check, stop supporting changes on running qdiscs, or do a qdisc swap with the new array. I'm tempted to make the qdisc swap work, still need benchmarks I guess without the empty check. Either way to get it working we need a callback from tx_queue_len code paths. Unfortunately, I guess someone somewhere probably uses pfifo_fast and changes there queue length with a script after creating the qdisc and expects it to work. > Thanks. >