On Mon, Jun 25, 2018 at 7:06 PM Amritha Nambiar
<amritha.namb...@intel.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.namb...@intel.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.

Reply via email to