linux/drivers/net
Eugenia Emantayev ddae0349fd net/mlx4: Change QP allocation scheme
When using BF (Blue-Flame), the QPN overrides the VLAN, CV, and SV fields
in the WQE. Thus, BF may only be used for QPNs with bits 6,7 unset.

The current Ethernet driver code reserves a Tx QP range with 256b alignment.

This is wrong because if there are more than 64 Tx QPs in use,
QPNs >= base + 65 will have bits 6/7 set.

This problem is not specific for the Ethernet driver, any entity that
tries to reserve more than 64 BF-enabled QPs should fail. Also, using
ranges is not necessary here and is wasteful.

The new mechanism introduced here will support reservation for
"Eth QPs eligible for BF" for all drivers: bare-metal, multi-PF, and VFs
(when hypervisors support WC in VMs). The flow we use is:

1. In mlx4_en, allocate Tx QPs one by one instead of a range allocation,
   and request "BF enabled QPs" if BF is supported for the function

2. In the ALLOC_RES FW command, change param1 to:
a. param1[23:0]  - number of QPs
b. param1[31-24] - flags controlling QPs reservation

Bit 31 refers to Eth blueflame supported QPs. Those QPs must have
bits 6 and 7 unset in order to be used in Ethernet.

Bits 24-30 of the flags are currently reserved.

When a function tries to allocate a QP, it states the required attributes
for this QP. Those attributes are considered "best-effort". If an attribute,
such as Ethernet BF enabled QP, is a must-have attribute, the function has
to check that attribute is supported before trying to do the allocation.

In a lower layer of the code, mlx4_qp_reserve_range masks out the bits
which are unsupported. If SRIOV is used, the PF validates those attributes
and masks out unsupported attributes as well. In order to notify VFs which
attributes are supported, the VF uses QUERY_FUNC_CAP command. This command's
mailbox is filled by the PF, which notifies which QP allocation attributes
it supports.

Signed-off-by: Eugenia Emantayev <eugenia@mellanox.co.il>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-12-11 14:47:35 -05:00
..
appletalk net: better IFF_XMIT_DST_RELEASE support 2014-10-07 13:22:11 -04:00
arcnet ARCNET: enable eae arcnet card support 2014-09-29 14:36:26 -04:00
bonding Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-12-10 15:48:20 -05:00
caif
can Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-12-10 15:48:20 -05:00
cris
dsa Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-11-29 20:47:48 -08:00
ethernet net/mlx4: Change QP allocation scheme 2014-12-11 14:47:35 -05:00
fddi defxx: Clean up DEFEA resource management 2014-11-21 16:37:13 -05:00
hamradio hamradio: 6pack: remove unnecessary check 2014-11-03 15:34:31 -05:00
hippi
hyperv hyperv: Add support for vNIC hot removal 2014-12-08 20:24:11 -05:00
ieee802154 cc2520: adds terminating newline 2014-12-05 14:18:42 +01:00
ipvlan ipvlan: move the device check function into netdevice.h 2014-12-09 16:10:06 -05:00
irda irda: Convert IRDA_DEBUG to pr_debug 2014-11-12 13:56:41 -05:00
phy net: phy: bcm7xxx: add an explicit version check for GPHY rev G0 2014-12-08 21:33:29 -05:00
plip
ppp ppp_read(): switch to skb_copy_datagram_iter() 2014-12-09 16:29:10 -05:00
slip
team net: generic dev_disable_lro() stacked device handling 2014-11-13 14:48:56 -05:00
usb r8152: redefine REALTEK_USB_DEVICE 2014-12-09 13:41:24 -05:00
vmxnet3 ethtool: Support for configurable RSS hash function 2014-12-08 21:07:10 -05:00
wan net: better IFF_XMIT_DST_RELEASE support 2014-10-07 13:22:11 -04:00
wimax kbuild: remove unnecessary "obj- := dummy.o" trick 2014-10-02 13:55:02 +02:00
wireless Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless 2014-12-08 13:58:58 -05:00
xen-netback Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-12-10 15:48:20 -05:00
dummy.c dummy: use MODULE_VERSION 2014-12-09 21:51:06 -05:00
eql.c net: better IFF_XMIT_DST_RELEASE support 2014-10-07 13:22:11 -04:00
ifb.c net: better IFF_XMIT_DST_RELEASE support 2014-10-07 13:22:11 -04:00
Kconfig ipvlan: ipvlan depends on INET and IPV6 2014-11-29 20:53:05 -08:00
LICENSE.SRC
loopback.c net: better IFF_XMIT_DST_RELEASE support 2014-10-07 13:22:11 -04:00
macvlan.c macvlan: play well with ipvlan device 2014-12-09 16:10:06 -05:00
macvtap.c put iov_iter into msghdr 2014-12-09 16:29:03 -05:00
Makefile ipvlan: Initial check-in of the IPVLAN driver. 2014-11-24 15:29:18 -05:00
mdio.c
mii.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tun.c put iov_iter into msghdr 2014-12-09 16:29:03 -05:00
veth.c
virtio_net.c virtio-net: validate features during probe 2014-11-21 00:26:43 -05:00
vxlan.c net: make vid as a parameter for ndo_fdb_add/ndo_fdb_del 2014-12-02 20:01:18 -08:00
xen-netfront.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-12-10 15:48:20 -05:00