From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mail.toke.dk (Postfix) with ESMTPS id DE104A2000E for ; Wed, 9 Aug 2023 22:18:39 +0200 (CEST) Authentication-Results: mail.toke.dk; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=gR0xZ4j5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691612318; 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=FZ/hAJigtNZkRkPpAn2IHk5mSzp9dipr9W9tKZ7Di2g=; b=gR0xZ4j5gyHsfqUdvMig3TpmxubzqRJeS9Q7nRqbMahcns9h9Dya+XN4lHKYxVbi0m4Tu8 3oE6shZs/+fv4U2GQXh/funWH7No10k6zMyZmYDBqG3aRRTzNXmTfaSwa7hpKJ8mZa6mEm e4+glj+9DBeMIjP5ht9gx2jSLsPNTqU= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-671-sw7vXGOsNCGjk9J5BkimVw-1; Wed, 09 Aug 2023 16:18:37 -0400 X-MC-Unique: sw7vXGOsNCGjk9J5BkimVw-1 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-99bfe3dd009so179843966b.0 for ; Wed, 09 Aug 2023 13:18:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691612316; x=1692217116; h=content-transfer-encoding:in-reply-to:references:to :content-language:subject:cc:user-agent:mime-version:date:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FZ/hAJigtNZkRkPpAn2IHk5mSzp9dipr9W9tKZ7Di2g=; b=LQCNYofjR8ktpqgCeBl7Esad771WUeEVR8yyd0S8DAyixE77D+v2YjAmbyrdqKRSRq b+AwIUg0Ecij2lIe70VtjuW4i7kvq7/7CRCV2FPmYzsPNhzeH+fXNcFms441uUoqDvus 3AHi5oVfbNdlmYlMPo/32mL0vSIHR6paNWsO9mspgUX+gWg1TFkLdQGQhvINSZvj/7pI y0gc0sQpZmbjANgzS/k4TDX0YUJQ5qP6IyKQ6JyUY+bHSVkTGSz2Ce0Zmpj+1lFrp3u1 zr7PNaoVLlGJ/ERViueuGZ0SwNo5dDOMxKlpICvrsoiEw9uwdepSrBQO676CA+qg24de Q18g== X-Gm-Message-State: AOJu0YyqsPiIbM9UP4Evs7GSqsZyL4kXSQAGu+QcyD/AbreS2K2pFhTA e/FPdq4rOpcIN+Z/YJY5cyomF07ROHoCsqrJbjNl1PQKzOg/NdrLgwTuUQO8A8CyVa4joYiR+nA kuAKDKryF3jD7D5z15NYG X-Received: by 2002:a17:907:75f3:b0:99b:ce6d:fc90 with SMTP id jz19-20020a17090775f300b0099bce6dfc90mr589897ejc.2.1691612316112; Wed, 09 Aug 2023 13:18:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF3LI0N7KFW17e6anvDkx9Zt5ywf390HKMqsCts77xR6BfCUNzFMAFhHV0WcmRLMWxmz5meVA== X-Received: by 2002:a17:907:75f3:b0:99b:ce6d:fc90 with SMTP id jz19-20020a17090775f300b0099bce6dfc90mr589884ejc.2.1691612315850; Wed, 09 Aug 2023 13:18:35 -0700 (PDT) Received: from [192.168.42.222] (194-45-78-10.static.kviknet.net. [194.45.78.10]) by smtp.gmail.com with ESMTPSA id b3-20020a170906038300b0098e42bef732sm8374826eja.183.2023.08.09.13.18.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Aug 2023 13:18:35 -0700 (PDT) From: Jesper Dangaard Brouer X-Google-Original-From: Jesper Dangaard Brouer Message-ID: <23743395-5e9a-ec95-b685-e094777a1d4b@redhat.com> Date: Wed, 9 Aug 2023 22:18:34 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 To: Stanislav Fomichev , bpf@vger.kernel.org References: <20230809165418.2831456-1-sdf@google.com> <20230809165418.2831456-3-sdf@google.com> In-Reply-To: <20230809165418.2831456-3-sdf@google.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID-Hash: NKXVQRMQDUHKTCX24NJ7IOZRUMSWFNYX X-Message-ID-Hash: NKXVQRMQDUHKTCX24NJ7IOZRUMSWFNYX X-MailFrom: jbrouer@redhat.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: 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 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? --Jesper