diff options
author | Ariel Elior <ariele@broadcom.com> | 2013-01-01 05:22:37 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-01-02 01:45:07 -0800 |
commit | 8db573baa5cf1f65ed94039ac3100ea5a94260de (patch) | |
tree | e1e87d6ff08fe89806015884f2040f58d85cc09e /drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | |
parent | 67c431a5f2f3e0dda511509ed5773346839c07c0 (diff) | |
download | lwn-8db573baa5cf1f65ed94039ac3100ea5a94260de.tar.gz lwn-8db573baa5cf1f65ed94039ac3100ea5a94260de.zip |
bnx2x: Support of PF driver of a VF setup_q request
Upon receiving a 'setup_q' request from the VF over the VF <-> PF
channel the PF driver will open a corresponding queue in the
device. The PF driver configures the queue with appropriate mac
address, vlan configuration, etc from the VF.
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index 022c491cd0fb..cdb073a6297e 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c @@ -2029,7 +2029,7 @@ static void bnx2x_free_fw_stats_mem(struct bnx2x *bp) static int bnx2x_alloc_fw_stats_mem(struct bnx2x *bp) { - int num_groups; + int num_groups, vf_headroom = 0; int is_fcoe_stats = NO_FCOE(bp) ? 0 : 1; /* number of queues for statistics is number of eth queues + FCoE */ @@ -2042,18 +2042,26 @@ static int bnx2x_alloc_fw_stats_mem(struct bnx2x *bp) */ bp->fw_stats_num = 2 + is_fcoe_stats + num_queue_stats; + /* vf stats appear in the request list, but their data is allocated by + * the VFs themselves. We don't include them in the bp->fw_stats_num as + * it is used to determine where to place the vf stats queries in the + * request struct + */ + if (IS_SRIOV(bp)) + vf_headroom = bp->vfdb->sriov.nr_virtfn * BNX2X_CLIENTS_PER_VF; + /* Request is built from stats_query_header and an array of * stats_query_cmd_group each of which contains * STATS_QUERY_CMD_COUNT rules. The real number or requests is * configured in the stats_query_header. */ num_groups = - (((bp->fw_stats_num) / STATS_QUERY_CMD_COUNT) + - (((bp->fw_stats_num) % STATS_QUERY_CMD_COUNT) ? + (((bp->fw_stats_num + vf_headroom) / STATS_QUERY_CMD_COUNT) + + (((bp->fw_stats_num + vf_headroom) % STATS_QUERY_CMD_COUNT) ? 1 : 0)); - DP(BNX2X_MSG_SP, "stats fw_stats_num %d, num_groups %d\n", - bp->fw_stats_num, num_groups); + DP(BNX2X_MSG_SP, "stats fw_stats_num %d, vf headroom %d, num_groups %d\n", + bp->fw_stats_num, vf_headroom, num_groups); bp->fw_stats_req_sz = sizeof(struct stats_query_header) + num_groups * sizeof(struct stats_query_cmd_group); |