From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-x449.google.com (mail-pf1-x449.google.com [IPv6:2607:f8b0:4864:20::449]) by mail.toke.dk (Postfix) with ESMTPS id 45C06A203BD for ; Thu, 10 Aug 2023 20:25:58 +0200 (CEST) Authentication-Results: mail.toke.dk; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20221208 header.b=TT2elFGL Received: by mail-pf1-x449.google.com with SMTP id d2e1a72fcca58-6872615b890so2573212b3a.1 for ; Thu, 10 Aug 2023 11:25:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1691691957; x=1692296757; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=+BLYqudylqXgLrn3dkh31GMazxRYXHwKlIWAfdLP26Y=; b=TT2elFGLHdgirqUPPztA6mM2wIL5hl9KSBxEw0WWmLnpkXhvsO2JR1FUBOgxMCW1+B qqpBRNQ2CPhUiVw+2EdfIHYa+LhXGyiRs88RjaJNKBXvdn9XCeppCKahsbgpEhNVrgYO zFJv77J2h8xTNHbvtJ2krPSifbBZqPa+Z+eY6zyN4ZfM/Fb/o5fpp6FX/E4JHRDISxQh YhZ1Fp900sgjF7VnRp9vg4EvRcylAUjqNA/82TSe755eQ6msdYAB7r9/ih76DtyjJ1bg jIkyuXrWRtaU7T6X1o0u88YO/hMDN+DoM3OTurwYkAc3VmuH/pFKDu+rSGspK+npHlvl feiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691691957; x=1692296757; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+BLYqudylqXgLrn3dkh31GMazxRYXHwKlIWAfdLP26Y=; b=VhViz0Ryu1RqBn1lWVOQ7JPlTF4tYEk/wFi6UyEImgyMXIwZGO1BLjRmNWnSWSePAN RsthmQs43+ZVzkPDlVXRmIrdzqws7b3fhQl2t1MvPIaVlqedu4WAR7JRtp/sZA91hw3f C+cOOAD4Uz6Z3iJyqyovjWj2LctFX9O0mpNtbog50kPWC5/2czg+WvJDy4uzumjxq4un FOQBtjgdGxWoHiXe6B6DhDczCTaO0ZUaWzinL0/vLcfoXm9ETSFedr9Fs2R96qzqoCfU 8AhmVwBX/xCB5+4do7ALcmGjNJE/No4v2Sv1C1cvUXEoEcca2IZ7LDMUhrLOTkmi50K5 fVbA== X-Gm-Message-State: AOJu0YzSCtofxwTqJP4IV8gZMkoGR2W+MyaMeM3D/XvKhms0/LSJhtKt PrX0xogKbptdWjy4ZXkU+diq9oU= X-Google-Smtp-Source: AGHT+IEc92sn+li9HY5MkxUeFXWfPGX3qr4M+mD9j/s/NzllJhY4lahZol6TYBOw6auXj8Rob99n398= X-Received: from sdf.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5935]) (user=sdf job=sendgmr) by 2002:a05:6a00:399b:b0:687:26bc:6377 with SMTP id fi27-20020a056a00399b00b0068726bc6377mr1086622pfb.3.1691691956739; Thu, 10 Aug 2023 11:25:56 -0700 (PDT) Date: Thu, 10 Aug 2023 11:25:54 -0700 In-Reply-To: <23743395-5e9a-ec95-b685-e094777a1d4b@redhat.com> Mime-Version: 1.0 References: <20230809165418.2831456-1-sdf@google.com> <20230809165418.2831456-3-sdf@google.com> <23743395-5e9a-ec95-b685-e094777a1d4b@redhat.com> Message-ID: From: Stanislav Fomichev To: Jesper Dangaard Brouer Content-Type: text/plain; charset="utf-8" Message-ID-Hash: UUJ7V67WJBW6A3ZHSRTD65AN5FHUAP33 X-Message-ID-Hash: UUJ7V67WJBW6A3ZHSRTD65AN5FHUAP33 X-MailFrom: 3tCvVZAMKCY09uwx55x2v.t53Eu6-yz4A9Eu6-6850vtA.4vA@flex--sdf.bounces.google.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, brouer@redhat.com, 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, kuba@kernel.org, toke@kernel.org, willemb@google.com, dsahern@kernel.org, magnus.karlsson@intel.com, bjorn@kernel.org, maciej.fijalkowski@intel.com, hawk@kernel.org, netdev@vger.kernel.org, xdp-hints@xdp-project.net X-Mailman-Version: 3.3.8 Precedence: list Subject: [xdp-hints] Re: [PATCH bpf-next 2/9] xsk: add TX timestamp and TX checksum offload support List-Id: XDP hardware hints design discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 08/09, Jesper Dangaard Brouer wrote: > > > On 09/08/2023 18.54, Stanislav Fomichev wrote: > > diff --git a/include/net/xdp_sock_drv.h b/include/net/xdp_sock_drv.h > > index 1f6fc8c7a84c..e2558ac3e195 100644 > > --- a/include/net/xdp_sock_drv.h > > +++ b/include/net/xdp_sock_drv.h > > @@ -165,6 +165,14 @@ static inline void *xsk_buff_raw_get_data(struct xsk_buff_pool *pool, u64 addr) > > return xp_raw_get_data(pool, addr); > > } > > +static inline struct xsk_tx_metadata *xsk_buff_get_metadata(struct xsk_buff_pool *pool, u64 addr) > > +{ > > + if (!pool->tx_metadata_len) > > + return NULL; > > + > > + return xp_raw_get_data(pool, addr) - pool->tx_metadata_len; > > +} > > + > > static inline void xsk_buff_dma_sync_for_cpu(struct xdp_buff *xdp, struct xsk_buff_pool *pool) > > { > > struct xdp_buff_xsk *xskb = container_of(xdp, struct xdp_buff_xsk, xdp); > > @@ -324,6 +332,11 @@ static inline void *xsk_buff_raw_get_data(struct xsk_buff_pool *pool, u64 addr) > > return NULL; > > } > > +static inline struct xsk_tx_metadata *xsk_buff_get_metadata(struct xsk_buff_pool *pool, u64 addr) > > +{ > > + return NULL; > > +} > > + > > static inline void xsk_buff_dma_sync_for_cpu(struct xdp_buff *xdp, struct xsk_buff_pool *pool) > > { > > } > > diff --git a/include/net/xsk_buff_pool.h b/include/net/xsk_buff_pool.h > > index 9c31e8d1e198..3a559753e793 100644 > > --- a/include/net/xsk_buff_pool.h > > +++ b/include/net/xsk_buff_pool.h > > @@ -234,4 +234,9 @@ static inline u64 xp_get_handle(struct xdp_buff_xsk *xskb) > > return xskb->orig_addr + (offset << XSK_UNALIGNED_BUF_OFFSET_SHIFT); > > } > > +static inline bool xp_tx_metadata_enabled(const xdp_buff_xsk *xskb) > > Hmm, shouldn't this argument be "struct xsk_buff_pool *pool" ?!? > > > +{ > > + return sq->xsk_pool->tx_metadata_len > 0; > > +} > > Will this even compile? Yeah, you're right, this is completely bogus. This me doing the 'fixes' before sending out :-/ Will fix in a v2, thanks!