xiaoxiang781216 commented on a change in pull request #5423:
URL: https://github.com/apache/incubator-nuttx/pull/5423#discussion_r800089682



##########
File path: drivers/pipes/Kconfig
##########
@@ -14,8 +14,7 @@ if PIPES
 
 config DEV_PIPE_MAXSIZE
        int "Maximum pipe/FIFO size"
-       default 1024 if !DEFAULT_SMALL
-       default 256 if DEFAULT_SMALL
+       default 65535

Review comment:
       > This influence memory allocation by the system 
   
   No, the memory allocation isn't really affected by DEV_PIPE_MAXSIZE. The 
functionality of DEV_PIPE_MAXSIZE is very minor:
   
   1. Control pipe_ndx_t map to uint8_t, uint16_t and uint32_t:
       
https://github.com/apache/incubator-nuttx/blob/master/drivers/pipes/pipe_common.h#L99-L107
   2. DEBUGASSERT when the buffer size passed by caller is bigger than 
DEV_PIPE_MAXSIZE:
       
https://github.com/apache/incubator-nuttx/blob/master/drivers/pipes/pipe_common.c#L129
   
   > by `dev->d_buffer = (FAR uint8_t *)kmm_malloc(dev->d_bufsize);`
   
   d_bufsize come from the caller in case of nx_pipe/nx_mkfifo:
   
https://github.com/apache/incubator-nuttx/blob/master/drivers/pipes/pipe.c#L291
   
https://github.com/apache/incubator-nuttx/blob/master/drivers/pipes/fifo.c#L94
   
   or DEV_PIPE_SIZE/DEV_FIFO_SIZE in case of pipe/mkfifo:
   
https://github.com/apachor/incubator-nuttx/blob/master/drivers/pipes/Kconfig#L22-L36
   
https://github.com/apache/incubator-nuttx/blob/master/libs/libc/unistd/lib_pipe.c#L60
   
https://github.com/apache/incubator-nuttx/blob/master/libs/libc/misc/lib_mkfifo.c#L72
   
   > and I think it is good to review it separately
   
   Since the patch only change the default value of minor config, the new 
default value doesn't modify pipe_ndx_t(which is still uint16_t), only 
DEBUGASSERT get relax. Do you still prefer to split it into another PR?




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to