Skip to content

Commit dd8427a

Browse files
Netanel Belgazaldavem330
authored andcommitted
net/ena: change condition for host attribute configuration
Move the host info config to be the first admin command that is executed. This change require the driver to remove the 'feature check' from host info configuration flow. The check is removed since the supported features bitmask field is retrieved only after calling ENA_ADMIN_DEVICE_ATTRIBUTES admin command. If set host info is not supported an error will be returned by the device. Signed-off-by: Netanel Belgazal <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7102a18 commit dd8427a

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

drivers/net/ethernet/amazon/ena/ena_com.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2451,11 +2451,9 @@ int ena_com_set_host_attributes(struct ena_com_dev *ena_dev)
24512451

24522452
int ret;
24532453

2454-
if (!ena_com_check_supported_feature_id(ena_dev,
2455-
ENA_ADMIN_HOST_ATTR_CONFIG)) {
2456-
pr_warn("Set host attribute isn't supported\n");
2457-
return -EPERM;
2458-
}
2454+
/* Host attribute config is called before ena_com_get_dev_attr_feat
2455+
* so ena_com can't check if the feature is supported.
2456+
*/
24592457

24602458
memset(&cmd, 0x0, sizeof(cmd));
24612459
admin_queue = &ena_dev->admin_queue;

drivers/net/ethernet/amazon/ena/ena_netdev.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2414,6 +2414,8 @@ static int ena_device_init(struct ena_com_dev *ena_dev, struct pci_dev *pdev,
24142414
*/
24152415
ena_com_set_admin_polling_mode(ena_dev, true);
24162416

2417+
ena_config_host_info(ena_dev);
2418+
24172419
/* Get Device Attributes*/
24182420
rc = ena_com_get_dev_attr_feat(ena_dev, get_feat_ctx);
24192421
if (rc) {
@@ -2438,11 +2440,10 @@ static int ena_device_init(struct ena_com_dev *ena_dev, struct pci_dev *pdev,
24382440

24392441
*wd_state = !!(aenq_groups & BIT(ENA_ADMIN_KEEP_ALIVE));
24402442

2441-
ena_config_host_info(ena_dev);
2442-
24432443
return 0;
24442444

24452445
err_admin_init:
2446+
ena_com_delete_host_info(ena_dev);
24462447
ena_com_admin_destroy(ena_dev);
24472448
err_mmio_read_less:
24482449
ena_com_mmio_reg_read_request_destroy(ena_dev);

0 commit comments

Comments
 (0)