Commit 8a47558a authored by David S. Miller's avatar David S. Miller

Merge branch 'tsnep-napi-fixes'

Gerhard Engleder says:

====================
tsnep: Fixes based on napi.rst

Based on the documentation networking/napi.rst some fixes have been
done. tsnep driver should be in line with this new documentation after
these fixes.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents af21b94b 46589db3
...@@ -300,10 +300,8 @@ static void tsnep_ethtool_get_channels(struct net_device *netdev, ...@@ -300,10 +300,8 @@ static void tsnep_ethtool_get_channels(struct net_device *netdev,
{ {
struct tsnep_adapter *adapter = netdev_priv(netdev); struct tsnep_adapter *adapter = netdev_priv(netdev);
ch->max_rx = adapter->num_rx_queues; ch->max_combined = adapter->num_queues;
ch->max_tx = adapter->num_tx_queues; ch->combined_count = adapter->num_queues;
ch->rx_count = adapter->num_rx_queues;
ch->tx_count = adapter->num_tx_queues;
} }
static int tsnep_ethtool_get_ts_info(struct net_device *netdev, static int tsnep_ethtool_get_ts_info(struct net_device *netdev,
......
...@@ -87,8 +87,11 @@ static irqreturn_t tsnep_irq(int irq, void *arg) ...@@ -87,8 +87,11 @@ static irqreturn_t tsnep_irq(int irq, void *arg)
/* handle TX/RX queue 0 interrupt */ /* handle TX/RX queue 0 interrupt */
if ((active & adapter->queue[0].irq_mask) != 0) { if ((active & adapter->queue[0].irq_mask) != 0) {
tsnep_disable_irq(adapter, adapter->queue[0].irq_mask); if (napi_schedule_prep(&adapter->queue[0].napi)) {
napi_schedule(&adapter->queue[0].napi); tsnep_disable_irq(adapter, adapter->queue[0].irq_mask);
/* schedule after masking to avoid races */
__napi_schedule(&adapter->queue[0].napi);
}
} }
return IRQ_HANDLED; return IRQ_HANDLED;
...@@ -99,8 +102,11 @@ static irqreturn_t tsnep_irq_txrx(int irq, void *arg) ...@@ -99,8 +102,11 @@ static irqreturn_t tsnep_irq_txrx(int irq, void *arg)
struct tsnep_queue *queue = arg; struct tsnep_queue *queue = arg;
/* handle TX/RX queue interrupt */ /* handle TX/RX queue interrupt */
tsnep_disable_irq(queue->adapter, queue->irq_mask); if (napi_schedule_prep(&queue->napi)) {
napi_schedule(&queue->napi); tsnep_disable_irq(queue->adapter, queue->irq_mask);
/* schedule after masking to avoid races */
__napi_schedule(&queue->napi);
}
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -1728,6 +1734,10 @@ static int tsnep_poll(struct napi_struct *napi, int budget) ...@@ -1728,6 +1734,10 @@ static int tsnep_poll(struct napi_struct *napi, int budget)
if (queue->tx) if (queue->tx)
complete = tsnep_tx_poll(queue->tx, budget); complete = tsnep_tx_poll(queue->tx, budget);
/* handle case where we are called by netpoll with a budget of 0 */
if (unlikely(budget <= 0))
return budget;
if (queue->rx) { if (queue->rx) {
done = queue->rx->xsk_pool ? done = queue->rx->xsk_pool ?
tsnep_rx_poll_zc(queue->rx, napi, budget) : tsnep_rx_poll_zc(queue->rx, napi, budget) :
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment