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.133.124]) by mail.toke.dk (Postfix) with ESMTPS id 15C70A07420 for ; Tue, 16 May 2023 17:35:34 +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=B4gbIoW+ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684251333; 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=CcyRieVlUfnyzXKTzR5d4JdkM5K3TgxrxW94yInGt+Q=; b=B4gbIoW+U4T+vrwvlrmUl5rf188eqf7cSfjIo0mXWYIIchfOygUjADKXXakTQfYH+0lP/L SfB0Lqc0FM7K8kcUGRvqxN9SNmAQNpqfReV5i6I/lmkW3eQY+/j17Gh4AZUVZEaJn9DVtr nIkUQ4xZmuCozTuD+Kj+k26tCKc88qg= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-544-SHWczNjtMJCjnw2gyMRvyQ-1; Tue, 16 May 2023 11:35:31 -0400 X-MC-Unique: SHWczNjtMJCjnw2gyMRvyQ-1 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-969f12b2818so1200242466b.1 for ; Tue, 16 May 2023 08:35:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684251330; x=1686843330; 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=CcyRieVlUfnyzXKTzR5d4JdkM5K3TgxrxW94yInGt+Q=; b=Kdnv8npeNoV68y8eXAn2wCTOAZw1yolewd730/dMlFIZNy6yrQeV0uejslAIOSgBHX XQdKyzMH17LbEPRiB8aKo2mVrBq9kK0ArcXaQQOmk/kNCViXz1HhVXSSU5pfHl3z8hUS F1CFt3qQ/62MvtRv6OcuZVLC10MABk1YpIW2YZUx0/cqsgSNPnSFjINzkm5JS7C+aaWH md+y7Pm0ePC1nrrd6eD9j453erKUrV6PGE7w7aH9cE+3csrxmCTyby1lcxjl197V7uTT D/HpPhXCyctrZZyUa8VusfZpZal6NYCHkkiE0mI4ScGPYdOClrm20RtZTNGNzGfGKgPJ Kavg== X-Gm-Message-State: AC+VfDwRhV6NAdYwybf9oi70Ai36/dXJbcdmH+vdslDc2Jr6guq4hr63 xu0uR73Rsy5JebWTYz+NWcrHgJZeBdS/0JLieXl6d047SDmfBYRhPbi5A77hb0+PjpNNcC8+D0y KmfRuzzCjV/0sSabW8R0S X-Received: by 2002:a17:907:7241:b0:96a:f688:db6d with SMTP id ds1-20020a170907724100b0096af688db6dmr9440492ejc.39.1684251330712; Tue, 16 May 2023 08:35:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ57HOpAvaM/nwXSOEpBnwKQLHKhU91w24YzKezDzveXbLZUSTWHiqd71UBuqaWRBls0iTWibg== X-Received: by 2002:a17:907:7241:b0:96a:f688:db6d with SMTP id ds1-20020a170907724100b0096af688db6dmr9440452ejc.39.1684251330293; Tue, 16 May 2023 08:35:30 -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 og40-20020a1709071de800b0095807ab4b57sm11264399ejc.178.2023.05.16.08.35.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 May 2023 08:35:29 -0700 (PDT) From: Jesper Dangaard Brouer X-Google-Original-From: Jesper Dangaard Brouer Message-ID: Date: Tue, 16 May 2023 17:35:27 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 To: Alexander Lobakin , Larysa Zaremba References: <20230512152607.992209-1-larysa.zaremba@intel.com> <20230512152607.992209-15-larysa.zaremba@intel.com> In-Reply-To: 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: 2EJJETAQBZNSBU7WCHZ4OH7GOCH26GJV X-Message-ID-Hash: 2EJJETAQBZNSBU7WCHZ4OH7GOCH26GJV 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, Jesper Dangaard Brouer , bpf@vger.kernel.org, Stanislav Fomichev , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Jakub Kicinski , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Jiri Olsa , Jesse Brandeburg , Tony Nguyen , Anatoly Burakov , Alexander Lobakin , Magnus Karlsson , Maryam Tahhan , xdp-hints@xdp-project.net, netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org X-Mailman-Version: 3.3.8 Precedence: list Subject: [xdp-hints] Re: [PATCH RESEND bpf-next 14/15] net, xdp: allow metadata > 32 List-Id: XDP hardware hints design discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 16/05/2023 14.37, Alexander Lobakin wrote: > From: Larysa Zaremba > Date: Mon, 15 May 2023 19:08:39 +0200 > >> On Mon, May 15, 2023 at 06:17:02PM +0200, Jesper Dangaard Brouer wrote: >>> >>> On 12/05/2023 17.26, Larysa Zaremba wrote: >>>> From: Aleksander Lobakin >>>> >>>> When using XDP hints, metadata sometimes has to be much bigger >>>> than 32 bytes. Relax the restriction, allow metadata larger than 32 bytes >>>> and make __skb_metadata_differs() work with bigger lengths. >>>> >>>> Now size of metadata is only limited by the fact it is stored as u8 >>>> in skb_shared_info, so maximum possible value is 255. >>> >>> I'm confused, IIRC the metadata area isn't stored "in skb_shared_info". >>> The maximum possible size is limited by the XDP headroom, which is also >>> shared/limited with/by xdp_frame. I must be reading the sentence wrong, >>> somehow. > > skb_shared_info::meta_size is u8. Since metadata gets carried from > xdp_buff to skb, this check is needed (it's compile-time constant anyway). > Check for headroom is done separately already (two sentences below). > Damn, argh, for SKBs the "meta_len" is stored in skb_shared_info, which is located on another cacheline. That is a sure way to KILL performance! :-( But only use for SKBs that gets created from xdp with metadata, right? >> It's not 'metadata is stored as u8', it's 'metadata size is stored as u8' :) >> Maybe I should rephrase it better in v2. Yes, a rephrase will be good. --Jesper static inline u8 skb_metadata_len(const struct sk_buff *skb) { return skb_shinfo(skb)->meta_len; }