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 373924597C; Fri, 13 Sep 2024 14:40:53 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C53E34025E; Fri, 13 Sep 2024 14:40:52 +0200 (CEST) Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) by mails.dpdk.org (Postfix) with ESMTP id B2DD44003C for ; Fri, 13 Sep 2024 14:40:50 +0200 (CEST) Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-a8d29b7edc2so268086566b.1 for ; Fri, 13 Sep 2024 05:40:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=interfacemasters.com; s=google; t=1726231250; x=1726836050; 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=lghJO1xh82P5O402PGd+SsddOr6K6w27rkIZvD4eaPs=; b=L7U6oLUqOzpAr81LG1Gy60D5j6jZAToV3FW9AYYlM12VpTIHQSxprZ+OQi8WWZ1/S6 2GdLpCXKXsJw5umzaPTV4Vx/FZdC0pivQ+06ZBwGMxENa34gw3oIZrf2mCJPuQ0e21rN Sll4fn/GeT+TPptNuZ+SKN3+EdNiL7fBIkq+o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726231250; x=1726836050; 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=lghJO1xh82P5O402PGd+SsddOr6K6w27rkIZvD4eaPs=; b=kkH4OsLChl2axDHMtNy57KMrctgsQrnUpHmYE9XMMjbc+QttXjI1zromy0golIRsw7 MF7XpDyU/LwULIuX6QbNJwnM286BJR4Zivpq4THyXSJ8tW4QycRffFQGIHOZ74g+jrs4 mOM2Jlsxfdk/YLIE6PTP5C0ADjurYtccGnTTEgEnJPdnxXw9D7jbXwmptG5WtNzwX/M6 ygFiBCToZeranoOb9N437HTZdAK2wUmAVdZhhegft/ndhBAFOSWr32DpWqyk9LxsxP7n TwzPeci3geg9tQnN1dVhdikZi23uvplyAMQatU+2ArvVC1jeFgXxlGMnfKh78IqZc0x3 sXgQ== X-Gm-Message-State: AOJu0YxkACnathtdYN6nNfCxps9z6hkx2hnkUYwYzsej2uNX7/ANz9Fs WlruiurcVZlpjtk0h/RLkRprwSZFdTAFeYFCpLaGoH0rrWCVGL1hn31E4B3VKbo= X-Google-Smtp-Source: AGHT+IHVfIWOd7MVv2Ah7YuDBAzikKZGmfQstR8n6at7LIQWzTUfrcUWCTOIJhdt+IwaN7+NnKqzWw== X-Received: by 2002:a17:907:f1e5:b0:a8c:78a5:8fc4 with SMTP id a640c23a62f3a-a902947d512mr562925566b.19.1726231249889; Fri, 13 Sep 2024 05:40:49 -0700 (PDT) Received: from fedora ([185.143.144.104]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d25c7286esm858352566b.138.2024.09.13.05.40.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Sep 2024 05:40:49 -0700 (PDT) From: Oleksandr Nahnybida X-Google-Original-From: Oleksandr Nahnybida Date: Fri, 13 Sep 2024 15:40:47 +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 --- 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