Re: [PATCH v8] Bluetooth: compute LE flow credits based on recvbuf space

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/1/24 12:43, Pauli Virtanen wrote:
>> diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
>> index b6eac37f5b74..2dd77de38d1d 100644
>> --- a/include/net/bluetooth/l2cap.h
>> +++ b/include/net/bluetooth/l2cap.h
>> @@ -554,6 +554,9 @@ struct l2cap_chan {
>>   	__u16		tx_credits;
>>   	__u16		rx_credits;
>>   
>> +	/* estimated available receive buffer space or -1 if unknown */
>> +	ssize_t		rx_avail;
>> +
>>   	__u8		tx_state;
>>   	__u8		rx_state;
>>   
>> @@ -688,10 +691,15 @@ struct l2cap_user {
>>   /* ----- L2CAP socket info ----- */
>>   #define l2cap_pi(sk) ((struct l2cap_pinfo *) sk)
>>   
>> +struct l2cap_rx_busy {
>> +	struct list_head	list;
>> +	struct sk_buff		*skb;
>> +};
>> +
>>   struct l2cap_pinfo {
>>   	struct bt_sock		bt;
>>   	struct l2cap_chan	*chan;
>> -	struct sk_buff		*rx_busy_skb;
>> +	struct list_head	rx_busy;
> 
> Does it need to be custom list, or could this be skb queue instead
> (struct sk_buff_head)?
> 
> AFAICS, if these skb are going to go to __sock_queue_rcv_skb() they
> probably can be put to queue before that.

Yes, it must be a custom list. During dequeueing we don't know how many 
skbs will fit in the socket's receive buffer and I am not aware of any 
method to partially put an skb queue into a socket's receive buffer.

--
Sebastian Urban





[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux