datapath: Move segmentation compatibility code into a compatibility function
authorSimon Horman <horms@verge.net.au>
Tue, 24 Sep 2013 07:44:06 +0000 (16:44 +0900)
committerJesse Gross <jesse@nicira.com>
Thu, 26 Sep 2013 01:19:00 +0000 (18:19 -0700)
commitc1f90e07a6733dd4399bbb47ed6d63c6fa07573f
tree201cf9f4413775acd2968b0d241e5fddb887da60
parent6b30e53e6290b43e60c7c6f64f568a1d17961920
datapath: Move segmentation compatibility code into a compatibility function

Move segmentation compatibility code out of netdev_send and into
rpl_dev_queue_xmit(), a compatibility function used in place
of dev_queue_xmit() as necessary.

As suggested by Jesse Gross.

Some minor though verbose implementation notes:

* This rpl_dev_queue_xmit() endeavours to return a valid error code or
  zero on success as per dev_queue_xmit(). The exception is that when
  dev_queue_xmit() is called in a loop only the status of the last call is
  taken into account, thus ignoring any errors returned by previous calls.
  This is derived from the previous calls to dev_queue_xmit() in a loop
  where netdev_send() ignores the return value of dev_queue_xmit()
  entirely.

* netdev_send() continues to ignore the value of dev_queue_xmit().
  So the discussion of the return value of rpl_dev_queue_xmit()
  above is has no bearing on run-time behaviour.

* The return value of netdev_send() may differ from the previous
  implementation in the case where segmentation is performed before
  calling the real dev_queue_xmit(). This is because previously in
  this case netdev_send() would return the combined length of the
  skbs resulting from segmentation. Whereas the current code
  always returns the length of the original skb.

Signed-off-by: Simon Horman <horms@verge.net.au>
[jesse: adjust error path in netdev_send() to match upstream]
Signed-off-by: Jesse Gross <jesse@nicira.com>
datapath/linux/compat/gso.c
datapath/linux/compat/include/linux/netdevice.h
datapath/vport-netdev.c