提交 879c3808 编写于 作者: D David S. Miller

Merge branch 'net-aquantia-fixes-on-vlan-filters-and-other-conditions'

Igor Russkikh says:

====================
net: aquantia: fixes on vlan filters and other conditions

Here is a set of various bug fixes related to vlan filter offload and
two other rare cases.
====================
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
...@@ -431,7 +431,8 @@ int aq_del_fvlan_by_vlan(struct aq_nic_s *aq_nic, u16 vlan_id) ...@@ -431,7 +431,8 @@ int aq_del_fvlan_by_vlan(struct aq_nic_s *aq_nic, u16 vlan_id)
if (be16_to_cpu(rule->aq_fsp.h_ext.vlan_tci) == vlan_id) if (be16_to_cpu(rule->aq_fsp.h_ext.vlan_tci) == vlan_id)
break; break;
} }
if (rule && be16_to_cpu(rule->aq_fsp.h_ext.vlan_tci) == vlan_id) { if (rule && rule->type == aq_rx_filter_vlan &&
be16_to_cpu(rule->aq_fsp.h_ext.vlan_tci) == vlan_id) {
struct ethtool_rxnfc cmd; struct ethtool_rxnfc cmd;
cmd.fs.location = rule->aq_fsp.location; cmd.fs.location = rule->aq_fsp.location;
...@@ -843,7 +844,7 @@ int aq_filters_vlans_update(struct aq_nic_s *aq_nic) ...@@ -843,7 +844,7 @@ int aq_filters_vlans_update(struct aq_nic_s *aq_nic)
return err; return err;
if (aq_nic->ndev->features & NETIF_F_HW_VLAN_CTAG_FILTER) { if (aq_nic->ndev->features & NETIF_F_HW_VLAN_CTAG_FILTER) {
if (hweight < AQ_VLAN_MAX_FILTERS && hweight > 0) { if (hweight <= AQ_VLAN_MAX_FILTERS && hweight > 0) {
err = aq_hw_ops->hw_filter_vlan_ctrl(aq_hw, err = aq_hw_ops->hw_filter_vlan_ctrl(aq_hw,
!(aq_nic->packet_filter & IFF_PROMISC)); !(aq_nic->packet_filter & IFF_PROMISC));
aq_nic->aq_nic_cfg.is_vlan_force_promisc = false; aq_nic->aq_nic_cfg.is_vlan_force_promisc = false;
......
...@@ -61,6 +61,10 @@ static int aq_ndev_open(struct net_device *ndev) ...@@ -61,6 +61,10 @@ static int aq_ndev_open(struct net_device *ndev)
if (err < 0) if (err < 0)
goto err_exit; goto err_exit;
err = aq_filters_vlans_update(aq_nic);
if (err < 0)
goto err_exit;
err = aq_nic_start(aq_nic); err = aq_nic_start(aq_nic);
if (err < 0) if (err < 0)
goto err_exit; goto err_exit;
......
...@@ -393,7 +393,7 @@ int aq_nic_start(struct aq_nic_s *self) ...@@ -393,7 +393,7 @@ int aq_nic_start(struct aq_nic_s *self)
self->aq_nic_cfg.link_irq_vec); self->aq_nic_cfg.link_irq_vec);
err = request_threaded_irq(irqvec, NULL, err = request_threaded_irq(irqvec, NULL,
aq_linkstate_threaded_isr, aq_linkstate_threaded_isr,
IRQF_SHARED, IRQF_SHARED | IRQF_ONESHOT,
self->ndev->name, self); self->ndev->name, self);
if (err < 0) if (err < 0)
goto err_exit; goto err_exit;
......
...@@ -86,6 +86,7 @@ static int aq_vec_poll(struct napi_struct *napi, int budget) ...@@ -86,6 +86,7 @@ static int aq_vec_poll(struct napi_struct *napi, int budget)
} }
} }
err_exit:
if (!was_tx_cleaned) if (!was_tx_cleaned)
work_done = budget; work_done = budget;
...@@ -95,7 +96,7 @@ static int aq_vec_poll(struct napi_struct *napi, int budget) ...@@ -95,7 +96,7 @@ static int aq_vec_poll(struct napi_struct *napi, int budget)
1U << self->aq_ring_param.vec_idx); 1U << self->aq_ring_param.vec_idx);
} }
} }
err_exit:
return work_done; return work_done;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册