Skip to content

Commit b0fca31

Browse files
Mintz, Yuvaldavem330
authored andcommitted
qed: Correct VF mac number
When relaxing the limitation on the number of unicast MAC filters an interface can configure, qed started passing the MAC quota to qede. However, the value is initialized only for PFs, causing VFs to always try and configure themselves as promiscuous [as they believe they lack the resources to configure the rx-mode]. Fixes: 7b7e70f ("qed*: Allow unicast filtering") Signed-off-by: Yuval Mintz <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 0183eb1 commit b0fca31

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1692,6 +1692,8 @@ static int qed_fill_eth_dev_info(struct qed_dev *cdev,
16921692

16931693
qed_vf_get_num_vlan_filters(&cdev->hwfns[0],
16941694
(u8 *)&info->num_vlan_filters);
1695+
qed_vf_get_num_mac_filters(&cdev->hwfns[0],
1696+
(u8 *)&info->num_mac_filters);
16951697
qed_vf_get_port_mac(&cdev->hwfns[0], info->port_mac);
16961698

16971699
info->is_legacy = !!cdev->hwfns[0].vf_iov_info->b_pre_fp_hsi;

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,6 +1171,13 @@ void qed_vf_get_num_vlan_filters(struct qed_hwfn *p_hwfn, u8 *num_vlan_filters)
11711171
*num_vlan_filters = p_vf->acquire_resp.resc.num_vlan_filters;
11721172
}
11731173

1174+
void qed_vf_get_num_mac_filters(struct qed_hwfn *p_hwfn, u8 *num_mac_filters)
1175+
{
1176+
struct qed_vf_iov *p_vf = p_hwfn->vf_iov_info;
1177+
1178+
*num_mac_filters = p_vf->acquire_resp.resc.num_mac_filters;
1179+
}
1180+
11741181
bool qed_vf_check_mac(struct qed_hwfn *p_hwfn, u8 *mac)
11751182
{
11761183
struct qed_bulletin_content *bulletin;

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,14 @@ void qed_vf_get_port_mac(struct qed_hwfn *p_hwfn, u8 *port_mac);
622622
void qed_vf_get_num_vlan_filters(struct qed_hwfn *p_hwfn,
623623
u8 *num_vlan_filters);
624624

625+
/**
626+
* @brief Get number of MAC filters allocated for VF by qed
627+
*
628+
* @param p_hwfn
629+
* @param num_rxqs - allocated MAC filters
630+
*/
631+
void qed_vf_get_num_mac_filters(struct qed_hwfn *p_hwfn, u8 *num_mac_filters);
632+
625633
/**
626634
* @brief Check if VF can set a MAC address
627635
*
@@ -872,6 +880,11 @@ static inline void qed_vf_get_num_vlan_filters(struct qed_hwfn *p_hwfn,
872880
{
873881
}
874882

883+
static inline void qed_vf_get_num_mac_filters(struct qed_hwfn *p_hwfn,
884+
u8 *num_mac_filters)
885+
{
886+
}
887+
875888
static inline bool qed_vf_check_mac(struct qed_hwfn *p_hwfn, u8 *mac)
876889
{
877890
return false;

0 commit comments

Comments
 (0)