aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuval Mintz <Yuval.Mintz@qlogic.com>2016-07-27 07:45:24 -0400
committerDavid S. Miller <davem@davemloft.net>2016-07-30 23:34:03 -0400
commit25eb8d46e4a0ad7aea11e73e47c20c0e400e57f1 (patch)
tree672895221de189c9970f4874f2cd90fe91946592
parentd572c4308fdecc95a84e747b8a13c2fa10a5fff6 (diff)
qed: Prevent over-usage of vlan credits by PF
Each PF/VF has a limited number of vlan filters for configuration purposes; This information is passed to qede and is used to prevent over-usage - once a vlan is to be configured and no filter credit is available, the driver would switch into working in vlan-promisc mode. Problem is the credit pool is shared by both PFs and VFs, and currently PFs aren't deducting the filters that are reserved for their VFs from their quota, which may lead to some vlan filters failing unknowingly due to lack of credit. Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/qlogic/qed/qed_l2.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/ethernet/qlogic/qed/qed_l2.c b/drivers/net/ethernet/qlogic/qed/qed_l2.c
index 6ccf32795ea7..401e738543b5 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_l2.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_l2.c
@@ -1664,6 +1664,8 @@ static int qed_fill_eth_dev_info(struct qed_dev *cdev,
1664 info->num_tc = 1; 1664 info->num_tc = 1;
1665 1665
1666 if (IS_PF(cdev)) { 1666 if (IS_PF(cdev)) {
1667 int max_vf_vlan_filters = 0;
1668
1667 if (cdev->int_params.out.int_mode == QED_INT_MODE_MSIX) { 1669 if (cdev->int_params.out.int_mode == QED_INT_MODE_MSIX) {
1668 for_each_hwfn(cdev, i) 1670 for_each_hwfn(cdev, i)
1669 info->num_queues += 1671 info->num_queues +=
@@ -1676,7 +1678,12 @@ static int qed_fill_eth_dev_info(struct qed_dev *cdev,
1676 info->num_queues = cdev->num_hwfns; 1678 info->num_queues = cdev->num_hwfns;
1677 } 1679 }
1678 1680
1679 info->num_vlan_filters = RESC_NUM(&cdev->hwfns[0], QED_VLAN); 1681 if (IS_QED_SRIOV(cdev))
1682 max_vf_vlan_filters = cdev->p_iov_info->total_vfs *
1683 QED_ETH_VF_NUM_VLAN_FILTERS;
1684 info->num_vlan_filters = RESC_NUM(&cdev->hwfns[0], QED_VLAN) -
1685 max_vf_vlan_filters;
1686
1680 ether_addr_copy(info->port_mac, 1687 ether_addr_copy(info->port_mac,
1681 cdev->hwfns[0].hw_info.hw_mac_addr); 1688 cdev->hwfns[0].hw_info.hw_mac_addr);
1682 } else { 1689 } else {