From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-x54a.google.com (mail-pg1-x54a.google.com [IPv6:2607:f8b0:4864:20::54a]) by mail.toke.dk (Postfix) with ESMTPS id F2F3BA2A325 for ; Thu, 14 Sep 2023 23:05:05 +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=dlw0pC0k Received: by mail-pg1-x54a.google.com with SMTP id 41be03b00d2f7-57774c725ebso1119397a12.0 for ; Thu, 14 Sep 2023 14:05:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1694725504; x=1695330304; 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=tf19T9rRGxsZfukPPxPZNYc1yxG0C28TAql/7/AOXQo=; b=dlw0pC0k0lraovbW+yETMVhKeZEjPusO+Zr301OknTkIuv3tRgNfgcFIvcJqzCyUpi jnJJbmFg1RhU77/6vq43vh/V7kUDTXC1BoqbKnZJw65KVtdJ3oZyLuovYXE4AcBkd9zf QCt2hpbTjz3U3WdjbINVhYX88V/iigBNcovF9xzc8jnhrYW3Tg2UEuiErCnclPGg5Mt/ drFBImAomlNUP5v9Z9vYyLK6FQ8C6xdfnz3fkQalEbryD4JNMedlndww75qpTLnqFBw8 +p5FLQj+imMdGFX0Ovo1/ficCq2J+T8vz4wY6EZ8hXkFmR9b8NeUKFtDxShHyFSmyBlh 1NvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694725504; x=1695330304; 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=tf19T9rRGxsZfukPPxPZNYc1yxG0C28TAql/7/AOXQo=; b=Qae7mBPZTrb+mym4JBUR2dBRq6fk0acav84L/N2BOYU7UjZ+hK/QFV9UBXIqh7YDIk MvXzhehjk5Y/Gmfq/x1L2eXZoDYp5ZxmGAU/5Erm9b/ycVEiT2EXvoz+g4qOVIJt5l2b jnxkaJkxz17pycuEeG+i4RXhIwBJVJ3UigUa9Ov9SZdpUCdQXW2y3DwuyZQZ50QqwqXN FmfQFhtT3S0jNhGvbPT/P8jl9VJTGtfwzqrjM/iVMrkV4lAN3ODA1xcCk7StvEq1nCs7 VcfpvNjPhRXLKY8q4vD9U6ikkMAF7qhslL9KTlxtuSZQAW6n5FMDS+soURAA7mguP8YV 3v+A== X-Gm-Message-State: AOJu0YwOErVSl/qh3d07+tLqlxWNoJGwimV01QfubQCSTLAOjaNgx3Cb FBD6Gh5KMhOhCiNIqx+x8EsAOBE= X-Google-Smtp-Source: AGHT+IFmD2hAX/VwTYHIHw/W7HhFYlJ6aK73uLJiGlxAHLq3ldCzLSUUUdBbFn8FvQzx2drbgbuGquY= X-Received: from sdf.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5935]) (user=sdf job=sendgmr) by 2002:a63:af06:0:b0:566:1c6:139b with SMTP id w6-20020a63af06000000b0056601c6139bmr145712pge.8.1694725504374; Thu, 14 Sep 2023 14:05:04 -0700 (PDT) Date: Thu, 14 Sep 2023 14:04:48 -0700 In-Reply-To: <20230914210452.2588884-1-sdf@google.com> Mime-Version: 1.0 References: <20230914210452.2588884-1-sdf@google.com> X-Mailer: git-send-email 2.42.0.459.ge4e396fd5e-goog Message-ID: <20230914210452.2588884-6-sdf@google.com> From: Stanislav Fomichev To: bpf@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Message-ID-Hash: TZZUW4Q3QUXK75WNU4GI77BX3ZVDP3HK X-Message-ID-Hash: TZZUW4Q3QUXK75WNU4GI77BX3ZVDP3HK X-MailFrom: 3gHUDZQMKCacZKMNVVNSL.JVTeKW-OPUaZeKW-WYVQLJa.ULa@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 v2 5/9] 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.459.ge4e396fd5e-goog