Commit dcf7ebba authored by Padmanabh Ratnakar's avatar Padmanabh Ratnakar Committed by David S. Miller

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: default avatarPadmanabh Ratnakar <padmanabh.ratnakar@emulex.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c8a54163
...@@ -3131,6 +3131,38 @@ int be_cmd_set_profile_config(struct be_adapter *adapter, u32 bps, ...@@ -3131,6 +3131,38 @@ int be_cmd_set_profile_config(struct be_adapter *adapter, u32 bps,
return status; 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 be_roce_mcc_cmd(void *netdev_handle, void *wrb_payload,
int wrb_payload_size, u16 *cmd_status, u16 *ext_status) int wrb_payload_size, u16 *cmd_status, u16 *ext_status)
{ {
......
...@@ -203,6 +203,7 @@ struct be_mcc_mailbox { ...@@ -203,6 +203,7 @@ struct be_mcc_mailbox {
#define OPCODE_COMMON_GET_FN_PRIVILEGES 170 #define OPCODE_COMMON_GET_FN_PRIVILEGES 170
#define OPCODE_COMMON_READ_OBJECT 171 #define OPCODE_COMMON_READ_OBJECT 171
#define OPCODE_COMMON_WRITE_OBJECT 172 #define OPCODE_COMMON_WRITE_OBJECT 172
#define OPCODE_COMMON_ENABLE_DISABLE_VF 196
#define OPCODE_ETH_RSS_CONFIG 1 #define OPCODE_ETH_RSS_CONFIG 1
#define OPCODE_ETH_ACPI_CONFIG 2 #define OPCODE_ETH_ACPI_CONFIG 2
...@@ -1802,6 +1803,12 @@ struct be_cmd_resp_set_profile_config { ...@@ -1802,6 +1803,12 @@ struct be_cmd_resp_set_profile_config {
struct be_cmd_req_hdr hdr; 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) static inline bool check_privilege(struct be_adapter *adapter, u32 flags)
{ {
return flags & adapter->cmd_privileges ? true : false; 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, ...@@ -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, extern int be_cmd_set_profile_config(struct be_adapter *adapter, u32 bps,
u8 domain); 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) ...@@ -2731,6 +2731,8 @@ static int be_vf_setup(struct be_adapter *adapter)
if (status) if (status)
goto err; goto err;
vf_cfg->def_vid = def_vlan; vf_cfg->def_vid = def_vlan;
be_cmd_enable_vf(adapter, vf + 1);
} }
return 0; return 0;
err: err:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment