Skip to content

Commit

Permalink
Merge branch 'bpf-xdp-rxq-fixes'
Browse files Browse the repository at this point in the history
Jakub Kicinski says:

====================
Two more trivial fixes to the recent XDP RXQ series.
====================

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
  • Loading branch information
Daniel Borkmann committed Jan 10, 2018
2 parents 5896351 + 82aaff2 commit 148989d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -7645,24 +7645,23 @@ static int netif_alloc_rx_queues(struct net_device *dev)
/* Rollback successful reg's and free other resources */
while (i--)
xdp_rxq_info_unreg(&rx[i].xdp_rxq);
kfree(dev->_rx);
kvfree(dev->_rx);
dev->_rx = NULL;
return err;
}

static void netif_free_rx_queues(struct net_device *dev)
{
unsigned int i, count = dev->num_rx_queues;
struct netdev_rx_queue *rx;

/* netif_alloc_rx_queues alloc failed, resources have been unreg'ed */
if (!dev->_rx)
return;

rx = dev->_rx;

for (i = 0; i < count; i++)
xdp_rxq_info_unreg(&rx[i].xdp_rxq);
xdp_rxq_info_unreg(&dev->_rx[i].xdp_rxq);

kvfree(dev->_rx);
}

static void netdev_init_one_queue(struct net_device *dev,
Expand Down

0 comments on commit 148989d

Please sign in to comment.