linux/drivers/staging/bcm
Jason Wang f663dd9aaf net: core: explicitly select a txq before doing l2 forwarding
Currently, the tx queue were selected implicitly in ndo_dfwd_start_xmit(). The
will cause several issues:

- NETIF_F_LLTX were removed for macvlan, so txq lock were done for macvlan
  instead of lower device which misses the necessary txq synchronization for
  lower device such as txq stopping or frozen required by dev watchdog or
  control path.
- dev_hard_start_xmit() was called with NULL txq which bypasses the net device
  watchdog.
- dev_hard_start_xmit() does not check txq everywhere which will lead a crash
  when tso is disabled for lower device.

Fix this by explicitly introducing a new param for .ndo_select_queue() for just
selecting queues in the case of l2 forwarding offload. netdev_pick_tx() was also
extended to accept this parameter and dev_queue_xmit_accel() was used to do l2
forwarding transmission.

With this fixes, NETIF_F_LLTX could be preserved for macvlan and there's no need
to check txq against NULL in dev_hard_start_xmit(). Also there's no need to keep
a dedicated ndo_dfwd_start_xmit() and we can just reuse the code of
dev_queue_xmit() to do the transmission.

In the future, it was also required for macvtap l2 forwarding support since it
provides a necessary synchronization method.

Cc: John Fastabend <john.r.fastabend@intel.com>
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: e1000-devel@lists.sourceforge.net
Signed-off-by: Jason Wang <jasowang@redhat.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-01-10 13:23:08 -05:00
..
Adapter.h Staging: bcm: Fix WARNING: space prohibited before semicolon. 2013-10-29 08:54:12 -07:00
Bcmchar.c Staging driver update for 3.13-rc1 2013-11-07 15:07:58 +09:00
Bcmnet.c net: core: explicitly select a txq before doing l2 forwarding 2014-01-10 13:23:08 -05:00
CmHost.c staging: bcm: Remove unnecessary pointer casting 2013-10-29 17:03:40 -07:00
CmHost.h staging: bcm: Replace BOOLEAN with bool 2013-10-28 14:13:08 -07:00
DDRInit.c staging: bcm: Replace FALSE with false 2013-10-28 14:13:46 -07:00
DDRInit.h Staging: bcm: Remove typedef for _MINI_ADAPTER and call directly. 2012-06-04 21:09:22 -07:00
Debug.h Staging: bcm: Fix warning: "Prefer netdev_dbg(netdev, ... then dev_dbg(dev, ... then pr_debug(... to printk(KERN_DEBUG ..." 2013-01-07 10:57:51 -08:00
HandleControlPacket.c staging: bcm: Replace FALSE with false 2013-10-28 14:13:46 -07:00
HostMIBSInterface.h Staging: bcm: Remove typedef for _U_MIBS_IP_ADDRESS and call directly. 2012-11-26 16:07:58 -08:00
IPv6Protocol.c staging: bcm: Remove unnecessary pointer casting 2013-10-29 17:03:40 -07:00
IPv6ProtocolHdr.h Staging: bcm: Remove typedef for IPV6HeaderFormatTag and call directly. 2013-01-07 10:49:02 -08:00
InterfaceAdapter.h Staging: bcm: Change ULONG to unsigned long in InterfaceAdapter.h 2012-11-02 11:36:47 -07:00
InterfaceDld.c staging: bcm: Remove unnecessary pointer casting 2013-10-29 17:03:40 -07:00
InterfaceIdleMode.c staging: bcm: Replace FALSE with false 2013-10-28 14:13:46 -07:00
InterfaceIdleMode.h Staging: bcm: InterfaceIdleMode.h: Checkpatch fixes 2012-10-23 20:28:19 -07:00
InterfaceInit.c staging: bcm: Replace FALSE with false 2013-10-28 14:13:46 -07:00
InterfaceInit.h Staging: bcm: Add two products and remove an existing product. 2012-11-13 12:38:29 -08:00
InterfaceIsr.c staging: bcm: Replace FALSE with false 2013-10-28 14:13:46 -07:00
InterfaceIsr.h Staging: bcm: Remove typedef for _S_INTERFACE_ADAPTER and call directly. 2012-11-02 11:36:46 -07:00
InterfaceMacros.h
InterfaceMisc.c staging: bcm: Replace FALSE with false 2013-10-28 14:13:46 -07:00
InterfaceMisc.h Staging: bcm: Remove typedef for _S_INTERFACE_ADAPTER and call directly. 2012-11-02 11:36:46 -07:00
InterfaceRx.c staging: bcm: Replace FALSE with false 2013-10-28 14:13:46 -07:00
InterfaceRx.h staging: bcm: Replace BOOLEAN with bool 2013-10-28 14:13:08 -07:00
InterfaceTx.c staging: bcm: Remove unnecessary pointer casting 2013-10-29 17:03:40 -07:00
InterfaceTx.h
Ioctl.h staging: bcm: Fix typo in comments 2013-08-23 10:01:43 -07:00
Kconfig Staging: remove CONFIG_EXPERIMENTAL dependancies 2012-09-17 23:02:36 -07:00
LeakyBucket.c staging: bcm: Replace FALSE with false 2013-10-28 14:13:46 -07:00
Macros.h Staging: bcm: Replace UCHAR with unsigned char in Macros.h 2013-01-07 10:56:43 -08:00
Makefile
Misc.c staging: bcm: Replace FALSE with false 2013-10-28 14:13:46 -07:00
PHSDefines.h Staging: bcm: Remove typedef for _S_PHS_RULE and call directly. 2013-01-07 10:54:49 -08:00
PHSModule.c staging: bcm: Replace FALSE with false 2013-10-28 14:13:46 -07:00
PHSModule.h staging: bcm: Replace BOOLEAN with bool 2013-10-28 14:13:08 -07:00
Protocol.h Staging: bcm: Remove typedef for TransportHeaderT and call directly. 2013-01-07 10:56:54 -08:00
Prototypes.h staging: bcm: Replace BOOLEAN with bool 2013-10-28 14:13:08 -07:00
Qos.c staging: bcm: Replace FALSE with false 2013-10-28 14:13:46 -07:00
Queue.h
TODO
Transmit.c staging: bcm: Replace FALSE with false 2013-10-28 14:13:46 -07:00
Typedefs.h staging: bcm: Replace FALSE with false 2013-10-28 14:13:46 -07:00
cntrl_SignalingInterface.h Staging: bcm: Change B_UINT8 to u8 in cntrl_SignalingInterface.h 2012-10-29 17:07:57 -07:00
headers.h staging: bcm: remove Version.h file. 2013-08-30 11:46:48 -07:00
hostmibs.c Staging: bcm: Remove typedef for _S_PHS_RULE and call directly. 2013-01-07 10:54:49 -08:00
led_control.c staging: bcm: Replace FALSE with false 2013-10-28 14:13:46 -07:00
led_control.h Staging: bcm: Remove macro B_ULONG32 in led_control.h. 2013-01-07 10:51:50 -08:00
nvm.c staging: bcm: Replace FALSE with false 2013-10-28 14:13:46 -07:00
nvm.h Staging: bcm: Remove typedef for _FLASH_SECTOR_INFO. 2013-01-07 10:45:51 -08:00
sort.c Staging: bcm: Remove typedef for _MINI_ADAPTER and call directly. 2012-06-04 21:09:22 -07:00
target_params.h Staging: bcm: Remove typedef for _TARGET_PARAMS and call directly. 2013-01-07 10:54:01 -08:00
vendorspecificextn.c staging: bcm: Replace BOOLEAN with bool 2013-10-28 14:13:08 -07:00
vendorspecificextn.h staging: bcm: Replace BOOLEAN with bool 2013-10-28 14:13:08 -07:00