Skip to content

bnx2x: support SR-IOV

Ariel Elior netdev 6 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest22 patches 1 replyIn review
  2. v422 patches 2 repliesSuperseded
  3. v3 posting 2/20 of 22 patches 0 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v3 posting 1/222 patches4 repliesSuperseded
v222 patches1 replySuperseded
v10 of 20 patches1 replySuperseded

Changes in v5 from the cover letter

-Fix compile warnings on gcc-4.7.2 on Fedora 17

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/22bnx2x: Support probing and removing of VF devicedrivers/net/ethernet/broadcom/bnx2x/bnx2x.h drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +4 more+353 -1580 replies
2/22bnx2x: VF <-> PF channel 'acquire' at vf probedrivers/net/ethernet/broadcom/bnx2x/Makefile drivers/net/ethernet/broadcom/bnx2x/bnx2x.h drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +4 more+407 -10 replies
3/22bnx2x: Add to VF <-> PF channel the release requestdrivers/net/ethernet/broadcom/bnx2x/bnx2x.h drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.h+59 -00 replies
4/22bnx2x: Separate VF and PF logicdrivers/net/ethernet/broadcom/bnx2x/bnx2x.h drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +3 more+525 -2660 replies
5/22bnx2x: Add init, setup_q, set_mac to VF <-> PF channeldrivers/net/ethernet/broadcom/bnx2x/bnx2x.h drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +1 more+310 -00 replies
6/22bnx2x: Add teardown_q and close to VF <-> PF channeldrivers/net/ethernet/broadcom/bnx2x/bnx2x.h drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +1 more+112 -20 replies
7/22bnx2x: Support ndo_set_rxmode in VF driverdrivers/net/ethernet/broadcom/bnx2x/bnx2x.h drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.h+179 -60 replies
8/22bnx2x: VF fastpathdrivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c+50 -510 replies
9/22bnx2x: Allocate VF database in PF when VFs are presentdrivers/net/ethernet/broadcom/bnx2x/Makefile drivers/net/ethernet/broadcom/bnx2x/bnx2x.h drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +3 more+570 -10 replies
10/22bnx2x: Prepare device and initialize VF databasedrivers/net/ethernet/broadcom/bnx2x/bnx2x.h drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +5 more+535 -510 replies
11/22bnx2x: Infrastructure for VF <-> PF request on PF sidedrivers/net/ethernet/broadcom/bnx2x/bnx2x.h drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +2 more+664 -450 replies
12/22bnx2x: Support of PF driver of a VF acquire requestdrivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +3 more+476 -110 replies
13/22bnx2x: Support of PF driver of a VF init requestdrivers/net/ethernet/broadcom/bnx2x/bnx2x.h drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h +3 more+190 -30 replies
14/22bnx2x: Support statistics collection for VFs by the PFdrivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h +3 more+217 -930 replies
15/22bnx2x: Support of PF driver of a VF setup_q requestdrivers/net/ethernet/broadcom/bnx2x/bnx2x.h drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +2 more+1071 -1770 replies
16/22bnx2x: Support of PF driver of a VF q_filters requestdrivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c+589 -00 replies
17/22bnx2x: Support of PF driver of a VF q_teardown requestdrivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c+295 -00 replies
18/22bnx2x: Support of PF driver of a VF close requestdrivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c+119 -00 replies
19/22bnx2x: Support of PF driver of a VF release requestdrivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h +2 more+170 -10 replies
20/22bnx2x: Support VF FLRdrivers/net/ethernet/broadcom/bnx2x/bnx2x.h drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h +3 more+321 -70 replies
21/22bnx2x: Support PF <-> VF Bulletin Boarddrivers/net/ethernet/broadcom/bnx2x/bnx2x.h drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +5 more+320 -20 replies
22/22bnx2x: Add VF device ids and enable featuredrivers/net/ethernet/broadcom/bnx2x/bnx2x.h drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c+99 -100 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.

Read the v5 thread

Cover letter [PATCH net-next v5 00/22] bnx2x: support SR-IOV

Hi Dave,

Changes for v2:
-Remove redundant empty lines
-Remove redundant 'inline'

Changes for v3:
-Really remove all redundant empty lines
-Remove __dev* attributes from series

Changes for v4:
-Rearrange comments to be indented according to basic block -Remove more redundant empty lines...
-use dev_info() rather than pr_info()
-add termnating newlines to all printouts (thanks Joe)
-add empty line between functional local variable declarations and actual code

Changes for v5:
-Fix compile warnings on gcc-4.7.2 on Fedora 17

This patch series adds support for SR-IOV in the bnx2x driver.
In bnx2x SR-IOV scheme the same bnx2x driver drives both VFs and PFs (single binary).
The bulk of the communication between the VF drivers and the PF driver is done via the VF <-> PF channel, a hardware-based communications channel with TLV messages. The TLVs are designed to support different versions of VF drivers (from multiple VMs) communicating with the same PF driver.

Patches:
01-03 - Probing and removing a VF driver
Includes sending the 'acquire' and 'release' messages on the VF PF channel. Here the VF PF channel infrastructure is added, including the allocations of the mailboxes and the definition of thin API structures (which will fill out with more content as the series progresses).

04-07 - Loading/Unloading a VF driver
Includes refactoring of the driver load code and differentiating the VF flow from the PF flow. This also includes requests from the VF for the PF to open a queue in the HW on its behalf, configure the device with macs/vlans/rxmode data, etc. Likewise the unload flow has been modified for the PF to undo these configurations when the VF indicates it is going down.

08 - Modify fastpath flows for VFs
VFs have almost identical behavior in fastpath to PFs. In this patch the VFs prepare transmit transaction for tx-switching, and the code for acking a fastpath interrupt has been reorganized to allow a VF or PF to preconfigure the offset of the interrupt's location in the BAR (as they have BARs with different mapping) so as not to do so in fastpath.

09-10 - Probe and Load a PF driver with SR-IOV
The PF driver allocates and initializes the VF database to manage and keep track of its VFs, their resources, queues, etc.

11-19 - The PF side of the VF <-> PF channel requests
Here is the implementation on the PF's side of the requests submitted in patches 01 through 07 by the VF. Patch 14 adds support for statistics collection by the PF for all of its VFs (stats are DMAEed directly to VM GPA memory).

20 - Support for VF function level reset
When FLR indication is received for VFs, the PF reclaims all the resources allocated for these VFs (interrupts, queues) and releases allocation it performed for the FLRed VFs (it does so by consulting the VF database).

21 - Bulletin Board interface
This patch adds the PF <-> VF Bulletin Board interface. This interface is a simple interface where the PF can be the initiator, and indicate to a VF that it has a new MAC for it to use. In this interface each post "covers" any previous posts (hence the name).

22 - Add the VF device ids and enable feature
In this patch we add the VF device ids of the various devices driven by bnx2x. Here we also add the calls to "pci_enable_sriov" and "pci_disable_sriov".

Important: In this patch series we have laid the ground work for interfacing with the infrastructure for dynamically controlling the number of VFs of a physical device.

Meanwhile, in patch 9 this code is added to bnx2x_init_one():
--snip snip--
rc = bnx2x_iov_init_one(bp, int_mode, 0/*num vfs*/);
--snip snip--
recompiling the bnx2x with a number of vfs which is not 0 will enable SR-IOV with that number of VFs.

Please consider applying these patches.