@@ -35,7 +35,7 @@ struct devlink_port_phys_attrs {
3535/**
3636 * struct devlink_port_pci_pf_attrs - devlink port's PCI PF attributes
3737 * @controller: Associated controller number
38- * @pf: Associated PCI PF number for this port.
38+ * @pf: associated PCI function number for the devlink port instance
3939 * @external: when set, indicates if a port is for an external controller
4040 */
4141struct devlink_port_pci_pf_attrs {
@@ -47,8 +47,9 @@ struct devlink_port_pci_pf_attrs {
4747/**
4848 * struct devlink_port_pci_vf_attrs - devlink port's PCI VF attributes
4949 * @controller: Associated controller number
50- * @pf: Associated PCI PF number for this port.
51- * @vf: Associated PCI VF for of the PCI PF for this port.
50+ * @pf: associated PCI function number for the devlink port instance
51+ * @vf: associated PCI VF number of a PF for the devlink port instance;
52+ * VF number starts from 0 for the first PCI virtual function
5253 * @external: when set, indicates if a port is for an external controller
5354 */
5455struct devlink_port_pci_vf_attrs {
@@ -61,8 +62,8 @@ struct devlink_port_pci_vf_attrs {
6162/**
6263 * struct devlink_port_pci_sf_attrs - devlink port's PCI SF attributes
6364 * @controller: Associated controller number
64- * @sf: Associated PCI SF for of the PCI PF for this port.
65- * @pf: Associated PCI PF number for this port.
65+ * @sf: associated SF number of a PF for the devlink port instance
66+ * @pf: associated PCI function number for the devlink port instance
6667 * @external: when set, indicates if a port is for an external controller
6768 */
6869struct devlink_port_pci_sf_attrs {
@@ -1261,6 +1262,18 @@ enum devlink_trap_group_generic_id {
12611262 .min_burst = _min_burst, \
12621263 }
12631264
1265+ #define devlink_fmsg_put (fmsg , name , value ) ( \
1266+ _Generic((value), \
1267+ bool : devlink_fmsg_bool_pair_put, \
1268+ u8 : devlink_fmsg_u8_pair_put, \
1269+ u16 : devlink_fmsg_u32_pair_put, \
1270+ u32 : devlink_fmsg_u32_pair_put, \
1271+ u64 : devlink_fmsg_u64_pair_put, \
1272+ int : devlink_fmsg_u32_pair_put, \
1273+ char * : devlink_fmsg_string_pair_put, \
1274+ const char * : devlink_fmsg_string_pair_put) \
1275+ (fmsg, name, (value)))
1276+
12641277enum {
12651278 /* device supports reload operations */
12661279 DEVLINK_F_RELOAD = 1UL << 0 ,
@@ -1522,6 +1535,7 @@ int devl_trylock(struct devlink *devlink);
15221535void devl_unlock (struct devlink * devlink );
15231536void devl_assert_locked (struct devlink * devlink );
15241537bool devl_lock_is_held (struct devlink * devlink );
1538+ DEFINE_GUARD (devl , struct devlink * , devl_lock (_T ), devl_unlock (_T ));
15251539
15261540struct ib_device ;
15271541
@@ -1779,12 +1793,6 @@ int devl_resource_register(struct devlink *devlink,
17791793 u64 resource_id ,
17801794 u64 parent_resource_id ,
17811795 const struct devlink_resource_size_params * size_params );
1782- int devlink_resource_register (struct devlink * devlink ,
1783- const char * resource_name ,
1784- u64 resource_size ,
1785- u64 resource_id ,
1786- u64 parent_resource_id ,
1787- const struct devlink_resource_size_params * size_params );
17881796void devl_resources_unregister (struct devlink * devlink );
17891797void devlink_resources_unregister (struct devlink * devlink );
17901798int devl_resource_size_get (struct devlink * devlink ,
@@ -1797,15 +1805,8 @@ void devl_resource_occ_get_register(struct devlink *devlink,
17971805 u64 resource_id ,
17981806 devlink_resource_occ_get_t * occ_get ,
17991807 void * occ_get_priv );
1800- void devlink_resource_occ_get_register (struct devlink * devlink ,
1801- u64 resource_id ,
1802- devlink_resource_occ_get_t * occ_get ,
1803- void * occ_get_priv );
18041808void devl_resource_occ_get_unregister (struct devlink * devlink ,
18051809 u64 resource_id );
1806-
1807- void devlink_resource_occ_get_unregister (struct devlink * devlink ,
1808- u64 resource_id );
18091810int devl_params_register (struct devlink * devlink ,
18101811 const struct devlink_param * params ,
18111812 size_t params_count );
@@ -2007,6 +2008,7 @@ int devlink_compat_switch_id_get(struct net_device *dev,
20072008
20082009int devlink_nl_port_handle_fill (struct sk_buff * msg , struct devlink_port * devlink_port );
20092010size_t devlink_nl_port_handle_size (struct devlink_port * devlink_port );
2011+ void devlink_fmsg_dump_skb (struct devlink_fmsg * fmsg , const struct sk_buff * skb );
20102012
20112013#else
20122014
0 commit comments