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

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


  • To: minios-devel@xxxxxxxxxxxxx
  • From: Costin Lupu <costin.lupu@xxxxxxxxx>
  • Date: Mon, 1 Apr 2019 16:42:41 +0300
  • Cc: felipe.huici@xxxxxxxxx, Florian.Schmidt@xxxxxxxxx, simon.kuenzer@xxxxxxxxx, yuri.volchkov@xxxxxxxxx, sharan.santhanam@xxxxxxxxx
  • Delivery-date: Mon, 01 Apr 2019 13:43:01 +0000
  • Ironport-phdr: 9a23:gp342x/c0wkpkv9uRHKM819IXTAuvvDOBiVQ1KB+0+0XIJqq85mqBkHD//Il1AaPAdyDraMYwLSK+4nbGkU4qa6bt34DdJEeHzQksu4x2zIaPcieFEfgJ+TrZSFpVO5LVVti4m3peRMNQJW2aFLduGC94iAPERvjKwV1Ov71GonPhMiryuy+4ZLebxhUiDanZb5/Ixq6oATeu8ILnYZsN6E9xwfTrHBVYepW32RoJVySnxb4+Mi9+YNo/jpTtfw86cNOSL32cKskQ7NWCjQmKH0169bwtRbfVwuP52ATXXsQnxFVHgXK9hD6XpP2sivnqupw3TSRMMPqQbwoXzmp8qFmQwLqhigaLT406GHZhNJtgqxVoxyvoB5ww4DPbY2JKPZzZL/RcMkGSWZdWMtaSixPApm7b4sKF+cMI+FYr5Lhp1sPqxu1GA+iBP73yj9Vm3T72rE10+M6EQHa3QwgGcgCsHDJrNXtKacfSvy6zLLSwTXbcvNZwi3x6JLPch04p/yHQLF+cdLJxEUyGA7Jk0+cpI/lMj+PyOgBrWqW4/BuWO63lmIqpBx9riKsy8oskIXFmIwYx17e+Slkz4s5O9u1Q1Nhb9G+CptfrSSaOpNzQsMlXm5npj43yqYDuZ6nZCgKz4knxwLHZ/yHbYeI5hXjWf6PITd9nn1leba/iwyu/ki70OH8TtS0301QoipfldnArnEN1xrN5cibUvZx40is1SuV2w3Q6uxIO144mbTZJpI7zLM8jp8Tvl7CHi/ylkX2lqiWdkA89+e07OTneanmpp6aN4NujgH+L7wumtGkDOskKQgCRXCb+fmn27H55035R61GjucqnanBrJDaOcMbq7a8Aw9U1IYj6hG/Dyy/3NsFg3YHMkxKeBacgojtOlHOO+z4Deylj1WjjjhrwerKPrr7ApXCNnLDiqvufa5h605Azwo+1dBR55ZTCrEbIfL8QEnxuMbFABAlMwy0xufnB8hh1o4FX2KAHLOWMKfIvlCT/O4gPfSMbpcPuDnhM/gl++LujXghlF8TY6ap2ZoXaGimEfh8I0WZfHvsjcsAEWoRuAoxUvDliFmYXjFIfXq9Qb887CkhCI26FYfDWpytgLuZ0SegHp1ZfHpGBUqKEXvybIWLQfEMaD6SIsB7lDwLT72hRpQn1R6wqAD6z6BoIfHO9iIGqJLpzMJ16PHLlREu6Tx0CNyQ03qMT2FxmWMIQSU63KNioUNjzFeC0LZ3g+ZDGNxV+fxGTgM6OoTHwOBgFd/yRxrLfs2VR1a+XtWmHTYxQ8oxwt8TeUZ9Gs+ujg7E3yquH7AVl7+LBJsq8q/H2Xj+Odpyy3Lc26Y6lVUpXNZPZiWagft69g7SAJWMn0iHmqKCcaUHwDWL5GqFi22UsxJ2Sgl1BI7CRmweYAPysMzkrhfJSKSyCLJhNhZZ1OaJMe1Sd9evl1IQF6SrA8jXf2/kwzT4Ph2P3L7ZNIc=
  • Ironport-sdr: dvXc9XGayLHOseXSQrQMlpr8iwWakXjt8KYCoPN8CxECI+7YyaI/GwXF115TX/E8JMfBZQsCY8 gSOe4gT6zmYA==
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>

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
@@ -69,6 +69,13 @@ 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
  */
 #define UK_NETDEV_HWADDR_LEN 6 /**< Length of Ethernet address. */
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.11.0


_______________________________________________
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®.