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 8284A4597C; Fri, 13 Sep 2024 14:54:42 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5C4EC4025E; Fri, 13 Sep 2024 14:54:41 +0200 (CEST) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) by mails.dpdk.org (Postfix) with ESMTP id 277564003C for ; Fri, 13 Sep 2024 14:54:39 +0200 (CEST) Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-53653ee23adso1928799e87.3 for ; Fri, 13 Sep 2024 05:54:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=interfacemasters.com; s=google; t=1726232078; x=1726836878; darn=dpdk.org; h=in-reply-to:content-disposition:mime-version:references:reply-to :message-id:subject:cc:to:date:from:from:to:cc:subject:date :message-id:reply-to; bh=6nlMLY2ZuJLajo9CTPmTdIcXRPGtweGjuci+egrSrXA=; b=craOx1OTqcUV88wTOf9nGgI3KbGIUIjJ1IxaonKCb0JjLdTHBHD7q05886cchzFVqg SBC2DRCuvgx+Uawue+hm1K98CQgj6YFTGUZgBH1crQLeUoid17mRgfrkoXVMFFpM+QHB act6Wt4ckTXJ7wC7RilNzFnplhEFUop5naeAM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726232078; x=1726836878; h=in-reply-to:content-disposition:mime-version:references:reply-to :message-id:subject:cc:to:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6nlMLY2ZuJLajo9CTPmTdIcXRPGtweGjuci+egrSrXA=; b=O2VA43+eDewep2/Vj09Fwfr4kOj/WzYtzikTet+r+w1jvnBJRXm8rQuS1uNNUEPmvs UM34l22ETi8hWrRt7UEXFXJW7GGOyVPB1YkyO73VzlbExrMRFESJQzGTQ0Hhbl5oibQr 4PrKtVWchJqUO0tGWHoxVKKFCeDKSpvnhlL5OsWRrGO7KnjVrlfU4ZhvPNxdIJS6SjkF AHCISsaUL4XI1T2M92Ll21OUz0XpdBnDODpHjcSwZjNzHaYHxNKaenhcHIQf+kJagLkG +76/v1XJuJ/AL//wRshy7XxywxnX+42dZbS7caX9yR6hSECBtKpiGVOidFz8xFgjm0BJ XzkA== X-Gm-Message-State: AOJu0YwLDevz6JJMSJKwbZ1YcRPxPuCvkdAg2svrimACR961Bga9ipCL zMgrtAdfgmamw+ad6iCXMIRqCEaLN3cC1w8mXO9WMty611H79ngI9ISnr/pVXwZfIPMDqDptWVo mtA4= X-Google-Smtp-Source: AGHT+IGCG/qkglacd6sadytx8Vr1vRIFuJ4brPspmqcA6lN2gC+mjXzkdqpzS2NOes6sEJwRs6sbzw== X-Received: by 2002:a05:6512:4013:b0:52c:842b:c276 with SMTP id 2adb3069b0e04-53678ff49cdmr4146591e87.53.1726232078093; Fri, 13 Sep 2024 05:54:38 -0700 (PDT) Received: from fedora ([185.143.144.104]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9012fa463csm313089166b.139.2024.09.13.05.54.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Sep 2024 05:54:37 -0700 (PDT) From: Oleksandr Nahnybida X-Google-Original-From: Oleksandr Nahnybida Date: Fri, 13 Sep 2024 15:54:35 +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: <7yrjcy7sk4nexcqynikybhjvpxlhhmlwvubngwqvib5o752sys@644loude6vbd> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7yrjcy7sk4nexcqynikybhjvpxlhhmlwvubngwqvib5o752sys@644loude6vbd> 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: , Reply-To: rf7wzd6ytwereegdzzfduo46suisj5azxsfgvc3r5ufip6iwqt@bhidb2bsahmy Errors-To: dev-bounces@dpdk.org Adjust test to check if pcapng works with chained mbufs Signed-off-by: Oleksandr Nahnybida --- 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