OSDN Git Service

devlink: Fix reload stats structure
authorMoshe Shemesh <moshe@mellanox.com>
Mon, 23 Nov 2020 05:36:25 +0000 (07:36 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 24 Nov 2020 21:04:04 +0000 (13:04 -0800)
commit5204bb683c1633e550c2124ccc2358dd645a80db
treebd7955b94678e96d3b89de81d6a094c9c50219a8
parent9bd2702d292cb7b565b09e949d30288ab7a26d51
devlink: Fix reload stats structure

Fix reload stats structure exposed to the user. Change stats structure
hierarchy to have the reload action as a parent of the stat entry and
then stat entry includes value per limit. This will also help to avoid
string concatenation on iproute2 output.

Reload stats structure before this fix:
"stats": {
    "reload": {
        "driver_reinit": 2,
        "fw_activate": 1,
        "fw_activate_no_reset": 0
     }
}

After this fix:
"stats": {
    "reload": {
        "driver_reinit": {
            "unspecified": 2
        },
        "fw_activate": {
            "unspecified": 1,
            "no_reset": 0
        }
}

Fixes: a254c264267e ("devlink: Add reload stats")
Signed-off-by: Moshe Shemesh <moshe@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Link: https://lore.kernel.org/r/1606109785-25197-1-git-send-email-moshe@mellanox.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/uapi/linux/devlink.h
net/core/devlink.c