]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
net: ena: enable the interrupt_moderation in driver_supported_features
authorArthur Kiyanovski <akiyano@amazon.com>
Mon, 16 Sep 2019 11:31:29 +0000 (14:31 +0300)
committerStefan Bader <stefan.bader@canonical.com>
Thu, 28 Nov 2019 16:48:45 +0000 (17:48 +0100)
BugLink: https://bugs.launchpad.net/bugs/1853180
Add driver_supported_features to host_host info which is a new API used to
communicate to the device which features are supported by the driver.

Add the interrupt_moderation bit to host_info->driver_supported_features
and enable it to signal the device that this driver supports interrupt
moderation properly.

Reserved bits are for features implemented in the future

Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit bd21b0cc3a63d1c658b230db084b0f392b78cab2)
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Acked-by: Khaled Elmously <khalid.elmously@canonical.com>
Acked-by: Connor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/net/ethernet/amazon/ena/ena_admin_defs.h
drivers/net/ethernet/amazon/ena/ena_netdev.c

index d19f2ecf8e84cd821ed46b2e6cd65c2daa133ec3..8baf847e8622a6162f01ac4c7bffb6f5880ed487 100644 (file)
@@ -808,6 +808,12 @@ struct ena_admin_host_info {
        u16 num_cpus;
 
        u16 reserved;
+
+       /* 1 :0 : reserved
+        * 2 : interrupt_moderation
+        * 31:3 : reserved
+        */
+       u32 driver_supported_features;
 };
 
 struct ena_admin_rss_ind_table_entry {
@@ -1110,6 +1116,8 @@ struct ena_admin_ena_mmio_req_read_less_resp {
 #define ENA_ADMIN_HOST_INFO_DEVICE_MASK                     GENMASK(7, 3)
 #define ENA_ADMIN_HOST_INFO_BUS_SHIFT                       8
 #define ENA_ADMIN_HOST_INFO_BUS_MASK                        GENMASK(15, 8)
+#define ENA_ADMIN_HOST_INFO_INTERRUPT_MODERATION_SHIFT      2
+#define ENA_ADMIN_HOST_INFO_INTERRUPT_MODERATION_MASK       BIT(2)
 
 /* aenq_common_desc */
 #define ENA_ADMIN_AENQ_COMMON_DESC_PHASE_MASK               BIT(0)
index 2f0e17d92474d752355eb072a49bcd7cb032e28d..0c80db213fef886278c2afe6856bcde6172ef5a8 100644 (file)
@@ -2440,6 +2440,9 @@ static void ena_config_host_info(struct ena_com_dev *ena_dev,
                ("K"[0] << ENA_ADMIN_HOST_INFO_MODULE_TYPE_SHIFT);
        host_info->num_cpus = num_online_cpus();
 
+       host_info->driver_supported_features =
+               ENA_ADMIN_HOST_INFO_INTERRUPT_MODERATION_MASK;
+
        rc = ena_com_set_host_attributes(ena_dev);
        if (rc) {
                if (rc == -EOPNOTSUPP)