From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B28C945502; Thu, 27 Jun 2024 13:58:57 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7DDC140E3A; Thu, 27 Jun 2024 13:58:32 +0200 (CEST) Received: from forward502b.mail.yandex.net (forward502b.mail.yandex.net [178.154.239.146]) by mails.dpdk.org (Postfix) with ESMTP id 561B440B8F for ; Thu, 27 Jun 2024 13:55:53 +0200 (CEST) Received: from mail-nwsmtp-smtp-production-main-91.sas.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-91.sas.yp-c.yandex.net [IPv6:2a02:6b8:c23:222b:0:640:695f:0]) by forward502b.mail.yandex.net (Yandex) with ESMTPS id 248435F7CB; Thu, 27 Jun 2024 14:55:53 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-91.sas.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id YtPWcA4Mi8c0-AFsSEuU2; Thu, 27 Jun 2024 14:55:52 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1719489352; bh=2LVIuTkJkMaRK8J44X7WTUeWNmRFxAILk3yNyXzhIso=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=OX0pDNjn8K5yiPeaRUX/jMEIOG04XbC5CEKKo4A/5vmc/KxUOYg6up8nQSTPVGOqs iaLKlBc/MowGd/KevXLNpx/r0DqdO1TEP2wKV9ZLl0JV4ImFDbYjWueY3BrgXR3dZK XfHigxcKyLGcL9AfHd9eZ0nsS8ytqxWAANi1CTCE= Authentication-Results: mail-nwsmtp-smtp-production-main-91.sas.yp-c.yandex.net; dkim=pass header.i=@yandex.ru From: Konstantin Ananyev To: dev@dpdk.org Cc: stephen@networkplumber.org, Konstantin Ananyev , Isaac Boukris Subject: [PATCH 3/3] test/bpf: add extra test cases for bpf convert Date: Thu, 27 Jun 2024 12:55:31 +0100 Message-Id: <20240627115531.1440-4-konstantin.v.ananyev@yandex.ru> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240627115531.1440-1-konstantin.v.ananyev@yandex.ru> References: <20240627115531.1440-1-konstantin.v.ananyev@yandex.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Konstantin Ananyev 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 Signed-off-by: Konstantin Ananyev --- 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..993e181b76 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