From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-180.mta1.migadu.com (out-180.mta1.migadu.com [95.215.58.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2FBFC27E1D7 for ; Thu, 25 Jun 2026 02:47:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782355643; cv=none; b=gXwaVZdfFudAbURzvjT8X3RAkGuayAKHXvOg7DXMvtxWCgG8EU+BY1EJGiOIbizRAFOHjgVidZ/sBTV+8389XW1v0op/fCORf+yfZ3nU0QcmALuUeUtLv37oZRmtk6VFJAjoNNFf14azR1fbGQdA1CXNKH2xytT/8f9JQv/BbYg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782355643; c=relaxed/simple; bh=ekZ5hEH2mFMqQume6ySdjrLotZSjBf5heSdddEZljjg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=h8CvAiNZIw/8wOYZZAD8Vjm/9MftV6DbhNLt8FDO7CUJoKGq6hZPYA6GzZ5SLls1bk53y55d/3IR6cJ4YAVb9p23ItxJ3yFUKsecRLB4a2m3vXwLLc2jyA1Wjo1WGfOC46Wb60s+ehUqxA03Q4WvjGyUqMdo7sAC09Wl/g+NEMI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=eLByWqDB; arc=none smtp.client-ip=95.215.58.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="eLByWqDB" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1782355640; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OcvEdPoWwW8h6fIjkmybDFsWwjAoRy7aNjzn3vle93k=; b=eLByWqDB0l83nQU3jBECHR+LKGMHZ0Bw5Lux0p1+5KL/IwN2ugtwMNg0+w9LEhRJlD6OFN zhZFY3ayeN3ujdnvhJkwE29K8uQ8O3BGN4AkomTSBkwT6UZ4+WADS+zJU0YUfocuiClu/t dnIsV+vAW2ufGBOfMOvzjPzzYMjHMMM= Date: Thu, 25 Jun 2026 10:47:07 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH bpf-next v7 07/11] bpftool: Generate skeleton for global percpu data Content-Language: en-US To: Andrii Nakryiko Cc: bpf@vger.kernel.org, Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Kumar Kartikeya Dwivedi , Song Liu , Yonghong Song , Jiri Olsa , John Fastabend , Quentin Monnet , Shuah Khan , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kernel-patches-bot@fb.com References: <20260622143557.22955-1-leon.hwang@linux.dev> <20260622143557.22955-8-leon.hwang@linux.dev> <2330e6a8-c7eb-4296-8aa0-feaafd6b09cf@linux.dev> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Leon Hwang In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT On 25/6/26 00:47, Andrii Nakryiko wrote: > On Tue, Jun 23, 2026 at 9:15 PM Leon Hwang wrote: >> >> Makes sense. >> >> With adding the helper bpf_map_is_skel_data(), will this change looks >> more readable? >> >> >> +static bool bpf_map_is_skel_data(const struct bpf_map *map) >> +{ >> + return bpf_map__is_internal(map) && >> + ((bpf_map__map_flags(map) & BPF_F_MMAPABLE) || >> + bpf_map__type(map) == BPF_MAP_TYPE_PERCPU_ARRAY); > > if (!bpf_map__is_internal(map)) > return false; > > return (bpf_map__map_flags(map) & BPF_F_MMAPABLE) || > bpf_map__type(map) == BPF_MAP_TYPE_PERCPU_ARRAY; > > or just split that last return into two if (...) return true); > Will follow your suggestion, and use two if (...) return true. Thanks, Leon > both work for me > >> [...]