Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp875908pxb; Thu, 26 Aug 2021 17:29:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIiK7+4mPYrbA75CaKBt4mzIgJBvTNT+bzwUUUqDcD9Atv0DpbFYFoO2OegLl22CCb6yQR X-Received: by 2002:a05:6e02:531:: with SMTP id h17mr4611642ils.288.1630024163211; Thu, 26 Aug 2021 17:29:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630024163; cv=none; d=google.com; s=arc-20160816; b=0ClUFP4NzYF9PZZRo504fnpAP4UWgL+TkG5ftD6Y4j08i2IhmX7nOA7iPbkCoqS+yT HfAWT33yABpsOq16J59H4jIO09kPiiezDYCukw00x1BsRgP4OII1DMToeToyT1HU6/Aj LhY0M2UzFsPAKcJSYKMeGORyGjIXD6dt1VoGlkPzSGb5hUu4wH3fsNSj8KyF9bLv4crq XaVTaXlDPOx1Yz6StamWVmBtj8iczI1MvpcfXJHeJUEB1B6h6x9pQg+xUuTmmmhZEaQm gTyuxnldq3NL9gsX8RGOa6HMqz0gFEdR27TWhGeDilsZQgikU9Aac770tJ62+ZTaOMc4 IQ4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=pnwBhL+bIRZ+1AujOyithEsycI0iSDtmHs6X+/x+Fhc=; b=A5uTrE0XATonlsEakKvUUfv1ROlhCqvZfkXhxS7mjUerBl7DZuxvxCSn8wCs9TLyK5 6P7t+BOt7rvlu/T/K6RKmZcaXz6lWXWOdwIlXmM7Ev0SlwtPLc4JpD5+3ytq+gEfpBOp inXLhc9V4ubZniMGFXii2nXUJLTWC3uOjey+ldyuy7TAM1edRxuPqAf5vuu+KgGHbz7W 5tj98lPvQtQxiQsTUmaOBaI3DGAUqtrzQHEnDVkiLOz+elD1i7cBg74e6IzAJbfBxJ9H yWvV7YDBuWglpZ4HBI5Y4WRzgTXge0jrx1xCY1NEeQZUg57lGEnCFSuUkJY22QPtrkiF JGhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sBP1y9Og; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k10si77945iof.8.2021.08.26.17.28.59; Thu, 26 Aug 2021 17:29:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sBP1y9Og; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243811AbhH0A1Y (ORCPT + 99 others); Thu, 26 Aug 2021 20:27:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229563AbhH0A1W (ORCPT ); Thu, 26 Aug 2021 20:27:22 -0400 Received: from mail-oo1-xc2b.google.com (mail-oo1-xc2b.google.com [IPv6:2607:f8b0:4864:20::c2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 844A8C061757; Thu, 26 Aug 2021 17:26:34 -0700 (PDT) Received: by mail-oo1-xc2b.google.com with SMTP id s21-20020a4ae495000000b0028e499b5921so1496527oov.12; Thu, 26 Aug 2021 17:26:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pnwBhL+bIRZ+1AujOyithEsycI0iSDtmHs6X+/x+Fhc=; b=sBP1y9OgvieB5CccQH32mPE+X+ashq9FrlnUIlsj20FzDRksOusy3AEq18QQTjGlTN j7HCMqzoDTKGUfxl+NjSTSPWAUvFySjZO2ED4rFuZfmfE1hI6G1UxrJ+xMKI6/Q8ot8S Sm1unDbFtNAXi53kHjGwYPwHpcpv93aMMdzCexVagDs0dEy6PmXV9BWlHWVWJrBKn2Jn EnWBCmWzEhsA6E9EqeyVzjiW0afuEbMkhoV+ivtaNJW8PaDxbtZr/xwdBRfdeY0D/S86 HUhj6QWPmCd3lNBSskZ67qX+MG9QVqCHfVaCI+HGe84L3JR3YSDQtuQ4mlLI5azhbI50 YxGw== 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=pnwBhL+bIRZ+1AujOyithEsycI0iSDtmHs6X+/x+Fhc=; b=anoBQSwBHflfgaX5kbSsRaRh8R8BeVqXiXb4x4iYuc8xYtG0L8w1oCTv1xHGxmu3Qt kQe9pRDk3DaGpmqTW4m2nlxtM1REdN8u7tYRtiyFSglIzZ1jkb3zsAPESIsq7FqJIWx6 tL+/R06izYrKoBxVnSTW/cAj2U+3g4G19AhWuT6fcbR+OPQsvMTlt7T6M3RjyZIkhWb7 okPVqdYpMJXh1C92KUVBsiAcMwBANHq73LdIgQvrRNdoaawUy0+7jXMZGFdOmi/JLxuf WRbV5jKLFU80G8hVjJFQVhYTaa5WHMV4AbSxDBfJMlKTD4CdkE68oXC70KT8OZpSpAEm 8afw== X-Gm-Message-State: AOAM533nl1W1cUWdj+RqXLYZj5iNBot4iYN9x9WhxA9lbDFE18rxiT+P pinFXA/jQdyhDLRiGEcynbqS1syPYEekixKuhU+KVyT+sY1eNsQH X-Received: by 2002:a4a:5742:: with SMTP id u63mr5507687ooa.87.1630023993563; Thu, 26 Aug 2021 17:26:33 -0700 (PDT) MIME-Version: 1.0 References: <20210826141623.8151-1-kerneljasonxing@gmail.com> <00890ff4-3264-337a-19cc-521a6434d1d0@gmail.com> <860ead37-87f4-22fa-e4f3-5cadd0f2c85c@intel.com> In-Reply-To: From: Jason Xing Date: Fri, 27 Aug 2021 08:25:57 +0800 Message-ID: Subject: Re: [PATCH v4] ixgbe: let the xdpdrv work with more than 64 cpus To: Eric Dumazet Cc: Jesse Brandeburg , "Nguyen, Anthony L" , David Miller , kuba@kernel.org, ast@kernel.org, daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, kpsingh@kernel.org, intel-wired-lan@lists.osuosl.org, netdev , LKML , bpf@vger.kernel.org, Jason Xing , Shujin Li Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 27, 2021 at 2:19 AM Eric Dumazet wrote: > > > > On 8/26/21 10:03 AM, Jason Xing wrote: > > > > > Honestly, I'm a little confused right now. @nr_cpu_ids is the fixed > > number which means the total number of cpus the machine has. > > I think, using @nr_cpu_ids is safe one way or the other regardless of > > whether the cpu goes offline or not. What do you think? > > > > More exactly, nr_cpu_ids is the max number cpu id can reach, > even in presence of holes. > > I think that most/many num_online_cpus() in drivers/net are simply broken > and should be replaced by nr_cpu_ids. > Thank you, Eric, really. I nearly made a terrible mistake. > The assumptions of cpus being nicely numbered from [0 to X-1], > with X==num_online_cpus() is wrong. > > Same remark for num_possible_cpus(), see commit > 88d4f0db7fa8 ("perf: Fix alloc_callchain_buffers()") for reference.