mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 17:02:45 +00:00 
			
		
		
		
	Kernel: Plumb packet receive timestamp from NetworkAdapter to Socket::recvfrom
Since the receiving socket isn't yet known at packet receive time, keep timestamps for all packets. This is useful for keeping statistics about in-kernel queue latencies in the future, and it can be used to implement SO_TIMESTAMP.
This commit is contained in:
		
							parent
							
								
									b36a2d6686
								
							
						
					
					
						commit
						416d470d07
					
				
					 10 changed files with 52 additions and 37 deletions
				
			
		|  | @ -249,7 +249,8 @@ ssize_t Process::sys$recvmsg(int sockfd, Userspace<struct msghdr*> user_msg, int | |||
|     auto data_buffer = UserOrKernelBuffer::for_user_buffer((u8*)iovs[0].iov_base, iovs[0].iov_len); | ||||
|     if (!data_buffer.has_value()) | ||||
|         return -EFAULT; | ||||
|     auto result = socket.recvfrom(*description, data_buffer.value(), iovs[0].iov_len, flags, user_addr, user_addr_length); | ||||
|     timeval timestamp = { 0, 0 }; | ||||
|     auto result = socket.recvfrom(*description, data_buffer.value(), iovs[0].iov_len, flags, user_addr, user_addr_length, timestamp); | ||||
|     if (flags & MSG_DONTWAIT) | ||||
|         description->set_blocking(original_blocking); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Nico Weber
						Nico Weber