[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [UNIKRAFT PATCH v4 01/12] plat/drivers/virtio: Fill MTU and queues alignments when retrieving information
Wouldn't this patch go independently to netfront? I do not see the
relation...
On 13.08.20 10:53, Costin Lupu wrote:
This patch sets the max MTU value when retrieving device information and the
alignments used when allocating packets for each queue.
Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
---
plat/drivers/virtio/virtio_net.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/plat/drivers/virtio/virtio_net.c b/plat/drivers/virtio/virtio_net.c
index b0663e60..0e748b8f 100644
--- a/plat/drivers/virtio/virtio_net.c
+++ b/plat/drivers/virtio/virtio_net.c
@@ -770,6 +770,7 @@ static int virtio_netdev_rxq_info_get(struct uk_netdev *dev,
rxq = &vndev->rxqs[queue_id];
qinfo->nb_min = 1;
qinfo->nb_max = rxq->max_nb_desc;
+ qinfo->nb_align = sizeof(void *); /* word size alignment */
@Costin, @Sharan: Does changing the alignment something good or bad to
the virtio performance? I guess it does not harm. 0 meant that there is
no alignment requirement for network packet buffers.
qinfo->nb_is_power_of_two = 1;
exit:
@@ -797,6 +798,7 @@ static int virtio_netdev_txq_info_get(struct uk_netdev *dev,
txq = &vndev->txqs[queue_id];
qinfo->nb_min = 1;
qinfo->nb_max = txq->max_nb_desc;
+ qinfo->nb_align = sizeof(void *); /* word size alignment */
@Costin, @Sharan: ...same here.
qinfo->nb_is_power_of_two = 1;
exit:
@@ -1048,6 +1050,7 @@ static void virtio_net_info_get(struct uk_netdev *dev,
dev_info->max_rx_queues = vndev->max_vqueue_pairs;
dev_info->max_tx_queues = vndev->max_vqueue_pairs;
+ dev_info->max_mtu = vndev->max_mtu;
I agree, this should be announced.
dev_info->nb_encap_tx = sizeof(struct virtio_net_hdr_padded);
dev_info->nb_encap_rx = sizeof(struct virtio_net_hdr_padded);
dev_info->features = UK_FEATURE_RXQ_INTR_AVAILABLE;
|