[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Minios-devel] [UNIKRAFT PATCH 10/15] plat/tap: Setup txq
Hi Sharan, See inline. Roxana On 10/7/19 12:47 PM, Sharan Santhanam wrote: Tap driver implements the function to setup the txq. Signed-off-by: Sharan Santhanam<sharan.santhanam@xxxxxxxxx> --- plat/drivers/tap/tap.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/plat/drivers/tap/tap.c b/plat/drivers/tap/tap.c index bcc8b6e..d564e15 100644 --- a/plat/drivers/tap/tap.c +++ b/plat/drivers/tap/tap.c @@ -69,6 +69,7 @@struct uk_netdev_tx_queue {int queue_id; + __u16 nb_desc; I don't understand what's the use of this variable. UK_TAILQ_ENTRY(struct uk_netdev_tx_queue) next; struct uk_alloc *a; /* Set the file descriptor for the tap device */ @@ -293,17 +294,33 @@ static struct uk_netdev_rx_queue *tap_netdev_rxq_setup(struct uk_netdev *dev, }static struct uk_netdev_tx_queue *tap_netdev_txq_setup(struct uk_netdev *dev,- __u16 queue_id __unused, - __u16 nb_desc __unused, + __u16 queue_id, + __u16 nb_desc, struct uk_netdev_txqueue_conf *conf) { - int rc = -EINVAL; + int rc = 0; struct uk_netdev_tx_queue *txq = NULL; + struct tap_net_dev *tdev = NULL;UK_ASSERT(dev && conf); - txq = ERR2PTR(rc);+ tdev = to_tapnetdev(dev); + txq = uk_zalloc(conf->a, sizeof(*txq)); + if (!txq) { + uk_pr_err(DRIVER_NAME": Failed to allocate the rx queue\n"); It's tx queue, right? + rc = -ENOMEM; + goto err_exit; + } + + txq->queue_id = queue_id; + txq->fd = tdev->tap_fd; + txq->nb_desc = nb_desc; + txq->a = conf->a; +exit: return txq; +err_exit: + txq = ERR2PTR(rc); + goto exit; }static int tap_netdev_start(struct uk_netdev *n) _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |