You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/12/03 16:57:08 UTC
[GitHub] [nuttx] anchao opened a new pull request, #7768: net/d_buf: remove d_buf reference from l3/l4
anchao opened a new pull request, #7768:
URL: https://github.com/apache/nuttx/pull/7768
## Summary
net/d_buf: remove d_buf reference from l3/l4
l3/l4 stack will decouple the reference of d_buf gradually, Only legacy
devices still retain d_buf support, new net devices will use d_iob
Signed-off-by: chao an <an...@xiaomi.com>
## Impact
N/A
## Testing
iperf ipv4/ipv6 test
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #7768: net/d_buf: remove d_buf reference from l3/l4
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #7768:
URL: https://github.com/apache/nuttx/pull/7768#discussion_r1038951108
##########
include/nuttx/net/netdev.h:
##########
@@ -157,17 +157,12 @@
# define NETDEV_ERRORS(dev)
#endif
-/* There are some helper pointers for accessing the contents of the Ethernet
- * headers
- */
-
-#define ETHBUF ((FAR struct eth_hdr_s *)&dev->d_buf[0])
-
/* There are some helper pointers for accessing the contents of the IP
* headers
*/
-#define IPBUF(hl) ((FAR void *)&dev->d_buf[NET_LL_HDRLEN(dev) + (hl)])
+#define IPBUF(hl) ((FAR void *)\
+ &dev->d_iob->io_data[CONFIG_NET_LL_GUARDSIZE + (hl)])
#define IPv4BUF ((FAR struct ipv4_hdr_s *)IPBUF(0))
#define IPv6BUF ((FAR struct ipv6_hdr_s *)IPBUF(0))
Review Comment:
let's move IPv4BUF/IPv6BUF/IPBUF to private header file too.
##########
net/arp/arp.h:
##########
@@ -81,8 +81,10 @@
/* This is a helper pointer for accessing the contents of the IP header */
-#define ARPBUF ((FAR struct arp_hdr_s *)&dev->d_buf[ETH_HDRLEN])
-#define ARPIPBUF ((FAR struct arp_iphdr_s *)&dev->d_buf[ETH_HDRLEN])
+#define ARPBUF ((FAR struct arp_hdr_s *)\
Review Comment:
But no change
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] anchao commented on a diff in pull request #7768: net/d_buf: remove d_buf reference from l3/l4
Posted by GitBox <gi...@apache.org>.
anchao commented on code in PR #7768:
URL: https://github.com/apache/nuttx/pull/7768#discussion_r1038942060
##########
net/utils/net_ipchksum.c:
##########
@@ -170,13 +170,11 @@ uint16_t ipv6_upperlayer_chksum(FAR struct net_driver_s *dev,
/* Sum IP payload data. */
-#ifdef CONFIG_MM_IOB
Review Comment:
Done
##########
net/utils/net_ipchksum.c:
##########
@@ -93,13 +94,11 @@ uint16_t ipv4_upperlayer_chksum(FAR struct net_driver_s *dev, uint8_t proto)
/* Sum IP payload data. */
-#ifdef CONFIG_MM_IOB
if (dev->d_iob != NULL)
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] pkarashchenko commented on a diff in pull request #7768: net/d_buf: remove d_buf reference from l3/l4
Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #7768:
URL: https://github.com/apache/nuttx/pull/7768#discussion_r1039380199
##########
arch/arm/src/tiva/lm/lm3s_ethernet.c:
##########
@@ -160,6 +160,12 @@
#define TIVA_MAX_MDCCLK 2500000
+/* This is a helper pointer for accessing the contents of the Ethernet
+ * header
+ */
+
+#define BUF ((FAR struct eth_hdr_s *)&dev->d_buf[0])
Review Comment:
remove `FAR`
##########
arch/arm/src/lpc54xx/lpc54_ethernet.c:
##########
@@ -253,6 +253,12 @@
#define ETH8021QWBUF ((struct eth_8021qhdr_s *)priv->eth_dev.d_buf)
+/* This is a helper pointer for accessing the contents of the Ethernet
+ * header
+ */
+
+#define BUF ((FAR struct eth_hdr_s *)&dev->d_buf[0])
Review Comment:
remove `FAR`
##########
net/devif/devif.h:
##########
@@ -233,6 +233,14 @@
# define DEVIF_IS_IPv6(dev) (0)
#endif
+/* There are some helper pointers for accessing the contents of the Ethernet
+ * headers
+ */
+
+#define ETHBUF ((FAR struct eth_hdr_s *)\
Review Comment:
add space `) \`
##########
net/arp/arp.h:
##########
@@ -81,8 +83,10 @@
/* This is a helper pointer for accessing the contents of the IP header */
-#define ARPBUF ((FAR struct arp_hdr_s *)&dev->d_buf[ETH_HDRLEN])
-#define ARPIPBUF ((FAR struct arp_iphdr_s *)&dev->d_buf[ETH_HDRLEN])
+#define ARPBUF ((FAR struct arp_hdr_s *)\
+ &dev->d_iob->io_data[CONFIG_NET_LL_GUARDSIZE])
+#define ARPIPBUF ((FAR struct arp_iphdr_s *)\
Review Comment:
add space `) \`
##########
include/nuttx/net/netdev.h:
##########
@@ -157,17 +157,12 @@
# define NETDEV_ERRORS(dev)
#endif
-/* There are some helper pointers for accessing the contents of the Ethernet
- * headers
- */
-
-#define ETHBUF ((FAR struct eth_hdr_s *)&dev->d_buf[0])
-
/* There are some helper pointers for accessing the contents of the IP
* headers
*/
-#define IPBUF(hl) ((FAR void *)&dev->d_buf[NET_LL_HDRLEN(dev) + (hl)])
+#define IPBUF(hl) ((FAR void *)\
Review Comment:
add space `) \`
##########
net/arp/arp.h:
##########
@@ -81,8 +83,10 @@
/* This is a helper pointer for accessing the contents of the IP header */
-#define ARPBUF ((FAR struct arp_hdr_s *)&dev->d_buf[ETH_HDRLEN])
-#define ARPIPBUF ((FAR struct arp_iphdr_s *)&dev->d_buf[ETH_HDRLEN])
+#define ARPBUF ((FAR struct arp_hdr_s *)\
Review Comment:
add space `) \`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] anchao commented on a diff in pull request #7768: net/d_buf: remove d_buf reference from l3/l4
Posted by GitBox <gi...@apache.org>.
anchao commented on code in PR #7768:
URL: https://github.com/apache/nuttx/pull/7768#discussion_r1038956488
##########
include/nuttx/net/netdev.h:
##########
@@ -157,17 +157,12 @@
# define NETDEV_ERRORS(dev)
#endif
-/* There are some helper pointers for accessing the contents of the Ethernet
- * headers
- */
-
-#define ETHBUF ((FAR struct eth_hdr_s *)&dev->d_buf[0])
-
/* There are some helper pointers for accessing the contents of the IP
* headers
*/
-#define IPBUF(hl) ((FAR void *)&dev->d_buf[NET_LL_HDRLEN(dev) + (hl)])
+#define IPBUF(hl) ((FAR void *)\
+ &dev->d_iob->io_data[CONFIG_NET_LL_GUARDSIZE + (hl)])
#define IPv4BUF ((FAR struct ipv4_hdr_s *)IPBUF(0))
#define IPv6BUF ((FAR struct ipv6_hdr_s *)IPBUF(0))
Review Comment:
IPv4BUF/IPv6BUF/IPBUF are referenced by other directories
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #7768: net/d_buf: remove d_buf reference from l3/l4
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #7768:
URL: https://github.com/apache/nuttx/pull/7768#discussion_r1038919007
##########
net/arp/arp.h:
##########
@@ -81,8 +81,10 @@
/* This is a helper pointer for accessing the contents of the IP header */
-#define ARPBUF ((FAR struct arp_hdr_s *)&dev->d_buf[ETH_HDRLEN])
-#define ARPIPBUF ((FAR struct arp_iphdr_s *)&dev->d_buf[ETH_HDRLEN])
+#define ARPBUF ((FAR struct arp_hdr_s *)\
Review Comment:
let's move to net/arp/arp.h
##########
include/nuttx/net/netdev.h:
##########
@@ -161,13 +161,16 @@
* headers
*/
-#define ETHBUF ((FAR struct eth_hdr_s *)&dev->d_buf[0])
+#define ETHBUF ((FAR struct eth_hdr_s *)\
Review Comment:
let's move to private header file inside net/?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] anchao commented on a diff in pull request #7768: net/d_buf: remove d_buf reference from l3/l4
Posted by GitBox <gi...@apache.org>.
anchao commented on code in PR #7768:
URL: https://github.com/apache/nuttx/pull/7768#discussion_r1038942333
##########
net/arp/arp.h:
##########
@@ -81,8 +81,10 @@
/* This is a helper pointer for accessing the contents of the IP header */
-#define ARPBUF ((FAR struct arp_hdr_s *)&dev->d_buf[ETH_HDRLEN])
-#define ARPIPBUF ((FAR struct arp_iphdr_s *)&dev->d_buf[ETH_HDRLEN])
+#define ARPBUF ((FAR struct arp_hdr_s *)\
Review Comment:
Done
##########
include/nuttx/net/netdev.h:
##########
@@ -161,13 +161,16 @@
* headers
*/
-#define ETHBUF ((FAR struct eth_hdr_s *)&dev->d_buf[0])
+#define ETHBUF ((FAR struct eth_hdr_s *)\
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 merged pull request #7768: net/d_buf: remove d_buf reference from l3/l4
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged PR #7768:
URL: https://github.com/apache/nuttx/pull/7768
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #7768: net/d_buf: remove d_buf reference from l3/l4
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #7768:
URL: https://github.com/apache/nuttx/pull/7768#discussion_r1038913641
##########
net/utils/net_ipchksum.c:
##########
@@ -170,13 +170,11 @@ uint16_t ipv6_upperlayer_chksum(FAR struct net_driver_s *dev,
/* Sum IP payload data. */
-#ifdef CONFIG_MM_IOB
Review Comment:
should we remove the check? since IPBUF also access d_iob too.
##########
net/utils/net_ipchksum.c:
##########
@@ -93,13 +94,11 @@ uint16_t ipv4_upperlayer_chksum(FAR struct net_driver_s *dev, uint8_t proto)
/* Sum IP payload data. */
-#ifdef CONFIG_MM_IOB
if (dev->d_iob != NULL)
Review Comment:
should we remove the check? since IPBUF also access d_iob too.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] anchao commented on a diff in pull request #7768: net/d_buf: remove d_buf reference from l3/l4
Posted by GitBox <gi...@apache.org>.
anchao commented on code in PR #7768:
URL: https://github.com/apache/nuttx/pull/7768#discussion_r1038956328
##########
net/arp/arp.h:
##########
@@ -81,8 +81,10 @@
/* This is a helper pointer for accessing the contents of the IP header */
-#define ARPBUF ((FAR struct arp_hdr_s *)&dev->d_buf[ETH_HDRLEN])
-#define ARPIPBUF ((FAR struct arp_iphdr_s *)&dev->d_buf[ETH_HDRLEN])
+#define ARPBUF ((FAR struct arp_hdr_s *)\
Review Comment:
already in net/arp/arp.h ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org