|
27 | 27 | #include "bnx2x_cmn.h"
|
28 | 28 | #include "bnx2x_init.h"
|
29 | 29 | #include "bnx2x_sp.h"
|
30 |
| -#include "bnx2x_sriov.h" |
31 | 30 |
|
32 | 31 | /**
|
33 | 32 | * bnx2x_move_fp - move content of the fastpath structure.
|
@@ -109,7 +108,7 @@ void bnx2x_fill_fw_str(struct bnx2x *bp, char *buf, size_t buf_len)
|
109 | 108 | (bp->common.bc_ver & 0xff),
|
110 | 109 | ((phy_fw_ver[0] != '\0') ? " phy " : ""), phy_fw_ver);
|
111 | 110 | } else {
|
112 |
| - strlcpy(buf, bp->acquire_resp.pfdev_info.fw_ver, buf_len); |
| 111 | + bnx2x_vf_fill_fw_str(bp, buf, buf_len); |
113 | 112 | }
|
114 | 113 | }
|
115 | 114 |
|
@@ -2048,7 +2047,7 @@ static int bnx2x_alloc_fw_stats_mem(struct bnx2x *bp)
|
2048 | 2047 | * request struct
|
2049 | 2048 | */
|
2050 | 2049 | if (IS_SRIOV(bp))
|
2051 |
| - vf_headroom = bp->vfdb->sriov.nr_virtfn * BNX2X_CLIENTS_PER_VF; |
| 2050 | + vf_headroom = bnx2x_vf_headroom(bp); |
2052 | 2051 |
|
2053 | 2052 | /* Request is built from stats_query_header and an array of
|
2054 | 2053 | * stats_query_cmd_group each of which contains
|
@@ -3793,93 +3792,6 @@ int bnx2x_setup_tc(struct net_device *dev, u8 num_tc)
|
3793 | 3792 | return 0;
|
3794 | 3793 | }
|
3795 | 3794 |
|
3796 |
| -/* New mac for VF. Consider these cases: |
3797 |
| - * 1. VF hasn't been acquired yet - save the mac in local bulletin board and |
3798 |
| - * supply at acquire. |
3799 |
| - * 2. VF has already been acquired but has not yet initialized - store in local |
3800 |
| - * bulletin board. mac will be posted on VF bulletin board after VF init. VF |
3801 |
| - * will configure this mac when it is ready. |
3802 |
| - * 3. VF has already initialized but has not yet setup a queue - post the new |
3803 |
| - * mac on VF's bulletin board right now. VF will configure this mac when it |
3804 |
| - * is ready. |
3805 |
| - * 4. VF has already set a queue - delete any macs already configured for this |
3806 |
| - * queue and manually config the new mac. |
3807 |
| - * In any event, once this function has been called refuse any attempts by the |
3808 |
| - * VF to configure any mac for itself except for this mac. In case of a race |
3809 |
| - * where the VF fails to see the new post on its bulletin board before sending a |
3810 |
| - * mac configuration request, the PF will simply fail the request and VF can try |
3811 |
| - * again after consulting its bulletin board |
3812 |
| - */ |
3813 |
| -int bnx2x_set_vf_mac(struct net_device *dev, int queue, u8 *mac) |
3814 |
| -{ |
3815 |
| - struct bnx2x *bp = netdev_priv(dev); |
3816 |
| - int rc, q_logical_state, vfidx = queue; |
3817 |
| - struct bnx2x_virtf *vf = BP_VF(bp, vfidx); |
3818 |
| - struct pf_vf_bulletin_content *bulletin = BP_VF_BULLETIN(bp, vfidx); |
3819 |
| - |
3820 |
| - /* if SRIOV is disabled there is nothing to do (and somewhere, someone |
3821 |
| - * has erred). |
3822 |
| - */ |
3823 |
| - if (!IS_SRIOV(bp)) { |
3824 |
| - BNX2X_ERR("bnx2x_set_vf_mac called though sriov is disabled\n"); |
3825 |
| - return -EINVAL; |
3826 |
| - } |
3827 |
| - |
3828 |
| - if (!is_valid_ether_addr(mac)) { |
3829 |
| - BNX2X_ERR("mac address invalid\n"); |
3830 |
| - return -EINVAL; |
3831 |
| - } |
3832 |
| - |
3833 |
| - /* update PF's copy of the VF's bulletin. will no longer accept mac |
3834 |
| - * configuration requests from vf unless match this mac |
3835 |
| - */ |
3836 |
| - bulletin->valid_bitmap |= 1 << MAC_ADDR_VALID; |
3837 |
| - memcpy(bulletin->mac, mac, ETH_ALEN); |
3838 |
| - |
3839 |
| - /* Post update on VF's bulletin board */ |
3840 |
| - rc = bnx2x_post_vf_bulletin(bp, vfidx); |
3841 |
| - if (rc) { |
3842 |
| - BNX2X_ERR("failed to update VF[%d] bulletin\n", vfidx); |
3843 |
| - return rc; |
3844 |
| - } |
3845 |
| - |
3846 |
| - /* is vf initialized and queue set up? */ |
3847 |
| - q_logical_state = |
3848 |
| - bnx2x_get_q_logical_state(bp, &bnx2x_vfq(vf, 0, sp_obj)); |
3849 |
| - if (vf->state == VF_ENABLED && |
3850 |
| - q_logical_state == BNX2X_Q_LOGICAL_STATE_ACTIVE) { |
3851 |
| - /* configure the mac in device on this vf's queue */ |
3852 |
| - unsigned long flags = 0; |
3853 |
| - struct bnx2x_vlan_mac_obj *mac_obj = &bnx2x_vfq(vf, 0, mac_obj); |
3854 |
| - |
3855 |
| - /* must lock vfpf channel to protect against vf flows */ |
3856 |
| - bnx2x_lock_vf_pf_channel(bp, vf, CHANNEL_TLV_PF_SET_MAC); |
3857 |
| - |
3858 |
| - /* remove existing eth macs */ |
3859 |
| - rc = bnx2x_del_all_macs(bp, mac_obj, BNX2X_ETH_MAC, true); |
3860 |
| - if (rc) { |
3861 |
| - BNX2X_ERR("failed to delete eth macs\n"); |
3862 |
| - return -EINVAL; |
3863 |
| - } |
3864 |
| - |
3865 |
| - /* remove existing uc list macs */ |
3866 |
| - rc = bnx2x_del_all_macs(bp, mac_obj, BNX2X_UC_LIST_MAC, true); |
3867 |
| - if (rc) { |
3868 |
| - BNX2X_ERR("failed to delete uc_list macs\n"); |
3869 |
| - return -EINVAL; |
3870 |
| - } |
3871 |
| - |
3872 |
| - /* configure the new mac to device */ |
3873 |
| - __set_bit(RAMROD_COMP_WAIT, &flags); |
3874 |
| - bnx2x_set_mac_one(bp, (u8 *)&bulletin->mac, mac_obj, true, |
3875 |
| - BNX2X_ETH_MAC, &flags); |
3876 |
| - |
3877 |
| - bnx2x_unlock_vf_pf_channel(bp, vf, CHANNEL_TLV_PF_SET_MAC); |
3878 |
| - } |
3879 |
| - |
3880 |
| - return rc; |
3881 |
| -} |
3882 |
| - |
3883 | 3795 | /* called with rtnl_lock */
|
3884 | 3796 | int bnx2x_change_mac_addr(struct net_device *dev, void *p)
|
3885 | 3797 | {
|
|
0 commit comments