Re: [PATCH v3] stmmac: enable rx queues

2016-12-28 Thread Kishan Sandeep
On Wed, Dec 28, 2016 at 5:23 PM, Joao Pinto <joao.pi...@synopsys.com> wrote:
> Hello,
>
> Às 11:50 AM de 12/28/2016, Kishan Sandeep escreveu:
>> On Wed, Dec 28, 2016 at 4:45 PM, Joao Pinto <joao.pi...@synopsys.com> wrote:
>>
>>> When the hardware is synthesized with multiple queues, all queues are
>>> disabled for default. This patch adds the rx queues configuration.
>>> This patch was successfully tested in a Synopsys QoS Reference design.
>>>
>>> Signed-off-by: Joao Pinto <jpi...@synopsys.com>
>>> ---
>>> changes v2 -> v3 (Seraphin Bonnaffe):
>>> - GMAC_RX_QUEUE_CLEAR macro simplified
>>> changes v1 -> v2 (Niklas Cassel and Seraphin Bonnaffe):
>>> - Instead of using number of DMA channels, lets use number of queues
>>> - Create 2 flavors of RX queue enable Macros: AV and DCB (AV by default)
>>> - Make sure that the RX queue related bits are cleared before setting
>>> - Check if rx_queue_enable is available before executing
>>>
>>>  drivers/net/ethernet/stmicro/stmmac/common.h  |  5 +
>>>  drivers/net/ethernet/stmicro/stmmac/dwmac4.h  |  8 
>>>  drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 12 
>>>  drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c  |  5 +
>>>  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 22
>>> ++
>>>  5 files changed, 52 insertions(+)
>>>
>>> diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h
>>> b/drivers/net/ethernet/stmicro/stmmac/common.h
>>> index b13a144..6c96291 100644
>>> --- a/drivers/net/ethernet/stmicro/stmmac/common.h
>>> +++ b/drivers/net/ethernet/stmicro/stmmac/common.h
>>> @@ -323,6 +323,9 @@ struct dma_features {
>>> /* TX and RX number of channels */
>>> unsigned int number_rx_channel;
>>> unsigned int number_tx_channel;
>>> +   /* TX and RX number of queues */
>>> +   unsigned int number_rx_queues;
>>> +   unsigned int number_tx_queues;
>>>
>>
>> Looks like this variable is unused. Current driver is only supporting
>> single Tx channel/queue. ??  Is current driver not supporting
>> multichannel/multiqueue ?
>
> stmmac has a good base for multichannel / multiple queue support, but is only
> using 1 for now. My next task is to add complete multiple queues / channel to
> stmmac amd that is why number of tx queues is being available.
>
> Thanks!

I believe *number_tx_queues* variable can be added at the time support
we are providing.

One query is that what is the algorithm that we are following
currently in the driver if we enable multi Rx queues/DMA channels ?

Thanks!


Re: [PATCH v2] net: stmmac: bug fix to synchronize stmmac_open and stmmac_dvr_probe

2016-12-28 Thread Kishan Sandeep
On Wed, Dec 28, 2016 at 7:10 AM, Kweh, Hock Leong
 wrote:
>> -Original Message-
>> From: David Miller [mailto:da...@davemloft.net]
>> Sent: Wednesday, December 28, 2016 12:34 AM
>> To: Kweh, Hock Leong 
>> Cc: joao.pi...@synopsys.com; peppe.cavall...@st.com;
>> seraphin.bonna...@st.com; f.faine...@gmail.com;
>> alexandre.tor...@gmail.com; manab...@gmail.com; niklas.cas...@axis.com;
>> jo...@kernel.org; pa...@ucw.cz; Ong, Boon Leong
>> ; Voon, Weifeng ;
>> lars.pers...@axis.com; netdev@vger.kernel.org; linux-ker...@vger.kernel.org
>> Subject: Re: [PATCH v2] net: stmmac: bug fix to synchronize stmmac_open and
>> stmmac_dvr_probe
>>
>> From: "Kweh, Hock Leong"  
>> Date: Tue, 27 Dec 2016 22:42:36 +0800
>>
>> > From: "Kweh, Hock Leong" 
>>
>> You are not the author of this change, do not take credit for it.
>>
>> You have copied Florian's patch character by character, therefore
>> he is the author.
>>
>> You also didn't CC: the netdev mailing list properly.
>
> Noted & Thanks.
>
> Hi Florian, could you submit this fix from your side so that you are the 
> author.
> I will help to test out.
>
> Thanks & Regards,
> Wilson
>
I think you can give *--author* for giving author name. Try git commit
-am "commit message" --author="Author_name "


Re: [PATCH] netfilter: fix buffer null termination

2016-06-14 Thread Kishan Sandeep
Hi Pablo,

On Tue, Jun 14, 2016 at 8:38 PM, Pablo Neira Ayuso <pa...@netfilter.org> wrote:
> Cc'ing netfilter-devel.
>
> On Tue, Jun 14, 2016 at 07:39:27PM +0530, Kishan Sandeep wrote:
>> + netdev
>>
>> On Sat, Jun 11, 2016 at 10:18 AM, Kishan Sandeep
>> <sandeepkishan...@gmail.com> wrote:
>> > strncpy generally perferable fo non-terminated
>> > fixed-width strings. For NULL termination strlcpy
>> > is preferrable.
>> >
>> > Signed-off-by: Kishan Sandeep <sandeepkishan...@gmail.com>
>> > ---
>> >  net/netfilter/xt_repldata.h |2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/net/netfilter/xt_repldata.h b/net/netfilter/xt_repldata.h
>> > index 8fd3241..a460211 100644
>> > --- a/net/netfilter/xt_repldata.h
>> > +++ b/net/netfilter/xt_repldata.h
>> > @@ -28,7 +28,7 @@
>> > if (tbl == NULL) \
>> > return NULL; \
>> > term = (struct type##_error *)&(((char *)tbl)[term_offset]); \
>> > -   strncpy(tbl->repl.name, info->name, sizeof(tbl->repl.name)); \
>> > +   strlcpy(tbl->repl.name, info->name, sizeof(tbl->repl.name)); \
>
> I don't think this is actually fixing anything. Tables in x_tables
> have a known and fixed name that is defined from the kernel side, that
> is always smaller that the buffer we have there. So are you observing
> any real problem from there?
>
> Thanks.

Not observed any real problem. Here the string is not NULL terminated with
the use of strncpy - that is the problem. With the use of strlcpy we can make
the string to terminated properly.

Thanks!


Re: [PATCH] netfilter: fix buffer null termination

2016-06-14 Thread Kishan Sandeep
+ netdev

On Sat, Jun 11, 2016 at 10:18 AM, Kishan Sandeep
<sandeepkishan...@gmail.com> wrote:
> strncpy generally perferable fo non-terminated
> fixed-width strings. For NULL termination strlcpy
> is preferrable.
>
> Signed-off-by: Kishan Sandeep <sandeepkishan...@gmail.com>
> ---
>  net/netfilter/xt_repldata.h |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/netfilter/xt_repldata.h b/net/netfilter/xt_repldata.h
> index 8fd3241..a460211 100644
> --- a/net/netfilter/xt_repldata.h
> +++ b/net/netfilter/xt_repldata.h
> @@ -28,7 +28,7 @@
> if (tbl == NULL) \
> return NULL; \
> term = (struct type##_error *)&(((char *)tbl)[term_offset]); \
> -   strncpy(tbl->repl.name, info->name, sizeof(tbl->repl.name)); \
> +   strlcpy(tbl->repl.name, info->name, sizeof(tbl->repl.name)); \
> *term = (struct type##_error)typ2##_ERROR_INIT;  \
> tbl->repl.valid_hooks = hook_mask; \
> tbl->repl.num_entries = nhooks + 1; \
> --
> 1.7.9.5
>


Re: [PATCH] netfilter: fix buffer null termination

2016-06-13 Thread Kishan Sandeep
+ netdev

On Sat, Jun 11, 2016 at 10:18 AM, Kishan Sandeep
<sandeepkishan...@gmail.com> wrote:
> strncpy generally perferable fo non-terminated
> fixed-width strings. For NULL termination strlcpy
> is preferrable.
>
> Signed-off-by: Kishan Sandeep <sandeepkishan...@gmail.com>
> ---
>  net/netfilter/xt_repldata.h |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/netfilter/xt_repldata.h b/net/netfilter/xt_repldata.h
> index 8fd3241..a460211 100644
> --- a/net/netfilter/xt_repldata.h
> +++ b/net/netfilter/xt_repldata.h
> @@ -28,7 +28,7 @@
> if (tbl == NULL) \
> return NULL; \
> term = (struct type##_error *)&(((char *)tbl)[term_offset]); \
> -   strncpy(tbl->repl.name, info->name, sizeof(tbl->repl.name)); \
> +   strlcpy(tbl->repl.name, info->name, sizeof(tbl->repl.name)); \
> *term = (struct type##_error)typ2##_ERROR_INIT;  \
> tbl->repl.valid_hooks = hook_mask; \
> tbl->repl.num_entries = nhooks + 1; \
> --
> 1.7.9.5
>