diff options
author | Netanel Belgazal <netanel@amazon.com> | 2018-01-03 01:17:29 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-01-03 12:21:00 -0500 |
commit | 7853b49ce8e0ef6364d24512b287463841d71bd3 (patch) | |
tree | f627bd04730778582c647f87f94dd3e284fbfefa | |
parent | 15962a18284552b5ec58982ff60a5e92e0c5c92b (diff) |
net: ena: unmask MSI-X only after device initialization is completed
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 <netanel@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/amazon/ena/ena_netdev.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c index 97c5a89a9cf7..6fb28fd43eb3 100644 --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c | |||
@@ -1565,7 +1565,7 @@ static int ena_rss_configure(struct ena_adapter *adapter) | |||
1565 | 1565 | ||
1566 | static int ena_up_complete(struct ena_adapter *adapter) | 1566 | static int ena_up_complete(struct ena_adapter *adapter) |
1567 | { | 1567 | { |
1568 | int rc, i; | 1568 | int rc; |
1569 | 1569 | ||
1570 | rc = ena_rss_configure(adapter); | 1570 | rc = ena_rss_configure(adapter); |
1571 | if (rc) | 1571 | if (rc) |
@@ -1584,17 +1584,6 @@ static int ena_up_complete(struct ena_adapter *adapter) | |||
1584 | 1584 | ||
1585 | ena_napi_enable_all(adapter); | 1585 | ena_napi_enable_all(adapter); |
1586 | 1586 | ||
1587 | /* Enable completion queues interrupt */ | ||
1588 | for (i = 0; i < adapter->num_queues; i++) | ||
1589 | ena_unmask_interrupt(&adapter->tx_ring[i], | ||
1590 | &adapter->rx_ring[i]); | ||
1591 | |||
1592 | /* schedule napi in case we had pending packets | ||
1593 | * from the last time we disable napi | ||
1594 | */ | ||
1595 | for (i = 0; i < adapter->num_queues; i++) | ||
1596 | napi_schedule(&adapter->ena_napi[i].napi); | ||
1597 | |||
1598 | return 0; | 1587 | return 0; |
1599 | } | 1588 | } |
1600 | 1589 | ||
@@ -1731,7 +1720,7 @@ create_err: | |||
1731 | 1720 | ||
1732 | static int ena_up(struct ena_adapter *adapter) | 1721 | static int ena_up(struct ena_adapter *adapter) |
1733 | { | 1722 | { |
1734 | int rc; | 1723 | int rc, i; |
1735 | 1724 | ||
1736 | netdev_dbg(adapter->netdev, "%s\n", __func__); | 1725 | netdev_dbg(adapter->netdev, "%s\n", __func__); |
1737 | 1726 | ||
@@ -1774,6 +1763,17 @@ static int ena_up(struct ena_adapter *adapter) | |||
1774 | 1763 | ||
1775 | set_bit(ENA_FLAG_DEV_UP, &adapter->flags); | 1764 | set_bit(ENA_FLAG_DEV_UP, &adapter->flags); |
1776 | 1765 | ||
1766 | /* Enable completion queues interrupt */ | ||
1767 | for (i = 0; i < adapter->num_queues; i++) | ||
1768 | ena_unmask_interrupt(&adapter->tx_ring[i], | ||
1769 | &adapter->rx_ring[i]); | ||
1770 | |||
1771 | /* schedule napi in case we had pending packets | ||
1772 | * from the last time we disable napi | ||
1773 | */ | ||
1774 | for (i = 0; i < adapter->num_queues; i++) | ||
1775 | napi_schedule(&adapter->ena_napi[i].napi); | ||
1776 | |||
1777 | return rc; | 1777 | return rc; |
1778 | 1778 | ||
1779 | err_up: | 1779 | err_up: |