]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
net: hns: Remove the redundant adding and deleting mac function
authorKejian Yan <yankejian@huawei.com>
Sat, 1 Apr 2017 11:03:40 +0000 (12:03 +0100)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Wed, 28 Jun 2017 14:24:09 +0000 (11:24 -0300)
BugLink: https://bugs.launchpad.net/bugs/1696031
The functions (hns_dsaf_set_mac_mc_entry() and hns_mac_del_mac()) are
not called by any functions. They are dead code in hns. And the same
features are implemented by the patch (the id is 66355f5).

Reported-by: Weiwei Deng <dengweiwei@huawei.com>
Signed-off-by: Kejian Yan <yankejian@huawei.com>
Reviewed-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 040a3800aac0ca0f40a09ca751a037239f93896b)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.h
drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c
drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.h

index b9bde2378cacc79f5b2d07cbaba27284cd16ae92..0c1f56e5807402d39e14a2e48277794a2e7e78c1 100644 (file)
@@ -335,44 +335,6 @@ int hns_mac_set_multi(struct hns_mac_cb *mac_cb,
        return 0;
 }
 
-/**
- *hns_mac_del_mac - delete mac address into dsaf table,can't delete the same
- *                  address twice
- *@net_dev: net device
- *@vfn :   vf lan
- *@mac : mac address
- *return status
- */
-int hns_mac_del_mac(struct hns_mac_cb *mac_cb, u32 vfn, char *mac)
-{
-       struct mac_entry_idx *old_mac;
-       struct dsaf_device *dsaf_dev;
-       u32 ret;
-
-       dsaf_dev = mac_cb->dsaf_dev;
-
-       if (vfn < DSAF_MAX_VM_NUM) {
-               old_mac = &mac_cb->addr_entry_idx[vfn];
-       } else {
-               dev_err(mac_cb->dev,
-                       "vf queue is too large, %s mac%d queue = %#x!\n",
-                       mac_cb->dsaf_dev->ae_dev.name, mac_cb->mac_id, vfn);
-               return -EINVAL;
-       }
-
-       if (dsaf_dev) {
-               ret = hns_dsaf_del_mac_entry(dsaf_dev, old_mac->vlan_id,
-                                            mac_cb->mac_id, old_mac->addr);
-               if (ret)
-                       return ret;
-
-               if (memcmp(old_mac->addr, mac, sizeof(old_mac->addr)) == 0)
-                       old_mac->valid = 0;
-       }
-
-       return 0;
-}
-
 int hns_mac_clr_multicast(struct hns_mac_cb *mac_cb, int vfn)
 {
        struct dsaf_device *dsaf_dev = mac_cb->dsaf_dev;
index 7f14d9172e5e19f0087ffb2957dc3334ee34ac22..e6842c922e9536d7607f81991591f66af507d76e 100644 (file)
@@ -436,7 +436,6 @@ int hns_mac_set_multi(struct hns_mac_cb *mac_cb,
 int hns_mac_vm_config_bc_en(struct hns_mac_cb *mac_cb, u32 vm, bool enable);
 void hns_mac_start(struct hns_mac_cb *mac_cb);
 void hns_mac_stop(struct hns_mac_cb *mac_cb);
-int hns_mac_del_mac(struct hns_mac_cb *mac_cb, u32 vfn, char *mac);
 void hns_mac_uninit(struct dsaf_device *dsaf_dev);
 void hns_mac_adjust_link(struct hns_mac_cb *mac_cb, int speed, int duplex);
 void hns_mac_reset(struct hns_mac_cb *mac_cb);
index 403ea9db6dbd15a6384ed845480fe8cf18c52163..3b99ba4326f13d7381a8ef5f85c13541d2dc0ced 100644 (file)
@@ -1648,87 +1648,6 @@ int hns_dsaf_rm_mac_addr(
                                      mac_entry->addr);
 }
 
-/**
- * hns_dsaf_set_mac_mc_entry - set mac mc-entry
- * @dsaf_dev: dsa fabric device struct pointer
- * @mac_entry: mc-mac entry
- */
-int hns_dsaf_set_mac_mc_entry(
-       struct dsaf_device *dsaf_dev,
-       struct dsaf_drv_mac_multi_dest_entry *mac_entry)
-{
-       u16 entry_index = DSAF_INVALID_ENTRY_IDX;
-       struct dsaf_drv_tbl_tcam_key mac_key;
-       struct dsaf_tbl_tcam_mcast_cfg mac_data;
-       struct dsaf_drv_priv *priv =
-           (struct dsaf_drv_priv *)hns_dsaf_dev_priv(dsaf_dev);
-       struct dsaf_drv_soft_mac_tbl *soft_mac_entry = priv->soft_mac_tbl;
-       struct dsaf_drv_tbl_tcam_key tmp_mac_key;
-       struct dsaf_tbl_tcam_data tcam_data;
-
-       /* mac addr check */
-       if (MAC_IS_ALL_ZEROS(mac_entry->addr)) {
-               dev_err(dsaf_dev->dev, "set uc %s Mac %pM err!\n",
-                       dsaf_dev->ae_dev.name, mac_entry->addr);
-               return -EINVAL;
-       }
-
-       /*config key */
-       hns_dsaf_set_mac_key(dsaf_dev, &mac_key,
-                            mac_entry->in_vlan_id,
-                            mac_entry->in_port_num, mac_entry->addr);
-
-       /* entry ie exist? */
-       entry_index = hns_dsaf_find_soft_mac_entry(dsaf_dev, &mac_key);
-       if (entry_index == DSAF_INVALID_ENTRY_IDX) {
-               /*if hasnot, find enpty entry*/
-               entry_index = hns_dsaf_find_empty_mac_entry(dsaf_dev);
-               if (entry_index == DSAF_INVALID_ENTRY_IDX) {
-                       /*if hasnot empty, error*/
-                       dev_err(dsaf_dev->dev,
-                               "set_uc_entry failed, %s Mac key(%#x:%#x)\n",
-                               dsaf_dev->ae_dev.name,
-                               mac_key.high.val, mac_key.low.val);
-                       return -EINVAL;
-               }
-
-               /* config hardware entry */
-               memset(mac_data.tbl_mcast_port_msk,
-                      0, sizeof(mac_data.tbl_mcast_port_msk));
-       } else {
-               /* config hardware entry */
-               hns_dsaf_tcam_mc_get(dsaf_dev, entry_index, &tcam_data,
-                                    &mac_data);
-
-               tmp_mac_key.high.val =
-                       le32_to_cpu(tcam_data.tbl_tcam_data_high);
-               tmp_mac_key.low.val = le32_to_cpu(tcam_data.tbl_tcam_data_low);
-       }
-       mac_data.tbl_mcast_old_en = 0;
-       mac_data.tbl_mcast_item_vld = 1;
-       dsaf_set_field(mac_data.tbl_mcast_port_msk[0],
-                      0x3F, 0, mac_entry->port_mask[0]);
-
-       dev_dbg(dsaf_dev->dev,
-               "set_uc_entry, %s key(%#x:%#x) entry_index%d\n",
-               dsaf_dev->ae_dev.name, mac_key.high.val,
-               mac_key.low.val, entry_index);
-
-       tcam_data.tbl_tcam_data_high = cpu_to_le32(mac_key.high.val);
-       tcam_data.tbl_tcam_data_low = cpu_to_le32(mac_key.low.val);
-
-       hns_dsaf_tcam_mc_cfg(dsaf_dev, entry_index, &tcam_data, NULL,
-                            &mac_data);
-
-       /* config software entry */
-       soft_mac_entry += entry_index;
-       soft_mac_entry->index = entry_index;
-       soft_mac_entry->tcam_key.high.val = mac_key.high.val;
-       soft_mac_entry->tcam_key.low.val = mac_key.low.val;
-
-       return 0;
-}
-
 static void hns_dsaf_mc_mask_bit_clear(char *dst, const char *src)
 {
        u16 *a = (u16 *)dst;
index cef6bf46ae9309bf84c9f5ff466982d59d8bed93..e2d71be4b5737e096cb599b9686c984ef4c8c08d 100644 (file)
@@ -429,8 +429,6 @@ static inline struct hnae_vf_cb *hns_ae_get_vf_cb(
 
 int hns_dsaf_set_mac_uc_entry(struct dsaf_device *dsaf_dev,
                              struct dsaf_drv_mac_single_dest_entry *mac_entry);
-int hns_dsaf_set_mac_mc_entry(struct dsaf_device *dsaf_dev,
-                             struct dsaf_drv_mac_multi_dest_entry *mac_entry);
 int hns_dsaf_add_mac_mc_port(struct dsaf_device *dsaf_dev,
                             struct dsaf_drv_mac_single_dest_entry *mac_entry);
 int hns_dsaf_del_mac_entry(struct dsaf_device *dsaf_dev, u16 vlan_id,