From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [net-next PATCH v5 3/7] net: sock: Change tx_queue_mapping in sock_common to unsigned short Date: Fri, 29 Jun 2018 22:05:11 +0900 (KST) Message-ID: <20180629.220511.870587764860032381.davem@davemloft.net> References: <153013824922.4959.14633065530326138344.stgit@anamhost.jf.intel.com> <153013868881.4959.10801776136694650125.stgit@anamhost.jf.intel.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, alexander.h.duyck@intel.com, willemdebruijn.kernel@gmail.com, sridhar.samudrala@intel.com, alexander.duyck@gmail.com, edumazet@google.com, hannes@stressinduktion.org, tom@herbertland.com, tom@quantonium.net To: amritha.nambiar@intel.com Return-path: Received: from shards.monkeyblade.net ([23.128.96.9]:44852 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932553AbeF2NFP (ORCPT ); Fri, 29 Jun 2018 09:05:15 -0400 In-Reply-To: <153013868881.4959.10801776136694650125.stgit@anamhost.jf.intel.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Amritha Nambiar Date: Wed, 27 Jun 2018 15:31:28 -0700 > @@ -1681,17 +1681,25 @@ static inline int sk_receive_skb(struct sock *sk, struct sk_buff *skb, > > static inline void sk_tx_queue_set(struct sock *sk, int tx_queue) > { > + /* sk_tx_queue_mapping accept only upto a 16-bit value */ > + if (WARN_ON_ONCE((unsigned short)tx_queue > USHRT_MAX)) > + return; > sk->sk_tx_queue_mapping = tx_queue; > } > > +#define NO_QUEUE_MAPPING USHRT_MAX I think you need to check ">= USHRT_MAX" since USHRT_MAX is how you indicate no queue.