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 77D1BA0032 for ; Fri, 15 Jul 2022 13:34:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 07E1540696; Fri, 15 Jul 2022 13:34:38 +0200 (CEST) Received: from guvercin.ceng.metu.edu.tr (guvercin.ceng.metu.edu.tr [144.122.171.43]) by mails.dpdk.org (Postfix) with ESMTP id 1B46B40696 for ; Fri, 15 Jul 2022 13:34:36 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by guvercin.ceng.metu.edu.tr (Postfix) with ESMTP id 2E0C62C394 for ; Fri, 15 Jul 2022 14:34:32 +0300 (+03) X-Virus-Scanned: Debian amavisd-new at ceng.metu.edu.tr Received: from guvercin.ceng.metu.edu.tr ([127.0.0.1]) by localhost (guvercin.ceng.metu.edu.tr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4OoJ3on3MaZl for ; Fri, 15 Jul 2022 14:34:28 +0300 (+03) Received: from roundcube.ceng.metu.edu.tr (kanarya.ceng.metu.edu.tr [144.122.171.33]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: e1885458) by guvercin.ceng.metu.edu.tr (Postfix) with ESMTPSA id DCD5F2C2BF for ; Fri, 15 Jul 2022 14:34:27 +0300 (+03) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ceng.metu.edu.tr; s=mail; t=1657884868; bh=1uFHz0S6cdHwdZTN0NHSgBIGxqwCXBoaKiWSLerINOY=; h=Date:From:To:Subject:From; b=fGjq0POL5ezyTsMqVeYY8CyeuEEOkDG40EquSWqor4xqe956YUrlcdhyNkdZMiGRB Dxp22t5DU7LJFmaSVuoJFepDbuPQgSilr1fhj2oCl69mJ9VPNg7d6R9qwE0up/Q25l qKtsXErWhNM5alCeNdy8U4mOp3BP07RS5BYZqQUk= MIME-Version: 1.0 Date: Fri, 15 Jul 2022 14:34:26 +0300 From: Omer Yamac To: users@dpdk.org Subject: rte_ring_enqueue_burst enqueue single packet for each call User-Agent: Roundcube Webmail Message-ID: <28b48411ea7657cce854dc3cc1cf98c8@ceng.metu.edu.tr> X-Sender: omer.yamac@ceng.metu.edu.tr Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org Hi All, I was working on passive traffic application. That means I receive packets but I transmit nothing. So I have two core one for the capture packet and one for the processing packet. In my case, Worker thread (processing packet) is much slower than the capturing packet. I just want to test this case and to see what happens if the number of enqueue operation is much higher than the dequeue operation. I realize that I got a segmentation fault if I enqueue packets one by one. Do I miss some point? Why "rte_ring_enqueue_burst" function behaves differently? Any Idea Here are the loops of cores: Capture core loop: while (!quit_signal_rx) { const uint16_t nb_rx = rte_eth_rx_burst(0, 0, bufs,BURST_SIZE); uint16_t sent = 0; // following line seg fault for (size_t i = 0; i < nb_rx; i++) sent += rte_ring_enqueue_burst(out_ring, (void *)&bufs[i], 1, NULL); // Works perfectly //sent = rte_ring_enqueue_burst(out_ring, (void *)bufs, nb_rx, NULL); if(nb_rx - sent != 0) rte_pktmbuf_free_bulk(&bufs[sent],nb_rx - sent); } Worker core loop: while (!quit_signal_work) { const uint16_t num = rte_ring_dequeue_burst(in_r, (void *)bufs, BURST_SIZE*1, NULL); /* Do a little bit of work for each packet */ for (i = 0; i < num; i++) { uint64_t t = rte_rdtsc()+100000; while (rte_rdtsc() < t) rte_pause(); } rte_pktmbuf_free_bulk(bufs,num); }