Index: trunk/kernel/kernel_config.h
===================================================================
--- trunk/kernel/kernel_config.h	(revision 657)
+++ trunk/kernel/kernel_config.h	(revision 667)
@@ -2,5 +2,5 @@
  * kernel_config.h - global kernel configuration arguments
  * 
- * Authors        Alain Greiner (2016,2017,2018,2019)
+ * Authors        Alain Greiner (2016,2017,2018,2019,2020)
  *
  * Copyright (c)  UPMC Sorbonne Universites
@@ -36,7 +36,7 @@
 #define DEBUG_BARRIER_WAIT                0
 
-#define DEBUG_BUSYLOCK                    0
-#define DEBUG_BUSYLOCK_PID                0          // for busylock detailed debug
-#define DEBUG_BUSYLOCK_TRDID              0          // for busylock detailed debug
+#define DEBUG_BUSYLOCK_TYPE               0
+#define DEBUG_BUSYLOCK_PID                0         
+#define DEBUG_BUSYLOCK_TRDID              0       
                  
 #define DEBUG_CHDEV_CMD_RX                0
@@ -55,5 +55,5 @@
 #define DEBUG_DEV_IOC_TX                  0
 #define DEBUG_DEV_NIC_RX                  0
-#define DEBUG_DEV_NIC_RX                  0
+#define DEBUG_DEV_NIC_TX                  0
 #define DEBUG_DEV_FBF                     0
 #define DEBUG_DEV_DMA                     0
@@ -96,4 +96,5 @@
 #define DEBUG_HAL_CONTEXT_INIT            0
 #define DEBUG_HAL_EXCEPTIONS              0
+#define DEBUG_HAL_FBF                     0
 #define DEBUG_HAL_GPT_COPY                0
 #define DEBUG_HAL_GPT_CREATE              0
@@ -106,7 +107,8 @@
 #define DEBUG_HAL_IRQS                    0
 #define DEBUG_HAL_KENTRY                  0
+#define DEBUG_HAL_NIC_RX                  0
+#define DEBUG_HAL_NIC_TX                  0
 #define DEBUG_HAL_TXT_RX                  0
 #define DEBUG_HAL_TXT_TX                  0
-#define DEBUG_HAL_FBF                     0
 #define DEBUG_HAL_USPACE                  0
 #define DEBUG_HAL_VMM                     0
@@ -137,4 +139,6 @@
 #define DEBUG_PROCESS_DESTROY             0
 #define DEBUG_PROCESS_FD_REGISTER         0
+#define DEBUG_PROCESS_FD_REMOVE           0
+#define DEBUG_PROCESS_FD_CLEAN_ALL        0
 #define DEBUG_PROCESS_GET_LOCAL_COPY      0
 #define DEBUG_PROCESS_INIT_CREATE         0
@@ -146,5 +150,5 @@
 #define DEBUG_PROCESS_ZERO_CREATE         0
 
-#define DEBUG_QUEUELOCK_TYPE              0       // lock type 0 is undefined => no debug
+#define DEBUG_QUEUELOCK_TYPE              0           // type 0 undefined => no debug
 #define DEBUG_QUEUELOCK_PTR               0
 #define DEBUG_QUEUELOCK_CXY               0
@@ -165,5 +169,5 @@
 #define DEBUG_RPC_VMM_SET_COW             0
 
-#define DEBUG_RWLOCK_TYPE                 0        // lock type 0 is undefined => no debug
+#define DEBUG_RWLOCK_TYPE                 0           // type 0 undefined => no debug
 #define DEBUG_RWLOCK_PTR                  0
 #define DEBUG_RWLOCK_CXY                  0
@@ -174,4 +178,16 @@
 
 #define DEBUG_SEM                         0
+
+#define DEBUG_SOCKET_ACCEPT               0
+#define DEBUG_SOCKET_BIND                 0
+#define DEBUG_SOCKET_BUILD                0
+#define DEBUG_SOCKET_CLOSE                0
+#define DEBUG_SOCKET_CONNECT              0
+#define DEBUG_SOCKET_CREATE               0
+#define DEBUG_SOCKET_DESTROY              0
+#define DEBUG_SOCKET_LISTEN               0
+#define DEBUG_SOCKET_RECV                 0
+#define DEBUG_SOCKET_SEND                 0
+#define DEBUG_SOCKET_LINK                 0
 
 #define DEBUG_SYSCALLS_ERROR                 2
@@ -207,4 +223,5 @@
 #define DEBUG_SYS_READDIR                 0
 #define DEBUG_SYS_SEM                     0
+#define DEBUG_SYS_SOCKET                  0
 #define DEBUG_SYS_STAT                    0
 #define DEBUG_SYS_THREAD_CANCEL           0
@@ -301,24 +318,26 @@
 #define LOCK_PROCESS_CWD      19   // remote (B)  protect current working directory in process
 #define LOCK_BARRIER_STATE    20   // remote (B)  protect user barrier state
-
-#define LOCK_CLUSTER_PREFTBL  21   // local  (Q)  protect array of ref. processes in cluster
-
-#define LOCK_PPM_DIRTY        22   // remote (Q)  protect PPM dirty_pages list
-#define LOCK_CLUSTER_LOCALS   23   // remote (Q)  protect xlist of local processes in cluster
-#define LOCK_CLUSTER_COPIES   24   // remote (Q)  protect xlist of process copies in cluster
-#define LOCK_PROCESS_CHILDREN 25   // remote (Q)  protect xlist of chidren process in process
-#define LOCK_PROCESS_USERSYNC 26   // remote (Q)  protect lists of user synchros in process
-#define LOCK_PROCESS_FDARRAY  27   // remote (Q)  protect array of open files in owner process 
-#define LOCK_PROCESS_DIR      28   // remote (Q)  protect xlist of open directories in process
-#define LOCK_VMM_VSL          29   // remote (Q)  protect VSL (local list of vsegs)
-
-#define LOCK_PROCESS_THTBL    30   // local  (RW) protect local array of threads in a process 
-
-#define LOCK_MAPPER_STATE     31   // remote (RW) protect mapper state
-#define LOCK_VFS_SIZE         32   // remote (RW) protect inode state and associated mapper
-#define LOCK_VFS_FILE         33   // remote (RW) protect file descriptor state
-#define LOCK_VFS_MAIN         34   // remote (RW) protect vfs traversal (in root inode)
-#define LOCK_FATFS_FAT        35   // remote (RW) protect exclusive access to the VFS FAT
-#define LOCK_FBF_WINDOWS      36   // remote (RW) protect FBF windows set
+#define LOCK_LISTEN_SOCKET    21   // remote (B)  protect xlist of listening sockets
+
+#define LOCK_CLUSTER_PREFTBL  22   // local  (Q)  protect array of ref. processes in cluster
+
+#define LOCK_SOCKET_STATE     23   // remote (Q)  protect kernel socket state
+#define LOCK_PPM_DIRTY        24   // remote (Q)  protect PPM dirty_pages list
+#define LOCK_CLUSTER_LOCALS   25   // remote (Q)  protect xlist of local processes in cluster
+#define LOCK_CLUSTER_COPIES   26   // remote (Q)  protect xlist of process copies in cluster
+#define LOCK_PROCESS_CHILDREN 27   // remote (Q)  protect xlist of chidren process in process
+#define LOCK_PROCESS_USERSYNC 28   // remote (Q)  protect lists of user synchros in process
+#define LOCK_PROCESS_FDARRAY  29   // remote (Q)  protect array of open files in owner process
+#define LOCK_PROCESS_DIR      30   // remote (Q)  protect xlist of open directories in process
+#define LOCK_VMM_VSL          31   // remote (Q)  protect VSL (local list of vsegs)
+
+#define LOCK_PROCESS_THTBL    32   // local  (RW) protect local array of threads in a process 
+
+#define LOCK_MAPPER_STATE     33   // remote (RW) protect mapper state
+#define LOCK_VFS_SIZE         34   // remote (RW) protect inode state and associated mapper
+#define LOCK_VFS_FILE         35   // remote (RW) protect file descriptor state
+#define LOCK_VFS_MAIN         36   // remote (RW) protect vfs traversal (in root inode)
+#define LOCK_FATFS_FAT        37   // remote (RW) protect exclusive access to the VFS FAT
+#define LOCK_FBF_WINDOWS      38   // remote (RW) protect FBF windows set
 
 ////////////////////////////////////////////////////////////////////////////////////////////
@@ -361,5 +380,4 @@
 #define CONFIG_CPU_CTX_SIZE                 256        // up to 64 uint32_t registers
 #define CONFIG_FPU_CTX_SIZE                 256        // up to 32 uint64_t registers
-#define CONFIG_NIC_CHBUF_DEPTH              1          // number of containers in NIC chbuf
 
 ////////////////////////////////////////////////////////////////////////////////////////////
