Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Jan 2015 09:24:38 -0800
From:      Avinash Sridharan <avinash.sridharan@gmail.com>
To:        Luigi Rizzo <rizzo@iet.unipi.it>
Cc:        Adrian Chadd <adrian@freebsd.org>, Vincenzo Maffione <v.maffione@gmail.com>, "freebsd-net@freebsd.org" <net@freebsd.org>
Subject:   Re: netmap over virtio giving packets with extra 12 bytes
Message-ID:  <CADJyuDjLn6Lu12=gozbGoWxYwzYcmRVAnEQSMQqMe5Yo0AFMpQ@mail.gmail.com>
In-Reply-To: <20150105170530.GB22916@onelab2.iet.unipi.it>
References:  <CADJyuDg-PujV%2BtknoSBi3fDd3%2BK%2BOwvjgwh1%2B=Z-eoBUkP2gPg@mail.gmail.com> <CA%2BhQ2%2BgRz0Q-f5N-C_CrC27qE1i-zSvb3rjWDH0JPCq4Q1%2BA8A@mail.gmail.com> <CAJ-VmonqqMedqnAwHfq%2BTSAEKwdSdxXfRpkmuTm2eLrB_uCV2w@mail.gmail.com> <20150105170530.GB22916@onelab2.iet.unipi.it>

next in thread | previous in thread | raw e-mail | index | archive | help
I used virsh to start the VM over qemu-kvm. Here is a dump of the network
XML that was fed to libvirt, while creating the domain:

<interface type='bridge'>

      <mac address='52:54:00:0f:8f:af'/>

      <source bridge='br0'/>

      <target dev='vnet3'/>

      <model type='virtio'/>

      <alias name='net0'/>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x03'
function='0x0'/>

    </interface>

    <interface type='bridge'>

      <mac address='52:54:00:0f:8f:bf'/>

      <source bridge='br0'/>

      <target dev='vnet4'/>

      <model type='virtio'/>

      <alias name='net1'/>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x05'
function='0x0'/>

    </interface>


The network backend is a bridge interface running over gentoo. The bridge
has a single port, which is a realtek r8169 NIC.


I didn't quite understand the question about using "virtio in native or
emulated netmap mode "?

While running the above experiment I just replaced the virtio-net drivers
with the netmap enabled virtio-net drivers.


*asridharan@stitch-dp-1** ~/stitch-click/kernel $* lsmod

Module                  Size  Used by

virtio_net             24612  0

netmap                 95166  1 virtio_net

mii                     3875  0


*asridharan@stitch-dp-1** ~/stitch-click/kernel $* modinfo ./virtio_net.ko

filename:       /home/asridharan/stitch-click/kernel/./virtio_net.ko

license:        GPL

description:    Virtio network driver

alias:          virtio:d00000001v*

depends:        netmap

vermagic:       3.14.14-gentoo SMP mod_unload

parm:           napi_weight:int

parm:           csum:bool

parm:           gso:bool


*asridharan@stitch-dp-1** ~/stitch-click/kernel $* modinfo ./netmap.ko

filename:       /home/asridharan/stitch-click/kernel/./netmap.ko

license:        Dual BSD/GPL

description:    The netmap packet I/O framework

author:         http://info.iet.unipi.it/~luigi/netmap/

depends:

vermagic:       3.14.14-gentoo SMP mod_unload

parm:           verbose:int

parm:           no_timestamp:int

parm:           mitigate:int

parm:           no_pendintr:int

parm:           txsync_retry:int

parm:           adaptive_io:int

parm:           flags:int

parm:           fwd:int

parm:           mmap_unreg:int

parm:           admode:int

parm:           generic_mit:int

parm:           generic_ringsize:int

parm:           generic_rings:int

parm:           default_pipes:int

parm:           bridge_batch:int

parm:           if_size:int

parm:           if_curr_size:int

parm:           if_num:int

parm:           if_curr_num:int

parm:           priv_if_size:int

parm:           priv_if_num:int

parm:           ring_size:int

parm:           ring_curr_size:int

parm:           ring_num:int

parm:           ring_curr_num:int

parm:           priv_ring_size:int

parm:           priv_ring_num:int

parm:           buf_size:int

parm:           buf_curr_size:int

parm:           buf_num:int

parm:           buf_curr_num:int

parm:           priv_buf_size:int

parm:           priv_buf_num:int


Please ping me if I haven't given enough data.


Thanks,

Avinash

On Mon, Jan 5, 2015 at 9:05 AM, Luigi Rizzo <rizzo@iet.unipi.it> 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).
>
> I need to investigate further.
> Avinash, could you tell us exactly your configuration -- what is the
> network backend for QEMU/KVM, and whether you are using virtio in
> native or emulated netmap mode ?
>
> cheers
> luigi
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CADJyuDjLn6Lu12=gozbGoWxYwzYcmRVAnEQSMQqMe5Yo0AFMpQ>