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 5A65C9C373B for ; Fri, 18 Nov 2022 15:05:37 +0100 (CET) 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=V3UujCqX DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668780336; 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=aLKr1m8jjPxQRRjh36786KjP2Xs3iTgpbpgt4JjXzlI=; b=V3UujCqXMo5Hnqy0zUZ3rnz4k6epylrUuoKKG9DDi9DZZZa9RHBHHuaoxVJVNdaPctlJwR rhabOzsuOrh0Rsc6iwdV/J7LgoWohWVSsWzxTtM4l+Y0nv+0Eezm+a9umnDLO6sE6Ll9UZ E7hRmRtJ4qP6S9x6l6In/Ql4aDgeieU= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-66-tnseCHf_PVefM3YXGmcvjA-1; Fri, 18 Nov 2022 09:05:35 -0500 X-MC-Unique: tnseCHf_PVefM3YXGmcvjA-1 Received: by mail-ed1-f69.google.com with SMTP id dz9-20020a0564021d4900b0045d9a3aded4so3098920edb.22 for ; Fri, 18 Nov 2022 06:05:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=aLKr1m8jjPxQRRjh36786KjP2Xs3iTgpbpgt4JjXzlI=; b=m/wu9LeYLNth1bEZNblF4O/b2ec2VbMF56MY8J8JvHiRsjjxGOyJdyq+Z0mqGUqP1Y keJxsPfqcqrz4YYsJAAumhfEPIA4D3ztLFEbZj1h4Qq0tUVi0Nw49tLfswsAPHk5LRhr 4c+bpjqYkyi6aTbO7xEc57B4p7wih5dXDXn1ecZPwpE5Vq+xZTTDpTISiJ+Puh3C6LoP foRdw+vVkzs0cBc6wgsMbVjU3Im+RtKDl+8GBxQVWQDoAqx2uA4XyRLET2PLguObfafe i1mZq5ApHV8X88joScY7p28nwXFCMw4JsR3OY2VInGiwmEB5IxyBwW3gMYi0sgUa1yad watw== X-Gm-Message-State: ANoB5pmi4zUWiEjbm87Fr2w1C6W/qWc59ldnxT29KalPEyMcx2IuVlcs 8mymHdr4bvX5gz6Yxdm+mE0n0qhs+RnDVjVlZf4SbSlS0L8499N2RQO+y2lF92xSOAz6phHSJgc 1bCKZKpU9N34RBm/3+nWa X-Received: by 2002:aa7:dbd9:0:b0:461:e8c4:d21f with SMTP id v25-20020aa7dbd9000000b00461e8c4d21fmr6377573edt.186.1668780333766; Fri, 18 Nov 2022 06:05:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf63VFqZxyKNew0KnlumR1thzphh/OAwj5NqyXGnv9hqfXp7EU9ZcroxigCIYHJsyFM4u5hwzg== X-Received: by 2002:aa7:dbd9:0:b0:461:e8c4:d21f with SMTP id v25-20020aa7dbd9000000b00461e8c4d21fmr6377526edt.186.1668780333385; Fri, 18 Nov 2022 06:05:33 -0800 (PST) Received: from [192.168.41.200] (83-90-141-187-cable.dk.customer.tdc.net. [83.90.141.187]) by smtp.gmail.com with ESMTPSA id kx10-20020a170907774a00b0078ba492db81sm1729506ejc.9.2022.11.18.06.05.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Nov 2022 06:05:32 -0800 (PST) From: Jesper Dangaard Brouer X-Google-Original-From: Jesper Dangaard Brouer Message-ID: Date: Fri, 18 Nov 2022 15:05:30 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 To: Stanislav Fomichev , bpf@vger.kernel.org References: <20221115030210.3159213-1-sdf@google.com> <20221115030210.3159213-7-sdf@google.com> In-Reply-To: <20221115030210.3159213-7-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: 6Z5UCSRTAWCNTGKKIBCKOHMOIM5ZCZVQ X-Message-ID-Hash: 6Z5UCSRTAWCNTGKKIBCKOHMOIM5ZCZVQ 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, David Ahern , Jakub Kicinski , Willem de Bruijn , Anatoly Burakov , Alexander Lobakin , Magnus Karlsson , Maryam Tahhan , xdp-hints@xdp-project.net, netdev@vger.kernel.org X-Mailman-Version: 3.3.6 Precedence: list Subject: [xdp-hints] Re: [PATCH bpf-next 06/11] xdp: Carry over xdp metadata into skb context List-Id: XDP hardware hints design discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 15/11/2022 04.02, Stanislav Fomichev wrote: > Implement new bpf_xdp_metadata_export_to_skb kfunc which > prepares compatible xdp metadata for kernel consumption. > This kfunc should be called prior to bpf_redirect > or when XDP_PASS'ing the frame into the kernel (note, the drivers > have to be updated to enable consuming XDP_PASS'ed metadata). > > veth driver is amended to consume this metadata when converting to skb. > > Internally, XDP_FLAGS_HAS_SKB_METADATA flag is used to indicate > whether the frame has skb metadata. The metadata is currently > stored prior to xdp->data_meta. bpf_xdp_adjust_meta refuses > to work after a call to bpf_xdp_metadata_export_to_skb (can lift > this requirement later on if needed, we'd have to memmove > xdp_skb_metadata). > I think it is wrong to refuses using metadata area (bpf_xdp_adjust_meta) when the function bpf_xdp_metadata_export_to_skb() have been called. In my design they were suppose to co-exist, and BPF-prog was expected to access this directly themselves. With this current design, I think it is better to place the struct xdp_skb_metadata (maybe call it xdp_skb_hints) after xdp_frame (in the top of the frame). This way we don't conflict with metadata and headroom use-cases. Plus, verifier will keep BPF-prog from accessing this area directly (which seems to be one of the new design goals). By placing it after xdp_frame, I think it would be possible to let veth unroll functions seamlessly access this info for XDP_REDIRECT'ed xdp_frame's. WDYT? --Jesper