Commit 15981952 authored by David S. Miller's avatar David S. Miller

Merge branch 'qed-fixes'

Sudarsana Reddy Kalluru says:

====================
qed*: Bug fix series.

The series contains minor bug fixes for qed/qede drivers.

Please consider applying it to 'net' branch.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 77ef033b 161adb04
...@@ -2536,6 +2536,9 @@ static int qed_hw_get_nvm_info(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt) ...@@ -2536,6 +2536,9 @@ static int qed_hw_get_nvm_info(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
DP_NOTICE(p_hwfn, "Unknown Speed in 0x%08x\n", link_temp); DP_NOTICE(p_hwfn, "Unknown Speed in 0x%08x\n", link_temp);
} }
p_hwfn->mcp_info->link_capabilities.default_speed_autoneg =
link->speed.autoneg;
link_temp &= NVM_CFG1_PORT_DRV_FLOW_CONTROL_MASK; link_temp &= NVM_CFG1_PORT_DRV_FLOW_CONTROL_MASK;
link_temp >>= NVM_CFG1_PORT_DRV_FLOW_CONTROL_OFFSET; link_temp >>= NVM_CFG1_PORT_DRV_FLOW_CONTROL_OFFSET;
link->pause.autoneg = !!(link_temp & link->pause.autoneg = !!(link_temp &
...@@ -3586,7 +3589,7 @@ static int qed_set_coalesce(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, ...@@ -3586,7 +3589,7 @@ static int qed_set_coalesce(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt,
} }
int qed_set_rxq_coalesce(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, int qed_set_rxq_coalesce(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt,
u16 coalesce, u8 qid, u16 sb_id) u16 coalesce, u16 qid, u16 sb_id)
{ {
struct ustorm_eth_queue_zone eth_qzone; struct ustorm_eth_queue_zone eth_qzone;
u8 timeset, timer_res; u8 timeset, timer_res;
...@@ -3607,7 +3610,7 @@ int qed_set_rxq_coalesce(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, ...@@ -3607,7 +3610,7 @@ int qed_set_rxq_coalesce(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt,
} }
timeset = (u8)(coalesce >> timer_res); timeset = (u8)(coalesce >> timer_res);
rc = qed_fw_l2_queue(p_hwfn, (u16)qid, &fw_qid); rc = qed_fw_l2_queue(p_hwfn, qid, &fw_qid);
if (rc) if (rc)
return rc; return rc;
...@@ -3628,7 +3631,7 @@ int qed_set_rxq_coalesce(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, ...@@ -3628,7 +3631,7 @@ int qed_set_rxq_coalesce(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt,
} }
int qed_set_txq_coalesce(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, int qed_set_txq_coalesce(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt,
u16 coalesce, u8 qid, u16 sb_id) u16 coalesce, u16 qid, u16 sb_id)
{ {
struct xstorm_eth_queue_zone eth_qzone; struct xstorm_eth_queue_zone eth_qzone;
u8 timeset, timer_res; u8 timeset, timer_res;
...@@ -3649,7 +3652,7 @@ int qed_set_txq_coalesce(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, ...@@ -3649,7 +3652,7 @@ int qed_set_txq_coalesce(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt,
} }
timeset = (u8)(coalesce >> timer_res); timeset = (u8)(coalesce >> timer_res);
rc = qed_fw_l2_queue(p_hwfn, (u16)qid, &fw_qid); rc = qed_fw_l2_queue(p_hwfn, qid, &fw_qid);
if (rc) if (rc)
return rc; return rc;
......
...@@ -454,7 +454,7 @@ int qed_final_cleanup(struct qed_hwfn *p_hwfn, ...@@ -454,7 +454,7 @@ int qed_final_cleanup(struct qed_hwfn *p_hwfn,
* @return int * @return int
*/ */
int qed_set_rxq_coalesce(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, int qed_set_rxq_coalesce(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt,
u16 coalesce, u8 qid, u16 sb_id); u16 coalesce, u16 qid, u16 sb_id);
/** /**
* @brief qed_set_txq_coalesce - Configure coalesce parameters for a Tx queue * @brief qed_set_txq_coalesce - Configure coalesce parameters for a Tx queue
...@@ -471,7 +471,7 @@ int qed_set_rxq_coalesce(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, ...@@ -471,7 +471,7 @@ int qed_set_rxq_coalesce(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt,
* @return int * @return int
*/ */
int qed_set_txq_coalesce(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, int qed_set_txq_coalesce(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt,
u16 coalesce, u8 qid, u16 sb_id); u16 coalesce, u16 qid, u16 sb_id);
const char *qed_hw_get_resc_name(enum qed_resources res_id); const char *qed_hw_get_resc_name(enum qed_resources res_id);
#endif #endif
...@@ -1372,7 +1372,7 @@ static void qed_fill_link(struct qed_hwfn *hwfn, ...@@ -1372,7 +1372,7 @@ static void qed_fill_link(struct qed_hwfn *hwfn,
/* TODO - at the moment assume supported and advertised speed equal */ /* TODO - at the moment assume supported and advertised speed equal */
if_link->supported_caps = QED_LM_FIBRE_BIT; if_link->supported_caps = QED_LM_FIBRE_BIT;
if (params.speed.autoneg) if (link_caps.default_speed_autoneg)
if_link->supported_caps |= QED_LM_Autoneg_BIT; if_link->supported_caps |= QED_LM_Autoneg_BIT;
if (params.pause.autoneg || if (params.pause.autoneg ||
(params.pause.forced_rx && params.pause.forced_tx)) (params.pause.forced_rx && params.pause.forced_tx))
...@@ -1382,6 +1382,10 @@ static void qed_fill_link(struct qed_hwfn *hwfn, ...@@ -1382,6 +1382,10 @@ static void qed_fill_link(struct qed_hwfn *hwfn,
if_link->supported_caps |= QED_LM_Pause_BIT; if_link->supported_caps |= QED_LM_Pause_BIT;
if_link->advertised_caps = if_link->supported_caps; if_link->advertised_caps = if_link->supported_caps;
if (params.speed.autoneg)
if_link->advertised_caps |= QED_LM_Autoneg_BIT;
else
if_link->advertised_caps &= ~QED_LM_Autoneg_BIT;
if (params.speed.advertised_speeds & if (params.speed.advertised_speeds &
NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_1G) NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_1G)
if_link->advertised_caps |= QED_LM_1000baseT_Half_BIT | if_link->advertised_caps |= QED_LM_1000baseT_Half_BIT |
...@@ -1521,7 +1525,7 @@ static void qed_get_coalesce(struct qed_dev *cdev, u16 *rx_coal, u16 *tx_coal) ...@@ -1521,7 +1525,7 @@ static void qed_get_coalesce(struct qed_dev *cdev, u16 *rx_coal, u16 *tx_coal)
} }
static int qed_set_coalesce(struct qed_dev *cdev, u16 rx_coal, u16 tx_coal, static int qed_set_coalesce(struct qed_dev *cdev, u16 rx_coal, u16 tx_coal,
u8 qid, u16 sb_id) u16 qid, u16 sb_id)
{ {
struct qed_hwfn *hwfn; struct qed_hwfn *hwfn;
struct qed_ptt *ptt; struct qed_ptt *ptt;
......
...@@ -61,6 +61,7 @@ struct qed_mcp_link_params { ...@@ -61,6 +61,7 @@ struct qed_mcp_link_params {
struct qed_mcp_link_capabilities { struct qed_mcp_link_capabilities {
u32 speed_capabilities; u32 speed_capabilities;
bool default_speed_autoneg;
}; };
struct qed_mcp_link_state { struct qed_mcp_link_state {
......
...@@ -493,6 +493,11 @@ static int qede_set_link_ksettings(struct net_device *dev, ...@@ -493,6 +493,11 @@ static int qede_set_link_ksettings(struct net_device *dev,
params.override_flags |= QED_LINK_OVERRIDE_SPEED_ADV_SPEEDS; params.override_flags |= QED_LINK_OVERRIDE_SPEED_ADV_SPEEDS;
params.override_flags |= QED_LINK_OVERRIDE_SPEED_AUTONEG; params.override_flags |= QED_LINK_OVERRIDE_SPEED_AUTONEG;
if (base->autoneg == AUTONEG_ENABLE) { if (base->autoneg == AUTONEG_ENABLE) {
if (!(current_link.supported_caps & QED_LM_Autoneg_BIT)) {
DP_INFO(edev, "Auto negotiation is not supported\n");
return -EOPNOTSUPP;
}
params.autoneg = true; params.autoneg = true;
params.forced_speed = 0; params.forced_speed = 0;
QEDE_ETHTOOL_TO_DRV_CAPS(params.adv_speeds, cmd, advertising) QEDE_ETHTOOL_TO_DRV_CAPS(params.adv_speeds, cmd, advertising)
...@@ -706,8 +711,7 @@ static int qede_set_coalesce(struct net_device *dev, ...@@ -706,8 +711,7 @@ static int qede_set_coalesce(struct net_device *dev,
{ {
struct qede_dev *edev = netdev_priv(dev); struct qede_dev *edev = netdev_priv(dev);
int i, rc = 0; int i, rc = 0;
u16 rxc, txc; u16 rxc, txc, sb_id;
u8 sb_id;
if (!netif_running(dev)) { if (!netif_running(dev)) {
DP_INFO(edev, "Interface is down\n"); DP_INFO(edev, "Interface is down\n");
...@@ -729,7 +733,7 @@ static int qede_set_coalesce(struct net_device *dev, ...@@ -729,7 +733,7 @@ static int qede_set_coalesce(struct net_device *dev,
for_each_queue(i) { for_each_queue(i) {
sb_id = edev->fp_array[i].sb_info->igu_sb_id; sb_id = edev->fp_array[i].sb_info->igu_sb_id;
rc = edev->ops->common->set_coalesce(edev->cdev, rxc, txc, rc = edev->ops->common->set_coalesce(edev->cdev, rxc, txc,
(u8)i, sb_id); (u16)i, sb_id);
if (rc) { if (rc) {
DP_INFO(edev, "Set coalesce error, rc = %d\n", rc); DP_INFO(edev, "Set coalesce error, rc = %d\n", rc);
return rc; return rc;
......
...@@ -635,7 +635,7 @@ struct qed_common_ops { ...@@ -635,7 +635,7 @@ struct qed_common_ops {
* @return 0 on success, error otherwise. * @return 0 on success, error otherwise.
*/ */
int (*set_coalesce)(struct qed_dev *cdev, u16 rx_coal, u16 tx_coal, int (*set_coalesce)(struct qed_dev *cdev, u16 rx_coal, u16 tx_coal,
u8 qid, u16 sb_id); u16 qid, u16 sb_id);
/** /**
* @brief set_led - Configure LED mode * @brief set_led - Configure LED mode
......
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