From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by mail.toke.dk (Postfix) with ESMTPS id A6AB0A2E289 for ; Tue, 3 Oct 2023 22:05:37 +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=20230601 header.b=Po3o0ND1 Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-59b5a586da6so1620337b3.1 for ; Tue, 03 Oct 2023 13:05:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1696363536; x=1696968336; darn=xdp-project.net; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=jLfu6nduRDM3dWzYzq/o3BySxKJwELyZOaZ+Zwhe/8w=; b=Po3o0ND1WA8r7OVyHgIDDAUqkvqj7AkafyHLlNVOg8i5dcyZV6eEkccFuqmNTRErxg YJ+mNsHFuInShswUqyfA473dxcSJ4kY9D60Wd7wtrjCOXWnUBUo8phQYr58pePoVBrDv z0gR1mdtyPky30HJ7Xl9pSIC8ay0YMrEeUIcW5QwHqNdkkxRx9cKO+pc1n3anzoNZcVl VrgtalWErWX7lDYciq7C0kGlFhZY2d6RYFlEwtgFIhwvR6wYLYHMi0/5DM9OqBQcpskJ SNpyKF8ZNgp1d9kN5hgRlBhwNf/mTKxuYfiSYDmWPrBG3bQR/mI+ICpPDWbGOgkgV8Ww vGdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696363536; x=1696968336; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jLfu6nduRDM3dWzYzq/o3BySxKJwELyZOaZ+Zwhe/8w=; b=wNd9YlzhDO+4ACT6T2y3FZ/7CfQh36NY911m3zlo0AMhpzDB0pQYW0k+30gcT4w61J Rv/MSsiJB2DR/3tDkkrgnDdXV/VmDCkgEHqx8OuaWDOcMsiFqO/xZnZm4NcLwQuzm8XT L14SPoKfUyuamcKvFX9yXBYKlrEko6o1mwb26HLhRp3GepdDYBDz8zAj8psf4vB4jmwp DW458UKgxhnZEo+PRZXfL8cOEXPPe39amnm4sRzeU6qfSJDSkPmhpsYZRx8hfhRGl/Sp Pab4g7vbHxoI/td3M47ZHTtSja3Yyy1pjUWn8MexfA40e5X+em4Wg2kZAMVPV7TQ4Wbl 4aFw== X-Gm-Message-State: AOJu0YzDLSmoeFt6ZZwnjFWfbukb1smsbxRKfSOBR5GUY2zPgE3u6JiY YW3SK4u3w5STzFo2osaCLxMHOJI= X-Google-Smtp-Source: AGHT+IG37FwY35BBpwUYvJZ3mMfpjvK56aS3ASvcODwAOF5iSPKj2kPihjeBEH1K+MuEKBkDJWFT/dM= X-Received: from sdf.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5935]) (user=sdf job=sendgmr) by 2002:a81:4043:0:b0:59b:eb4b:2cad with SMTP id m3-20020a814043000000b0059beb4b2cadmr5069ywn.5.1696363536465; Tue, 03 Oct 2023 13:05:36 -0700 (PDT) Date: Tue, 3 Oct 2023 13:05:18 -0700 In-Reply-To: <20231003200522.1914523-1-sdf@google.com> Mime-Version: 1.0 References: <20231003200522.1914523-1-sdf@google.com> X-Mailer: git-send-email 2.42.0.582.g8ccd20d70d-goog Message-ID: <20231003200522.1914523-7-sdf@google.com> From: Stanislav Fomichev To: bpf@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Message-ID-Hash: 4PFUA27RRXNDH7YQQEN6LG3UJCDKTSYU X-Message-ID-Hash: 4PFUA27RRXNDH7YQQEN6LG3UJCDKTSYU X-MailFrom: 3EHQcZQMKCZkL689HH9E7.5HFQ6I-ABGMLQ6I-IKHC75M.G7M@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, yoong.siang.song@intel.com, netdev@vger.kernel.org, xdp-hints@xdp-project.net X-Mailman-Version: 3.3.8 Precedence: list Subject: [xdp-hints] [PATCH bpf-next v3 06/10] selftests/xsk: Support tx_metadata_len List-Id: XDP hardware hints design discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Add new config field and propagate to umem registration setsockopt. Signed-off-by: Stanislav Fomichev --- tools/testing/selftests/bpf/xsk.c | 3 +++ tools/testing/selftests/bpf/xsk.h | 1 + 2 files changed, 4 insertions(+) diff --git a/tools/testing/selftests/bpf/xsk.c b/tools/testing/selftests/bpf/xsk.c index d9fb2b730a2c..24f5313dbfde 100644 --- a/tools/testing/selftests/bpf/xsk.c +++ b/tools/testing/selftests/bpf/xsk.c @@ -115,6 +115,7 @@ static void xsk_set_umem_config(struct xsk_umem_config *cfg, cfg->frame_size = XSK_UMEM__DEFAULT_FRAME_SIZE; cfg->frame_headroom = XSK_UMEM__DEFAULT_FRAME_HEADROOM; cfg->flags = XSK_UMEM__DEFAULT_FLAGS; + cfg->tx_metadata_len = 0; return; } @@ -123,6 +124,7 @@ static void xsk_set_umem_config(struct xsk_umem_config *cfg, cfg->frame_size = usr_cfg->frame_size; cfg->frame_headroom = usr_cfg->frame_headroom; cfg->flags = usr_cfg->flags; + cfg->tx_metadata_len = usr_cfg->tx_metadata_len; } static int xsk_set_xdp_socket_config(struct xsk_socket_config *cfg, @@ -252,6 +254,7 @@ int xsk_umem__create(struct xsk_umem **umem_ptr, void *umem_area, mr.chunk_size = umem->config.frame_size; mr.headroom = umem->config.frame_headroom; mr.flags = umem->config.flags; + mr.tx_metadata_len = umem->config.tx_metadata_len; err = setsockopt(umem->fd, SOL_XDP, XDP_UMEM_REG, &mr, sizeof(mr)); if (err) { diff --git a/tools/testing/selftests/bpf/xsk.h b/tools/testing/selftests/bpf/xsk.h index d93200fdaa8d..bff8e50d7532 100644 --- a/tools/testing/selftests/bpf/xsk.h +++ b/tools/testing/selftests/bpf/xsk.h @@ -200,6 +200,7 @@ struct xsk_umem_config { __u32 frame_size; __u32 frame_headroom; __u32 flags; + __u32 tx_metadata_len; }; int xsk_attach_xdp_program(struct bpf_program *prog, int ifindex, u32 xdp_flags); -- 2.42.0.582.g8ccd20d70d-goog