Changeset 668 for trunk/kernel/kern
- Timestamp:
- Oct 10, 2020, 6:38:47 PM (4 years ago)
- Location:
- trunk/kernel/kern
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/ksocket.c
r662 r668 1157 1157 thread_t * this = CURRENT_THREAD; 1158 1158 xptr_t client_xp = XPTR( local_cxy , this ); 1159 pid_t pid = this->process->pid; 1160 trdid_t trdid = this->trdid; 1159 1161 1160 1162 // get pointers on file descriptor … … 1176 1178 #if DEBUG_SOCKET_CONNECT 1177 1179 uint32_t cycle = (uint32_t)hal_get_cycles(); 1178 pid_t pid = this->process->pid;1179 trdid_t trdid = this->trdid;1180 1180 if( DEBUG_SOCKET_CONNECT < cycle ) 1181 1181 printk("\n[%s] thread[%x,%x] enter for socket[%x,%d] / addr %x / port %d / cycle %d\n", … … 1328 1328 thread_t * this = CURRENT_THREAD; 1329 1329 xptr_t client_xp = XPTR( local_cxy , this ); 1330 process_t * process = this->process; 1330 pid_t pid = this->process->pid; 1331 trdid_t trdid = this->trdid; 1331 1332 1332 1333 // get pointer on socket descriptor … … 1340 1341 #if DEBUG_SOCKET_CLOSE 1341 1342 uint32_t cycle = (uint32_t)hal_get_cycles(); 1342 pid_t pid = this->process->pid;1343 1343 if (DEBUG_SOCKET_CLOSE < cycle ) 1344 1344 printk("\n[%s] thread[%x,%x] enters for socket[%x,%d] / cycle %d\n", 1345 __FUNCTION__, pid, t his->trdid, pid, fdid, cycle );1345 __FUNCTION__, pid, trdid, pid, fdid, cycle ); 1346 1346 #endif 1347 1347 … … 1360 1360 1361 1361 printk("\n[ERROR] in %s : previous TX cmd on socket[%x,%d] / thread[%x,%x]\n", 1362 __FUNCTION__, p rocess->pid, fdid, process->pid, this->trdid );1362 __FUNCTION__, pid, fdid, pid, trdid ); 1363 1363 return -1; 1364 1364 } … … 1381 1381 if( cycle > DEBUG_DEV_NIC_TX ) 1382 1382 printk("\n[%s] thread[%x,%x] socket[%x,%d] %s / destroy socket / cycle %d\n", 1383 __FUNCTION__, this->process->pid, this->trdid, pid, fdid, 1384 socket_state_str( socket_state ), cycle ); 1383 __FUNCTION__, pid, trdid, pid, fdid, socket_state_str( socket_state ), cycle ); 1385 1384 #endif 1386 1385 // directly destroy socket … … 1398 1397 if( cycle > DEBUG_DEV_NIC_TX ) 1399 1398 printk("\n[%s] thread[%x,%x] socket[%x,%d] %s / destroy socket / cycle %d\n", 1400 __FUNCTION__, this->process->pid, this->trdid, pid, fdid, 1401 socket_state_str( socket_state ), cycle ); 1399 __FUNCTION__, pid, trdid, pid, fdid, socket_state_str( socket_state ), cycle ); 1402 1400 #endif 1403 1401 // directly destroy socket … … 1432 1430 if( DEBUG_SOCKET_CLOSE < cycle ) 1433 1431 printk("\n[%s] thread[%x,%x] socket[%x,%d] blocks on <IO> waiting close / cycle %d \n", 1434 __FUNCTION__, pid, t his->trdid, pid, fdid, cycle );1432 __FUNCTION__, pid, trdid, pid, fdid, cycle ); 1435 1433 #endif 1436 1434 // block itself and deschedule … … 1442 1440 if( DEBUG_SOCKET_CLOSE < cycle ) 1443 1441 printk("\n[%s] thread[%x,%x] socket[%x,%d] / resumes / cycle %d \n", 1444 __FUNCTION__, pid, t his->trdid, pid, fdid, cycle );1442 __FUNCTION__, pid, trdid, pid, fdid, cycle ); 1445 1443 #endif 1446 1444 // take socket lock … … 1474 1472 if( DEBUG_SOCKET_CLOSE < cycle ) 1475 1473 printk("\n[%s] thread[%x,%x] socket[%x,%d] / destroy socket / cycle %d\n", 1476 __FUNCTION__, pid, t his->trdid, pid, fdid, socket_state_str(socket_state) , cycle );1474 __FUNCTION__, pid, trdid, pid, fdid, socket_state_str(socket_state) , cycle ); 1477 1475 #endif 1478 1476 // destroy socket -
trunk/kernel/kern/ksocket.h
r662 r668 421 421 * It is called by a (local) server process to specify the max size of the CRQ queue 422 422 * for a socket identified by the <fdid> argument, that expect connection requests 423 * from one or several (remote) client processes. 423 * from one or several (remote) client processes. The selected socket CRQ is supposed 424 424 * to register all connections requests, whatever the client IP address and port values. 425 * 425 426 * This function applies only to a TCP socket, that must be in the BOUND state. 426 * The <fdid>socket is set to the LISTEN state.427 * The socket is set to the LISTEN state. 427 428 * It does not require any service from the NIC_TX and NIC_RX server threads. 428 429 * It can be called by a thread running in any cluster. … … 451 452 * with bind(), and listening for connections after a listen(). It blocks on the <IO> 452 453 * condition if the CRQ is empty. Otherwise, it get a pending connection request from 453 * the listening socket CRQ queue, and creates & initializes a new socket with 454 * the same properties as the listening socket, allocating a new file descriptor 455 * for this new socket. It returns the new socket fdid as well as the remote IP address 454 * the listening socket CRQ queue, and creates a new socket with the same properties 455 * as the listening socket, allocating a new file descriptor for this new socket. 456 * It computes the nic_channel index [k] from <remote_addr> and <remote_port> values, 457 * and initializes "remote_addr","remote_port", "nic_channel" in local socket. 458 * It returns the new socket fdid as well as the remote IP address 456 459 * and port, but only when the new socket is set to the ESTAB state. The new socket 457 460 * cannot accept connections, but the listening socket keeps open for new connections.
Note: See TracChangeset
for help on using the changeset viewer.