diff options
author | David S. Miller <davem@davemloft.net> | 2017-05-04 12:31:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-05-04 12:31:03 -0400 |
commit | 15981952e8d04fa3349cd8db10f46ab3273ff398 (patch) | |
tree | 4ec0fb247d630bea29fc3d51d56f1d86686b96ac | |
parent | 77ef033b687c3e030017c94a29bf6ea3aaaef678 (diff) | |
parent | 161adb046b9119d480f2547db20fc3e9ce7cbf59 (diff) |
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: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/qlogic/qed/qed_dev.c | 11 | ||||
-rw-r--r-- | drivers/net/ethernet/qlogic/qed/qed_dev_api.h | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/qlogic/qed/qed_main.c | 8 | ||||
-rw-r--r-- | drivers/net/ethernet/qlogic/qed/qed_mcp.h | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/qlogic/qede/qede_ethtool.c | 10 | ||||
-rw-r--r-- | include/linux/qed/qed_if.h | 2 |
6 files changed, 24 insertions, 12 deletions
diff --git a/drivers/net/ethernet/qlogic/qed/qed_dev.c b/drivers/net/ethernet/qlogic/qed/qed_dev.c index 5f31140d0b77..bb70522ad362 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_dev.c +++ b/drivers/net/ethernet/qlogic/qed/qed_dev.c | |||
@@ -2536,6 +2536,9 @@ static int qed_hw_get_nvm_info(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt) | |||
2536 | DP_NOTICE(p_hwfn, "Unknown Speed in 0x%08x\n", link_temp); | 2536 | DP_NOTICE(p_hwfn, "Unknown Speed in 0x%08x\n", link_temp); |
2537 | } | 2537 | } |
2538 | 2538 | ||
2539 | p_hwfn->mcp_info->link_capabilities.default_speed_autoneg = | ||
2540 | link->speed.autoneg; | ||
2541 | |||
2539 | link_temp &= NVM_CFG1_PORT_DRV_FLOW_CONTROL_MASK; | 2542 | link_temp &= NVM_CFG1_PORT_DRV_FLOW_CONTROL_MASK; |
2540 | link_temp >>= NVM_CFG1_PORT_DRV_FLOW_CONTROL_OFFSET; | 2543 | link_temp >>= NVM_CFG1_PORT_DRV_FLOW_CONTROL_OFFSET; |
2541 | link->pause.autoneg = !!(link_temp & | 2544 | 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 | } | 3589 | } |
3587 | 3590 | ||
3588 | int qed_set_rxq_coalesce(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, | 3591 | int qed_set_rxq_coalesce(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, |
3589 | u16 coalesce, u8 qid, u16 sb_id) | 3592 | u16 coalesce, u16 qid, u16 sb_id) |
3590 | { | 3593 | { |
3591 | struct ustorm_eth_queue_zone eth_qzone; | 3594 | struct ustorm_eth_queue_zone eth_qzone; |
3592 | u8 timeset, timer_res; | 3595 | u8 timeset, timer_res; |
@@ -3607,7 +3610,7 @@ int qed_set_rxq_coalesce(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, | |||
3607 | } | 3610 | } |
3608 | timeset = (u8)(coalesce >> timer_res); | 3611 | timeset = (u8)(coalesce >> timer_res); |
3609 | 3612 | ||
3610 | rc = qed_fw_l2_queue(p_hwfn, (u16)qid, &fw_qid); | 3613 | rc = qed_fw_l2_queue(p_hwfn, qid, &fw_qid); |
3611 | if (rc) | 3614 | if (rc) |
3612 | return rc; | 3615 | return rc; |
3613 | 3616 | ||
@@ -3628,7 +3631,7 @@ out: | |||
3628 | } | 3631 | } |
3629 | 3632 | ||
3630 | int qed_set_txq_coalesce(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, | 3633 | int qed_set_txq_coalesce(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, |
3631 | u16 coalesce, u8 qid, u16 sb_id) | 3634 | u16 coalesce, u16 qid, u16 sb_id) |
3632 | { | 3635 | { |
3633 | struct xstorm_eth_queue_zone eth_qzone; | 3636 | struct xstorm_eth_queue_zone eth_qzone; |
3634 | u8 timeset, timer_res; | 3637 | u8 timeset, timer_res; |
@@ -3649,7 +3652,7 @@ int qed_set_txq_coalesce(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, | |||
3649 | } | 3652 | } |
3650 | timeset = (u8)(coalesce >> timer_res); | 3653 | timeset = (u8)(coalesce >> timer_res); |
3651 | 3654 | ||
3652 | rc = qed_fw_l2_queue(p_hwfn, (u16)qid, &fw_qid); | 3655 | rc = qed_fw_l2_queue(p_hwfn, qid, &fw_qid); |
3653 | if (rc) | 3656 | if (rc) |
3654 | return rc; | 3657 | return rc; |
3655 | 3658 | ||
diff --git a/drivers/net/ethernet/qlogic/qed/qed_dev_api.h b/drivers/net/ethernet/qlogic/qed/qed_dev_api.h index cefe3ee9064a..12d16c096e36 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_dev_api.h +++ b/drivers/net/ethernet/qlogic/qed/qed_dev_api.h | |||
@@ -454,7 +454,7 @@ int qed_final_cleanup(struct qed_hwfn *p_hwfn, | |||
454 | * @return int | 454 | * @return int |
455 | */ | 455 | */ |
456 | int qed_set_rxq_coalesce(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, | 456 | int qed_set_rxq_coalesce(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, |
457 | u16 coalesce, u8 qid, u16 sb_id); | 457 | u16 coalesce, u16 qid, u16 sb_id); |
458 | 458 | ||
459 | /** | 459 | /** |
460 | * @brief qed_set_txq_coalesce - Configure coalesce parameters for a Tx queue | 460 | * @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 | * @return int | 471 | * @return int |
472 | */ | 472 | */ |
473 | int qed_set_txq_coalesce(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, | 473 | int qed_set_txq_coalesce(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, |
474 | u16 coalesce, u8 qid, u16 sb_id); | 474 | u16 coalesce, u16 qid, u16 sb_id); |
475 | 475 | ||
476 | const char *qed_hw_get_resc_name(enum qed_resources res_id); | 476 | const char *qed_hw_get_resc_name(enum qed_resources res_id); |
477 | #endif | 477 | #endif |
diff --git a/drivers/net/ethernet/qlogic/qed/qed_main.c b/drivers/net/ethernet/qlogic/qed/qed_main.c index 59992cf20d42..b7ad36b91e12 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_main.c +++ b/drivers/net/ethernet/qlogic/qed/qed_main.c | |||
@@ -1372,7 +1372,7 @@ static void qed_fill_link(struct qed_hwfn *hwfn, | |||
1372 | 1372 | ||
1373 | /* TODO - at the moment assume supported and advertised speed equal */ | 1373 | /* TODO - at the moment assume supported and advertised speed equal */ |
1374 | if_link->supported_caps = QED_LM_FIBRE_BIT; | 1374 | if_link->supported_caps = QED_LM_FIBRE_BIT; |
1375 | if (params.speed.autoneg) | 1375 | if (link_caps.default_speed_autoneg) |
1376 | if_link->supported_caps |= QED_LM_Autoneg_BIT; | 1376 | if_link->supported_caps |= QED_LM_Autoneg_BIT; |
1377 | if (params.pause.autoneg || | 1377 | if (params.pause.autoneg || |
1378 | (params.pause.forced_rx && params.pause.forced_tx)) | 1378 | (params.pause.forced_rx && params.pause.forced_tx)) |
@@ -1382,6 +1382,10 @@ static void qed_fill_link(struct qed_hwfn *hwfn, | |||
1382 | if_link->supported_caps |= QED_LM_Pause_BIT; | 1382 | if_link->supported_caps |= QED_LM_Pause_BIT; |
1383 | 1383 | ||
1384 | if_link->advertised_caps = if_link->supported_caps; | 1384 | if_link->advertised_caps = if_link->supported_caps; |
1385 | if (params.speed.autoneg) | ||
1386 | if_link->advertised_caps |= QED_LM_Autoneg_BIT; | ||
1387 | else | ||
1388 | if_link->advertised_caps &= ~QED_LM_Autoneg_BIT; | ||
1385 | if (params.speed.advertised_speeds & | 1389 | if (params.speed.advertised_speeds & |
1386 | NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_1G) | 1390 | NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_1G) |
1387 | if_link->advertised_caps |= QED_LM_1000baseT_Half_BIT | | 1391 | 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 | } | 1525 | } |
1522 | 1526 | ||
1523 | static int qed_set_coalesce(struct qed_dev *cdev, u16 rx_coal, u16 tx_coal, | 1527 | static int qed_set_coalesce(struct qed_dev *cdev, u16 rx_coal, u16 tx_coal, |
1524 | u8 qid, u16 sb_id) | 1528 | u16 qid, u16 sb_id) |
1525 | { | 1529 | { |
1526 | struct qed_hwfn *hwfn; | 1530 | struct qed_hwfn *hwfn; |
1527 | struct qed_ptt *ptt; | 1531 | struct qed_ptt *ptt; |
diff --git a/drivers/net/ethernet/qlogic/qed/qed_mcp.h b/drivers/net/ethernet/qlogic/qed/qed_mcp.h index 5ae35d6cc7d1..2b09b8545236 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_mcp.h +++ b/drivers/net/ethernet/qlogic/qed/qed_mcp.h | |||
@@ -61,6 +61,7 @@ struct qed_mcp_link_params { | |||
61 | 61 | ||
62 | struct qed_mcp_link_capabilities { | 62 | struct qed_mcp_link_capabilities { |
63 | u32 speed_capabilities; | 63 | u32 speed_capabilities; |
64 | bool default_speed_autoneg; | ||
64 | }; | 65 | }; |
65 | 66 | ||
66 | struct qed_mcp_link_state { | 67 | struct qed_mcp_link_state { |
diff --git a/drivers/net/ethernet/qlogic/qede/qede_ethtool.c b/drivers/net/ethernet/qlogic/qede/qede_ethtool.c index 4dcfe9614731..172b292241a5 100644 --- a/drivers/net/ethernet/qlogic/qede/qede_ethtool.c +++ b/drivers/net/ethernet/qlogic/qede/qede_ethtool.c | |||
@@ -493,6 +493,11 @@ static int qede_set_link_ksettings(struct net_device *dev, | |||
493 | params.override_flags |= QED_LINK_OVERRIDE_SPEED_ADV_SPEEDS; | 493 | params.override_flags |= QED_LINK_OVERRIDE_SPEED_ADV_SPEEDS; |
494 | params.override_flags |= QED_LINK_OVERRIDE_SPEED_AUTONEG; | 494 | params.override_flags |= QED_LINK_OVERRIDE_SPEED_AUTONEG; |
495 | if (base->autoneg == AUTONEG_ENABLE) { | 495 | if (base->autoneg == AUTONEG_ENABLE) { |
496 | if (!(current_link.supported_caps & QED_LM_Autoneg_BIT)) { | ||
497 | DP_INFO(edev, "Auto negotiation is not supported\n"); | ||
498 | return -EOPNOTSUPP; | ||
499 | } | ||
500 | |||
496 | params.autoneg = true; | 501 | params.autoneg = true; |
497 | params.forced_speed = 0; | 502 | params.forced_speed = 0; |
498 | QEDE_ETHTOOL_TO_DRV_CAPS(params.adv_speeds, cmd, advertising) | 503 | QEDE_ETHTOOL_TO_DRV_CAPS(params.adv_speeds, cmd, advertising) |
@@ -706,8 +711,7 @@ static int qede_set_coalesce(struct net_device *dev, | |||
706 | { | 711 | { |
707 | struct qede_dev *edev = netdev_priv(dev); | 712 | struct qede_dev *edev = netdev_priv(dev); |
708 | int i, rc = 0; | 713 | int i, rc = 0; |
709 | u16 rxc, txc; | 714 | u16 rxc, txc, sb_id; |
710 | u8 sb_id; | ||
711 | 715 | ||
712 | if (!netif_running(dev)) { | 716 | if (!netif_running(dev)) { |
713 | DP_INFO(edev, "Interface is down\n"); | 717 | DP_INFO(edev, "Interface is down\n"); |
@@ -729,7 +733,7 @@ static int qede_set_coalesce(struct net_device *dev, | |||
729 | for_each_queue(i) { | 733 | for_each_queue(i) { |
730 | sb_id = edev->fp_array[i].sb_info->igu_sb_id; | 734 | sb_id = edev->fp_array[i].sb_info->igu_sb_id; |
731 | rc = edev->ops->common->set_coalesce(edev->cdev, rxc, txc, | 735 | rc = edev->ops->common->set_coalesce(edev->cdev, rxc, txc, |
732 | (u8)i, sb_id); | 736 | (u16)i, sb_id); |
733 | if (rc) { | 737 | if (rc) { |
734 | DP_INFO(edev, "Set coalesce error, rc = %d\n", rc); | 738 | DP_INFO(edev, "Set coalesce error, rc = %d\n", rc); |
735 | return rc; | 739 | return rc; |
diff --git a/include/linux/qed/qed_if.h b/include/linux/qed/qed_if.h index 5544d7b2f2bb..c70ac13a97e6 100644 --- a/include/linux/qed/qed_if.h +++ b/include/linux/qed/qed_if.h | |||
@@ -635,7 +635,7 @@ struct qed_common_ops { | |||
635 | * @return 0 on success, error otherwise. | 635 | * @return 0 on success, error otherwise. |
636 | */ | 636 | */ |
637 | int (*set_coalesce)(struct qed_dev *cdev, u16 rx_coal, u16 tx_coal, | 637 | int (*set_coalesce)(struct qed_dev *cdev, u16 rx_coal, u16 tx_coal, |
638 | u8 qid, u16 sb_id); | 638 | u16 qid, u16 sb_id); |
639 | 639 | ||
640 | /** | 640 | /** |
641 | * @brief set_led - Configure LED mode | 641 | * @brief set_led - Configure LED mode |