From owner-freebsd-net@freebsd.org Wed Apr 12 15:20:11 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 4393ED3B69E for ; Wed, 12 Apr 2017 15:20:11 +0000 (UTC) (envelope-from dreadiscool@gmail.com) Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com [IPv6:2a00:1450:400c:c09::231]) (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 CB8B3B78 for ; Wed, 12 Apr 2017 15:20:10 +0000 (UTC) (envelope-from dreadiscool@gmail.com) Received: by mail-wm0-x231.google.com with SMTP id t189so26881948wmt.1 for ; Wed, 12 Apr 2017 08:20:10 -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=84bLY32JpeZqnOFtST2mNYUIT80EfiGUvCpUKg+SkSA=; b=Q+utpSghU9A99an4BiLIOSzr4W4ZY8hRPraTgR8iF6txAsV6YCEdQXLAqUNVHm/R6P ubj5YEsNuvqpQrSTEIgiOTdCP1JwxpC7cKYdBjcAVwqlyEAaz+/2RTctZ5HJm8CnZLZI zghzxaqJ/ZJucGUknO3whbMNPTlZy7yFb3T075hWxWO7r5TaE/3ysx2rwGXsJBwDVhqc nAqauObSHQ0t39/3B2pqXr5t2mvpXXtU6RtlAMfDpKmkwhUoMzV1W7pew4lG8LxQPxO6 Dajk3B7GuierpnI70JDARn+aM+qVHLYhplILGzmZW7ySYCezzXugqb5WJO8vfUJa4gYz Vixg== 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=84bLY32JpeZqnOFtST2mNYUIT80EfiGUvCpUKg+SkSA=; b=PceDPkXEHrh5B2YC/29o/OBpU98mKpzP9uZVwXmzpQmvF2+5UrK975XQRvw/AIoMjQ ucwAJI8ypbNYDrfbRtFRurhYNPBeSQl96ISgJgHpX1xW+LLvKTDy2Eq/JTdgAInhDU4X l3Rz5tbSY330pnd9tU7ZT4iP/3wa1WiF/4qWm5i3YojLjCsjJyQGU/EUHTljTWjDu3Au PpZ4/8fDP3ycwnvtQcDtaazSqTfTWAjcA8WKC8A6F7NrpSz2+61BwL8O4/9RGnORH5jl Cxxg7Z8aAup04lbY0xxlSZtqIz8bBnc+GqCd7QP/gGk4pqa2fZrYMM3l9UQJJALDFWev R9Mw== X-Gm-Message-State: AN3rC/4LtW9OLTCBZA95TuSwGyYLmQjEPIItuLgB/cTVxYVKQ0t/RLMj Bpj/ounQEvvvUm3p/nZh+43uwrrc+Q== X-Received: by 10.28.109.81 with SMTP id i78mr6880556wmc.127.1492010408590; Wed, 12 Apr 2017 08:20:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.165.68 with HTTP; Wed, 12 Apr 2017 08:20:07 -0700 (PDT) In-Reply-To: References: From: Paras Jha Date: Wed, 12 Apr 2017 11:20:07 -0400 Message-ID: Subject: Re: Netmap pipe zero-copy with NIC buffer? To: Vincenzo Maffione Cc: 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: Wed, 12 Apr 2017 15:20:11 -0000 Thank you for the clarification! On Wed, Apr 12, 2017 at 3:50 AM, Vincenzo Maffione wrote: > netmap applications always bypass the kernel (network stack). There is > only a distinction between ports opened in "native" mode and "emulated" > mode. > If NIC driver doesn't have native netmap support, the legacy driver is > internally used by netmap to transmit and receive (and this is called > "emulated mode"). > In any case (both in native and emulated mode) the netmap application sees > netmap rings, and can zerocopy between two rings (in the same memory area) > by simply swapping the ring slots. > > Of course, in emulated mode netmap internally transforms each ring slot > into and mbuf and the other way around, possibly requiring a copy. And the > whole thing is way slower. > But this is unrelated to the zerocopy thing: your application isn't aware > of the emulated or native mode and can zerocopy slots between netmap rings. > > Cheers, > Vincenzo > > 2017-04-12 4:04 GMT+02:00 Paras Jha : > >> Apologies, by KB I meant kernel bypass, since it is possible to open a >> netmap port without bypassing the kernel. I didn't know if this would >> affect it or not. >> >> On Sun, Apr 9, 2017 at 3:20 AM, Vincenzo Maffione >> wrote: >> >>> Hi, >>> Yes, when you nm_open("netmap:em3{2", ...), you're opening a netmap >>> pipe in the same netmap memory area as the one used by >>> nm_open("netmap:em3", ...). >>> As a result, you can zero-copy packets from NIC rings to pipe rings. >>> >>> What do you mean by "KB mode"? >>> >>> Cheers, >>> Vincenzo >>> >>> 2017-04-08 19:56 GMT+02:00 Paras Jha : >>> >>>> Hi all, >>>> >>>> Is it possible to have a netmap pipe share memory with a netmap port >>>> opened >>>> in KB mode for zero-copy purposes? >>>> >>>> All the best >>>> _______________________________________________ >>>> 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 >>> >> >> > > > -- > Vincenzo Maffione >