[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <42622456-fa85-e96d-7d07-c3733779ff4b@intel.com>
Date: Tue, 26 Jun 2018 17:00:16 -0700
From: "Nambiar, Amritha" <amritha.nambiar@...el.com>
To: Willem de Bruijn <willemdebruijn.kernel@...il.com>
Cc: Network Development <netdev@...r.kernel.org>,
David Miller <davem@...emloft.net>,
Alexander Duyck <alexander.h.duyck@...el.com>,
"Samudrala, Sridhar" <sridhar.samudrala@...el.com>,
Alexander Duyck <alexander.duyck@...il.com>,
Eric Dumazet <edumazet@...gle.com>,
Hannes Frederic Sowa <hannes@...essinduktion.org>,
Tom Herbert <tom@...bertland.com>
Subject: Re: [net-next PATCH v4 3/7] net: sock: Change tx_queue_mapping in
sock_common to unsigned short
On 6/26/2018 3:58 AM, Willem de Bruijn wrote:
> On Mon, Jun 25, 2018 at 7:06 PM Amritha Nambiar
> <amritha.nambiar@...el.com> wrote:
>>
>> Change 'skc_tx_queue_mapping' field in sock_common structure from
>> 'int' to 'unsigned short' type with 0 indicating unset and
>> a positive queue value being set. This way it is consistent with
>> the queue_mapping field in the sk_buff. This will also accommodate
>> adding a new 'unsigned short' field in sock_common in the next
>> patch for rx_queue_mapping.
>>
>> Signed-off-by: Amritha Nambiar <amritha.nambiar@...el.com>
>> ---
>
>> static inline void sk_tx_queue_set(struct sock *sk, int tx_queue)
>> {
>> - sk->sk_tx_queue_mapping = tx_queue;
>> + /* sk_tx_queue_mapping accept only upto a 16-bit value */
>> + WARN_ON((unsigned short)tx_queue > USHRT_MAX);
>> + sk->sk_tx_queue_mapping = tx_queue + 1;
>> }
>
> WARN_ON_ONCE to avoid flooding the kernel buffer.
>
Will fix.
Powered by blists - more mailing lists