Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp974172ybh; Tue, 21 Jul 2020 12:30:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIPhB6rsoPTchXp3TrbgT7iuDUpRBiqF8yBKniBQL7S8pXmqwtbFDMiT8GJd33W2C3QjW6 X-Received: by 2002:aa7:da46:: with SMTP id w6mr28536121eds.261.1595359810409; Tue, 21 Jul 2020 12:30:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595359810; cv=none; d=google.com; s=arc-20160816; b=K52m4GXX4P117125Un85pYjZdENsWsJ6Y/45dc6LRzvfkJja8yClMX9w6MXI6OX6/Z o4KjRFHljVV7e6O63JNpu6p99vlWqkLdFz3WG6TpovxxVnfMEnZlLC2zXjK+smlZwjcX 3DFJESSmiTeAH2A2qDeC6S91n3QFmOTilk5URq+eOcgdHdg2a0v+soUdA6VS/+c/pXrA 0F8IObdc7OXDL26dloRYmNs/JHjk13eG5aCQfqbLVizMJX08jE7wARqghNKNR6ip4ak8 sPZV64UMMuRJLoUhE097bix56vM3wBlsQ7dAWyznhBTUsASKsa0QdoRdv73laXmzX/4Z /AEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Gdc7ompz7Y9cqUyclWX2LVzylrZVjLX5sJyGR822OiE=; b=JGHGdRbz54YU/UL5nLH8xyWyDtGXXabheWcrZ3QcIo1M5YanCvSduqEuZnEEppcCPt 8HZbw51J/CFmbnmtve8qjbB/CvVZQbydZro749KIh18T4SrUieBrDJ0/SghHVvl13xZ0 KQs7IxinQ3HEaUPgseLAe/+BUI46AjOkN4X2aM+MXXLxJrxrzA13B5Ww/Sr0rDccMFKU kXwF/RT1BQyo5oAJIowK1HleaoCnbHRKDu7G+C1xAHxW68EaWJCM6q/YYP1C2Y/3wrB9 CqqbgWGCzVrFXWLeefBnAFY9OsJqgLsB4yl51Gv/1EBHgRSqAzLUdbN9TATuZKS9HvOF cQiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ixobYwr9; 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 p10si12021613ejz.219.2020.07.21.12.29.47; Tue, 21 Jul 2020 12:30:10 -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=ixobYwr9; 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 S1730639AbgGUT0z (ORCPT + 99 others); Tue, 21 Jul 2020 15:26:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729497AbgGUT0z (ORCPT ); Tue, 21 Jul 2020 15:26:55 -0400 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B47A6C061794; Tue, 21 Jul 2020 12:26:52 -0700 (PDT) Received: by mail-lj1-x241.google.com with SMTP id h22so25305430lji.9; Tue, 21 Jul 2020 12:26:52 -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=Gdc7ompz7Y9cqUyclWX2LVzylrZVjLX5sJyGR822OiE=; b=ixobYwr9Hu55L7/IMZYbgTVz7Y4ber/W27KFrOwhFgubdTDMcWGsHcwACw/CssFszx Omdb5QzaSlFPrywNGeJJXTQj1b68rYfWzOcVLks90GO/C6Ck8s/UehdRnUdfgNU3oPSd OYk1GeMy43BFaf97qsqO2KS0f/4HUAdMfVQxrL+sqQNGOIIROBaVPy8GKLaTO7Z00spa QJ8aIvCzgLrCtIRrULp9NuMlDsfqGsCZW5OAOPM+CYo1zVA820fVVerhyCKJszf28bjR SjTIHc19Gwt/pn4x4J9rfPzJyCBautvtiJ9BjYbVEA40k+v/ZAMYw6w12dd8uQzN5TD2 jBgA== 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=Gdc7ompz7Y9cqUyclWX2LVzylrZVjLX5sJyGR822OiE=; b=mTCb6KK0mWDDxdlnHhO8HwBC084vxAmu9dfqrD/Wet7ZHJz8y+WTyY7/FzVyh31Zav uk+5Xqln1cgoR9X4L6RJ8KfxA7AQID5UNQLkOT3aBDEwtCg7UjOH3UsihyafZxz4isAL 0Vz9an5Kw1THidUeqeVlWio+ejkiFu1MzIVvDrKyDkL87EgZxjYghVxaNzPDNDlXdAf2 SJTKXA2acOen23Om/pTwuczI/e50s/ZRFMHoJ01LHXrpg+smqdtYYqRQiuhJx63k77Wz 5xWTDbXeKkKkg56vLaCz9tdGiyGU7kVdcNGQL4hEcRlsJw+qCaIXVn70+8jtKbCtrslo twJg== X-Gm-Message-State: AOAM530XdZTLtNTBjte91fHFcP6npQtTaDAozSPwLZopKds8ahSAKVGG 2SffGBpF7IDeykenBtfO7LYGM7IaDwyWtpQqZXM= X-Received: by 2002:a2e:9a4d:: with SMTP id k13mr14223952ljj.283.1595359611149; Tue, 21 Jul 2020 12:26:51 -0700 (PDT) MIME-Version: 1.0 References: <20200720061741.1514673-1-irogers@google.com> In-Reply-To: From: Alexei Starovoitov Date: Tue, 21 Jul 2020 12:26:39 -0700 Message-ID: Subject: Re: [PATCH v2] libbpf bpf_helpers: Use __builtin_offsetof for offsetof To: Andrii Nakryiko Cc: Ian Rogers , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , John Fastabend , KP Singh , Networking , bpf , open list , Stanislav Fomichev Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 19, 2020 at 11:21 PM Andrii Nakryiko wrote: > > On Sun, Jul 19, 2020 at 11:18 PM Ian Rogers wrote: > > > > The non-builtin route for offsetof has a dependency on size_t from > > stdlib.h/stdint.h that is undeclared and may break targets. > > The offsetof macro in bpf_helpers may disable the same macro in other > > headers that have a #ifdef offsetof guard. Rather than add additional > > dependencies improve the offsetof macro declared here to use the > > builtin that is available since llvm 3.7 (the first with a BPF backend). > > > > Signed-off-by: Ian Rogers > > --- > > Acked-by: Andrii Nakryiko Applied. Thanks