Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-24 Thread Matthias Kaehlcke
El Tue, Oct 24, 2017 at 10:03:56AM -0700 Jakub Kicinski ha dit: > On Tue, 24 Oct 2017 09:56:03 -0700, Matthias Kaehlcke wrote: > > > @@ -561,6 +568,6 @@ int __nfp_eth_set_speed(struct nfp_nsp *nsp, unsigned > > > int speed) > > > */ > > > int __nfp_eth_set_split(struct nfp_nsp *nsp, unsigned

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-24 Thread Matthias Kaehlcke
El Tue, Oct 24, 2017 at 10:03:56AM -0700 Jakub Kicinski ha dit: > On Tue, 24 Oct 2017 09:56:03 -0700, Matthias Kaehlcke wrote: > > > @@ -561,6 +568,6 @@ int __nfp_eth_set_speed(struct nfp_nsp *nsp, unsigned > > > int speed) > > > */ > > > int __nfp_eth_set_split(struct nfp_nsp *nsp, unsigned

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-24 Thread Jakub Kicinski
On Tue, 24 Oct 2017 09:56:03 -0700, Matthias Kaehlcke wrote: > > @@ -561,6 +568,6 @@ int __nfp_eth_set_speed(struct nfp_nsp *nsp, unsigned > > int speed) > > */ > > int __nfp_eth_set_split(struct nfp_nsp *nsp, unsigned int lanes) > > { > > - return nfp_eth_set_bit_config(nsp,

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-24 Thread Jakub Kicinski
On Tue, 24 Oct 2017 09:56:03 -0700, Matthias Kaehlcke wrote: > > @@ -561,6 +568,6 @@ int __nfp_eth_set_speed(struct nfp_nsp *nsp, unsigned > > int speed) > > */ > > int __nfp_eth_set_split(struct nfp_nsp *nsp, unsigned int lanes) > > { > > - return nfp_eth_set_bit_config(nsp,

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-24 Thread Matthias Kaehlcke
Hi Jakub, El Wed, Oct 04, 2017 at 11:17:24AM -0700 Jakub Kicinski ha dit: > On Wed, 4 Oct 2017 10:42:42 -0700, Manoj Gupta wrote: > > Hi Jakub, > > > > I had discussed about supporting this code with some clang developers. > > However, the consensus was this code relies on a specific GCC

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-24 Thread Matthias Kaehlcke
Hi Jakub, El Wed, Oct 04, 2017 at 11:17:24AM -0700 Jakub Kicinski ha dit: > On Wed, 4 Oct 2017 10:42:42 -0700, Manoj Gupta wrote: > > Hi Jakub, > > > > I had discussed about supporting this code with some clang developers. > > However, the consensus was this code relies on a specific GCC

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-09 Thread Matthias Kaehlcke
El Wed, Oct 04, 2017 at 07:13:26PM -0700 Manoj Gupta ha dit: > On Wed, Oct 4, 2017 at 7:06 PM, Jakub Kicinski > wrote: > > On Wed, 4 Oct 2017 18:50:04 -0700, Manoj Gupta wrote: > >> On Wed, Oct 4, 2017 at 5:56 PM, Jakub Kicinski wrote: > >> > On Wed, 4 Oct 2017

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-09 Thread Matthias Kaehlcke
El Wed, Oct 04, 2017 at 07:13:26PM -0700 Manoj Gupta ha dit: > On Wed, Oct 4, 2017 at 7:06 PM, Jakub Kicinski > wrote: > > On Wed, 4 Oct 2017 18:50:04 -0700, Manoj Gupta wrote: > >> On Wed, Oct 4, 2017 at 5:56 PM, Jakub Kicinski wrote: > >> > On Wed, 4 Oct 2017 17:38:22 -0700, Manoj Gupta wrote:

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-04 Thread Manoj Gupta
On Wed, Oct 4, 2017 at 7:06 PM, Jakub Kicinski wrote: > On Wed, 4 Oct 2017 18:50:04 -0700, Manoj Gupta wrote: >> On Wed, Oct 4, 2017 at 5:56 PM, Jakub Kicinski wrote: >> > On Wed, 4 Oct 2017 17:38:22 -0700, Manoj Gupta wrote: >> >> On Wed, Oct 4, 2017 at 4:25 PM,

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-04 Thread Manoj Gupta
On Wed, Oct 4, 2017 at 7:06 PM, Jakub Kicinski wrote: > On Wed, 4 Oct 2017 18:50:04 -0700, Manoj Gupta wrote: >> On Wed, Oct 4, 2017 at 5:56 PM, Jakub Kicinski wrote: >> > On Wed, 4 Oct 2017 17:38:22 -0700, Manoj Gupta wrote: >> >> On Wed, Oct 4, 2017 at 4:25 PM, Jakub Kicinski wrote: >> >> > On

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-04 Thread Jakub Kicinski
On Wed, 4 Oct 2017 18:50:04 -0700, Manoj Gupta wrote: > On Wed, Oct 4, 2017 at 5:56 PM, Jakub Kicinski wrote: > > On Wed, 4 Oct 2017 17:38:22 -0700, Manoj Gupta wrote: > >> On Wed, Oct 4, 2017 at 4:25 PM, Jakub Kicinski wrote: > >> > On Wed, 4 Oct 2017 16:16:49 -0700, Matthias Kaehlcke wrote:

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-04 Thread Jakub Kicinski
On Wed, 4 Oct 2017 18:50:04 -0700, Manoj Gupta wrote: > On Wed, Oct 4, 2017 at 5:56 PM, Jakub Kicinski wrote: > > On Wed, 4 Oct 2017 17:38:22 -0700, Manoj Gupta wrote: > >> On Wed, Oct 4, 2017 at 4:25 PM, Jakub Kicinski wrote: > >> > On Wed, 4 Oct 2017 16:16:49 -0700, Matthias Kaehlcke wrote:

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-04 Thread Manoj Gupta
On Wed, Oct 4, 2017 at 5:56 PM, Jakub Kicinski wrote: > On Wed, 4 Oct 2017 17:38:22 -0700, Manoj Gupta wrote: >> On Wed, Oct 4, 2017 at 4:25 PM, Jakub Kicinski wrote: >> > On Wed, 4 Oct 2017 16:16:49 -0700, Matthias Kaehlcke wrote: >> >> > > Thanks for the

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-04 Thread Manoj Gupta
On Wed, Oct 4, 2017 at 5:56 PM, Jakub Kicinski wrote: > On Wed, 4 Oct 2017 17:38:22 -0700, Manoj Gupta wrote: >> On Wed, Oct 4, 2017 at 4:25 PM, Jakub Kicinski wrote: >> > On Wed, 4 Oct 2017 16:16:49 -0700, Matthias Kaehlcke wrote: >> >> > > Thanks for the suggestion. This seems a viable

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-04 Thread Jakub Kicinski
On Wed, 4 Oct 2017 17:38:22 -0700, Manoj Gupta wrote: > On Wed, Oct 4, 2017 at 4:25 PM, Jakub Kicinski wrote: > > On Wed, 4 Oct 2017 16:16:49 -0700, Matthias Kaehlcke wrote: > >> > > Thanks for the suggestion. This seems a viable alternative if David > >> > > and the NFP owners can live without

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-04 Thread Jakub Kicinski
On Wed, 4 Oct 2017 17:38:22 -0700, Manoj Gupta wrote: > On Wed, Oct 4, 2017 at 4:25 PM, Jakub Kicinski wrote: > > On Wed, 4 Oct 2017 16:16:49 -0700, Matthias Kaehlcke wrote: > >> > > Thanks for the suggestion. This seems a viable alternative if David > >> > > and the NFP owners can live without

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-04 Thread Manoj Gupta
Hi Jakub, On Wed, Oct 4, 2017 at 4:25 PM, Jakub Kicinski wrote: > On Wed, 4 Oct 2017 16:16:49 -0700, Matthias Kaehlcke wrote: >> > > Thanks for the suggestion. This seems a viable alternative if David >> > > and the NFP owners can live without the extra checking

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-04 Thread Manoj Gupta
Hi Jakub, On Wed, Oct 4, 2017 at 4:25 PM, Jakub Kicinski wrote: > On Wed, 4 Oct 2017 16:16:49 -0700, Matthias Kaehlcke wrote: >> > > Thanks for the suggestion. This seems a viable alternative if David >> > > and the NFP owners can live without the extra checking provided by >> > >

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-04 Thread Jakub Kicinski
On Wed, 4 Oct 2017 16:16:49 -0700, Matthias Kaehlcke wrote: > > > Thanks for the suggestion. This seems a viable alternative if David > > > and the NFP owners can live without the extra checking provided by > > > __BF_FIELD_CHECK. > > > > The reason the __BF_FIELD_CHECK refuses to compile

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-04 Thread Jakub Kicinski
On Wed, 4 Oct 2017 16:16:49 -0700, Matthias Kaehlcke wrote: > > > Thanks for the suggestion. This seems a viable alternative if David > > > and the NFP owners can live without the extra checking provided by > > > __BF_FIELD_CHECK. > > > > The reason the __BF_FIELD_CHECK refuses to compile

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-04 Thread Matthias Kaehlcke
Hi Jakub, El Wed, Oct 04, 2017 at 03:22:03PM -0700 Jakub Kicinski ha dit: > On Wed, 4 Oct 2017 11:49:57 -0700, Matthias Kaehlcke wrote: > > Hi Joe, > > > > El Wed, Oct 04, 2017 at 11:07:19AM -0700 Joe Perches ha dit: > > > > > On Tue, 2017-10-03 at 13:05 -0700, Matthias Kaehlcke wrote: > > >

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-04 Thread Matthias Kaehlcke
Hi Jakub, El Wed, Oct 04, 2017 at 03:22:03PM -0700 Jakub Kicinski ha dit: > On Wed, 4 Oct 2017 11:49:57 -0700, Matthias Kaehlcke wrote: > > Hi Joe, > > > > El Wed, Oct 04, 2017 at 11:07:19AM -0700 Joe Perches ha dit: > > > > > On Tue, 2017-10-03 at 13:05 -0700, Matthias Kaehlcke wrote: > > >

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-04 Thread Jakub Kicinski
On Wed, 4 Oct 2017 11:49:57 -0700, Matthias Kaehlcke wrote: > Hi Joe, > > El Wed, Oct 04, 2017 at 11:07:19AM -0700 Joe Perches ha dit: > > > On Tue, 2017-10-03 at 13:05 -0700, Matthias Kaehlcke wrote: > > > nfp_eth_set_bit_config() is marked as __always_inline to allow gcc to > > > identify

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-04 Thread Jakub Kicinski
On Wed, 4 Oct 2017 11:49:57 -0700, Matthias Kaehlcke wrote: > Hi Joe, > > El Wed, Oct 04, 2017 at 11:07:19AM -0700 Joe Perches ha dit: > > > On Tue, 2017-10-03 at 13:05 -0700, Matthias Kaehlcke wrote: > > > nfp_eth_set_bit_config() is marked as __always_inline to allow gcc to > > > identify

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-04 Thread Matthias Kaehlcke
Hi Joe, El Wed, Oct 04, 2017 at 11:07:19AM -0700 Joe Perches ha dit: > On Tue, 2017-10-03 at 13:05 -0700, Matthias Kaehlcke wrote: > > nfp_eth_set_bit_config() is marked as __always_inline to allow gcc to > > identify the 'mask' parameter as known to be constant at compile time, > > which is

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-04 Thread Matthias Kaehlcke
Hi Joe, El Wed, Oct 04, 2017 at 11:07:19AM -0700 Joe Perches ha dit: > On Tue, 2017-10-03 at 13:05 -0700, Matthias Kaehlcke wrote: > > nfp_eth_set_bit_config() is marked as __always_inline to allow gcc to > > identify the 'mask' parameter as known to be constant at compile time, > > which is

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-04 Thread Matthias Kaehlcke
El Wed, Oct 04, 2017 at 11:17:24AM -0700 Jakub Kicinski ha dit: > On Wed, 4 Oct 2017 10:42:42 -0700, Manoj Gupta wrote: > > Hi Jakub, > > > > I had discussed about supporting this code with some clang developers. > > However, the consensus was this code relies on a specific GCC optimizer > >

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-04 Thread Matthias Kaehlcke
El Wed, Oct 04, 2017 at 11:17:24AM -0700 Jakub Kicinski ha dit: > On Wed, 4 Oct 2017 10:42:42 -0700, Manoj Gupta wrote: > > Hi Jakub, > > > > I had discussed about supporting this code with some clang developers. > > However, the consensus was this code relies on a specific GCC optimizer > >

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-04 Thread Jakub Kicinski
On Wed, 4 Oct 2017 10:42:42 -0700, Manoj Gupta wrote: > Hi Jakub, > > I had discussed about supporting this code with some clang developers. > However, the consensus was this code relies on a specific GCC optimizer > behavior and Clang does not share the same behavior by design. Hm. I find

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-04 Thread Jakub Kicinski
On Wed, 4 Oct 2017 10:42:42 -0700, Manoj Gupta wrote: > Hi Jakub, > > I had discussed about supporting this code with some clang developers. > However, the consensus was this code relies on a specific GCC optimizer > behavior and Clang does not share the same behavior by design. Hm. I find

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-04 Thread Joe Perches
On Tue, 2017-10-03 at 13:05 -0700, Matthias Kaehlcke wrote: > nfp_eth_set_bit_config() is marked as __always_inline to allow gcc to > identify the 'mask' parameter as known to be constant at compile time, > which is required to use the FIELD_GET() macro. > > The forced inlining does the trick for

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-04 Thread Joe Perches
On Tue, 2017-10-03 at 13:05 -0700, Matthias Kaehlcke wrote: > nfp_eth_set_bit_config() is marked as __always_inline to allow gcc to > identify the 'mask' parameter as known to be constant at compile time, > which is required to use the FIELD_GET() macro. > > The forced inlining does the trick for

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-04 Thread David Miller
From: Matthias Kaehlcke Date: Wed, 4 Oct 2017 10:42:15 -0700 > Given that this doesn't seem to be a widespread issue in the kernel > personally I would consider the conversion to a macro in this case an > acceptable solution, though it is definitely ugly. However I'm not the >

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-04 Thread David Miller
From: Matthias Kaehlcke Date: Wed, 4 Oct 2017 10:42:15 -0700 > Given that this doesn't seem to be a widespread issue in the kernel > personally I would consider the conversion to a macro in this case an > acceptable solution, though it is definitely ugly. However I'm not the > owner of the

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-04 Thread Matthias Kaehlcke
El Tue, Oct 03, 2017 at 02:50:00PM -0700 Jakub Kicinski ha dit: > On Tue, 3 Oct 2017 13:05:46 -0700, Matthias Kaehlcke wrote: > > nfp_eth_set_bit_config() is marked as __always_inline to allow gcc to > > identify the 'mask' parameter as known to be constant at compile time, > > which is required

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-04 Thread Matthias Kaehlcke
El Tue, Oct 03, 2017 at 02:50:00PM -0700 Jakub Kicinski ha dit: > On Tue, 3 Oct 2017 13:05:46 -0700, Matthias Kaehlcke wrote: > > nfp_eth_set_bit_config() is marked as __always_inline to allow gcc to > > identify the 'mask' parameter as known to be constant at compile time, > > which is required

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-03 Thread Jakub Kicinski
On Tue, 3 Oct 2017 13:05:46 -0700, Matthias Kaehlcke wrote: > nfp_eth_set_bit_config() is marked as __always_inline to allow gcc to > identify the 'mask' parameter as known to be constant at compile time, > which is required to use the FIELD_GET() macro. > > The forced inlining does the trick

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-03 Thread Jakub Kicinski
On Tue, 3 Oct 2017 13:05:46 -0700, Matthias Kaehlcke wrote: > nfp_eth_set_bit_config() is marked as __always_inline to allow gcc to > identify the 'mask' parameter as known to be constant at compile time, > which is required to use the FIELD_GET() macro. > > The forced inlining does the trick