Skip to content

Commit

Permalink
Merge pull request torvalds#89 from pscollins/refactor-net-enqueue
Browse files Browse the repository at this point in the history
lkl: Minor cleanup to virtio_net
  • Loading branch information
Octavian Purdila committed Feb 25, 2016
2 parents acb3be9 + 71916f0 commit 853beba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/lkl/lib/virtio_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#define RX_QUEUE_IDX 0
#define TX_QUEUE_IDX 1
#define NUM_QUEUES (TX_QUEUE_IDX + 1)
#define QUEUE_DEPTH 32

#ifdef DEBUG
#define bad_request(s) do { \
Expand Down Expand Up @@ -143,11 +144,10 @@ static struct lkl_mutex_t **init_queue_locks(int num_queues)
if (!ret)
return NULL;

memset(ret, 0, sizeof(struct lkl_mutex_t*) * num_queues);
for (i = 0; i < num_queues; i++) {
ret[i] = lkl_host_ops.mutex_alloc();
if (!ret[i]) {
free_queue_locks(ret, num_queues);
free_queue_locks(ret, i);
return NULL;
}
}
Expand Down Expand Up @@ -193,7 +193,7 @@ int lkl_netdev_add(union lkl_netdev nd, void *mac)
* could init the queues in virtio_dev_setup to help enforce
* this, but netdevs are the only flavor that need these
* locks, so it's better to do it here. */
ret = virtio_dev_setup(&dev->dev, NUM_QUEUES, 32);
ret = virtio_dev_setup(&dev->dev, NUM_QUEUES, QUEUE_DEPTH);

if (ret)
goto out_free;
Expand Down

0 comments on commit 853beba

Please sign in to comment.