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 3EDB54597C; Fri, 13 Sep 2024 15:06:05 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0EA0942E9B; Fri, 13 Sep 2024 15:06:05 +0200 (CEST) Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) by mails.dpdk.org (Postfix) with ESMTP id E18E34025E for ; Fri, 13 Sep 2024 15:06:03 +0200 (CEST) Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-a7a843bef98so103835066b.2 for ; Fri, 13 Sep 2024 06:06:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=interfacemasters.com; s=google; t=1726232763; x=1726837563; darn=dpdk.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:from:to:cc:subject:date:message-id:reply-to; bh=oGEOfCffiNbwebt/p4pvyZnG8EAExIgMTuJjDZhCZDg=; b=cllYGyVqpgkEmicxyNat5KjdAAnxKHiyrHbMWgpW7im+vT0VQedjvu97piulnC6P2l YY3oOOz9aUSozfTUFYVaGfePKYBwFBdPQzIkQ2fay9cikNZycaCCzjCW5vB28GnRdZb/ O7tzYXJ0Bjv6TyPNX6A1HOy31hfQsMFxlX8FU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726232763; x=1726837563; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=oGEOfCffiNbwebt/p4pvyZnG8EAExIgMTuJjDZhCZDg=; b=AfffQSGHPI67g1gFMR+M8J7q3Y7nhKOsrto4tFyo1EAztx87dev7EKQbFxBivziTDQ dNBuvEfYdXiSAb9N2r6lKOur8uHb2z9+UQMyD8nashhn4qvWjQO7eRbY3+xK/CcA5tFH UR+2v4BMWn4i/VWIRyjQWPogrUC9YYO0pRO72/Pw5n2yO6PTVM+WFgYLoYjNFkjVP3Mo lbwZs8ygp+7STD3Di8XQ7FSm7HVnyHJjre8WwkOS85KJR9amZNjHSLpFBsKZd5m0c0yr JDLlzph4Q2ZoJh2K3pCpz6YZ+r/cFMtgILrlvrP8x4zUWySM57Iz3ggmVcWjge2X0CdW sHIQ== X-Gm-Message-State: AOJu0YxyzNDu2ZZxtK+rkXRn5cCvj82XgxuXPAC3MgnBE5gjSXOWm38a 4mnp3V4HytEd0E5zHGctbfa1Emx+7wOjvTBvWefowJ10tGmEJvAOVrflWSK5vG6T7ivkMvX6yen bKlU= X-Google-Smtp-Source: AGHT+IEqp0lVQ4X2BHj7t5+Ww3AzdBLJYnKoBrHpQdslerSwk1HQwNbzyY+Q7V19EEMjIbl9Dim5Kg== X-Received: by 2002:a17:907:1b27:b0:a89:f5f6:395 with SMTP id a640c23a62f3a-a9047b47d1fmr256607166b.1.1726232763282; Fri, 13 Sep 2024 06:06:03 -0700 (PDT) Received: from fedora ([185.143.144.104]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d25a258a3sm864769966b.89.2024.09.13.06.06.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Sep 2024 06:06:02 -0700 (PDT) From: Oleksandr Nahnybida X-Google-Original-From: Oleksandr Nahnybida Date: Fri, 13 Sep 2024 16:06:00 +0300 To: reshma.pattan@intel.com, stephen@networkplumber.org Cc: dev@dpdk.org Subject: [PATCH v2 2/2] test/pcapng: test chained mbufs Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Adjust test to check if pcapng works with chained mbufs Signed-off-by: Oleksandr Nahnybida --- Sorry for the mess. Resending PATCH v2 2/2 as the previous submission was incorrectly threaded to the v1. Please ignore the earlier email app/test/test_pcapng.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/test/test_pcapng.c b/app/test/test_pcapng.c index 2665b08c76..b219873c3a 100644 --- a/app/test/test_pcapng.c +++ b/app/test/test_pcapng.c @@ -102,6 +102,14 @@ mbuf1_prepare(struct dummy_mbuf *dm, uint32_t plen) pkt.udp.dgram_len = rte_cpu_to_be_16(plen); memcpy(rte_pktmbuf_mtod(dm->mb, void *), &pkt, sizeof(pkt)); + + /* Idea here is to create mbuf chain big enough that after mbuf deep copy they won't be + * compressed into single mbuf to properly test store of chained mbufs + */ + dummy_mbuf_prep(&dm->mb[1], dm->buf[1], sizeof(dm->buf[1]), pkt_len); + dummy_mbuf_prep(&dm->mb[2], dm->buf[2], sizeof(dm->buf[2]), pkt_len); + rte_pktmbuf_chain(&dm->mb[0], &dm->mb[1]); + rte_pktmbuf_chain(&dm->mb[0], &dm->mb[2]); } static int @@ -117,7 +125,7 @@ test_setup(void) /* Make a pool for cloned packets */ mp = rte_pktmbuf_pool_create_by_ops("pcapng_test_pool", - MAX_BURST, 0, 0, + MAX_BURST * 32, 0, 0, rte_pcapng_mbuf_size(pkt_len) + 128, SOCKET_ID_ANY, "ring_mp_sc"); if (mp == NULL) { @@ -155,7 +163,7 @@ fill_pcapng_file(rte_pcapng_t *pcapng, unsigned int num_packets) for (i = 0; i < burst_size; i++) { struct rte_mbuf *mc; - mc = rte_pcapng_copy(port_id, 0, orig, mp, pkt_len, + mc = rte_pcapng_copy(port_id, 0, orig, mp, rte_pktmbuf_pkt_len(orig), RTE_PCAPNG_DIRECTION_IN, NULL); if (mc == NULL) { fprintf(stderr, "Cannot copy packet\n"); -- 2.46.0