All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Benjamin Poirier <benjamin.poirier@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v6] rtl8139: add vlan support
Date: Fri, 18 Mar 2011 13:50:23 +0800	[thread overview]
Message-ID: <4D82F29F.8050902@redhat.com> (raw)
In-Reply-To: <1299803757-26812-1-git-send-email-benjamin.poirier@gmail.com>

On 03/11/2011 08:35 AM, Benjamin Poirier wrote:
> Here is version 6 of my patchset to add vlan support to the emulated rtl8139
> nic.
>
> Changes since v5:
> 	* moved all receive changes to "add vlan tag extraction"
> 	* fixed checkpatch.pl style issues
> 	* fixed bugs in receive case related to small buffers and loopback
> 	  mode. Moved "too small buffer" code back where it used to be, though
> 	  it is changed in content.
>
> Changes since v4:
> 	* removed alloca(), for real. Thanks to the reviewers for their
> 	  patience. This patchset now has more versions than the vlan header
> 	  has bytes!
> 	* corrected the unlikely, debug printf and long lines, as per comments
> 	* cleaned out ifdef's pertaining to ethernet checksum calculation.
> 	  According to a comment since removed they were related to an
> 	  "optimization":
> 	>  RTL8139 provides frame CRC with received packet, this feature
> 	>  seems to be ignored by most drivers, disabled by default
> 	  see commit ccf1d14
>
> I've tested v5 using x86_64 host/guest with the usual procedure. I've also ran
> the clang analyzer on the qemu code base, just for fun.
>
> Changes since v3:
> 	* removed alloca() and #include<net/ethernet.h>  as per comments
> 	* reordered patches to put extraction before insertion. Extraction
> 	  touches only the receive path but insertion touches both. The two
> 	  patches are now needed to have vlan functionnality.
>
> I've tested v4 with x86_64 host/guest. I used the same testing procedure as
> before. I've tested a plain configuration as well as one with tso + vlan
> offload, successfully.
>
> I had to hack around the Linux 8139cp driver to be able to enable tso on vlan
> which leads me to wonder, can someone with access to the C+ spec or a real
> card confirm that it can do tso and vlan offload at the same time? The patch
> I used for the kernel is at https://gist.github.com/851895.

8139cp does have the support for VLAN with TSO. See IFCAP_VLAN_HWTSO 
capabilities in FreeBSD re(4) driver: 
http://svn.freebsd.org/viewvc/base/release/8.2.0/sys/dev/re/if_re.c?revision=218742&view=markup. 
You can use it in your testing for both vlan tso and loopback TX. 
Additionally, you can submit your 8139 modifications to linux upstream I 
think.

> Changes since v2:
> insertion:
> 	* moved insertion later in the process, to handle tso
> 	* use qemu_sendv_packet() to insert the tag for us
> 	* added dot1q_buf parameter to rtl8139_do_receive() to avoid some
> 	  memcpy() in loopback mode. Note that the code path through that
> 	  function is unchanged when dot1q_buf is NULL.
>
> extraction:
> 	* reduced the amount of copying by moving the "frame too short" logic
> 	  after the removal of the vlan tag (as is done in e1000.c for
> 	  example). Unfortunately, that logic can no longer be shared betwen
> 	  C+ and C mode.
>
> I've posted v2 of these patches back in November
> http://article.gmane.org/gmane.comp.emulators.qemu/84252
>
> I've tested v3 on the following combinations of guest and hosts:
> host: x86_64, guest: x86_64
> host: x86_64, guest: ppc32
> host: ppc32, guest: ppc32
>
> Testing on the x86_64 host used '-net tap' and consisted of:
> * making an http transfert on the untagged interface.
> * ping -s 0-1472 to another host on a vlan.
> * making an scp upload to another host on a vlan.
>
> Testing on the ppc32 host used '-net socket' connected to an x86_64 qemu-kvm
> running the virtio nic and consisted of:
> * establishing an ssh connection between the two using an untagged interface.
> * ping -s 0-1472 between the two using a vlan.
> * making an scp transfer in both directions using a vlan.
>
> All that was successful. Nevertheless, it doesn't exercise all code paths so
> care is in order.
>
> Please note that the lack of vlan support in rtl8139 has taken a few people
> aback:
> https://bugzilla.redhat.com/show_bug.cgi?id=516587
> http://article.gmane.org/gmane.linux.network.general/14266
>
> Thanks,
> -Ben
>

      parent reply	other threads:[~2011-03-18  5:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-11  0:35 [Qemu-devel] [PATCH v6] rtl8139: add vlan support Benjamin Poirier
2011-03-11  0:35 ` [Qemu-devel] [PATCH v6 1/3] rtl8139: cleanup FCS calculation Benjamin Poirier
2011-03-11  5:35   ` [Qemu-devel] " Igor Kovalenko
2011-03-11  6:44     ` Michael S. Tsirkin
2011-03-11  6:49   ` Igor Kovalenko
2011-03-11  0:35 ` [Qemu-devel] [PATCH v6 2/3] rtl8139: add vlan tag extraction Benjamin Poirier
2011-03-18  9:32   ` Jason Wang
2011-03-11  0:35 ` [Qemu-devel] [PATCH v6 3/3] rtl8139: add vlan tag insertion Benjamin Poirier
2011-03-18  9:33   ` Jason Wang
2011-03-18  5:50 ` Jason Wang [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=4D82F29F.8050902@redhat.com \
    --to=jasowang@redhat.com \
    --cc=benjamin.poirier@gmail.com \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.