From owner-freebsd-net@FreeBSD.ORG Fri Jan 17 20:03:54 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45E1CE2D for ; Fri, 17 Jan 2014 20:03:54 +0000 (UTC) Received: from mail-ea0-f179.google.com (mail-ea0-f179.google.com [209.85.215.179]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D090715BD for ; Fri, 17 Jan 2014 20:03:53 +0000 (UTC) Received: by mail-ea0-f179.google.com with SMTP id q10so1156278ead.24 for ; Fri, 17 Jan 2014 12:03:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=OYFDDy8MiT+UEw7haQ+008ZBh1biiVXj9KJMmoPrftI=; b=ZE/cU+mseaTUVT7ENpjXHrLRCoUc6vjWC5Zt/hIY7AaZHTnMm61M1XQOxaQN/GraIR lsDtd4OMJrboP1ilWM5dfK9MZWENoEaYhppolY0cohhv4hI7i1AhDnI7hXGmc0U9PrSQ pWBzEvUFUc1EQgEs9Zf2JF0gkLMTjEafKSb3KKFJ0S3Gg9/Ty685HgVAjNctff88ZpE1 UHNpaD9HJ9DCcD2tpz0qcN6vr5UGsqCBj5hMEbVc5SX7Q9ekX4c59joCf1LqCXhJ0dxr aypx2Er03Vbtj8qU1P00DgOK+gYT7uiTFep1yM9vIe1/bPFJPIPH+XW3v9FAo1qNsz1k +NGQ== MIME-Version: 1.0 X-Received: by 10.15.74.200 with SMTP id j48mr4561835eey.102.1389988990738; Fri, 17 Jan 2014 12:03:10 -0800 (PST) Received: by 10.14.2.66 with HTTP; Fri, 17 Jan 2014 12:03:10 -0800 (PST) In-Reply-To: References: Date: Fri, 17 Jan 2014 12:03:10 -0800 Message-ID: Subject: Re: Problems with netmap pkt-gen (ip range and packet counter) From: hiren panchasara To: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: "freebsd-net@freebsd.org" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jan 2014 20:03:54 -0000 On Fri, Jan 17, 2014 at 11:16 AM, Olivier Cochard-Labb=C3=A9 wrote: > On Mon, Dec 23, 2013 at 11:16 AM, Olivier Cochard-Labb=C3=A9 > wrote: > >> >> My second problem is with the latest -current version of pkt-gen only: T= he >> first time (and only the first time) I'm using the pk-gen in sender mode >> with a max number of packet (-n option) to send: It doesn't stop and >> doesn't exit automatically when counter is reached. >> >> >> > I've added some DEBUG messages to the pkt-gen code and found an infinite > loop when it wait all the TX queues to be empty at "nm_tx_pending(txring)= ". > > > (etc..) > main_thread [1397] 12829932 pps (12842762 pkts in 1001000 usec) > main_thread [1397] 12829621 pps (12842463 pkts in 1001001 usec) > main_thread [1397] 12835472 pps (12861092 pkts in 1001996 usec) > main_thread [1397] 12834919 pps (13078782 pkts in 1019000 usec) > sender_body [1040] [DEBUG] End for while sent < n > sender_body [1043] [DEBUG] End flush remaining packets > sender_body [1048] [DEBUG] wait for TX queue 0 be empty... > main_thread [1397] 8271783 pps (8797049 pkts in 1063501 usec) > main_thread [1397] 0 pps (0 pkts in 1007501 usec) > main_thread [1397] 0 pps (0 pkts in 1063499 usec) > (etc....) Appears to me that main_thread() doesn't have a terminating condition based on g.npackets (number of packets to send). Only condition seems to be: if (done =3D=3D g->nthreads) break; Can we add if (npkts >=3D g.npackets) then break? Would that work? cheers, Hiren