[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCH v3 01/12] lib/uknetdev: Make Ethernet macros visible to all network devices



Both Ethernet header and payload sizes have the same values for all
network devices.

Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
---
 lib/uknetdev/include/uk/netdev_core.h | 7 +++++++
 plat/drivers/virtio/virtio_net.c      | 2 --
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/lib/uknetdev/include/uk/netdev_core.h 
b/lib/uknetdev/include/uk/netdev_core.h
index dba719fc..f073e101 100644
--- a/lib/uknetdev/include/uk/netdev_core.h
+++ b/lib/uknetdev/include/uk/netdev_core.h
@@ -68,6 +68,13 @@ extern "C" {
 struct uk_netdev;
 UK_TAILQ_HEAD(uk_netdev_list, struct uk_netdev);
 
+/**
+ * Ethernet macros
+ */
+#define ETH_HDR_LEN           14
+#define ETH_PKT_PAYLOAD_LEN   1500
+#define ETH_PKT_LEN           (ETH_HDR_LEN + ETH_PKT_PAYLOAD_LEN)
+
 /**
  * A structure used for Ethernet hardware addresses
  */
diff --git a/plat/drivers/virtio/virtio_net.c b/plat/drivers/virtio/virtio_net.c
index 3025ed3f..efc2cb71 100644
--- a/plat/drivers/virtio/virtio_net.c
+++ b/plat/drivers/virtio/virtio_net.c
@@ -47,8 +47,6 @@
  *                12 bytes in length in modern mode.
  */
 #define VIRTIO_HDR_LEN          12
-#define ETH_HDR_LEN             14
-#define ETH_PKT_PAYLOAD_LEN   1500
 #define VIRTIO_PKT_BUFFER_LEN ((ETH_PKT_PAYLOAD_LEN)   \
                               + (ETH_HDR_LEN)          \
                               + (VIRTIO_HDR_LEN))
-- 
2.20.1


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.