From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by mail.toke.dk (Postfix) with ESMTPS id EC789A1BDA8 for ; Tue, 25 Jul 2023 02:00:01 +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=JE/idUD1 Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-57320c10635so59539957b3.3 for ; Mon, 24 Jul 2023 17:00:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690243199; x=1690847999; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=mb1j8LQVRs00LG4v/ZDtJyKdrYAUO/L1CQHpXM/CMbw=; b=JE/idUD1XwLgxZtdASbXBtVEWkJvBd7ZIW4j7n3sas8NWnjxxJ3YsmvpSub5z8hdYm +i0gfHcxDiPX5eIMV2V5DV++oTJZsKIEzKus3Tat962dZJcOhC9Yu6UApxtly9HBssdv 0yBV3tN0zQIa0oQaR+QSuhTUtgBzk+yRH7VpQ5PyB0AHHqhVosMafKRGGpvX4ckg+dhE knf+uxIwYEU7rkxTm8lFqPAq1XZDTz9PAjzZ6FBCb1dNkHgJGQ0eKWH8URTjHcBXvVaY jIcmc6p3AwPhUrEvI8zntzgSe7QdoYGcr40ZENkr7eJtSC/aUPuWeQRUD73G6ibOhmgh kNFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690243199; x=1690847999; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=mb1j8LQVRs00LG4v/ZDtJyKdrYAUO/L1CQHpXM/CMbw=; b=IxFOili4bWW+2W3UIYyCkNSE/HYocTf6OIwcDmptGnubestDDdgKZIS1NFa+CPT7YE ed2KUyAxcbmbS4DcEBhy35Gs4BrzU+in0ldmOw6zKp0UxyNqIek5ok/NHkR8L1Nj3N3k fIJ5zRlp1krGTH4QCjK02GD/gKT3ILLiuNIouvo+j2t8oCJsZu7jTvsP7VAPM02AzkpZ gDfH/gQOCXuHBqGGYTX1L/tqkWXzM7b3ibAuUnqMG/wlvs0j35A3yaB9zsbfwJL4AdVA iP+znBi1UMNYIrHV4rOBxv83zo1OPvQWNaVohs9BWAcIWloxnubDBQF3KrXcDBXu9MWP 1K1g== X-Gm-Message-State: ABy/qLZdoLqpiIgIIrtfSDUw6/ikuKu4VQjP8L3hWCGynY4PHuLu/KVl gOvJ4WcaL6the65Xaa1+IgMzpWY= X-Google-Smtp-Source: APBJJlGYebW0op/3iuEIh9lx2Hv4PKsRCDOc1Xco+8T07Ui5UtuoEVB82IkQQNytxac4RdcXFVeEz8Y= X-Received: from sdf.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5935]) (user=sdf job=sendgmr) by 2002:a81:af5d:0:b0:583:a866:3450 with SMTP id x29-20020a81af5d000000b00583a8663450mr81469ywj.7.1690243199375; Mon, 24 Jul 2023 16:59:59 -0700 (PDT) Date: Mon, 24 Jul 2023 16:59:49 -0700 Mime-Version: 1.0 X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog Message-ID: <20230724235957.1953861-1-sdf@google.com> From: Stanislav Fomichev To: bpf@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Message-ID-Hash: ZKSMQAJL5SA3I6UJQLZ5BLF6PZ3NPEQK X-Message-ID-Hash: ZKSMQAJL5SA3I6UJQLZ5BLF6PZ3NPEQK X-MailFrom: 3fxC_ZAMKCcg6rtu22uzs.q20Br3-vw176Br3-352xsq7.1s7@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: 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, sdf@google.com, 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] [RFC net-next v4 0/8] xsk: TX metadata List-Id: XDP hardware hints design discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: This series implements initial TX metadata (offloads) for AF_XDP. See patch #2 for the main implementation and mlx5-one for the example on how to consume the metadata on the device side. With v4, I'm switching from BPF hooks and kfuncs to a fixed TX metadata/offload format: the metadata is passed with every tx umem chunk and it's up to the device driver to interpret it. Starting with two types of offloads: - request TX timestamp (and write it back into the metadata area) - request TX checksum offload TODO for the non-RFC series: - have some real device support to verify xdp_hw_metadata works - Documentation/networking/xdp-rx-metadata.rst - like documentation v3: https://lore.kernel.org/bpf/20230707193006.1309662-1-sdf@google.com/ Stanislav Fomichev (8): xsk: Support XDP_TX_METADATA_LEN xsk: add TX timestamp and TX checksum offload support net/mlx5e: Implement AF_XDP TX timestamp and checksum offload tools: ynl: update netdev sample to dump xsk-features selftests/xsk: Support XDP_TX_METADATA_LEN selftests/bpf: Add csum helpers selftests/bpf: Add TX side to xdp_metadata selftests/bpf: Add TX side to xdp_hw_metadata Documentation/netlink/specs/netdev.yaml | 25 ++- drivers/net/ethernet/mellanox/mlx5/core/en.h | 4 +- .../net/ethernet/mellanox/mlx5/core/en/xdp.c | 71 ++++++- .../net/ethernet/mellanox/mlx5/core/en/xdp.h | 10 +- .../ethernet/mellanox/mlx5/core/en/xsk/tx.c | 9 +- .../net/ethernet/mellanox/mlx5/core/en_main.c | 1 + include/linux/netdevice.h | 27 +++ include/linux/skbuff.h | 5 +- include/net/xdp_sock.h | 61 ++++++ include/net/xdp_sock_drv.h | 13 ++ include/net/xsk_buff_pool.h | 1 + include/uapi/linux/if_xdp.h | 36 ++++ include/uapi/linux/netdev.h | 15 ++ net/core/netdev-genl.c | 12 +- net/xdp/xsk.c | 58 +++++ net/xdp/xsk_buff_pool.c | 1 + net/xdp/xsk_queue.h | 19 +- tools/include/uapi/linux/if_xdp.h | 50 ++++- tools/include/uapi/linux/netdev.h | 15 ++ tools/net/ynl/generated/netdev-user.c | 25 +++ tools/net/ynl/generated/netdev-user.h | 5 + tools/net/ynl/samples/netdev.c | 8 + tools/testing/selftests/bpf/network_helpers.h | 43 ++++ .../selftests/bpf/prog_tests/xdp_metadata.c | 31 ++- tools/testing/selftests/bpf/xdp_hw_metadata.c | 201 +++++++++++++++++- tools/testing/selftests/bpf/xsk.c | 17 ++ tools/testing/selftests/bpf/xsk.h | 1 + 27 files changed, 718 insertions(+), 46 deletions(-) -- 2.41.0.487.g6d72f3e995-goog