From owner-freebsd-net@FreeBSD.ORG Mon Jan 5 20:39:00 2015 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A64C17D9 for ; Mon, 5 Jan 2015 20:39:00 +0000 (UTC) Received: from mail-we0-x22d.google.com (mail-we0-x22d.google.com [IPv6:2a00:1450:400c:c03::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3767528DD for ; Mon, 5 Jan 2015 20:39:00 +0000 (UTC) Received: by mail-we0-f173.google.com with SMTP id q58so8648200wes.18 for ; Mon, 05 Jan 2015 12:38:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=USaaifkoB9t9PMo9PpwRN6W+0Px+0HF/kOUYUtaM5pw=; b=wICUekXT0Ha46vBRH2/VMdsOgad6eztZ1CIjAK/OIxWABHpDPIWNtf+1lyd3ZXvcm0 NJbG5BJhhn3g05NCOXB8bZq99aQXsD9Vl8QWPmTa438dN1jK3/bYSC3IrrozoyLmnftd ykJ2hdM3pIbCB9eGKSLWeq/000xFyXillZUf2NGRdSM2BPuDKqIXMD0ZTA5g4xNQdcAv EdcIKzdkca8cape2j46LWNhqnszGMBzxbBq7ImNVTUoy9dFu80rf/IAAxHUuJhEXzm2Q nHavqzyF1IBfytK06Ztf3NbTyNpAXS6X3DDaf5CFnQ8I5L5yUuGz0Nn01bmib2QWyo+G EUCg== MIME-Version: 1.0 X-Received: by 10.180.87.36 with SMTP id u4mr29135301wiz.20.1420490338640; Mon, 05 Jan 2015 12:38:58 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.41.136 with HTTP; Mon, 5 Jan 2015 12:38:58 -0800 (PST) In-Reply-To: <20150105170530.GB22916@onelab2.iet.unipi.it> References: <20150105170530.GB22916@onelab2.iet.unipi.it> Date: Mon, 5 Jan 2015 12:38:58 -0800 X-Google-Sender-Auth: 0VHPIlplfMvOlCd4kO-GJ4x9ZLw Message-ID: Subject: Re: netmap over virtio giving packets with extra 12 bytes From: Adrian Chadd To: Luigi Rizzo Content-Type: text/plain; charset=UTF-8 Cc: Avinash Sridharan , Vincenzo Maffione , "freebsd-net@freebsd.org" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Jan 2015 20:39:00 -0000 On 5 January 2015 at 09:05, Luigi Rizzo wrote: > On Mon, Jan 05, 2015 at 08:33:17AM -0800, Adrian Chadd wrote: >> ... surely virtio should be skipping over those bytes in the netmap rx >> side before handing them up? >> >> (It won't be the only hardware that puts the RX descriptor status in >> the RX frame itself..) > > it is not the rx descriptor, those 12 bytes are also present on the tx side. > Think of them as an encapsulation whose presence is negotiated when KVM connects > to the TAP port, and after that is present on all packets bidirectionally. > > Now, surely we could add/remove those bytes in the virtio-netmap code > (at the price of an additional data copy). Right, but I have similar issues with other wifi devices who put RX descriptor completion info in the header of the mbuf you pass to the NIC. So in the driver RX path, I have to += the data pointer /past/ the header. So, maybe for netmap you need to consider adding something that lets you specify how many bytes into the RX buffer the payload starts. -adrian