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 B39F74550E; Thu, 27 Jun 2024 20:06:09 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1A98D40EDC; Thu, 27 Jun 2024 20:06:04 +0200 (CEST) Received: from forward502b.mail.yandex.net (forward502b.mail.yandex.net [178.154.239.146]) by mails.dpdk.org (Postfix) with ESMTP id E1E0D40F1A for ; Thu, 27 Jun 2024 20:06:02 +0200 (CEST) Received: from mail-nwsmtp-smtp-production-main-45.myt.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-45.myt.yp-c.yandex.net [IPv6:2a02:6b8:c12:28e:0:640:4e0e:0]) by forward502b.mail.yandex.net (Yandex) with ESMTPS id 462C05FB2D; Thu, 27 Jun 2024 21:06:02 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-45.myt.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id 55WIPZ5OoSw0-9beMYq2J; Thu, 27 Jun 2024 21:06:01 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1719511561; bh=wAqC+/gVtolejnDpqIZ58NeQjaB0PuCKfeS28HGx6Gg=; h=Cc:Message-Id:References:Date:In-Reply-To:Subject:To:From; b=pvKsNDWzVaBKM7fT69kuov10KtQa5NGFma9LgOaSLBE+VyXL32i2RTlylq3Df8EM9 ucoBz2IEp2DjYPljWIN7vOw1mNzJyrr1cZdjKzOAZdvRpsjXQ5HHYtlRYlVz8+oIVu UPU3ImsyjQoRgRkiPl3V6zCysQPBQfAZHym4uYK8= Authentication-Results: mail-nwsmtp-smtp-production-main-45.myt.yp-c.yandex.net; dkim=pass header.i=@yandex.ru From: Konstantin Ananyev To: dev@dpdk.org Cc: Konstantin Ananyev , Isaac Boukris , =?UTF-8?q?Morten=20Br=C3=B8rup?= , Stephen Hemminger Subject: [PATCH v2 3/3] test/bpf: add extra test cases for bpf convert Date: Thu, 27 Jun 2024 19:04:42 +0100 Message-Id: <20240627180442.1602-4-konstantin.v.ananyev@yandex.ru> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240627180442.1602-1-konstantin.v.ananyev@yandex.ru> References: <20240627115531.1440-1-konstantin.v.ananyev@yandex.ru> <20240627180442.1602-1-konstantin.v.ananyev@yandex.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 Acked-by: Morten Brørup Acked-by: Stephen Hemminger --- 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