]> git.baikalelectronics.ru Git - kernel.git/commit
net: ena: Add capabilities field with support for ENI stats capability
authorArthur Kiyanovski <akiyano@amazon.com>
Fri, 7 Jan 2022 20:23:38 +0000 (20:23 +0000)
committerJakub Kicinski <kuba@kernel.org>
Sat, 8 Jan 2022 03:25:50 +0000 (19:25 -0800)
commitdceff7faf192948d529cc6012c81cc9de536fa9f
treedee20083b326028cfe50f95b9a85a93b70ff52e8
parent9c3b3e8b1b1f7748f8f73da3dda936d694a93e92
net: ena: Add capabilities field with support for ENI stats capability

This bitmask field indicates what capabilities are supported by the
device.

The capabilities field differs from the 'supported_features' field which
indicates what sub-commands for the set/get feature commands are
supported. The sub-commands are specified in the 'feature_id' field of
the 'ena_admin_set_feat_cmd' struct in the following way:

        struct ena_admin_set_feat_cmd cmd;

        cmd.aq_common_descriptor.opcode = ENA_ADMIN_SET_FEATURE;
        cmd.feat_common.feature_

The 'capabilities' field, on the other hand, specifies different
capabilities of the device. For example, whether the device supports
querying of ENI stats.

Also add an enumerator which contains all the capabilities. The
first added capability macro is for ENI stats feature.

Capabilities are queried along with the other device attributes (in
ena_com_get_dev_attr_feat()) during device initialization and are stored
in the ena_com_dev struct. They can be later queried using the
ena_com_get_cap() helper function.

Signed-off-by: Shay Agroskin <shayagr@amazon.com>
Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/amazon/ena/ena_admin_defs.h
drivers/net/ethernet/amazon/ena/ena_com.c
drivers/net/ethernet/amazon/ena/ena_com.h