]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
net: ena: Recalculate TX state variables every device reset
authorShay Agroskin <shayagr@amazon.com>
Thu, 23 Mar 2023 16:36:08 +0000 (18:36 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 28 Mar 2023 02:49:59 +0000 (19:49 -0700)
With the ability to modify LLQ entry size, the size of packet's
payload that can be written directly to the device changes.
This patch makes the driver recalculate this information every device
negotiation (also called device reset).

Reviewed-by: Michal Kubiak <michal.kubiak@intel.com>
Signed-off-by: Shay Agroskin <shayagr@amazon.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/amazon/ena/ena_netdev.c

index 97da4d841df3574529421e188d1baabdd9c0142f..ed5b019d27eaf063de88234cc9ec3081ba48503b 100644 (file)
@@ -3750,8 +3750,9 @@ static int ena_restore_device(struct ena_adapter *adapter)
        struct ena_com_dev_get_features_ctx get_feat_ctx;
        struct ena_com_dev *ena_dev = adapter->ena_dev;
        struct pci_dev *pdev = adapter->pdev;
+       struct ena_ring *txr;
+       int rc, count, i;
        bool wd_state;
-       int rc;
 
        set_bit(ENA_FLAG_ONGOING_RESET, &adapter->flags);
        rc = ena_device_init(adapter, adapter->pdev, &get_feat_ctx, &wd_state);
@@ -3761,6 +3762,13 @@ static int ena_restore_device(struct ena_adapter *adapter)
        }
        adapter->wd_state = wd_state;
 
+       count =  adapter->xdp_num_queues + adapter->num_io_queues;
+       for (i = 0 ; i < count; i++) {
+               txr = &adapter->tx_ring[i];
+               txr->tx_mem_queue_type = ena_dev->tx_mem_queue_type;
+               txr->tx_max_header_size = ena_dev->tx_max_header_size;
+       }
+
        rc = ena_device_validate_params(adapter, &get_feat_ctx);
        if (rc) {
                dev_err(&pdev->dev, "Validation of device parameters failed\n");