void (*init)(struct mlxsw_sp *mlxsw_sp);
};
-struct mlxsw_sp_mdb_entry {
- struct list_head list;
+struct mlxsw_sp_mdb_entry_key {
unsigned char addr[ETH_ALEN];
u16 fid;
+};
+
+struct mlxsw_sp_mdb_entry {
+ struct list_head list;
+ struct mlxsw_sp_mdb_entry_key key;
u16 mid;
bool in_hw;
unsigned long *ports_in_mid; /* bits array */
struct mlxsw_sp_mdb_entry *mdb_entry;
list_for_each_entry(mdb_entry, &bridge_device->mdb_list, list) {
- if (ether_addr_equal(mdb_entry->addr, addr) &&
- mdb_entry->fid == fid)
+ if (ether_addr_equal(mdb_entry->key.addr, addr) &&
+ mdb_entry->key.fid == fid)
return mdb_entry;
}
return NULL;
if (err)
return err;
- err = mlxsw_sp_port_mdb_op(mlxsw_sp, mdb_entry->addr, mdb_entry->fid,
- mid_idx, true);
+ err = mlxsw_sp_port_mdb_op(mlxsw_sp, mdb_entry->key.addr,
+ mdb_entry->key.fid, mid_idx, true);
if (err)
return err;
clear_bit(mdb_entry->mid, mlxsw_sp->bridge->mids_bitmap);
mdb_entry->in_hw = false;
- return mlxsw_sp_port_mdb_op(mlxsw_sp, mdb_entry->addr, mdb_entry->fid,
- mdb_entry->mid, false);
+ return mlxsw_sp_port_mdb_op(mlxsw_sp, mdb_entry->key.addr,
+ mdb_entry->key.fid, mdb_entry->mid, false);
}
static struct mlxsw_sp_mdb_entry *
if (!mdb_entry->ports_in_mid)
goto err_ports_in_mid_alloc;
- ether_addr_copy(mdb_entry->addr, addr);
- mdb_entry->fid = fid;
+ ether_addr_copy(mdb_entry->key.addr, addr);
+ mdb_entry->key.fid = fid;
mdb_entry->in_hw = false;
if (!bridge_device->multicast_enabled)