|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Minios-devel] [UNIKRAFT PATCH v4 10/11] lib/uknetdev: MTU interfaces
On 11.10.18 17:14, Sharan Santhanam wrote: Hello Simon, Please find the comments inline: On 10/10/2018 02:00 PM, Simon Kuenzer wrote:From: Razvan Cojocaru <razvan.cojocaru93@xxxxxxxxx> Add interfaces to query and set the maximum transmission unit (MTU) for a netdev. Signed-off-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx> Signed-off-by: Razvan Cojocaru <razvan.cojocaru93@xxxxxxxxx> --- lib/uknetdev/exportsyms.uk | 2 ++ lib/uknetdev/include/uk/netdev.h | 27 +++++++++++++++++++++++++++ lib/uknetdev/include/uk/netdev_core.h | 10 ++++++++++lib/uknetdev/netdev.c | 35 +++++++++++++++++++++++++++++++++++4 files changed, 74 insertions(+) diff --git a/lib/uknetdev/exportsyms.uk b/lib/uknetdev/exportsyms.uk index 6e8b06b..9e264bd 100644 --- a/lib/uknetdev/exportsyms.uk +++ b/lib/uknetdev/exportsyms.uk @@ -26,3 +26,5 @@ uk_netdev_hwaddr_set uk_netdev_hwaddr_get uk_netdev_promiscuous_get uk_netdev_promiscuous_set +uk_netdev_mtu_get +uk_netdev_mtu_setdiff --git a/lib/uknetdev/include/uk/netdev.h b/lib/uknetdev/include/uk/netdev.hindex b06978a..e527534 100644 --- a/lib/uknetdev/include/uk/netdev.h +++ b/lib/uknetdev/include/uk/netdev.h@@ -335,6 +335,33 @@ int uk_netdev_promiscuous_get(struct uk_netdev *dev);*/ int uk_netdev_promiscuous_set(struct uk_netdev *dev, int mode); +/** + * Returns the MTU of an Unikraft network device. + * + * @param dev + * The Unikraft Network Device. + * @return + * - (>0): MTU of the uk_netdevThe description does not match the implementation.+ * - (-ENOTSUP): driver did not set a MTU. + */ +int uk_netdev_mtu_get(struct uk_netdev *dev); + +/** + * Change the MTU of an Unikraft network device. + * + * @param dev + * The Unikraft Network Device. + * @param mtu + * A uint16_t for the MTU to be applied. + * @return + * - (0): if successful.The description of the API does not match with the implementation. Yes, sorry for this. I will update it. + * - (-ENOTSUP): if operation is not supported. + * - (-EIO): if device is removed. + * - (-EINVAL): if *mtu* invalid. + * - (-EBUSY): if operation is not allowed when the device is running + */ +int uk_netdev_mtu_set(struct uk_netdev *dev, uint16_t mtu); + #ifdef __cplusplus } #endifdiff --git a/lib/uknetdev/include/uk/netdev_core.h b/lib/uknetdev/include/uk/netdev_core.hindex 0171127..f78f992 100644 --- a/lib/uknetdev/include/uk/netdev_core.h +++ b/lib/uknetdev/include/uk/netdev_core.h@@ -247,6 +247,12 @@ typedef int (*uk_netdev_promiscuous_get_t)(struct uk_netdev *dev);/** Driver callback type to enable or disable promiscuous mode */typedef int (*uk_netdev_promiscuous_set_t)(struct uk_netdev *dev, int mode); You are right. The idea was to have this as a reliable interface that never fails. We thought that the MTU information should always be there, otherwise we are doing something seriously wrong. I am changing the return type of uk_netdev_mtu_get() to uint16_t, too.
Ooops, you are right.
_______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |