Commit d9d426af authored by Suresh Reddy's avatar Suresh Reddy Committed by David S. Miller

be2net: fix VF link state transition from disabled to auto

The VF link state setting transition from "disable" to "auto" does not work
due to a bug in SET_LOGICAL_LINK_CONFIG_V1 cmd in FW. This issue could not
be fixed in FW due to some backward compatibility issues it causes with
some released drivers. The issue has been fixed by introducing a new
version (v2) of the cmd from 10.6 FW onwards. In v2, to set the VF link
state to auto, both PLINK_ENABLE and PLINK_TRACK bits have to be set to 1.

The VF link state setting feature now works on Lancer chips too from
FW ver 10.6.315.0 onwards.
Signed-off-by: default avatarSuresh Reddy <suresh.reddy@avagotech.com>
Signed-off-by: default avatarSathya Perla <sathya.perla@avagotech.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent da0bcb4e
...@@ -4260,16 +4260,13 @@ int be_cmd_get_active_profile(struct be_adapter *adapter, u16 *profile_id) ...@@ -4260,16 +4260,13 @@ int be_cmd_get_active_profile(struct be_adapter *adapter, u16 *profile_id)
return status; return status;
} }
int be_cmd_set_logical_link_config(struct be_adapter *adapter, int __be_cmd_set_logical_link_config(struct be_adapter *adapter,
int link_state, u8 domain) int link_state, int version, u8 domain)
{ {
struct be_mcc_wrb *wrb; struct be_mcc_wrb *wrb;
struct be_cmd_req_set_ll_link *req; struct be_cmd_req_set_ll_link *req;
int status; int status;
if (BEx_chip(adapter) || lancer_chip(adapter))
return -EOPNOTSUPP;
spin_lock_bh(&adapter->mcc_lock); spin_lock_bh(&adapter->mcc_lock);
wrb = wrb_from_mccq(adapter); wrb = wrb_from_mccq(adapter);
...@@ -4284,14 +4281,15 @@ int be_cmd_set_logical_link_config(struct be_adapter *adapter, ...@@ -4284,14 +4281,15 @@ int be_cmd_set_logical_link_config(struct be_adapter *adapter,
OPCODE_COMMON_SET_LOGICAL_LINK_CONFIG, OPCODE_COMMON_SET_LOGICAL_LINK_CONFIG,
sizeof(*req), wrb, NULL); sizeof(*req), wrb, NULL);
req->hdr.version = 1; req->hdr.version = version;
req->hdr.domain = domain; req->hdr.domain = domain;
if (link_state == IFLA_VF_LINK_STATE_ENABLE) if (link_state == IFLA_VF_LINK_STATE_ENABLE ||
req->link_config |= 1; link_state == IFLA_VF_LINK_STATE_AUTO)
req->link_config |= PLINK_ENABLE;
if (link_state == IFLA_VF_LINK_STATE_AUTO) if (link_state == IFLA_VF_LINK_STATE_AUTO)
req->link_config |= 1 << PLINK_TRACK_SHIFT; req->link_config |= PLINK_TRACK;
status = be_mcc_notify_wait(adapter); status = be_mcc_notify_wait(adapter);
err: err:
...@@ -4299,6 +4297,25 @@ int be_cmd_set_logical_link_config(struct be_adapter *adapter, ...@@ -4299,6 +4297,25 @@ int be_cmd_set_logical_link_config(struct be_adapter *adapter,
return status; return status;
} }
int be_cmd_set_logical_link_config(struct be_adapter *adapter,
int link_state, u8 domain)
{
int status;
if (BEx_chip(adapter))
return -EOPNOTSUPP;
status = __be_cmd_set_logical_link_config(adapter, link_state,
2, domain);
/* Version 2 of the command will not be recognized by older FW.
* On such a failure issue version 1 of the command.
*/
if (base_status(status) == MCC_STATUS_ILLEGAL_REQUEST)
status = __be_cmd_set_logical_link_config(adapter, link_state,
1, domain);
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)
{ {
......
...@@ -2246,7 +2246,8 @@ struct be_cmd_resp_get_iface_list { ...@@ -2246,7 +2246,8 @@ struct be_cmd_resp_get_iface_list {
}; };
/*************** Set logical link ********************/ /*************** Set logical link ********************/
#define PLINK_TRACK_SHIFT 8 #define PLINK_ENABLE BIT(0)
#define PLINK_TRACK BIT(8)
struct be_cmd_req_set_ll_link { struct be_cmd_req_set_ll_link {
struct be_cmd_req_hdr hdr; struct be_cmd_req_hdr hdr;
u32 link_config; /* Bit 0: UP_DOWN, Bit 9: PLINK */ u32 link_config; /* Bit 0: UP_DOWN, Bit 9: PLINK */
......
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