From owner-freebsd-net@freebsd.org Fri Oct 27 01:06:43 2017 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C61E5E57B1E for ; Fri, 27 Oct 2017 01:06:43 +0000 (UTC) (envelope-from sunxiaoye07@gmail.com) Received: from mail-oi0-x234.google.com (mail-oi0-x234.google.com [IPv6:2607:f8b0:4003:c06::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A2C870B4B for ; Fri, 27 Oct 2017 01:06:43 +0000 (UTC) (envelope-from sunxiaoye07@gmail.com) Received: by mail-oi0-x234.google.com with SMTP id j126so8639565oib.8 for ; Thu, 26 Oct 2017 18:06:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:from:date:message-id:subject:to; bh=kmEpKiS3lyJFkket+Wx9oq+3fay/HyVkEUcyfVCj7qA=; b=LhScPnYk7g45S6YRsqRedMz0bbLI6dk846dRqq1JbjE1l74xItGCMF+IIBlASiq5RX AF6E1c95ZvSg76o9XbyJ3XzIkJyt2hmWFFLLnAR2SCudBZymfz7zoLUpYdfMTlw2fvY5 6H9AnQWhJQj5JGNlDNvJIGEDXAWaBiGi8MYkAUw+vvSBrJiENtM7/Qpm3UaoXaTsK6FE l8GXmzp1dNWKUVthRtZrxEBGou23gqgap7XsE5LbLJFkiuZYNNvYO9jAysNdqHCaG44k fXYXadfIVIqnva0uRpHoCoVejh19/blKkXvGT+Y03LuQzNIcSCLAAeflIaSO+1d1XvI6 Uipg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to; bh=kmEpKiS3lyJFkket+Wx9oq+3fay/HyVkEUcyfVCj7qA=; b=Fe8hLEcUPXCdJ5q5GUE6A5sTamIQoXj4AxGGxhmu6hZ0AassPIHnDLQf8SRyRBzPZ+ CMmV2swobWBwpfSKSlwKmLKBpZLV5AKxI51TCKS2nNDgaAB0dUhdHFMo6Z/ZBB2swoVg B1Jf9rtr1/nu4/hV/BYNG/SKntppVnn+6859CWTS/TQtKoKE+scaEXOwXA45xOFXrRA4 rOF+J5GGGvYVt9ZbardVdQ0SE7eYFwltIbN3OGoizxyIaBbp5L6AEEJ+95dIclwFhwPB T1Q7g/suZy152fAYOx7kwEiG4LsVlZvIla7mQ6ZZc8ZptJZDsd0X6gU9SNG43aDlipJN l9Gg== X-Gm-Message-State: AMCzsaU0EFibI/aou5fhfwZuwjSvO1CFoL18CIu9lHa+s06O/E1VT15Z fvW1Z4qF8smdvK2veqSGb3+xTTigynPOVONSo3KAAA== X-Google-Smtp-Source: ABhQp+QMzNpdBUatFdLTuhpmF/r6nerDzgjtOdTBKPHF8YutYxc48UN/XH7Obmu8H70yon1MK9+mB04VfEDe36tAHcA= X-Received: by 10.202.77.82 with SMTP id a79mr3156617oib.297.1509066402653; Thu, 26 Oct 2017 18:06:42 -0700 (PDT) MIME-Version: 1.0 Sender: sunxiaoye07@gmail.com Received: by 10.157.72.241 with HTTP; Thu, 26 Oct 2017 18:06:42 -0700 (PDT) From: Xiaoye Sun Date: Thu, 26 Oct 2017 20:06:42 -0500 X-Google-Sender-Auth: UNIx-SHbmw6xbohQdsoR66Ngqh0 Message-ID: Subject: [netmap] when does a packet in the netmap ring send out exactly To: FreeBSD Net Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.23 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, 27 Oct 2017 01:06:43 -0000 Hi I write a netmap program that sends packets to the network. my program uses one netmap ring and fills the ring slots with packets. My program needs to do something (action A) after a particular packet (packet P) in the ring slot is sent to the network. so the program tracks the position of the tail point and checks if the tail point has moved across the slot I used to put that packet P. However, I found that the tail pointer may not move forward even seconds after the receiver side got packet P. Sometimes the tail pointer never moves forward until the TX ring is full. I try ioctl(NIOCTXSYNC), however, it cannot 100% solve the problem. My question is that is there a way to make the TX ring empty as early as possible so that I can know when my packet is sent out. or is there another way to know when the packet in the slot is sent to the network/NIC physical queue? I am using Linux 3.16.0-4-amd64. Thanks! Best, Xiaoye