DPDK patches and discussions
 help / color / mirror / Atom feed
From: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
To: dev@dpdk.org
Cc: "Konstantin Ananyev" <konstantin.ananyev@huawei.com>,
	"Isaac Boukris" <iboukris@gmail.com>,
	"Morten Brørup" <mb@smartsharesystems.com>,
	"Stephen Hemminger" <stephen@networkplumber.org>
Subject: [PATCH v2 3/3] test/bpf: add extra test cases for bpf convert
Date: Thu, 27 Jun 2024 19:04:42 +0100	[thread overview]
Message-ID: <20240627180442.1602-4-konstantin.v.ananyev@yandex.ru> (raw)
In-Reply-To: <20240627180442.1602-1-konstantin.v.ananyev@yandex.ru>

From: Konstantin Ananyev <konstantin.ananyev@huawei.com>

Add few extra cases to catch problems similar to:
https://bugs.dpdk.org/show_bug.cgi?id=1465
Plus made it dump cBPF filter and converted eBPF program
to make things easier to track.

Suggested-by: Isaac Boukris <iboukris@gmail.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
 app/test/test_bpf.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/app/test/test_bpf.c b/app/test/test_bpf.c
index 64c3c90b0a..7819d6aba9 100644
--- a/app/test/test_bpf.c
+++ b/app/test/test_bpf.c
@@ -3423,6 +3423,9 @@ static const char * const sample_filters[] = {
 	" and ((ip[2:2] - 4 * (ip[0] & 0x0F) - 4 * ((tcp[12] & 0xF0) >> 4) > 69))",
 	/* Other */
 	"len = 128",
+	"host 1::1 or host 1::1 or host 1::1 or host 1::1 or host 1::1 or host 1::1",
+	("host 1::1 or host 1::2 or host 1::3 or host 1::4 or host 1::5 "
+	"or host 192.0.2.1 or host 192.0.2.100 or host 192.0.2.200"),
 };
 
 static int
@@ -3445,6 +3448,9 @@ test_bpf_filter(pcap_t *pcap, const char *s)
 		goto error;
 	}
 
+	printf("bpf convert for \"%s\" produced:\n", s);
+	rte_bpf_dump(stdout, prm->ins, prm->nb_ins);
+
 	bpf = rte_bpf_load(prm);
 	if (bpf == NULL) {
 		printf("%s@%d: failed to load bpf code, error=%d(%s);\n",
-- 
2.35.3


      parent reply	other threads:[~2024-06-27 18:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-27 11:55 [PATCH 0/3] fix bpf load hangs with six IPv6 addresses Konstantin Ananyev
2024-06-27 11:55 ` [PATCH 1/3] bfp: fix MOV instruction evaluation Konstantin Ananyev
2024-06-27 11:55 ` [PATCH 2/3] bfp: fix load hangs with six IPv6 addresses Konstantin Ananyev
2024-06-27 15:13   ` Stephen Hemminger
2024-06-27 11:55 ` [PATCH 3/3] test/bpf: add extra test cases for bpf convert Konstantin Ananyev
2024-06-27 15:15   ` Stephen Hemminger
2024-06-27 12:41 ` [PATCH 0/3] fix bpf load hangs with six IPv6 addresses Morten Brørup
2024-06-27 18:04 ` [PATCH v2 " Konstantin Ananyev
2024-06-27 18:04   ` [PATCH v2 1/3] bfp: fix MOV instruction evaluation Konstantin Ananyev
2024-06-27 18:04   ` [PATCH v2 2/3] bfp: fix load hangs with six IPv6 addresses Konstantin Ananyev
2024-06-27 18:04   ` Konstantin Ananyev [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240627180442.1602-4-konstantin.v.ananyev@yandex.ru \
    --to=konstantin.v.ananyev@yandex.ru \
    --cc=dev@dpdk.org \
    --cc=iboukris@gmail.com \
    --cc=konstantin.ananyev@huawei.com \
    --cc=mb@smartsharesystems.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).