“59c51591a0ac7568824f541f57de967e88adaa07”上不存在“scripts/docproc.c”
提交 25eb8d46 编写于 作者: Y Yuval Mintz 提交者: David S. Miller

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: NYuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 d572c430
...@@ -1664,6 +1664,8 @@ static int qed_fill_eth_dev_info(struct qed_dev *cdev, ...@@ -1664,6 +1664,8 @@ static int qed_fill_eth_dev_info(struct qed_dev *cdev,
info->num_tc = 1; info->num_tc = 1;
if (IS_PF(cdev)) { if (IS_PF(cdev)) {
int max_vf_vlan_filters = 0;
if (cdev->int_params.out.int_mode == QED_INT_MODE_MSIX) { if (cdev->int_params.out.int_mode == QED_INT_MODE_MSIX) {
for_each_hwfn(cdev, i) for_each_hwfn(cdev, i)
info->num_queues += info->num_queues +=
...@@ -1676,7 +1678,12 @@ static int qed_fill_eth_dev_info(struct qed_dev *cdev, ...@@ -1676,7 +1678,12 @@ static int qed_fill_eth_dev_info(struct qed_dev *cdev,
info->num_queues = cdev->num_hwfns; info->num_queues = cdev->num_hwfns;
} }
info->num_vlan_filters = RESC_NUM(&cdev->hwfns[0], QED_VLAN); if (IS_QED_SRIOV(cdev))
max_vf_vlan_filters = cdev->p_iov_info->total_vfs *
QED_ETH_VF_NUM_VLAN_FILTERS;
info->num_vlan_filters = RESC_NUM(&cdev->hwfns[0], QED_VLAN) -
max_vf_vlan_filters;
ether_addr_copy(info->port_mac, ether_addr_copy(info->port_mac,
cdev->hwfns[0].hw_info.hw_mac_addr); cdev->hwfns[0].hw_info.hw_mac_addr);
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册