Skip to content

Commit 7b7e70f

Browse files
Yuval Mintzdavem330
authored andcommitted
qed*: Allow unicast filtering
Apparently qede fails to set IFF_UNICAST_FLT, and as a result is not actually performing unicast MAC filtering. While we're at it - relax a hard-coded limitation that limits each interface into using at most 15 unicast MAC addresses before turning promiscuous. Instead utilize the HW resources to their limit. Signed-off-by: Yuval Mintz <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2569585 commit 7b7e70f

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1652,6 +1652,7 @@ static int qed_fill_eth_dev_info(struct qed_dev *cdev,
16521652

16531653
if (IS_PF(cdev)) {
16541654
int max_vf_vlan_filters = 0;
1655+
int max_vf_mac_filters = 0;
16551656

16561657
if (cdev->int_params.out.int_mode == QED_INT_MODE_MSIX) {
16571658
for_each_hwfn(cdev, i)
@@ -1665,11 +1666,18 @@ static int qed_fill_eth_dev_info(struct qed_dev *cdev,
16651666
info->num_queues = cdev->num_hwfns;
16661667
}
16671668

1668-
if (IS_QED_SRIOV(cdev))
1669+
if (IS_QED_SRIOV(cdev)) {
16691670
max_vf_vlan_filters = cdev->p_iov_info->total_vfs *
16701671
QED_ETH_VF_NUM_VLAN_FILTERS;
1671-
info->num_vlan_filters = RESC_NUM(&cdev->hwfns[0], QED_VLAN) -
1672+
max_vf_mac_filters = cdev->p_iov_info->total_vfs *
1673+
QED_ETH_VF_NUM_MAC_FILTERS;
1674+
}
1675+
info->num_vlan_filters = RESC_NUM(QED_LEADING_HWFN(cdev),
1676+
QED_VLAN) -
16721677
max_vf_vlan_filters;
1678+
info->num_mac_filters = RESC_NUM(QED_LEADING_HWFN(cdev),
1679+
QED_MAC) -
1680+
max_vf_mac_filters;
16731681

16741682
ether_addr_copy(info->port_mac,
16751683
cdev->hwfns[0].hw_info.hw_mac_addr);

drivers/net/ethernet/qlogic/qede/qede_main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2365,6 +2365,8 @@ static void qede_init_ndev(struct qede_dev *edev)
23652365

23662366
qede_set_ethtool_ops(ndev);
23672367

2368+
ndev->priv_flags = IFF_UNICAST_FLT;
2369+
23682370
/* user-changeble features */
23692371
hw_features = NETIF_F_GRO | NETIF_F_SG |
23702372
NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
@@ -3937,7 +3939,7 @@ static void qede_config_rx_mode(struct net_device *ndev)
39373939

39383940
/* Check for promiscuous */
39393941
if ((ndev->flags & IFF_PROMISC) ||
3940-
(uc_count > 15)) { /* @@@TBD resource allocation - 1 */
3942+
(uc_count > edev->dev_info.num_mac_filters - 1)) {
39413943
accept_flags = QED_FILTER_RX_MODE_TYPE_PROMISC;
39423944
} else {
39433945
/* Add MAC filters according to the unicast secondary macs */

include/linux/qed/qed_eth_if.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ struct qed_dev_eth_info {
2323

2424
u8 port_mac[ETH_ALEN];
2525
u8 num_vlan_filters;
26+
u16 num_mac_filters;
2627

2728
/* Legacy VF - this affects the datapath, so qede has to know */
2829
bool is_legacy;

0 commit comments

Comments
 (0)