RE: [PATCH net-next v2 4/9] nfp: extend flower add flow offload

2017-06-29 Thread David Laight
From: Jakub Kicinski > Sent: 29 June 2017 07:48 > On Thu, 29 Jun 2017 14:18:07 +0800, Yunsheng Lin wrote: > > > + if (mask_basic->n_proto) { > > cpu_to_be16(mask_basic->n_proto) Should be be16_to_cpu() > > remove cpu_to_be16 in case. > > Thanks, but this is incorrect. Byte swapping constants is

Re: [PATCH net-next v2 4/9] nfp: extend flower add flow offload

2017-06-28 Thread Jakub Kicinski
On Thu, 29 Jun 2017 14:18:07 +0800, Yunsheng Lin wrote: > > + if (mask_basic->n_proto) { > cpu_to_be16(mask_basic->n_proto) > remove cpu_to_be16 in case. Thanks, but this is incorrect. Byte swapping constants is done at compilation time - therefore it's preferred.

Re: [PATCH net-next v2 4/9] nfp: extend flower add flow offload

2017-06-28 Thread Yunsheng Lin
> + > + if (mask_basic->n_proto) { cpu_to_be16(mask_basic->n_proto) remove cpu_to_be16 in case. > + /* Ethernet type is present in the key. */ > + switch (key_basic->n_proto) { > + case cpu_to_be16(ETH_P_IP): > + key_layer |= NFP_FLOWER_L

[PATCH net-next v2 4/9] nfp: extend flower add flow offload

2017-06-28 Thread Simon Horman
From: Pieter Jansen van Vuuren Extends the flower flow add function by calculating which match fields are present in the flower offload structure and allocating the appropriate space to describe these. Signed-off-by: Pieter Jansen van Vuuren Signed-off-by: Simon Horman --- drivers/net/etherne