From owner-freebsd-net@freebsd.org Thu Oct 26 07:41:25 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 503FCE40EBA for ; Thu, 26 Oct 2017 07:41:25 +0000 (UTC) (envelope-from v.maffione@gmail.com) Received: from mail-it0-x22d.google.com (mail-it0-x22d.google.com [IPv6:2607:f8b0:4001:c0b::22d]) (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 1355170016 for ; Thu, 26 Oct 2017 07:41:25 +0000 (UTC) (envelope-from v.maffione@gmail.com) Received: by mail-it0-x22d.google.com with SMTP id k70so12960707itk.0 for ; Thu, 26 Oct 2017 00:41:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=eTpK5F3pGtcZTv1kFQlls8hPmgoApASTu9my2eNuIac=; b=URL7mwl51QWwH6OlkKh3bCAPcaUK67shzSRGjXaNXnfWPhyDBdhzWDFEM2w/G4QnmF iGxbtOjPZuDJmserYXkfDX/EjKzy4sO3lBvaXXOGk3147ybvp58r9IuoEY/vtqSK5Uef 00U1wvvraM55RP1HTnpkHYu+R1TqBsIIfYt+YF+bHBR9mciOWs3FJ3snj1juo8gNhcBa xkgev96Db5XElZsYXUTYjAgehLxQCq/1Pvxv10evBK5oAWeBe/B8kO2OjabtGrBgSxR3 JZeF7/I7qQVWnZksrcxY9xOwDTiGm3y93ezi7Xf18PFGBlGKRTgd5Ze9VrKpA0WYqoup MIcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=eTpK5F3pGtcZTv1kFQlls8hPmgoApASTu9my2eNuIac=; b=Vq+T9JJVSmAI8VAABhD88yC0ZlsZVv1snEL1CXqU7MrdyBozSL0t+6lW32biKEvvSF CVvwIdQI67EZhawOcOAaF334/ONHu9Uelj4RNXuOSCmoVziE67RzrCfckpwAFaBUm+9f BzeL0D7J0v+TusSbnJhSaP0AIAvxci0NBb8NKNgHGE74+yKcm62spDDf8ts3Oq9nqwpB 2kcZtX7OJ/VvXM36lYYszkbUXKnKpOUF5kmDHlLX+jwATjiZ/lVzn14pedKTtk3eXWRS Me/6JG6aKBSERwvqpkiBJo7FYyYWrb3l4cQ4Ymecx5fg2up72mODTQtjVIewng8mXFjQ qObg== X-Gm-Message-State: AMCzsaXzTwEhKlQg+LtjBu8Z8TQX/Mnq+6yPfp7vUzqyr34zqCwld6Vv 01ipRHDjJbuTzN2mp6cq84W6cS+ZttrLncv9HnSiWQ== X-Google-Smtp-Source: ABhQp+RTHsxGtyjNOc7VT3WW3yoY+XC2dUHnsNqHmVn63fWQz6J3oG4ZMXbo1JsNb9Wb58mqZ1pCTzS+gJqBaigdIqc= X-Received: by 10.36.250.4 with SMTP id v4mr1305010ith.31.1509003684205; Thu, 26 Oct 2017 00:41:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.2.176.143 with HTTP; Thu, 26 Oct 2017 00:41:23 -0700 (PDT) In-Reply-To: <59F0FBEE.6030008@cox.net> References: <59F0FBEE.6030008@cox.net> From: Vincenzo Maffione Date: Thu, 26 Oct 2017 09:41:23 +0200 Message-ID: Subject: Re: virtio_net / netmap RX dropping frames To: Joe Buehler Cc: "freebsd-net@freebsd.org" 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: Thu, 26 Oct 2017 07:41:25 -0000 I guess you are using a FreeBSD guest. Is this the case? If you have the chance, try a linux guest to check if virtio-net works better there (I've used netmap on the netmap-patched virtio-net in Linux guests, never tried on FreeBSD). The netmap ring size is just the NIC ring size. If you change the virtio-net NIC ring size (sysctl on FreeBSD, I guess). Anyway, for your specific use-case (VM accessing the physical 10G NIC) there is a way better solution, which is the netmap passthrough. Check out the virtualization.pdf in this tutorial https://github.com/vmaffione/netmap-tutorial. You basically need to run QEMU (with KVM enabled), saying that you want to pass through a netmap port (e.g. netmap:ethX in your case) to a VM. Then in the FreeBSD VM you will see a "ptnet0" interface, where you can use pkt-gen. You should get a 10x improvement if properly configured. Cheers, Vincenzo 2017-10-25 23:02 GMT+02:00 Joe Buehler : > I am running virtio_net (netmap-modified) on top of netmap (latest) in a > KVM virtual machine. The host adapter is Intel 82599ES 10G and the VM > is connected to it via macvtap. > > My test setup is a small program in the VM sending frames out to an > external loopback device and watching what comes back. > > I am running at fairly low frame rates (200k frames / sec) and seeing RX > frame drops and high latency (a few milliseconds). The TX frames are > all making it to the external loopback device (based on device counters) > but the macvtap device in the RX path is reporting dropped frames, the > count agreeing with what the test program observes. > > I guess my first question has to do with ring sizes. The netmap API is > reporting 255 buffers in the RX and TX rings. How do I increase this > substantially? > > Joe > > _______________________________________________ > freebsd-net@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > -- Vincenzo Maffione