OpenCloudOS-Kernel/drivers/net/ethernet/mellanox/mlx4
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
..
Kconfig mlx4_en: Remove remnants of LRO support 2012-11-19 19:13:59 -05:00
Makefile net/mlx4_en: Add HW timestamping (TS) support 2013-04-24 16:30:14 -04:00
alloc.c mlx4_core: Change bitmap allocator to work in round-robin fashion 2012-05-14 13:44:38 -07:00
catas.c mlx4: Add support for EEH error recovery 2012-07-25 15:24:13 -07:00
cmd.c net/mlx4_core: Add immediate activate for VGT->VST->VGT 2013-11-07 19:22:47 -05:00
cq.c net/mlx4_core: Initialize all mailbox buffers to zero before use 2013-11-07 19:22:47 -05:00
en_clock.c mlx4_en: fix a build error on 32bit arches 2013-04-30 19:00:25 -04:00
en_cq.c net/mlx4_en: Datapath structures are allocated per NUMA node 2013-11-07 19:22:48 -05:00
en_dcb_nl.c net/mlx4_en: Disable global flow control when PFC enabled 2013-08-21 12:19:26 -07:00
en_ethtool.c net/mlx4_en: Datapath resources allocated dynamically 2013-11-07 19:22:48 -05:00
en_main.c net/mlx4_en: Fixed crash when port type is changed 2013-11-07 19:11:13 -05:00
en_netdev.c net/mlx4_en: Datapath structures are allocated per NUMA node 2013-11-07 19:22:48 -05:00
en_port.c net/mlx4_en: Datapath resources allocated dynamically 2013-11-07 19:22:48 -05:00
en_port.h net/mlx4_core: set port QoS attributes 2012-04-05 05:08:03 -04:00
en_resources.c net/mlx4: Strengthen VLAN tags/priorities enforcement in VST mode 2013-05-11 16:12:44 -07:00
en_rx.c net/mlx4_en: Datapath structures are allocated per NUMA node 2013-11-07 19:22:48 -05:00
en_selftest.c net/mlx4_en: Remove selftest TX queues empty condition 2013-12-01 20:36:07 -05:00
en_tx.c net: core: explicitly select a txq before doing l2 forwarding 2014-01-10 13:23:08 -05:00
eq.c net/mlx4_core: Initialize all mailbox buffers to zero before use 2013-11-07 19:22:47 -05:00
fw.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2013-11-15 16:47:22 -08:00
fw.h net/mlx4_core: Respond to operation request by firmware 2013-07-29 01:12:40 -07:00
icm.c net/mlx4_core: ICM pages are allocated on device NUMA node 2013-11-07 19:22:48 -05:00
icm.h mlx4_core: Fix integer overflows so 8TBs of memory registration works 2012-09-13 17:52:02 -07:00
intf.c mlx4: Use port management change event instead of smp_snoop 2012-07-10 09:47:10 -07:00
main.c net/mlx4_core: destroy workqueue when driver fails to register 2013-12-03 11:55:44 -05:00
mcg.c net/mlx4_core: Initialize all mailbox buffers to zero before use 2013-11-07 19:22:47 -05:00
mlx4.h net/mlx4_core: Implement resource quota enforcement 2013-11-04 16:19:08 -05:00
mlx4_en.h net: core: explicitly select a txq before doing l2 forwarding 2014-01-10 13:23:08 -05:00
mr.c net/mlx4_core: Initialize all mailbox buffers to zero before use 2013-11-07 19:22:47 -05:00
pd.c net/mlx4_en: Datapath structures are allocated per NUMA node 2013-11-07 19:22:48 -05:00
port.c net/mlx4_core: Initialize all mailbox buffers to zero before use 2013-11-07 19:22:47 -05:00
profile.c mlx4_core: Fix integer overflow issues around MTT table 2012-08-15 21:05:26 -07:00
qp.c mlx4: Structures and init/teardown for VF resource quotas 2013-11-04 16:19:07 -05:00
reset.c mlx4: Use PCI Express Capability accessors 2012-08-23 10:11:13 -06:00
resource_tracker.c net/mlx4_core: Add immediate activate for VGT->VST->VGT 2013-11-07 19:22:47 -05:00
sense.c Merge branch 'for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq 2012-10-02 09:54:49 -07:00
srq.c net/mlx4_core: Initialize all mailbox buffers to zero before use 2013-11-07 19:22:47 -05:00