History

net: ethernet: ti: cpsw: clear all entries when delete vid

In cases if some of the entries were not found in forwarding table while killing vlan, the rest not needed entries still left in the table. No need to stop, as entry was deleted anyway. So fix this by returning error only after all was cleaned. To implement this, return -ENOENT in cpsw_ale_del_mcast() as it's supposed to be.

Ivan Khoronzhuk committed 8 years ago

Commit be35b981 parent e91e2182 files · +5 −11Browse files

Unified · Split

2 files
  1. drivers/net/ethernet/ti/cpsw.c +4 −10
  2. drivers/net/ethernet/ti/cpsw_ale.c +1 −1
drivers/net/ethernet/ti/cpsw.c+4−10
@@ -2125,16 +2125,10 @@ static int cpsw_ndo_vlan_rx_kill_vid(struct net_device *ndev, · 2124 unmodified lines
21252125
21262126 dev_info(priv->dev, "removing vlanid %d from vlan filter\n", vid);
21272127 ret = cpsw_ale_del_vlan(cpsw->ale, vid, 0);
2128− if (ret != 0)
2129− return ret;
2130−
2131− ret = cpsw_ale_del_ucast(cpsw->ale, priv->mac_addr,
2132− HOST_PORT_NUM, ALE_VLAN, vid);
2133− if (ret != 0)
2134− return ret;
2135−
2136− ret = cpsw_ale_del_mcast(cpsw->ale, priv->ndev->broadcast,
2137− 0, ALE_VLAN, vid);
2128+ ret |= cpsw_ale_del_ucast(cpsw->ale, priv->mac_addr,
2129+ HOST_PORT_NUM, ALE_VLAN, vid);
2130+ ret |= cpsw_ale_del_mcast(cpsw->ale, priv->ndev->broadcast,
2131+ 0, ALE_VLAN, vid);
21382132 pm_runtime_put(cpsw->dev);
21392133 return ret;
21402134 }
drivers/net/ethernet/ti/cpsw_ale.c+1−1
@@ -394,7 +394,7 @@ int cpsw_ale_del_mcast(struct cpsw_ale *ale, u8 *addr, int port_mask, · 393 unmodified lines
394394
395395 idx = cpsw_ale_match_addr(ale, addr, (flags & ALE_VLAN) ? vid : 0);
396396 if (idx < 0)
397− return -EINVAL;
397+ return -ENOENT;
398398
399399 cpsw_ale_read(ale, idx, ale_entry);
400400

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t