• Eran Ben Elisha's avatar
    devlink: Add devlink formatted message (fmsg) API · 1db64e87
    Eran Ben Elisha authored
    Devlink fmsg is a mechanism to pass descriptors between drivers and
    devlink, in json-like format. The API allows the driver to add nested
    attributes such as object, object pair and value array, in addition to
    attributes such as name and value.
    
    Driver can use this API to fill the fmsg context in a format which will be
    translated by the devlink to the netlink message later.
    There is no memory allocation in advance (other than the initial list
    head), and it dynamically allocates messages descriptors and add them to
    the list on the fly.
    
    When it needs to send the data using SKBs to the netlink layer, it
    fragments the data between different SKBs. In order to do this
    fragmentation, it uses virtual nests attributes, to avoid actual
    nesting use which cannot be divided between different SKBs.
    Signed-off-by: default avatarEran Ben Elisha <eranbe@mellanox.com>
    Reviewed-by: default avatarMoshe Shemesh <moshe@mellanox.com>
    Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    1db64e87
devlink.h 31.4 KB