From patchwork Thu Sep 19 09:23:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khalid Elmously X-Patchwork-Id: 1164482 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46YryL33D1z9sPM; Thu, 19 Sep 2019 19:24:09 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1iAsfT-0004bl-5m; Thu, 19 Sep 2019 09:24:03 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iAsfQ-0004al-91 for kernel-team@lists.ubuntu.com; Thu, 19 Sep 2019 09:24:00 +0000 Received: from mail-io1-f70.google.com ([209.85.166.70]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iAsfP-0001E5-V0 for kernel-team@lists.ubuntu.com; Thu, 19 Sep 2019 09:24:00 +0000 Received: by mail-io1-f70.google.com with SMTP id q1so4252059ios.14 for ; Thu, 19 Sep 2019 02:23:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=pywbk43qDIFV9K47XVq+sO//hIy/GrovRzn2dyO4fUY=; b=HACoy8tSNm/dZ/JgmLXdfbqr2GQSVQu5iN8+qybBQX3HTx4V8G5O/jdC4eDBW6JjW6 kac7FjG1jvuXwpDVYq8FD4DcgMlNlAuqTv1XVV1dXfCkQg2QNpfkcL/iOWtbuTCk7x/5 Io1SNbWUIwaPPZfKo+e4coZcBDLsKHSpbT1jFYKJ7jTxTUAQW8y/3yXokD+4PvlVwlrc pXXm5MP0D6Z1A7aZfpzIXuRCOC1Ey0iT73k83fAFQive6OY3gP9jp3/o/TxPLxX3PUjk wkJSOZBNCE9TjnkszlJVjlpSG6wHXvWRtoTLHCi6IA6nRU/zvlhmNf1/ekYY2dN3ssqM kU7g== X-Gm-Message-State: APjAAAUx42jX1H5cYdurNicySnUpQ2x24DETIeINx/IrT+qTLHBwHnRw 5W9kO6uMFe9xIWxNoTj/CSW2nEPVfsfBdXPKswRoSslZGup4Brt8PA0VRykGgLD+gwHUgJ5sepl UuQNTvdSU042Q8FxZREe2HYDsoTofAPAdeOJ7gpzYQA== X-Received: by 2002:a6b:b4c7:: with SMTP id d190mr7520874iof.209.1568885038869; Thu, 19 Sep 2019 02:23:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqxJNAWvTLRZGJE9d3JLdP+WTnFv7U3AsUGOa5o753YmsL4rSolr7IdxGd330Y8Drc9hx03I6Q== X-Received: by 2002:a6b:b4c7:: with SMTP id d190mr7520858iof.209.1568885038677; Thu, 19 Sep 2019 02:23:58 -0700 (PDT) Received: from kbuntu2.fuzzbuzz.org (dhcp-24-53-242-107.cable.user.start.ca. [24.53.242.107]) by smtp.gmail.com with ESMTPSA id d9sm798937ioq.9.2019.09.19.02.23.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Sep 2019 02:23:58 -0700 (PDT) From: Khalid Elmously To: kernel-team@lists.ubuntu.com Subject: [SRU][Xenial/gcp][PATCH 1/11] cpumask: make cpumask_next_wrap available without smp Date: Thu, 19 Sep 2019 05:23:43 -0400 Message-Id: <20190919092353.29993-2-khalid.elmously@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190919092353.29993-1-khalid.elmously@canonical.com> References: <20190919092353.29993-1-khalid.elmously@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Willem de Bruijn BugLink: https://bugs.launchpad.net/bugs/1810457 The kbuild robot shows build failure on machines without CONFIG_SMP: drivers/net/virtio_net.c:1916:10: error: implicit declaration of function 'cpumask_next_wrap' cpumask_next_wrap is exported from lib/cpumask.o, which has lib-$(CONFIG_SMP) += cpumask.o same as other functions, also define it as static inline in the NR_CPUS==1 branch in include/linux/cpumask.h. If wrap is true and next == start, return nr_cpumask_bits, or 1. Else wrap across the range of valid cpus, here [0]. Fixes: 2ca653d607ce ("virtio_net: Stripe queue affinities across cores.") Signed-off-by: Willem de Bruijn Tested-by: Krzysztof Kozlowski Signed-off-by: David S. Miller (cherry picked from commit 9af18e56d43ca4864ce65c3542c513827c2697de) Signed-off-by: Marcelo Henrique Cerri Signed-off-by: Khalid Elmously --- include/linux/cpumask.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 09b8d8aaa35f..e8ab8e941b91 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h @@ -154,6 +154,13 @@ static inline unsigned int cpumask_next_and(int n, return n+1; } +static inline unsigned int cpumask_next_wrap(int n, const struct cpumask *mask, + int start, bool wrap) +{ + /* cpu0 unless stop condition, wrap and at cpu0, then nr_cpumask_bits */ + return (wrap && n == 0); +} + /* cpu must be a valid cpu, ie 0, so there's no other choice. */ static inline unsigned int cpumask_any_but(const struct cpumask *mask, unsigned int cpu)