Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mlxsw: spectrum_router: Propagate extack to .fid_get()

In the follow-up patch, mlxsw_sp_rif_vlan_fid_get() will be changed in a
way that could fail. Give that function a possibility to explain the
failure through extack.

Signed-off-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Petr Machata and committed by
David S. Miller
5f15e257 fb223502

+10 -6
+10 -6
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
··· 163 163 const struct mlxsw_sp_rif_params *params); 164 164 int (*configure)(struct mlxsw_sp_rif *rif); 165 165 void (*deconfigure)(struct mlxsw_sp_rif *rif); 166 - struct mlxsw_sp_fid * (*fid_get)(struct mlxsw_sp_rif *rif); 166 + struct mlxsw_sp_fid * (*fid_get)(struct mlxsw_sp_rif *rif, 167 + struct netlink_ext_ack *extack); 167 168 }; 168 169 169 170 static void mlxsw_sp_lpm_tree_hold(struct mlxsw_sp_lpm_tree *lpm_tree); ··· 6163 6162 rif->ops = ops; 6164 6163 6165 6164 if (ops->fid_get) { 6166 - fid = ops->fid_get(rif); 6165 + fid = ops->fid_get(rif, extack); 6167 6166 if (IS_ERR(fid)) { 6168 6167 err = PTR_ERR(fid); 6169 6168 goto err_fid_get; ··· 6268 6267 } 6269 6268 6270 6269 /* FID was already created, just take a reference */ 6271 - fid = rif->ops->fid_get(rif); 6270 + fid = rif->ops->fid_get(rif, extack); 6272 6271 err = mlxsw_sp_fid_port_vid_map(fid, mlxsw_sp_port, vid); 6273 6272 if (err) 6274 6273 goto err_fid_port_vid_map; ··· 6776 6775 } 6777 6776 6778 6777 static struct mlxsw_sp_fid * 6779 - mlxsw_sp_rif_subport_fid_get(struct mlxsw_sp_rif *rif) 6778 + mlxsw_sp_rif_subport_fid_get(struct mlxsw_sp_rif *rif, 6779 + struct netlink_ext_ack *extack) 6780 6780 { 6781 6781 return mlxsw_sp_fid_rfid_get(rif->mlxsw_sp, rif->rif_index); 6782 6782 } ··· 6867 6865 } 6868 6866 6869 6867 static struct mlxsw_sp_fid * 6870 - mlxsw_sp_rif_vlan_fid_get(struct mlxsw_sp_rif *rif) 6868 + mlxsw_sp_rif_vlan_fid_get(struct mlxsw_sp_rif *rif, 6869 + struct netlink_ext_ack *extack) 6871 6870 { 6872 6871 u16 vid = is_vlan_dev(rif->dev) ? vlan_dev_vlan_id(rif->dev) : 1; 6873 6872 ··· 6940 6937 } 6941 6938 6942 6939 static struct mlxsw_sp_fid * 6943 - mlxsw_sp_rif_fid_fid_get(struct mlxsw_sp_rif *rif) 6940 + mlxsw_sp_rif_fid_fid_get(struct mlxsw_sp_rif *rif, 6941 + struct netlink_ext_ack *extack) 6944 6942 { 6945 6943 return mlxsw_sp_fid_8021d_get(rif->mlxsw_sp, rif->dev->ifindex); 6946 6944 }