[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Minios-devel] [UNIKRAFT PATCH v2 02/12] lib/uknetdev: Add alignment for allocating packet buffers
On Xen, packet buffers have to be page aligned because they are saved in page aligned memory regions which are shared between backend and frontend by using grants. Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx> --- lib/uknetdev/include/uk/netdev_core.h | 1 + plat/drivers/virtio/virtio_net.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/lib/uknetdev/include/uk/netdev_core.h b/lib/uknetdev/include/uk/netdev_core.h index f073e101..268d54d7 100644 --- a/lib/uknetdev/include/uk/netdev_core.h +++ b/lib/uknetdev/include/uk/netdev_core.h @@ -94,6 +94,7 @@ struct uk_netdev_info { uint16_t max_mtu; /**< Maximum supported MTU size. */ uint16_t nb_encap_tx; /**< Number of bytes required as headroom for tx. */ uint16_t nb_encap_rx; /**< Number of bytes required as headroom for rx. */ + uint16_t align; /**< Alignment required for data address. */ }; /** diff --git a/plat/drivers/virtio/virtio_net.c b/plat/drivers/virtio/virtio_net.c index efc2cb71..9f1873c5 100644 --- a/plat/drivers/virtio/virtio_net.c +++ b/plat/drivers/virtio/virtio_net.c @@ -1048,8 +1048,10 @@ 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; dev_info->nb_encap_tx = sizeof(struct virtio_net_hdr_padded); dev_info->nb_encap_rx = sizeof(struct virtio_net_hdr_padded); + dev_info->align = sizeof(void *); /* word size alignment */ } static int virtio_net_start(struct uk_netdev *n) -- 2.11.0 _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |