From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-23.2 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21A42C56201 for ; Wed, 18 Nov 2020 21:20:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B1094246B8 for ; Wed, 18 Nov 2020 21:20:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="bHLuk9JK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726739AbgKRVUu (ORCPT ); Wed, 18 Nov 2020 16:20:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726081AbgKRVUr (ORCPT ); Wed, 18 Nov 2020 16:20:47 -0500 Received: from mail-yb1-xb44.google.com (mail-yb1-xb44.google.com [IPv6:2607:f8b0:4864:20::b44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCC18C0613D4 for ; Wed, 18 Nov 2020 13:20:46 -0800 (PST) Received: by mail-yb1-xb44.google.com with SMTP id k65so3084228ybk.5 for ; Wed, 18 Nov 2020 13:20:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KMhQReRtisQCLWwZY0Qya20ywEC4J4hZ6sMiK5oDuY4=; b=bHLuk9JKx8EBpSkdOY8YbM9n4NT/BbU7PTdhbTm345ZcomyOUTN1Hpm45/KNCKOiiF urTGmBIY6mST50d4wjWpnM2Q5rOBxwf4Cc57RIO/VvSUTN8JVhGoIyc2RDt/qXDZIj+C eIyEct5p/U9aJsgb8qk094nTwTNUd2fdZeeWtPejp7nzJq7t6IEug6nusily7srJroUz aR4a53Rk81yxx9CvDbFAT3e8Z7/PTXYlF5HwvJ8X49qn0KUn5mnc3lnQJuAQqYWAlzy/ KU4QmEXjb8Hk+QkFNPWi4otM4RIEixxVKPjN0C0DVpd7Y90mI0jK70EsrRmPnfvgCicI rgWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KMhQReRtisQCLWwZY0Qya20ywEC4J4hZ6sMiK5oDuY4=; b=BiZbjehMSjb+8Ey3Vjl+czL3vYuFEqMKwr7eH2w57faPtOiRaSgQI29hpCWBHH+gSU yM8hD02xViYgWh//NejzwSaCkDs51/IAAVA6P2T0rWBrhJoTHgqPV+2LPh2MxTbtLVNT mPY76qp8egYK90gAAY+9DWGUUEcJcpRv7YSTuAufXhA12gf+HqsA3uIqT/Bf7r4CJtuF C2jKT8oowbtcL7vONucOz/G9wxdzAA+JV0dQ5r5O1JclVfb6cmPB72Nuc9r9xeE2kQCr zv+uHPl9XptzU3wWyFLzyYVxtiRYKd8U24symXRRv79QNNbxkbq/mNfrBarVqgbjhEFh 5VSQ== X-Gm-Message-State: AOAM5324HHd6WZeAb5Xpn9NVLrqoCr3BSDb/CHmt2ISDi98GR1vyLzcO fnV4btJnzH4OOy4VdW+W3H8L5cGPTxdut0c7KJ6fng== X-Google-Smtp-Source: ABdhPJxOhKAndWUtvUdyvc+cR6E0nqhlqukRkNiETzmhN0fs1KUhLKEE9LTtj2j45+o+ZYNAnQWj9w0E8V67xAqcu2M= X-Received: by 2002:a25:a4a1:: with SMTP id g30mr8826381ybi.195.1605734445925; Wed, 18 Nov 2020 13:20:45 -0800 (PST) MIME-Version: 1.0 References: <20201118191009.3406652-1-weiwan@google.com> <20201118191009.3406652-3-weiwan@google.com> <8578cfd8-dcaf-5a86-7803-922ee27d9e90@infradead.org> In-Reply-To: <8578cfd8-dcaf-5a86-7803-922ee27d9e90@infradead.org> From: Wei Wang Date: Wed, 18 Nov 2020 13:20:34 -0800 Message-ID: Subject: Re: [PATCH net-next v3 2/5] net: add sysfs attribute to control napi threaded mode To: Randy Dunlap Cc: David Miller , Jakub Kicinski , Linux Kernel Network Developers , Eric Dumazet , Felix Fietkau , Paolo Abeni , Hannes Frederic Sowa , Hillf Danton Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Nov 18, 2020 at 12:36 PM Randy Dunlap wrote: > > On 11/18/20 11:10 AM, Wei Wang wrote: > > From: Paolo Abeni > > > > this patch adds a new sysfs attribute to the network > > device class. Said attribute is a bitmask that allows controlling > > the threaded mode for all the napi instances of the given > > network device. > > > > The threaded mode can be switched only if related network device > > is down. > > > > Signed-off-by: Paolo Abeni > > Signed-off-by: Hannes Frederic Sowa > > Signed-off-by: Wei Wang > > Reviewed-by: Eric Dumazet > > Hi, > > Could someone describe the bitmask (is it a bit per instance of the > network device?). > And how to use the sysfs interface, please? > It is 1 bit per napi. Depending on the driver implementation, 1 napi could correspond to 1 tx queue, or 1 rx queue, or 1 pair of tx/rx queues. To set bits in the bit mask, you could do: echo 0-14 > /sys/class/net//threaded to set consecutive bits. or: echo 0,2,4,6,8 > /sys/class/net//threaded to set individual bits. To clear the bit mask, you could do: echo > /sys/class/net//threaded > > --- > > net/core/net-sysfs.c | 103 +++++++++++++++++++++++++++++++++++++++++++ > > 1 file changed, 103 insertions(+) > > > > diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c > > index 94fff0700bdd..df8dd25e5e4b 100644 > > --- a/net/core/net-sysfs.c > > +++ b/net/core/net-sysfs.c > > > thanks. > -- > ~Randy >