IB/opa_vnic: Properly return the total MACs in UC MAC list
[ Upstream commit b77eb45e0d
]
Do not include EM specified MAC address in total MACs of the
UC MAC list.
Reviewed-by: Sudeep Dutt <sudeep.dutt@intel.com>
Signed-off-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Родитель
ecffae1122
Коммит
0da9db57c0
|
@ -348,7 +348,7 @@ void opa_vnic_query_mcast_macs(struct opa_vnic_adapter *adapter,
|
||||||
void opa_vnic_query_ucast_macs(struct opa_vnic_adapter *adapter,
|
void opa_vnic_query_ucast_macs(struct opa_vnic_adapter *adapter,
|
||||||
struct opa_veswport_iface_macs *macs)
|
struct opa_veswport_iface_macs *macs)
|
||||||
{
|
{
|
||||||
u16 start_idx, tot_macs, num_macs, idx = 0, count = 0;
|
u16 start_idx, tot_macs, num_macs, idx = 0, count = 0, em_macs = 0;
|
||||||
struct netdev_hw_addr *ha;
|
struct netdev_hw_addr *ha;
|
||||||
|
|
||||||
start_idx = be16_to_cpu(macs->start_idx);
|
start_idx = be16_to_cpu(macs->start_idx);
|
||||||
|
@ -359,8 +359,10 @@ void opa_vnic_query_ucast_macs(struct opa_vnic_adapter *adapter,
|
||||||
|
|
||||||
/* Do not include EM specified MAC address */
|
/* Do not include EM specified MAC address */
|
||||||
if (!memcmp(adapter->info.vport.base_mac_addr, ha->addr,
|
if (!memcmp(adapter->info.vport.base_mac_addr, ha->addr,
|
||||||
ARRAY_SIZE(adapter->info.vport.base_mac_addr)))
|
ARRAY_SIZE(adapter->info.vport.base_mac_addr))) {
|
||||||
|
em_macs++;
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (start_idx > idx++)
|
if (start_idx > idx++)
|
||||||
continue;
|
continue;
|
||||||
|
@ -383,7 +385,7 @@ void opa_vnic_query_ucast_macs(struct opa_vnic_adapter *adapter,
|
||||||
}
|
}
|
||||||
|
|
||||||
tot_macs = netdev_hw_addr_list_count(&adapter->netdev->dev_addrs) +
|
tot_macs = netdev_hw_addr_list_count(&adapter->netdev->dev_addrs) +
|
||||||
netdev_uc_count(adapter->netdev);
|
netdev_uc_count(adapter->netdev) - em_macs;
|
||||||
macs->tot_macs_in_lst = cpu_to_be16(tot_macs);
|
macs->tot_macs_in_lst = cpu_to_be16(tot_macs);
|
||||||
macs->num_macs_in_msg = cpu_to_be16(count);
|
macs->num_macs_in_msg = cpu_to_be16(count);
|
||||||
macs->gen_count = cpu_to_be16(adapter->info.vport.uc_macs_gen_count);
|
macs->gen_count = cpu_to_be16(adapter->info.vport.uc_macs_gen_count);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче