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 2023/01/11 08:39:57 UTC

[GitHub] [nuttx] wengzhe opened a new pull request, #8080: net/netdev: Avoid hardcoded guardsize when using d_iob

wengzhe opened a new pull request, #8080:
URL: https://github.com/apache/nuttx/pull/8080

   ## Summary
   d_iob is always prepared with io_offset = CONFIG_NET_LL_GUARDSIZE, but hardcode CONFIG_NET_LL_GUARDSIZE is not good for flexibility, use io_offset (IOB_DATA macro) instead.
   
   ## Impact
   Reduce usage of CONFIG_NET_LL_GUARDSIZE, to let flexible incoming IOB with different offset become possible.
   
   ## Testing
   CI + SIM(ping / iperf)
   


-- 
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 pull request #8080: net/netdev: Avoid hardcoded guardsize when using d_iob

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on PR #8080:
URL: https://github.com/apache/nuttx/pull/8080#issuecomment-1385879981

   @wengzhe please fix the ci break.


-- 
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] wengzhe commented on pull request #8080: net/netdev: Avoid hardcoded guardsize when using d_iob

Posted by GitBox <gi...@apache.org>.
wengzhe commented on PR #8080:
URL: https://github.com/apache/nuttx/pull/8080#issuecomment-1386504698

   > @wengzhe please fix the ci break.
   
   @xiaoxiang781216 Rebased to master and the ci passed.


-- 
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 #8080: net/netdev: Avoid hardcoded guardsize when using d_iob

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged PR #8080:
URL: https://github.com/apache/nuttx/pull/8080


-- 
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] acassis commented on a diff in pull request #8080: net/netdev: Avoid hardcoded guardsize when using d_iob

Posted by GitBox <gi...@apache.org>.
acassis commented on code in PR #8080:
URL: https://github.com/apache/nuttx/pull/8080#discussion_r1068127490


##########
include/nuttx/net/netdev.h:
##########
@@ -161,8 +161,8 @@
  * headers
  */
 
-#define IPBUF(hl) ((FAR void *)\
-                   &dev->d_iob->io_data[CONFIG_NET_LL_GUARDSIZE + (hl)])
+#define IPBUF(hl) ((FAR void *)(IOB_DATA(dev->d_iob) + (hl)))
+#define LLBUF     (IPBUF(-NET_LL_HDRLEN(dev)))

Review Comment:
   The LLBUF is too generic, maybe NETLLBUF is better to make it easy to understand its purpose



##########
include/nuttx/net/netdev.h:
##########
@@ -161,8 +161,8 @@
  * headers
  */
 
-#define IPBUF(hl) ((FAR void *)\
-                   &dev->d_iob->io_data[CONFIG_NET_LL_GUARDSIZE + (hl)])
+#define IPBUF(hl) ((FAR void *)(IOB_DATA(dev->d_iob) + (hl)))
+#define LLBUF     (IPBUF(-NET_LL_HDRLEN(dev)))

Review Comment:
   ```suggestion
   #define LLBUF     (IPBUF - (NET_LL_HDRLEN(dev)))



-- 
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] wengzhe commented on a diff in pull request #8080: net/netdev: Avoid hardcoded guardsize when using d_iob

Posted by GitBox <gi...@apache.org>.
wengzhe commented on code in PR #8080:
URL: https://github.com/apache/nuttx/pull/8080#discussion_r1070803832


##########
include/nuttx/net/netdev.h:
##########
@@ -161,8 +161,8 @@
  * headers
  */
 
-#define IPBUF(hl) ((FAR void *)\
-                   &dev->d_iob->io_data[CONFIG_NET_LL_GUARDSIZE + (hl)])
+#define IPBUF(hl) ((FAR void *)(IOB_DATA(dev->d_iob) + (hl)))
+#define LLBUF     (IPBUF(-NET_LL_HDRLEN(dev)))

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