[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Minios-devel] [UNIKRAFT PATCH 2/2] lib/uknetdev: Get feature supported on uk_netdev
On 07.10.19 11:50, Sharan Santhanam wrote: The uk_netdev_info provides a way to forward information on netdevice to the network stack. We extend this with a bitmap of the features supported on device. The bit 0,1 of the bitmap indicates if the device supports interrupt. Signed-off-by: Sharan Santhanam <sharan.santhanam@xxxxxxxxx> --- lib/uknetdev/include/uk/netdev_core.h | 9 +++++++++ plat/drivers/tap/tap.c | 1 + plat/drivers/virtio/virtio_net.c | 1 + 3 files changed, 11 insertions(+) diff --git a/lib/uknetdev/include/uk/netdev_core.h b/lib/uknetdev/include/uk/netdev_core.h index 827f187..be8cd53 100644 --- a/lib/uknetdev/include/uk/netdev_core.h +++ b/lib/uknetdev/include/uk/netdev_core.h @@ -77,6 +77,14 @@ UK_TAILQ_HEAD(uk_netdev_list, struct uk_netdev); */ #define UK_NETDEV_HWADDR_LEN 6 /**< Length of Ethernet address. */+#define UK_FEATURE_RXQ_INTR_BIT 0+#define UK_FEATURE_RXQ_INTR_ENABLED (1UL << UK_FEATURE_RXQ_INTR_BIT) +#define UK_FEATURE_TXQ_INTR_BIT 1 +#define UK_FEATURE_TXQ_INTR_ENABLED (1UL << UK_FEATURE_TXQ_INTR_BIT) I find _INTR_ENABLED confusing because the name implies that this feature bit switches on and off depending if you enable and disable interrupts on the queue. Maybe call it *_INTR_AVAILABLE? + +#define uk_netdev_rxintr_supported(feature) \ + (feature & (UK_FEATURE_RXQ_INTR_ENABLED)) + struct uk_hwaddr { uint8_t addr_bytes[UK_NETDEV_HWADDR_LEN]; } __packed; @@ -91,6 +99,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. */ + uint32_t features; };/**diff --git a/plat/drivers/tap/tap.c b/plat/drivers/tap/tap.c index 1765a0a..46bad3c 100644 --- a/plat/drivers/tap/tap.c +++ b/plat/drivers/tap/tap.c @@ -498,6 +498,7 @@ static void tap_netdev_info_get(struct uk_netdev *dev __unused, dev_info->max_tx_queues = 1; dev_info->nb_encap_tx = 0; dev_info->nb_encap_rx = 0; + dev_info->features = 0; }static unsigned int tap_netdev_promisc_get(struct uk_netdev *n)diff --git a/plat/drivers/virtio/virtio_net.c b/plat/drivers/virtio/virtio_net.c index 3025ed3..6cb99c8 100644 --- a/plat/drivers/virtio/virtio_net.c +++ b/plat/drivers/virtio/virtio_net.c @@ -1052,6 +1052,7 @@ static void virtio_net_info_get(struct uk_netdev *dev, dev_info->max_tx_queues = vndev->max_vqueue_pairs; 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_ENABLED; }static int virtio_net_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 |