Skip to content

Commit 1a03f86

Browse files
committed
Merge branch 'qed-Fix-series-II'
Sudarsana Reddy Kalluru says: ==================== qed: Fix series II. The patch series fixes few issues in the qed driver. Please consider applying it to 'net' branch. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 64119e0 + 25c020a commit 1a03f86

File tree

6 files changed

+27
-16
lines changed

6 files changed

+27
-16
lines changed

drivers/net/ethernet/qlogic/qed/qed_l2.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ qed_sp_update_mcast_bin(struct qed_hwfn *p_hwfn,
665665

666666
p_ramrod->common.update_approx_mcast_flg = 1;
667667
for (i = 0; i < ETH_MULTICAST_MAC_BINS_IN_REGS; i++) {
668-
u32 *p_bins = (u32 *)p_params->bins;
668+
u32 *p_bins = p_params->bins;
669669

670670
p_ramrod->approx_mcast.bins[i] = cpu_to_le32(p_bins[i]);
671671
}
@@ -1476,8 +1476,8 @@ qed_sp_eth_filter_mcast(struct qed_hwfn *p_hwfn,
14761476
enum spq_mode comp_mode,
14771477
struct qed_spq_comp_cb *p_comp_data)
14781478
{
1479-
unsigned long bins[ETH_MULTICAST_MAC_BINS_IN_REGS];
14801479
struct vport_update_ramrod_data *p_ramrod = NULL;
1480+
u32 bins[ETH_MULTICAST_MAC_BINS_IN_REGS];
14811481
struct qed_spq_entry *p_ent = NULL;
14821482
struct qed_sp_init_data init_data;
14831483
u8 abs_vport_id = 0;
@@ -1513,26 +1513,25 @@ qed_sp_eth_filter_mcast(struct qed_hwfn *p_hwfn,
15131513
/* explicitly clear out the entire vector */
15141514
memset(&p_ramrod->approx_mcast.bins, 0,
15151515
sizeof(p_ramrod->approx_mcast.bins));
1516-
memset(bins, 0, sizeof(unsigned long) *
1517-
ETH_MULTICAST_MAC_BINS_IN_REGS);
1516+
memset(bins, 0, sizeof(bins));
15181517
/* filter ADD op is explicit set op and it removes
15191518
* any existing filters for the vport
15201519
*/
15211520
if (p_filter_cmd->opcode == QED_FILTER_ADD) {
15221521
for (i = 0; i < p_filter_cmd->num_mc_addrs; i++) {
1523-
u32 bit;
1522+
u32 bit, nbits;
15241523

15251524
bit = qed_mcast_bin_from_mac(p_filter_cmd->mac[i]);
1526-
__set_bit(bit, bins);
1525+
nbits = sizeof(u32) * BITS_PER_BYTE;
1526+
bins[bit / nbits] |= 1 << (bit % nbits);
15271527
}
15281528

15291529
/* Convert to correct endianity */
15301530
for (i = 0; i < ETH_MULTICAST_MAC_BINS_IN_REGS; i++) {
15311531
struct vport_update_ramrod_mcast *p_ramrod_bins;
1532-
u32 *p_bins = (u32 *)bins;
15331532

15341533
p_ramrod_bins = &p_ramrod->approx_mcast;
1535-
p_ramrod_bins->bins[i] = cpu_to_le32(p_bins[i]);
1534+
p_ramrod_bins->bins[i] = cpu_to_le32(bins[i]);
15361535
}
15371536
}
15381537

drivers/net/ethernet/qlogic/qed/qed_l2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ struct qed_sp_vport_update_params {
215215
u8 anti_spoofing_en;
216216
u8 update_accept_any_vlan_flg;
217217
u8 accept_any_vlan;
218-
unsigned long bins[8];
218+
u32 bins[8];
219219
struct qed_rss_params *rss_params;
220220
struct qed_filter_accept_flags accept_flags;
221221
struct qed_sge_tpa_params *sge_tpa_params;

drivers/net/ethernet/qlogic/qed/qed_mcp.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,6 +1211,7 @@ static void qed_mcp_handle_link_change(struct qed_hwfn *p_hwfn,
12111211
break;
12121212
default:
12131213
p_link->speed = 0;
1214+
p_link->link_up = 0;
12141215
}
12151216

12161217
if (p_link->link_up && p_link->speed)
@@ -1308,9 +1309,15 @@ int qed_mcp_set_link(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, bool b_up)
13081309
phy_cfg.pause |= (params->pause.forced_tx) ? ETH_PAUSE_TX : 0;
13091310
phy_cfg.adv_speed = params->speed.advertised_speeds;
13101311
phy_cfg.loopback_mode = params->loopback_mode;
1311-
if (p_hwfn->mcp_info->capabilities & FW_MB_PARAM_FEATURE_SUPPORT_EEE) {
1312-
if (params->eee.enable)
1313-
phy_cfg.eee_cfg |= EEE_CFG_EEE_ENABLED;
1312+
1313+
/* There are MFWs that share this capability regardless of whether
1314+
* this is feasible or not. And given that at the very least adv_caps
1315+
* would be set internally by qed, we want to make sure LFA would
1316+
* still work.
1317+
*/
1318+
if ((p_hwfn->mcp_info->capabilities &
1319+
FW_MB_PARAM_FEATURE_SUPPORT_EEE) && params->eee.enable) {
1320+
phy_cfg.eee_cfg |= EEE_CFG_EEE_ENABLED;
13141321
if (params->eee.tx_lpi_enable)
13151322
phy_cfg.eee_cfg |= EEE_CFG_TX_LPI;
13161323
if (params->eee.adv_caps & QED_EEE_1G_ADV)

drivers/net/ethernet/qlogic/qed/qed_sriov.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2831,7 +2831,7 @@ qed_iov_vp_update_mcast_bin_param(struct qed_hwfn *p_hwfn,
28312831

28322832
p_data->update_approx_mcast_flg = 1;
28332833
memcpy(p_data->bins, p_mcast_tlv->bins,
2834-
sizeof(unsigned long) * ETH_MULTICAST_MAC_BINS_IN_REGS);
2834+
sizeof(u32) * ETH_MULTICAST_MAC_BINS_IN_REGS);
28352835
*tlvs_mask |= 1 << QED_IOV_VP_UPDATE_MCAST;
28362836
}
28372837

drivers/net/ethernet/qlogic/qed/qed_vf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,7 @@ int qed_vf_pf_vport_update(struct qed_hwfn *p_hwfn,
11261126
resp_size += sizeof(struct pfvf_def_resp_tlv);
11271127

11281128
memcpy(p_mcast_tlv->bins, p_params->bins,
1129-
sizeof(unsigned long) * ETH_MULTICAST_MAC_BINS_IN_REGS);
1129+
sizeof(u32) * ETH_MULTICAST_MAC_BINS_IN_REGS);
11301130
}
11311131

11321132
update_rx = p_params->accept_flags.update_rx_mode_config;
@@ -1272,7 +1272,7 @@ void qed_vf_pf_filter_mcast(struct qed_hwfn *p_hwfn,
12721272
u32 bit;
12731273

12741274
bit = qed_mcast_bin_from_mac(p_filter_cmd->mac[i]);
1275-
__set_bit(bit, sp_params.bins);
1275+
sp_params.bins[bit / 32] |= 1 << (bit % 32);
12761276
}
12771277
}
12781278

drivers/net/ethernet/qlogic/qed/qed_vf.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,12 @@ struct vfpf_vport_update_mcast_bin_tlv {
392392
struct channel_tlv tl;
393393
u8 padding[4];
394394

395-
u64 bins[8];
395+
/* There are only 256 approx bins, and in HSI they're divided into
396+
* 32-bit values. As old VFs used to set-bit to the values on its side,
397+
* the upper half of the array is never expected to contain any data.
398+
*/
399+
u64 bins[4];
400+
u64 obsolete_bins[4];
396401
};
397402

398403
struct vfpf_vport_update_accept_param_tlv {

0 commit comments

Comments
 (0)