From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-il1-x132.google.com (mail-il1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) by mail.toke.dk (Postfix) with ESMTPS id B5DCB9BD15A for ; Thu, 10 Nov 2022 22:21:19 +0100 (CET) Authentication-Results: mail.toke.dk; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=SGgOEck9 Received: by mail-il1-x132.google.com with SMTP id z9so1665533ilu.10 for ; Thu, 10 Nov 2022 13:21:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=NJTtFMk9IclrsPZ9bH5dYLYGp8zVd3QiiY7z+IF5nlY=; b=SGgOEck9s8MJVqYRKp7ulJYa2RvHlAfha4mZbeGvt2QHcw/gVlrUmSbQ05Mn7IyDJ+ T+T57zpIL8t2dtaYHRQOydJQzz4CmCkfDlu6aaa/sPGuIoifSGEdMW/Y9I3vkU7XOujV msAgn28nX9IV+ubuWCknWbELarl6gc6fph9TOeazYpom5dEtvNMx+vA/n9LqEv81TqzL 1996ALeQkazRsbhKLnZXQnW5ZBXyPfqMgtw9dAG0zzqATOml3mkdssi5gjFGpw9c2Y9P Y3wf0yfWbYe/8tKvfHjxHdqBCXY8CrCuB8kjeBZZ/DnM/3KGkAZ9zopaxNF8pkyL+FJd xVqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NJTtFMk9IclrsPZ9bH5dYLYGp8zVd3QiiY7z+IF5nlY=; b=CxpiNICbiRGLBHRWG91WnSWzGd3DAHx5RZRYDSh46zUwmDob78dcmShACNQrOHXAhD 5S+Icfi0fuQuKm3QZcOXwroq/pS4jRhVVjRcYw3XkvdpJhYGKvJqSr8hh5n92sYCHnMf FA7xs/TEs2/mMKwVN6jpN+UFIrk+h4CYsyMbx2AlAIvMPWKa/fLbFeWaHena/j5en6rA qeN9Np0UMFZN9n1OIlvV6VxqrYc7sMOPV3Rq9S7rZBADwfttUTGwyFTJBdC0JZ6qZweU 4ZCDoJKd6seof2NQtV1WwKnYJbkAJezy+jxbEsIzzjvEckzYHSe/RaTk7tV2q8kQTu6T Leaw== X-Gm-Message-State: ACrzQf0Zg2hdiKRFGeHVs4iU14MMk9UgRSB0k0vXAr6bzgunk7bpD/wL p3bNXYi10QsH3HSy9ZwVBJE= X-Google-Smtp-Source: AMsMyM5cof5VwkRpjF9dTMXmLIMUk9LM8fqk8PswJUUBw7dzIXzAyzvEcaRhpStE/mnVj0bJorUDrg== X-Received: by 2002:a05:6e02:20cb:b0:2ff:d44c:67e1 with SMTP id 11-20020a056e0220cb00b002ffd44c67e1mr3614105ilq.104.1668115276866; Thu, 10 Nov 2022 13:21:16 -0800 (PST) Received: from ?IPV6:2601:282:800:dc80:41d2:94a2:b558:c66e? ([2601:282:800:dc80:41d2:94a2:b558:c66e]) by smtp.googlemail.com with ESMTPSA id s5-20020a0566022bc500b006a102cb4900sm78796iov.39.2022.11.10.13.21.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Nov 2022 13:21:16 -0800 (PST) Message-ID: Date: Thu, 10 Nov 2022 14:21:14 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.13.1 Content-Language: en-US To: Stanislav Fomichev , John Fastabend References: <20221104032532.1615099-1-sdf@google.com> <20221104032532.1615099-7-sdf@google.com> <636c4f5a3812f_13c9f4208b1@john.notmuch> From: David Ahern In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Message-ID-Hash: WQI5BCZMOZR4DVNJSHFJYMKJQ4OYLWWR X-Message-ID-Hash: WQI5BCZMOZR4DVNJSHFJYMKJQ4OYLWWR X-MailFrom: dsahern@gmail.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, kpsingh@kernel.org, haoluo@google.com, jolsa@kernel.org, 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.6 Precedence: list Subject: [xdp-hints] Re: [RFC bpf-next v2 06/14] 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 11/9/22 11:44 PM, Stanislav Fomichev wrote: >>> @@ -423,14 +425,25 @@ XDP_METADATA_KFUNC_xxx >>> MAX_XDP_METADATA_KFUNC, >>> }; >>> >>> +struct xdp_to_skb_metadata { >>> + u32 magic; /* xdp_metadata_magic */ >>> + u64 rx_timestamp; >> >> Slightly confused. I thought/think most drivers populate the skb timestamp >> if they can already? So why do we need to bounce these through some xdp >> metadata? Won't all this cost more than the load/store directly from the >> descriptor into the skb? Even if drivers are not populating skb now >> shouldn't an ethtool knob be enough to turn this on? > > dsahern@ pointed out that it might be useful for the program to be > able to override some of that metadata. Examples that come to mind from previous work: 1. changing vlans on a redirect: Rx on vlan 1 with h/w popping the vlan so it is provided in metadata. Then on a redirect it shifts to vlan 2 for Tx. But this example use case assumes Tx accesses the metadata to ask h/w to insert the header. 2. popping or updating an encap header and wanting to update the checksum 3. changing the h/w provided hash to affect steering of a subsequent skb