Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Jan 2015 08:33:17 -0800
From:      Adrian Chadd <adrian@freebsd.org>
To:        Luigi Rizzo <rizzo@iet.unipi.it>
Cc:        Avinash Sridharan <avinash.sridharan@gmail.com>, 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:  <CAJ-VmonqqMedqnAwHfq%2BTSAEKwdSdxXfRpkmuTm2eLrB_uCV2w@mail.gmail.com>
In-Reply-To: <CA%2BhQ2%2BgRz0Q-f5N-C_CrC27qE1i-zSvb3rjWDH0JPCq4Q1%2BA8A@mail.gmail.com>
References:  <CADJyuDg-PujV%2BtknoSBi3fDd3%2BK%2BOwvjgwh1%2B=Z-eoBUkP2gPg@mail.gmail.com> <CA%2BhQ2%2BgRz0Q-f5N-C_CrC27qE1i-zSvb3rjWDH0JPCq4Q1%2BA8A@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
... 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..)



-adrian

On 5 January 2015 at 04:19, Luigi Rizzo <rizzo@iet.unipi.it> wrote:
> What you see is a virtio issue.
>
> virtio prepends a 10 or 12-byte "virtio header"
> to all packets, which is used to define what sort
> of NIC accelerations (checksum, tso etc.) are
> expected on the link.
>
> I do not remember if there is a way in qemu-kvm to
> remove the header. Maybe Vincenzo (in Cc) remembers.
>
> cheers
> luigi
>
> On Mon, Jan 5, 2015 at 6:54 AM, Avinash Sridharan <
> avinash.sridharan@gmail.com> wrote:
>
>> I am using netmap with the click modular router, running the click-modular
>> router in user space. A while back I was using this combination with the
>> e1000 device driver, with a slightly older netmap code-base.
>>
>> Recently I updated my netmap code base and am trying to use the
>> click-modular router with netmap over a virtio-net device driver (over
>> KVM). With this combination, though I was able to receive packets I was
>> unable to interpret any packets coming from the FromDevice element.
>>
>> To debug this issue (and to negate any changes I made to the click-modular
>> router), I ran the pkt-gen application with the "dump payload" option:
>>
>> sudo ~/pkt-gen -i eth1 -f rx -X
>>
>> This showed that packets are being received correctly from the
>> netmap-enabled interface, but there are an extra "12" bytes appended to the
>> packet.
>>
>> 381.088570 main_thread [1446] 1 pps (1 pkts in 1001088 usec)
>>
>> ring 0x7f133bca6000 cur     1 [buf    516 flags 0x0000 len    72]
>>
>>     0: 00 00 00 00 00 00 00 00 00 00 01 00 01 80 c2 00 ................ <<
>> extra 12 bytes
>>
>>    16: 00 00 40 16 7e 5b 50 f0 00 26 42 42 03 00 00 00 ..@.~[P..&BB....
>>
>>    32: 00 00 80 00 40 16 7e 5b 50 f0 00 00 00 00 80 00 ....@.~[P.......
>>
>>    48: 40 16 7e 5b 50 f0 80 01 00 00 14 00 02 00 00 00 @.~[P...........
>>
>>    64: 00 00 00 00 bc 9b f6 74
>>
>>
>> As we can see, the above is an STP BPDU, and there are 12 leading bytes in
>> the payload.
>>
>>
>> The extra leading bytes screw up the packet interpretation.
>>
>>
>> So is this is an artifact of the virtio-net driver or has something
>> changed in the netmap device driver?
>>
>>
>> Thanks,
>>
>> Avinash
>>
>
>
>
> --
> -----------------------------------------+-------------------------------
>  Prof. Luigi RIZZO, rizzo@iet.unipi.it  . Dip. di Ing. dell'Informazione
>  http://www.iet.unipi.it/~luigi/        . Universita` di Pisa
>  TEL      +39-050-2211611               . via Diotisalvi 2
>  Mobile   +39-338-6809875               . 56122 PISA (Italy)
> -----------------------------------------+-------------------------------
> _______________________________________________
> freebsd-net@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-VmonqqMedqnAwHfq%2BTSAEKwdSdxXfRpkmuTm2eLrB_uCV2w>