From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Nambiar, Amritha" Subject: Re: [net-next PATCH v4 3/7] net: sock: Change tx_queue_mapping in sock_common to unsigned short Date: Tue, 26 Jun 2018 17:00:16 -0700 Message-ID: <42622456-fa85-e96d-7d07-c3733779ff4b@intel.com> References: <152994950582.9733.3330634251364177102.stgit@anamhost.jf.intel.com> <152994986976.9733.18263514750793164132.stgit@anamhost.jf.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Network Development , David Miller , Alexander Duyck , "Samudrala, Sridhar" , Alexander Duyck , Eric Dumazet , Hannes Frederic Sowa , Tom Herbert To: Willem de Bruijn Return-path: Received: from mga05.intel.com ([192.55.52.43]:25995 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752169AbeF0AA0 (ORCPT ); Tue, 26 Jun 2018 20:00:26 -0400 In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 6/26/2018 3:58 AM, Willem de Bruijn wrote: > On Mon, Jun 25, 2018 at 7:06 PM Amritha Nambiar > 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 >> --- > >> 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.