netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: VLAN test cases in 2.6.38.7
Date: Wed, 25 May 2011 11:49:17 -0700	[thread overview]
Message-ID: <4DDD4F2D.4030503@candelatech.com> (raw)
In-Reply-To: <4DDC7888.3010406@candelatech.com>

On 05/24/2011 08:33 PM, Ben Greear wrote:
> On 05/24/2011 07:47 PM, David Miller wrote:
>> From: Ben Greear<greearb@candelatech.com>
>> Date: Tue, 24 May 2011 15:52:52 -0700
>>
>>> Either my ubridge code is broken, or 2.6.38.7+ doesn't send
>>> tp_vlan_tci
>>> properly. All I ever see is zero for that field.
>>
>> You need to put the af_packet socket into TPACKET_V2 format.
>
> Actually, that doesn't seem needed. I just needed to give more
> space to the cmsg buffer to account for the cmsg struct overhead.
> (And I had a bunch of other bugs, but that was the only one
> that directly affected the tci field.)
>
> I think that TPACKET_V2 stuff might be only for reading
> memmapped messages or something like that?
>
> It looks like for any flexible user-space code, we are just going
> to have to use recvmesg instead of recvfrom, and add the extra checks
> for cmesg data. I'll post code when I get it working better so
> the next person to try this might have an easier time :P

Updated code is here:
http://www.candelatech.com/~greearb/misc/ubridge.tar.gz

Some testing results:

kernel 2.6.38.7, plus back-port of:
    network: Allow af_packet to transmit +4 bytes for VLAN packets.
MTU: 1500
NIC: igb (3.0.19)

   Test-cases:
   0:  Ensure receipt of tags when bridging ether devices
       with an un-used VLAN on one device.  Uses recvmsg (aux-data)
   1:  Ensure receipt of tags when bridging ether devices
       with an un-used VLAN on one device.  Uses recvfrom (no aux-data)
   2:  Ensure receipt of tags when bridging ether devices
       without any VLANs configured.  Uses recvmsg (aux-data)
   3:  Ensure receipt of tags when bridging ether devices
       without any VLANs configured.  Uses recvfrom (no aux-data)
   4:  Ensure receipt of tags when bridging ether devices
       with bridged VLAN on one device.  Uses recvmsg (aux-data)
   5:  Ensure receipt of tags when bridging ether devices
       with bridged VLAN on one device.  Uses recvfrom (no aux-data)


Generator (LANforge):
    MTU 1500
    udp connection on eth with 1024 byte pdu, 56kbps
    udp connection on eth with 4000 byte pdu, 56kbps
    udp connection on vlan 7 with 1024 byte pdu, 56kbps
    udp connection on vlan 7 with 4000 byte pdu, 56kbps

test-case 0:  Passes
test-case 1:  Fails on VLANs (expected, recvfrom doesn't get aux-data to re-build VLAN hdr)
test-case 2:  Passes
test-case 3:  Passes
test-case 4:  Passes
test-case 5:  Fails on VLANs (expected, recvfrom doesn't get aux-data to re-build VLAN hdr)

Thanks,
Ben


>
> I think we will need to add the has-vlan-tci flag to the cmesg
> data, and probably also remove that masking of the CFI bit.
>
> I've no idea about socket filters, but maybe someone else can
> deal with that :)
>
> Thanks,
> Ben
>
>


-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


      reply	other threads:[~2011-05-25 18:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-24 18:49 VLAN test cases in 2.6.38.7 Ben Greear
2011-05-24 19:08 ` Ben Greear
2011-05-24 22:52   ` Ben Greear
2011-05-25  0:34     ` Ben Greear
2011-05-25  2:47     ` David Miller
2011-05-25  3:33       ` Ben Greear
2011-05-25 18:49         ` Ben Greear [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DDD4F2D.4030503@candelatech.com \
    --to=greearb@candelatech.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).