From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by mail.toke.dk (Postfix) with ESMTPS id 75D4D9C7C58 for ; Tue, 29 Nov 2022 11:06:13 +0100 (CET) Authentication-Results: mail.toke.dk; dkim=pass (2048-bit key; unprotected) header.d=isovalent-com.20210112.gappssmtp.com header.i=@isovalent-com.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=EQZnEFyV Received: by mail-wr1-x435.google.com with SMTP id x17so21217520wrn.6 for ; Tue, 29 Nov 2022 02:06:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=isovalent-com.20210112.gappssmtp.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=d347PGicPnHnSxrHiUKliUhsEGwWWeTMGutskcoO1f8=; b=EQZnEFyV6mFuWYFQuEzwyqMFNjQs5N9crFahKpo7263Zh2Nd3ZsoGQxxnHwkT7pEen 76EdLhcmC+3Ro6CSIHl13rw7Xhu6djlkChnF//XJGsydrFDOIiMEQy56S17I3xZEuFp7 ZDdICQR0I/7uUIeVP0de6tCQH1LL5uhimWLYHYTvbv6AFPorP1RX5+r3zV19rm9sGXER vnsXA20bG1rvRXfXbY8UIuIhgaZI/BNxv1S3dZDFeHLrn7RTpMHGrrsHueHxh0IKe9s/ xZSUBig4tyAf+xbinrPYxpZqVarHionIOD1W1U1zzgL+oT2p6cbH8Wrya3K+XgVpNk+N 7oHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=d347PGicPnHnSxrHiUKliUhsEGwWWeTMGutskcoO1f8=; b=s5TXqNDmUBEYcKtTpt3MpKb0BuchRg5IbHhIY8xFegeJCWFiradlqYBGzAdHjBrjTZ hWd7UnWYV82K54hJywE7g9VoOSdWDFjRCbcymxjoggF3HVB/YF4CVPy3s0cQf9ctEmoa 6mx3c5BceSTODJDW6Yms3VrQSrPJbKCxIRmvnmoiU039OWPAJuMyOcZC61IpzCQ2o20e zjxlKlDVIY3Ny3+7zqTrNJnl7K2F/7QbbQ2P6wFNFIf78M1O834qLUiW6rMaerFhmdke em5g4Abpe4jLjOj2COXNMai+sceMSAFQ9BSebxjCol1RYE4mBt/KXo1zpf+eSGIdOkQk kDGg== X-Gm-Message-State: ANoB5plCEStzemGJYeO1BynsngcTY11iHVLa1aYkJt4Yb7aR3HyOhBNo kNuUQuuwvRX6NVKe338KIjVDzw== X-Google-Smtp-Source: AA0mqf7uqmv4AbHgFCGUCfF/aINhYFGb6bNTPlW8AYXWDL6hu+2EPxT8e41XcOLKCYyw6vOEEc9eTg== X-Received: by 2002:a5d:628b:0:b0:242:26f0:d395 with SMTP id k11-20020a5d628b000000b0024226f0d395mr200276wru.510.1669716371830; Tue, 29 Nov 2022 02:06:11 -0800 (PST) Received: from lavr ([81.6.34.132]) by smtp.gmail.com with ESMTPSA id f18-20020a05600c4e9200b003c6c182bef9sm1978757wmq.36.2022.11.29.02.06.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 02:06:11 -0800 (PST) Date: Tue, 29 Nov 2022 11:06:09 +0100 From: Anton Protopopov To: Stanislav Fomichev Message-ID: References: <20221121182552.2152891-1-sdf@google.com> <20221121182552.2152891-6-sdf@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221121182552.2152891-6-sdf@google.com> Message-ID-Hash: FPUEYJJKPXENAB7F3WCMZXNFUROCI3BW X-Message-ID-Hash: FPUEYJJKPXENAB7F3WCMZXNFUROCI3BW X-MailFrom: aspsk@isovalent.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, martin.lau@linux.dev, song@kernel.org, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, haoluo@google.com, jolsa@kernel.org, David Ahern , Jakub Kicinski , Willem de Bruijn , Jesper Dangaard Brouer , Anatoly Burakov , Alexander Lobakin , Magnus Karlsson , Maryam Tahhan , xdp-hints@xdp-project.net, netdev@vger.kernel.org X-Mailman-Version: 3.3.7 Precedence: list Subject: [xdp-hints] Re: [PATCH bpf-next v2 5/8] selftests/bpf: Verify xdp_metadata xdp->af_xdp path List-Id: XDP hardware hints design discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 22/11/21 10:25, Stanislav Fomichev wrote: > > [...] > > + > + if (bpf_xdp_metadata_rx_timestamp_supported(ctx)) > + meta->rx_timestamp = bpf_xdp_metadata_rx_timestamp(ctx); > + > + if (bpf_xdp_metadata_rx_hash_supported(ctx)) > + meta->rx_hash = bpf_xdp_metadata_rx_hash(ctx); Is there a case when F_supported and F are not called in a sequence? If not, then you can join them: bool (*ndo_xdp_rx_timestamp)(const struct xdp_md *ctx, u64 *timestamp); so that a calling XDP program does one indirect call instead of two for one field if (bpf_xdp_metadata_rx_timestamp(ctx, &meta->rx_timestamp)) { /* ... couldn't get the timestamp */ }