Skip to content

Commit

Permalink
net: ena: unmask MSI-X only after device initialization is completed
Browse files Browse the repository at this point in the history
Under certain conditions MSI-X interrupt might arrive right after it
was unmasked in ena_up(). There is a chance it would be processed by
the driver before device ENA_FLAG_DEV_UP flag is set. In such a case
the interrupt is ignored.
ENA device operates in auto-masked mode, therefore ignoring
interrupt leaves it masked for good.
Moving unmask of interrupt to be the last step in ena_up().

Signed-off-by: Netanel Belgazal <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
NetanelBelgazal authored and davem330 committed Jan 3, 2018
1 parent 15962a1 commit 7853b49
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions drivers/net/ethernet/amazon/ena/ena_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1565,7 +1565,7 @@ static int ena_rss_configure(struct ena_adapter *adapter)

static int ena_up_complete(struct ena_adapter *adapter)
{
int rc, i;
int rc;

rc = ena_rss_configure(adapter);
if (rc)
Expand All @@ -1584,17 +1584,6 @@ static int ena_up_complete(struct ena_adapter *adapter)

ena_napi_enable_all(adapter);

/* Enable completion queues interrupt */
for (i = 0; i < adapter->num_queues; i++)
ena_unmask_interrupt(&adapter->tx_ring[i],
&adapter->rx_ring[i]);

/* schedule napi in case we had pending packets
* from the last time we disable napi
*/
for (i = 0; i < adapter->num_queues; i++)
napi_schedule(&adapter->ena_napi[i].napi);

return 0;
}

Expand Down Expand Up @@ -1731,7 +1720,7 @@ static int ena_create_all_io_rx_queues(struct ena_adapter *adapter)

static int ena_up(struct ena_adapter *adapter)
{
int rc;
int rc, i;

netdev_dbg(adapter->netdev, "%s\n", __func__);

Expand Down Expand Up @@ -1774,6 +1763,17 @@ static int ena_up(struct ena_adapter *adapter)

set_bit(ENA_FLAG_DEV_UP, &adapter->flags);

/* Enable completion queues interrupt */
for (i = 0; i < adapter->num_queues; i++)
ena_unmask_interrupt(&adapter->tx_ring[i],
&adapter->rx_ring[i]);

/* schedule napi in case we had pending packets
* from the last time we disable napi
*/
for (i = 0; i < adapter->num_queues; i++)
napi_schedule(&adapter->ena_napi[i].napi);

return rc;

err_up:
Expand Down

0 comments on commit 7853b49

Please sign in to comment.