mirror of https://gitee.com/openkylin/linux.git
Merge branch 'bnx2x-Fix-series'
Sudarsana Reddy Kalluru says: ==================== bnx2x: Fix series The patch series addresses few important issues in the bnx2x driver. Please consider applying it 'net' tree. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
9463b9a4e0
|
@ -1282,6 +1282,7 @@ enum sp_rtnl_flag {
|
|||
BNX2X_SP_RTNL_TX_STOP,
|
||||
BNX2X_SP_RTNL_GET_DRV_VERSION,
|
||||
BNX2X_SP_RTNL_CHANGE_UDP_PORT,
|
||||
BNX2X_SP_RTNL_UPDATE_SVID,
|
||||
};
|
||||
|
||||
enum bnx2x_iov_flag {
|
||||
|
@ -2520,6 +2521,7 @@ void bnx2x_update_mfw_dump(struct bnx2x *bp);
|
|||
void bnx2x_init_ptp(struct bnx2x *bp);
|
||||
int bnx2x_configure_ptp_filters(struct bnx2x *bp);
|
||||
void bnx2x_set_rx_ts(struct bnx2x *bp, struct sk_buff *skb);
|
||||
void bnx2x_register_phc(struct bnx2x *bp);
|
||||
|
||||
#define BNX2X_MAX_PHC_DRIFT 31000000
|
||||
#define BNX2X_PTP_TX_TIMEOUT
|
||||
|
|
|
@ -2842,6 +2842,7 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
|
|||
bnx2x_set_rx_mode_inner(bp);
|
||||
|
||||
if (bp->flags & PTP_SUPPORTED) {
|
||||
bnx2x_register_phc(bp);
|
||||
bnx2x_init_ptp(bp);
|
||||
bnx2x_configure_ptp_filters(bp);
|
||||
}
|
||||
|
|
|
@ -2925,6 +2925,10 @@ static void bnx2x_handle_update_svid_cmd(struct bnx2x *bp)
|
|||
func_params.f_obj = &bp->func_obj;
|
||||
func_params.cmd = BNX2X_F_CMD_SWITCH_UPDATE;
|
||||
|
||||
/* Prepare parameters for function state transitions */
|
||||
__set_bit(RAMROD_COMP_WAIT, &func_params.ramrod_flags);
|
||||
__set_bit(RAMROD_RETRY, &func_params.ramrod_flags);
|
||||
|
||||
if (IS_MF_UFP(bp) || IS_MF_BD(bp)) {
|
||||
int func = BP_ABS_FUNC(bp);
|
||||
u32 val;
|
||||
|
@ -4311,7 +4315,8 @@ static void bnx2x_attn_int_deasserted3(struct bnx2x *bp, u32 attn)
|
|||
bnx2x_handle_eee_event(bp);
|
||||
|
||||
if (val & DRV_STATUS_OEM_UPDATE_SVID)
|
||||
bnx2x_handle_update_svid_cmd(bp);
|
||||
bnx2x_schedule_sp_rtnl(bp,
|
||||
BNX2X_SP_RTNL_UPDATE_SVID, 0);
|
||||
|
||||
if (bp->link_vars.periodic_flags &
|
||||
PERIODIC_FLAGS_LINK_EVENT) {
|
||||
|
@ -7723,6 +7728,9 @@ static int bnx2x_init_hw_port(struct bnx2x *bp)
|
|||
REG_WR(bp, reg_addr, val);
|
||||
}
|
||||
|
||||
if (CHIP_IS_E3B0(bp))
|
||||
bp->flags |= PTP_SUPPORTED;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -8472,6 +8480,7 @@ int bnx2x_set_vlan_one(struct bnx2x *bp, u16 vlan,
|
|||
/* Fill a user request section if needed */
|
||||
if (!test_bit(RAMROD_CONT, ramrod_flags)) {
|
||||
ramrod_param.user_req.u.vlan.vlan = vlan;
|
||||
__set_bit(BNX2X_VLAN, &ramrod_param.user_req.vlan_mac_flags);
|
||||
/* Set the command: ADD or DEL */
|
||||
if (set)
|
||||
ramrod_param.user_req.cmd = BNX2X_VLAN_MAC_ADD;
|
||||
|
@ -8492,6 +8501,27 @@ int bnx2x_set_vlan_one(struct bnx2x *bp, u16 vlan,
|
|||
return rc;
|
||||
}
|
||||
|
||||
static int bnx2x_del_all_vlans(struct bnx2x *bp)
|
||||
{
|
||||
struct bnx2x_vlan_mac_obj *vlan_obj = &bp->sp_objs[0].vlan_obj;
|
||||
unsigned long ramrod_flags = 0, vlan_flags = 0;
|
||||
struct bnx2x_vlan_entry *vlan;
|
||||
int rc;
|
||||
|
||||
__set_bit(RAMROD_COMP_WAIT, &ramrod_flags);
|
||||
__set_bit(BNX2X_VLAN, &vlan_flags);
|
||||
rc = vlan_obj->delete_all(bp, vlan_obj, &vlan_flags, &ramrod_flags);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
/* Mark that hw forgot all entries */
|
||||
list_for_each_entry(vlan, &bp->vlan_reg, link)
|
||||
vlan->hw = false;
|
||||
bp->vlan_cnt = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bnx2x_del_all_macs(struct bnx2x *bp,
|
||||
struct bnx2x_vlan_mac_obj *mac_obj,
|
||||
int mac_type, bool wait_for_comp)
|
||||
|
@ -9330,6 +9360,11 @@ void bnx2x_chip_cleanup(struct bnx2x *bp, int unload_mode, bool keep_link)
|
|||
BNX2X_ERR("Failed to schedule DEL commands for UC MACs list: %d\n",
|
||||
rc);
|
||||
|
||||
/* Remove all currently configured VLANs */
|
||||
rc = bnx2x_del_all_vlans(bp);
|
||||
if (rc < 0)
|
||||
BNX2X_ERR("Failed to delete all VLANs\n");
|
||||
|
||||
/* Disable LLH */
|
||||
if (!CHIP_IS_E1(bp))
|
||||
REG_WR(bp, NIG_REG_LLH0_FUNC_EN + port*8, 0);
|
||||
|
@ -9417,8 +9452,13 @@ void bnx2x_chip_cleanup(struct bnx2x *bp, int unload_mode, bool keep_link)
|
|||
* function stop ramrod is sent, since as part of this ramrod FW access
|
||||
* PTP registers.
|
||||
*/
|
||||
if (bp->flags & PTP_SUPPORTED)
|
||||
if (bp->flags & PTP_SUPPORTED) {
|
||||
bnx2x_stop_ptp(bp);
|
||||
if (bp->ptp_clock) {
|
||||
ptp_clock_unregister(bp->ptp_clock);
|
||||
bp->ptp_clock = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* Disable HW interrupts, NAPI */
|
||||
bnx2x_netif_stop(bp, 1);
|
||||
|
@ -10359,6 +10399,9 @@ static void bnx2x_sp_rtnl_task(struct work_struct *work)
|
|||
&bp->sp_rtnl_state))
|
||||
bnx2x_update_mng_version(bp);
|
||||
|
||||
if (test_and_clear_bit(BNX2X_SP_RTNL_UPDATE_SVID, &bp->sp_rtnl_state))
|
||||
bnx2x_handle_update_svid_cmd(bp);
|
||||
|
||||
if (test_and_clear_bit(BNX2X_SP_RTNL_CHANGE_UDP_PORT,
|
||||
&bp->sp_rtnl_state)) {
|
||||
if (bnx2x_udp_port_update(bp)) {
|
||||
|
@ -11750,8 +11793,10 @@ static void bnx2x_get_fcoe_info(struct bnx2x *bp)
|
|||
* If maximum allowed number of connections is zero -
|
||||
* disable the feature.
|
||||
*/
|
||||
if (!bp->cnic_eth_dev.max_fcoe_conn)
|
||||
if (!bp->cnic_eth_dev.max_fcoe_conn) {
|
||||
bp->flags |= NO_FCOE_FLAG;
|
||||
eth_zero_addr(bp->fip_mac);
|
||||
}
|
||||
}
|
||||
|
||||
static void bnx2x_get_cnic_info(struct bnx2x *bp)
|
||||
|
@ -12494,9 +12539,6 @@ static int bnx2x_init_bp(struct bnx2x *bp)
|
|||
|
||||
bp->dump_preset_idx = 1;
|
||||
|
||||
if (CHIP_IS_E3B0(bp))
|
||||
bp->flags |= PTP_SUPPORTED;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -13024,13 +13066,6 @@ static void bnx2x_vlan_configure(struct bnx2x *bp, bool set_rx_mode)
|
|||
|
||||
int bnx2x_vlan_reconfigure_vid(struct bnx2x *bp)
|
||||
{
|
||||
struct bnx2x_vlan_entry *vlan;
|
||||
|
||||
/* The hw forgot all entries after reload */
|
||||
list_for_each_entry(vlan, &bp->vlan_reg, link)
|
||||
vlan->hw = false;
|
||||
bp->vlan_cnt = 0;
|
||||
|
||||
/* Don't set rx mode here. Our caller will do it. */
|
||||
bnx2x_vlan_configure(bp, false);
|
||||
|
||||
|
@ -13895,7 +13930,7 @@ static int bnx2x_ptp_enable(struct ptp_clock_info *ptp,
|
|||
return -ENOTSUPP;
|
||||
}
|
||||
|
||||
static void bnx2x_register_phc(struct bnx2x *bp)
|
||||
void bnx2x_register_phc(struct bnx2x *bp)
|
||||
{
|
||||
/* Fill the ptp_clock_info struct and register PTP clock*/
|
||||
bp->ptp_clock_info.owner = THIS_MODULE;
|
||||
|
@ -14097,8 +14132,6 @@ static int bnx2x_init_one(struct pci_dev *pdev,
|
|||
dev->base_addr, bp->pdev->irq, dev->dev_addr);
|
||||
pcie_print_link_status(bp->pdev);
|
||||
|
||||
bnx2x_register_phc(bp);
|
||||
|
||||
if (!IS_MF_SD_STORAGE_PERSONALITY_ONLY(bp))
|
||||
bnx2x_set_os_driver_state(bp, OS_DRIVER_STATE_DISABLED);
|
||||
|
||||
|
@ -14131,11 +14164,6 @@ static void __bnx2x_remove(struct pci_dev *pdev,
|
|||
struct bnx2x *bp,
|
||||
bool remove_netdev)
|
||||
{
|
||||
if (bp->ptp_clock) {
|
||||
ptp_clock_unregister(bp->ptp_clock);
|
||||
bp->ptp_clock = NULL;
|
||||
}
|
||||
|
||||
/* Delete storage MAC address */
|
||||
if (!NO_FCOE(bp)) {
|
||||
rtnl_lock();
|
||||
|
|
|
@ -265,6 +265,7 @@ enum {
|
|||
BNX2X_ETH_MAC,
|
||||
BNX2X_ISCSI_ETH_MAC,
|
||||
BNX2X_NETQ_ETH_MAC,
|
||||
BNX2X_VLAN,
|
||||
BNX2X_DONT_CONSUME_CAM_CREDIT,
|
||||
BNX2X_DONT_CONSUME_CAM_CREDIT_DEST,
|
||||
};
|
||||
|
@ -272,7 +273,8 @@ enum {
|
|||
#define BNX2X_VLAN_MAC_CMP_MASK (1 << BNX2X_UC_LIST_MAC | \
|
||||
1 << BNX2X_ETH_MAC | \
|
||||
1 << BNX2X_ISCSI_ETH_MAC | \
|
||||
1 << BNX2X_NETQ_ETH_MAC)
|
||||
1 << BNX2X_NETQ_ETH_MAC | \
|
||||
1 << BNX2X_VLAN)
|
||||
#define BNX2X_VLAN_MAC_CMP_FLAGS(flags) \
|
||||
((flags) & BNX2X_VLAN_MAC_CMP_MASK)
|
||||
|
||||
|
|
Loading…
Reference in New Issue