[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAEf4BzarqE+t35r-+3r5AYHVcw9qaraaG+h0CTjn-b-9vX4dYg@mail.gmail.com>
Date: Fri, 29 Mar 2024 15:09:31 -0700
From: Andrii Nakryiko <andrii.nakryiko@...il.com>
To: Jordan Rife <jrife@...gle.com>
Cc: bpf@...r.kernel.org, linux-kselftest@...r.kernel.org,
netdev@...r.kernel.org, Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>, Andrii Nakryiko <andrii@...nel.org>,
Martin KaFai Lau <martin.lau@...ux.dev>, Eduard Zingerman <eddyz87@...il.com>, Song Liu <song@...nel.org>,
Yonghong Song <yonghong.song@...ux.dev>, John Fastabend <john.fastabend@...il.com>,
KP Singh <kpsingh@...nel.org>, Stanislav Fomichev <sdf@...gle.com>, Hao Luo <haoluo@...gle.com>,
Jiri Olsa <jolsa@...nel.org>, Mykola Lysenko <mykolal@...com>, Shuah Khan <shuah@...nel.org>,
"David S. Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>,
Jesper Dangaard Brouer <hawk@...nel.org>, Daan De Meyer <daan.j.demeyer@...il.com>
Subject: Re: [PATCH v1 bpf-next 1/8] selftests/bpf: Introduce sock_addr_testmod
On Fri, Mar 29, 2024 at 12:20 PM Jordan Rife <jrife@...gle.com> wrote:
>
> sock_addr_testmod provides a mechanism for the sock_addr_kern prog_test
> to drive socket operations in kernel space. On init, one of the
> following socket operations is performed based on the module parameters:
> kernel_bind(), kernel_connect(), or sock_sendmsg()/kernel_sendmsg() and
> results are exposed through debugfs.
>
> Signed-off-by: Jordan Rife <jrife@...gle.com>
> ---
> tools/testing/selftests/bpf/Makefile | 11 +-
> .../bpf/sock_addr_testmod/.gitignore | 6 +
> .../selftests/bpf/sock_addr_testmod/Makefile | 20 ++
> .../bpf/sock_addr_testmod/sock_addr_testmod.c | 256 ++++++++++++++++++
> 4 files changed, 292 insertions(+), 1 deletion(-)
> create mode 100644 tools/testing/selftests/bpf/sock_addr_testmod/.gitignore
> create mode 100644 tools/testing/selftests/bpf/sock_addr_testmod/Makefile
> create mode 100644 tools/testing/selftests/bpf/sock_addr_testmod/sock_addr_testmod.c
>
> diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
> index 3b9eb40d63436..b5d02ff724957 100644
> --- a/tools/testing/selftests/bpf/Makefile
> +++ b/tools/testing/selftests/bpf/Makefile
> @@ -132,7 +132,7 @@ TEST_GEN_PROGS_EXTENDED = test_sock_addr test_skb_cgroup_id_user \
> flow_dissector_load test_flow_dissector test_tcp_check_syncookie_user \
> test_lirc_mode2_user xdping test_cpp runqslower bench bpf_testmod.ko \
> xskxceiver xdp_redirect_multi xdp_synproxy veristat xdp_hw_metadata \
> - xdp_features bpf_test_no_cfi.ko
> + xdp_features bpf_test_no_cfi.ko sock_addr_testmod.ko
>
Do we need yet another kernel module? Can this be done as part of
existing bpf_testmod module?
> TEST_GEN_FILES += liburandom_read.so urandom_read sign-file uprobe_multi
>
> @@ -160,6 +160,7 @@ override define CLEAN
> $(Q)$(RM) -r $(TEST_GEN_FILES)
> $(Q)$(RM) -r $(EXTRA_CLEAN)
> $(Q)$(MAKE) -C bpf_testmod clean
> + $(Q)$(MAKE) -C sock_addr_testmod clean
> $(Q)$(MAKE) docs-clean
> endef
>
[...]
X-sender: <netdev+bounces-83473-steffen.klassert=cunet.com@...r.kernel.org>
X-Receiver: <steffen.klassert@...unet.com> ORCPT=c822;steffen.klassert@...unet.com NOTIFY=VER; X-ExtendedProps=AVABYAAgAAAAUAFAARAPDFCS25BAlDktII2g02frgPADUAAABNaWNyb3NvZnQuRXhjaGFuZ2UuVHJhbnNwb3J0LkRpcmVjdG9yeURhdGEuSXNSZXNvdXJjZQIAAAUAagAJAAEAAAAAAAAABQAWAAIAAAUAQwACAAAFAEYABwADAAAABQBHAAIAAAUAEgAPAGIAAAAvbz1zZWN1bmV0L291PUV4Y2hhbmdlIEFk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AAAAAUASQACAAEFAGIACgAeAAAAjIoAAAUABAAUIAEAAAAcAAAAc3RlZmZlbi5rbGFzc2VydEBzZWN1bmV0LmNvbQUABgACAAEFACkAAgABDwAJAAAAQ0lBdWRpdGVkAgABBQACAAcAAQAAAAUAAwAHAAAAAAAFAAUAAgABBQBkAA8AAwAAAEh1Yg=
X-Source: SMTP:Default MBX-DRESDEN-01
X-SourceIPAddress: 62.96.220.36
X-EndOfInjectedXHeaders: 17063
Received: from cas-essen-02.secunet.de (10.53.40.202) by
mbx-dresden-01.secunet.de (10.53.40.199) with Microsoft SMTP Server
(version=S1_2, cipher=S_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
15.1.2507.37; Fri, 29 Mar 2024 23:10:06 +0100
Received: from a.mx.secunet.com (62.96.220.36) by cas-essen-02.secunet.de
(10.53.40.202) with Microsoft SMTP Server (version=S1_2,
cipher=S_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend
Transport; Fri, 29 Mar 2024 23:10:06 +0100
Received: from localhost (localhost [127.0.0.1])
by a.mx.secunet.com (Postfix) with ESMTP id C708A20883
for <steffen.klassert@...unet.com>; Fri, 29 Mar 2024 23:10:06 +0100 (CET)
X-Virus-Scanned: by secunet
X-Spam-Flag: NO
X-Spam-Score: -2.749
X-Spam-Level:
X-Spam-Status: No, score=.749 tagged_above=99 required=1
tests=AYES_00=.9, DKIM_SIGNED=1, DKIM_VALID=.1,
DKIM_VALID_AU=.1, FREEMAIL_FORGED_FROMDOMAIN=001,
FREEMAIL_FROM=001, HEADER_FROM_DIFFERENT_DOMAINS=249,
MAILING_LIST_MULTI=, RCVD_IN_DNSWL_NONE=.0001,
SPF_HELO_NONE=001, SPF_PASS=.001]
autolearn=available autolearn_force=
Authentication-Results: a.mx.secunet.com (amavisd-new);
dkim=ss (2048-bit key) header.d=ail.com
Received: from a.mx.secunet.com ([127.0.0.1])
by localhost (a.mx.secunet.com [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id iXMB-mO3iNad for <steffen.klassert@...unet.com>;
Fri, 29 Mar 2024 23:10:03 +0100 (CET)
Received-SPF: Pass (sender SPF authorized) identity=ilfrom; client-ip.7.75.48.161; helo=.mirrors.kernel.org; envelope-from=tdev+bounces-83473-steffen.klassert=cunet.com@...r.kernel.org; receiver=effen.klassert@...unet.com
DKIM-Filter: OpenDKIM Filter v2.11.0 a.mx.secunet.com 01965208AC
Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org [147.75.48.161])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by a.mx.secunet.com (Postfix) with ESMTPS id 01965208AC
for <steffen.klassert@...unet.com>; Fri, 29 Mar 2024 23:10:03 +0100 (CET)
Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by sy.mirrors.kernel.org (Postfix) with ESMTPS id 388D4B21E8B
for <steffen.klassert@...unet.com>; Fri, 29 Mar 2024 22:10:00 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id A703213D240;
Fri, 29 Mar 2024 22:09:53 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=ss (2048-bit key) header.d=ail.com header.i=mail.com header.b=bnA9wdW"
X-Original-To: netdev@...r.kernel.org
Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 774D439FD6;
Fri, 29 Mar 2024 22:09:51 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=ne smtp.client-ip 9.85.218.47
ARC-Seal: i= a=a-sha256; d=bspace.kernel.org; s=c-20240116;
t.11750193; cv=ne; b=JbqHT+BnRlc2TliWVOCilRovqmJ4jHSON/5dHQmB7ueJd8laXbr6Y8jpfuXUyyTmweZOdmofoE0Kjvzz4XDCe8BAndmpoXmcJb5xl/V0CfbqhB3z7TfmRapKCauIb+Z+g2ASAyvs0L4I+PnmmBQrHwJ4BH0ZsG3EvL35uPWbsARC-Message-Signature: i= a=a-sha256; d=bspace.kernel.org;
s=c-20240116; t.11750193; c=laxed/simple;
bh=nv61COTtDCJ6Qzg4G3KuYC9o9q8lUsfZq/wAf5jvc=
h=ME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:
To:Cc:Content-Type; bÍlB9+5JRfuPUrxB12sAMGMmCsb+HQ5P0xn7RB8tFw6SfxwUPMjDyKVSbqi0Q+VzL7/BcZR0Oe9wdLl4NksBsmRx/TV4jB1S7jsMg2G0BfF2lx4C40IOJEIfTx4OsuhJLM8zL5Gfg7Dhyip+rajRMPG5wd91KnJAGw+i8A1ETGcARC-Authentication-Results: i= smtp.subspace.kernel.org; dmarc=ss (p=ne dis=ne) header.from=ail.com; spf=ss smtp.mailfrom=ail.com; dkim=ss (2048-bit key) header.d=ail.com header.i=mail.com header.b=nA9wdW; arc=ne smtp.client-ip 9.85.218.47
Authentication-Results: smtp.subspace.kernel.org; dmarc=ss (p=ne dis=ne) header.from=ail.com
Authentication-Results: smtp.subspace.kernel.org; spf=ss smtp.mailfrom=ail.com
Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-a46cd9e7fcaso305127866b.1;
Fri, 29 Mar 2024 15:09:51 -0700 (PDT)
DKIM-Signature: v= a=a-sha256; c=laxed/relaxed;
d=ail.com; s 230601; t.11750190; x.12354990; darn=er.kernel.org;
h=ntent-transfer-encoding:cc:to:subject:message-id:date:from
:in-reply-to:references:mime-version:from:to:cc:subject:date
:message-id:reply-to;
bh=kK35lFdR1p3nAj6ONZyvQKPyBvTq4KRhMXv8rS1mY=
b=nA9wdW1nfAEUHgGc53U84Wh64a1VYLxb+9KShGa6m1lJVYtRXz6zRv2EUlMlo4bg
7NlnQf+xDZaRKTZwBXfPdpcecrtY4qHI+tQ7UGfAKszgTocNMff27YduCBNMYXlPmwb7
9mRouYZCu4c9DqByPtaL50NvRBgoOzqxwD5bl3hfFFuEGFnrWkA+kKaAtwypyS+XNqEC
F/uSEt6VHCTNZR6ZquwespsQeUqkid0U4zfnZ23wmHBbYN9ITT8pq7yKJZRIyAG8npvB
xQ2iR9CAO9nd8jqL+J2vqgCr/UYl1T3SxTJhtUh/7cFSVu06DBAoLpdswuo3Z8dFL8LE
UzBQ=
X-Google-DKIM-Signature: v= a=a-sha256; c=laxed/relaxed;
d.100.net; s 230601; t.11750190; x.12354990;
h=ntent-transfer-encoding:cc:to:subject:message-id:date:from
:in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to;
bh=kK35lFdR1p3nAj6ONZyvQKPyBvTq4KRhMXv8rS1mY=
b=4paS84sSWCanoPcVZEwJkRGhWRub4SVQ9oGMFTalLzRgOrhonXovuSjrgB/qNI17
pl3e4fBPKLTp2+sfD1tzQcAKglV4Hc6q2nzXDMX8vMsOe/RySjGhFCFsUCpPvCSIuyNS
1JWO3azo+CNUnMFsoCLxGLfer+yAVuYa7ZRouKfaOCidgrllBcdT6subvj04/cgf4+uH
wzTwxyO0IyQfGoAEsRoavfQzf6Mt3gdBht7r0gbITeseCljvY9TjNsODVcaMqzDmhb7N
4CxJK3bvymVU4NFBEDOL3o1ul8qU7P1GPZDODr9dtXlo83hfPSKEnTkShKskf/PU7a6A
ctdg=
X-Forwarded-Encrypted: i= AJvYcCUxCb2yVB96UPGFat916RkR6BKGPcZ0iP0npWk9OpCkwwp+UCD7fSseu5tI7r/0VUYhBH8n2kz+QkVNw4Llrbzub824xFFbmrySHBRjsYWYQuP9oAfLzOEK+pr6xmPyzEAIYs7Flgpo
X-Gm-Message-State: AOJu0YzQbhSfiZOfcUs7tycQVkWQrGrJlq45lJZu2eHMBrD+O/b0iyXq
k0m6EJteHXeVLajkGDsjZODAH3y4el37WNOJ/P7GbEfR/3+S1a6dIlZ4Oe23SDvnoLANuf80zEv
cAZrRSCyaNO1mxT11fOIw/GHo1csX-Google-Smtp-Source: AGHT+IFfzXXrKpD+5hfmBnKPRig47WB3T+3H62/QXWsDLkxNELXWlzbFASuowBFdLRBLkfyZgVl4l9PoMRXM8aQbJSwX-Received: by 2002:a17:907:9915:b0:a47:61d:7d38 with SMTP id
ka21-20020a170907991500b00a47061d7d38mr2741292ejc.0.1711750189737; Fri, 29
Mar 2024 15:09:49 -0700 (PDT)
Precedence: bulk
X-Mailing-List: netdev@...r.kernel.org
List-Id: <netdev.vger.kernel.org>
List-Subscribe: <mailto:netdev+subscribe@...r.kernel.org>
List-Unsubscribe: <mailto:netdev+unsubscribe@...r.kernel.org>
MIME-Version: 1.0
References: <20240329191907.1808635-1-jrife@...gle.com> <20240329191907.1808635-2-jrife@...gle.com>
In-Reply-To: <20240329191907.1808635-2-jrife@...gle.com>
From: Andrii Nakryiko <andrii.nakryiko@...il.com>
Date: Fri, 29 Mar 2024 15:09:31 -0700
Message-ID: <CAEf4BzarqE+t35r-+3r5AYHVcw9qaraaG+h0CTjn-b-9vX4dYg@...l.gmail.com>
Subject: Re: [PATCH v1 bpf-next 1/8] selftests/bpf: Introduce sock_addr_testmod
To: Jordan Rife <jrife@...gle.com>
Cc: bpf@...r.kernel.org, linux-kselftest@...r.kernel.org,
netdev@...r.kernel.org, Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>, Andrii Nakryiko <andrii@...nel.org>,
Martin KaFai Lau <martin.lau@...ux.dev>, Eduard Zingerman <eddyz87@...il.com>, Song Liu <song@...nel.org>,
Yonghong Song <yonghong.song@...ux.dev>, John Fastabend <john.fastabend@...il.com>,
KP Singh <kpsingh@...nel.org>, Stanislav Fomichev <sdf@...gle.com>, Hao Luo <haoluo@...gle.com>,
Jiri Olsa <jolsa@...nel.org>, Mykola Lysenko <mykolal@...com>, Shuah Khan <shuah@...nel.org>,
"David S. Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>,
Jesper Dangaard Brouer <hawk@...nel.org>, Daan De Meyer <daan.j.demeyer@...il.com>
Content-Type: text/plain; charset=TF-8"
Content-Transfer-Encoding: quoted-printable
Return-Path: netdev+bounces-83473-steffen.klassert=cunet.com@...r.kernel.org
X-MS-Exchange-Organization-OriginalArrivalTime: 29 Mar 2024 22:10:06.8387
(UTC)
X-MS-Exchange-Organization-Network-Message-Id: 8c3a2a32-c495-4698-1768-08dc503cfdf0
X-MS-Exchange-Organization-OriginalClientIPAddress: 62.96.220.36
X-MS-Exchange-Organization-OriginalServerIPAddress: 10.53.40.202
X-MS-Exchange-Organization-Cross-Premises-Headers-Processed: cas-essen-02.secunet.de
X-MS-Exchange-Organization-OrderedPrecisionLatencyInProgress: LSRV=x-dresden-01.secunet.de:TOTAL-HUB=433|SMR=345(SMRDE=035|SMRC=310(SMRCL=102|X-SMRCR=310))|CAT=086(CATOS=012
(CATSM=012(CATSM-Malware
Agent=012))|CATRESL=040(CATRESLP2R=018)|CATORES=032
(CATRS=031(CATRS-Index Routing Agent=030)));2024-03-29T22:10:07.273Z
X-MS-Exchange-Forest-ArrivalHubServer: mbx-dresden-01.secunet.de
X-MS-Exchange-Organization-AuthSource: cas-essen-02.secunet.de
X-MS-Exchange-Organization-AuthAs: Anonymous
X-MS-Exchange-Organization-FromEntityHeader: Internet
X-MS-Exchange-Organization-OriginalSize: 10947
X-MS-Exchange-Organization-HygienePolicy: Standard
X-MS-Exchange-Organization-MessageLatency: SRVÊs-essen-02.secunet.de:TOTAL-FE=007|SMR=006(SMRPI=004(SMRPI-FrontendProxyAgent=004))
X-MS-Exchange-Organization-AVStamp-Enterprise: 1.0
X-MS-Exchange-Organization-Recipient-Limit-Verified: True
X-MS-Exchange-Organization-TotalRecipientCount: 1
X-MS-Exchange-Organization-Rules-Execution-History: 0b0cf904-14ac-4724-8bdf-482ee6223cf2%%%fd34672d-751c-45ae-a963-ed177fcabe23%%%d8080257-b0c3-47b4-b0db-23bc0c8ddb3c%%%95e591a2-5d7d-4afa-b1d0-7573d6c0a5d9%%%f7d0f6bc-4dcc-4876-8c5d-b3d6ddbb3d55%%%16355082-c50b-4214-9c7d-d39575f9f79b
X-MS-Exchange-Forest-RulesExecuted: mbx-dresden-01
X-MS-Exchange-Organization-RulesExecuted: mbx-dresden-01
X-MS-Exchange-Forest-IndexAgent-0: AQ0CZW4AAXUFAAAPAAADH4sIAAAAAAAEAK1VW28TRxSetb2+BScB2v
JQVToPPCRKfIljgoIKBYFBbQnQhIdKbbXay6y9tb3jzq6JI/Wh/6j/
qT+gv6HfmbUdGwdIJVaj3ZlzvnM/c/bf7dcxPdfRPp24mtrH+9RutT
vkpnTQftBu/fPX329O6AelAzem0yiU9O3vGp/HPaV6Q9nw1egRnWuV
yge16iMsSpQ/cNwg0E4qk3SkAhpr9S4KZEIujaTfd+MoGVGoNKV9uQ
QfSB0ztmcEWVWqKNDRuwwkU1Jjqd00UnFCUUyMl0NKxq4vG4QoojhK
90nFklTIullFqIZDdR7Fvat0JIQDHBnJgDw3wVvFxil4PRlKGrvaHc
lU6oSDmxl0vCgOdnb350dfxbH0U6YgJBNOIuNglPR2dpszzIJAbhyw
Ki2TyTBFRrQkOR0rtp32tZr0+hRIb9ILk8Ysn2dRL5ZBXYVh3bt48I
lSsEC9XucPsqeGSZNzifCbiRyGvE+a3jhsnrgDGUYIcfH8SXRwQHuZ
aKPRMLC1WjYbvSiFQ0qvitIR7S0kV02t67g0Dsl2i/b2PmF0jdLwId
q+B6Nrj1HVIdafEDdbTwbo6eM22iOR2lR+Zw/FOkCih5LPO/VdI+Vr
6aam+JIOWq2jTuejOfxYcj6PvnmiPo+2K7I4a7EgCkO0Dbwnt3mttv
GuBWPduCxySofesfQ6reDosHN41Gh494JWOwzvtzvH9+7Popm17jU9
YDSq/T8cefyY6geH7f37tJd9QHjbPXvrvOi+ct6cvn5x5nR/ftt99a
z7jB4S63AWGZsdB57j93BJx04U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g0KICA8L0NvbnRhY3RzPg0KPC9Db250YWN0U2V0PgEOzwFSZXRyaW
V2ZXJPcGVyYXRvciwxMCwwO1JldHJpZXZlck9wZXJhdG9yLDExLDE7
UG9zdERvY1BhcnNlck9wZXJhdG9yLDEwLDA7UG9zdERvY1BhcnNlck
9wZXJhdG9yLDExLDA7UG9zdFdvcmRCcmVha2VyRGlhZ25vc3RpY09w
ZXJhdG9yLDEwLDE7UG9zdFdvcmRCcmVha2VyRGlhZ25vc3RpY09wZX
JhdG9yLDExLDA7VHJhbnNwb3J0V3JpdGVyUHJvZHVjZXIsMjAsMTgX-MS-Exchange-Forest-IndexAgent: 1 3239
X-MS-Exchange-Forest-EmailMessageHash: EDEB6E63
X-MS-Exchange-Forest-Language: en
X-MS-Exchange-Organization-Processed-By-Journaling: Journal Agent
On Fri, Mar 29, 2024 at 12:20 PM Jordan Rife <jrife@...gle.com> wrote:
>
> sock_addr_testmod provides a mechanism for the sock_addr_kern prog_test
> to drive socket operations in kernel space. On init, one of the
> following socket operations is performed based on the module parameters:
> kernel_bind(), kernel_connect(), or sock_sendmsg()/kernel_sendmsg() and
> results are exposed through debugfs.
>
> Signed-off-by: Jordan Rife <jrife@...gle.com>
> ---
> tools/testing/selftests/bpf/Makefile | 11 +-
> .../bpf/sock_addr_testmod/.gitignore | 6 +
> .../selftests/bpf/sock_addr_testmod/Makefile | 20 ++
> .../bpf/sock_addr_testmod/sock_addr_testmod.c | 256 ++++++++++++++++++
> 4 files changed, 292 insertions(+), 1 deletion(-)
> create mode 100644 tools/testing/selftests/bpf/sock_addr_testmod/.gitignore
> create mode 100644 tools/testing/selftests/bpf/sock_addr_testmod/Makefile
> create mode 100644 tools/testing/selftests/bpf/sock_addr_testmod/sock_addr_testmod.c
>
> diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
> index 3b9eb40d63436..b5d02ff724957 100644
> --- a/tools/testing/selftests/bpf/Makefile
> +++ b/tools/testing/selftests/bpf/Makefile
> @@ -132,7 +132,7 @@ TEST_GEN_PROGS_EXTENDED = test_sock_addr test_skb_cgroup_id_user \
> flow_dissector_load test_flow_dissector test_tcp_check_syncookie_user \
> test_lirc_mode2_user xdping test_cpp runqslower bench bpf_testmod.ko \
> xskxceiver xdp_redirect_multi xdp_synproxy veristat xdp_hw_metadata \
> - xdp_features bpf_test_no_cfi.ko
> + xdp_features bpf_test_no_cfi.ko sock_addr_testmod.ko
>
Do we need yet another kernel module? Can this be done as part of
existing bpf_testmod module?
> TEST_GEN_FILES += liburandom_read.so urandom_read sign-file uprobe_multi
>
> @@ -160,6 +160,7 @@ override define CLEAN
> $(Q)$(RM) -r $(TEST_GEN_FILES)
> $(Q)$(RM) -r $(EXTRA_CLEAN)
> $(Q)$(MAKE) -C bpf_testmod clean
> + $(Q)$(MAKE) -C sock_addr_testmod clean
> $(Q)$(MAKE) docs-clean
> endef
>
[...]
Powered by blists - more mailing lists