|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Minios-devel] [UNIKRAFT PATCH 03/15] plat/driver: Add tap device to the uk_netdev
Hi Sharan, See inline. Roxana On 07.10.2019 12:46, Sharan Santhanam wrote: I don't understand the purpose of this if macro. If `PLAT_LINUXU` is not selected, the driver will not be selected according to the menu configuration.The patch provides the implementation to parse the user provided tap device information. The tap device detected are registered to the uk_netdev. Signed-off-by: Sharan Santhanam<sharan.santhanam@xxxxxxxxx> --- plat/drivers/tap/tap.c | 126 +++++++++++++++++++++++++++++++++++++++ plat/linuxu/Config.uk | 7 +++ plat/linuxu/Makefile.uk | 4 ++ plat/linuxu/include/linuxu/tap.h | 45 ++++++++++++++ 4 files changed, 182 insertions(+) create mode 100644 plat/linuxu/include/linuxu/tap.h diff --git a/plat/drivers/tap/tap.c b/plat/drivers/tap/tap.c index ffd21be..2f49788 100644 --- a/plat/drivers/tap/tap.c +++ b/plat/drivers/tap/tap.c @@ -40,8 +40,14 @@ #include <uk/netdev_driver.h> #include <uk/netbuf.h> #include <uk/errptr.h> +#include <uk/libparam.h> #include <uk/bus.h>+#ifdef CONFIG_PLAT_LINUXU+#include <linuxu/tap.h> +#else +#error "The driver does not support this Unikraft platform" +#endif /* CONFIG_PLAT_LINUXU */ #define TAPDEV_MAX_CNT 7 #define TAPDEV_IFNAME_BRS 255 @@ -58,6 +64,31 @@#define ETH_PKT_PAYLOAD_LEN 1500 +#define to_tapnetdev(dev) \ Why are two variable with the same purpose/description? I think it would improve a lot the visibility to provide an example for
this parameters.
Now I understand the difference between `id` and `tid`. This should depend on `TAP_NET`, right? + bool "Tap Device Debug" + default n + help + Enable debug messages from the tap device. endif diff --git a/plat/linuxu/Makefile.uk b/plat/linuxu/Makefile.uk index 1ace47c..561909e 100644 --- a/plat/linuxu/Makefile.uk +++ b/plat/linuxu/Makefile.uk @@ -11,6 +11,8 @@ $(eval $(call addplatlib,linuxu,liblinuxutapnet)) tap_drv.a = _a; 388 UK_TAILQ_INIT(&tap_drv.tap_dev_list); 389 return 0; ## Adding libparam for the linuxu platform $(eval $(call addlib_paramprefix,liblinuxuplat,linuxu)) +$(eval $(call addlib_paramprefix,liblinuxutapnet,tap)) + ## ## Platform library definitions ## @@ -53,4 +55,6 @@ LIBLINUXUPLAT_SRCS-$(CONFIG_ARCH_ARM_32) += \ LIBLINUXUTAPNET_ASINCLUED-y += -I$(LIBLINUXUPLAT_BASE)/include LIBLINUXUTAPNET_CINCLUDES-y += -I$(LIBLINUXUPLAT_BASE)/include+LIBLINUXUTAPNET_CFLAGS-$(CONFIG_TAP_DEV_DEBUG) += -DUK_DEBUG+ LIBLINUXUTAPNET_SRCS-y += $(UK_PLAT_DRIVERS_BASE)/tap/tap.c diff --git a/plat/linuxu/include/linuxu/tap.h b/plat/linuxu/include/linuxu/tap.h new file mode 100644 index 0000000..83116f5 --- /dev/null +++ b/plat/linuxu/include/linuxu/tap.h @@ -0,0 +1,45 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* + * Authors: Sharan Santhanam<sharan.santhanam@xxxxxxxxx> + * + * Copyright (c) 2018, NEC Europe Ltd., NEC Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary formThis should depend on `TAP_NET`, right? must reproduce the above copyright + * notice, this list of conditions and thie following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY. + */ +#ifndef __TAP_H__ +#define __TAP_H__ + +#include <uk/arch/types.h> + +/** + * Using the musl as reference for the data structure definition + * Commit-id: 39ef612aa193 + */ +#define IFNAMSIZ 16 + +#endif /* LINUXU_TAP_H */ I don't understand why this header is not in `drivers/tap/include`. _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |