mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-05 05:06:55 +07:00
be2net: Fix VF driver load on newer Lancer FW
PF driver should enable VF so that VF goes to ready state in new Lancer FW. Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
c8a541630d
commit
dcf7ebba94
@ -3131,6 +3131,38 @@ int be_cmd_set_profile_config(struct be_adapter *adapter, u32 bps,
|
||||
return status;
|
||||
}
|
||||
|
||||
/* Uses sync mcc */
|
||||
int be_cmd_enable_vf(struct be_adapter *adapter, u8 domain)
|
||||
{
|
||||
struct be_mcc_wrb *wrb;
|
||||
struct be_cmd_enable_disable_vf *req;
|
||||
int status;
|
||||
|
||||
if (!lancer_chip(adapter))
|
||||
return 0;
|
||||
|
||||
spin_lock_bh(&adapter->mcc_lock);
|
||||
|
||||
wrb = wrb_from_mccq(adapter);
|
||||
if (!wrb) {
|
||||
status = -EBUSY;
|
||||
goto err;
|
||||
}
|
||||
|
||||
req = embedded_payload(wrb);
|
||||
|
||||
be_wrb_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
|
||||
OPCODE_COMMON_ENABLE_DISABLE_VF, sizeof(*req),
|
||||
wrb, NULL);
|
||||
|
||||
req->hdr.domain = domain;
|
||||
req->enable = 1;
|
||||
status = be_mcc_notify_wait(adapter);
|
||||
err:
|
||||
spin_unlock_bh(&adapter->mcc_lock);
|
||||
return status;
|
||||
}
|
||||
|
||||
int be_roce_mcc_cmd(void *netdev_handle, void *wrb_payload,
|
||||
int wrb_payload_size, u16 *cmd_status, u16 *ext_status)
|
||||
{
|
||||
|
@ -203,6 +203,7 @@ struct be_mcc_mailbox {
|
||||
#define OPCODE_COMMON_GET_FN_PRIVILEGES 170
|
||||
#define OPCODE_COMMON_READ_OBJECT 171
|
||||
#define OPCODE_COMMON_WRITE_OBJECT 172
|
||||
#define OPCODE_COMMON_ENABLE_DISABLE_VF 196
|
||||
|
||||
#define OPCODE_ETH_RSS_CONFIG 1
|
||||
#define OPCODE_ETH_ACPI_CONFIG 2
|
||||
@ -1802,6 +1803,12 @@ struct be_cmd_resp_set_profile_config {
|
||||
struct be_cmd_req_hdr hdr;
|
||||
};
|
||||
|
||||
struct be_cmd_enable_disable_vf {
|
||||
struct be_cmd_req_hdr hdr;
|
||||
u8 enable;
|
||||
u8 rsvd[3];
|
||||
};
|
||||
|
||||
static inline bool check_privilege(struct be_adapter *adapter, u32 flags)
|
||||
{
|
||||
return flags & adapter->cmd_privileges ? true : false;
|
||||
@ -1929,3 +1936,4 @@ extern int be_cmd_get_profile_config(struct be_adapter *adapter, u32 *cap_flags,
|
||||
|
||||
extern int be_cmd_set_profile_config(struct be_adapter *adapter, u32 bps,
|
||||
u8 domain);
|
||||
extern int be_cmd_enable_vf(struct be_adapter *adapter, u8 domain);
|
||||
|
@ -2731,6 +2731,8 @@ static int be_vf_setup(struct be_adapter *adapter)
|
||||
if (status)
|
||||
goto err;
|
||||
vf_cfg->def_vid = def_vlan;
|
||||
|
||||
be_cmd_enable_vf(adapter, vf + 1);
|
||||
}
|
||||
return 0;
|
||||
err:
|
||||
|
Loading…
Reference in New Issue
Block a user