Message ID | b6f44c16abea1693dcc1333517778bd7a3e0b0f5.1490375512.git.jpinto@synopsys.com |
---|---|
State | Changes Requested, archived |
Delegated to: | David Miller |
Headers | show |
On Fri, Mar 24, 2017 at 05:16:45PM +0000, Joao Pinto wrote: > For cores that have more than 1 TX queue configured, the kernel would crash, > since only one TX queue is permitted by default. > > Signed-off-by: Joao Pinto <jpinto@synopsys.com> > --- > drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > index 3827952..1eab084 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > @@ -3429,7 +3429,7 @@ static int stmmac_poll(struct napi_struct *napi, int budget) > struct stmmac_rx_queue *rx_q = > container_of(napi, struct stmmac_rx_queue, napi); > struct stmmac_priv *priv = rx_q->priv_data; > - u32 tx_count = priv->dma_cap.number_tx_queues; > + u32 tx_count = priv->plat->tx_queues_to_use; > u32 chan = rx_q->queue_index; > u32 work_done = 0; > u32 queue = 0; > -- > 2.9.3 > This patch fix the performance issue on dwmac-sun8i only. The dwmac-sunxi is still broken.
Às 7:26 AM de 3/25/2017, Corentin Labbe escreveu: > On Fri, Mar 24, 2017 at 05:16:45PM +0000, Joao Pinto wrote: >> For cores that have more than 1 TX queue configured, the kernel would crash, >> since only one TX queue is permitted by default. >> >> Signed-off-by: Joao Pinto <jpinto@synopsys.com> >> --- >> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >> index 3827952..1eab084 100644 >> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >> @@ -3429,7 +3429,7 @@ static int stmmac_poll(struct napi_struct *napi, int budget) >> struct stmmac_rx_queue *rx_q = >> container_of(napi, struct stmmac_rx_queue, napi); >> struct stmmac_priv *priv = rx_q->priv_data; >> - u32 tx_count = priv->dma_cap.number_tx_queues; >> + u32 tx_count = priv->plat->tx_queues_to_use; >> u32 chan = rx_q->queue_index; >> u32 work_done = 0; >> u32 queue = 0; >> -- >> 2.9.3 >> > > This patch fix the performance issue on dwmac-sun8i only. Ok, great! > The dwmac-sunxi is still broken. > What is the difference between the setups? Thanks, Joao
On Mon, Mar 27, 2017 at 10:04:57AM +0100, Joao Pinto wrote: > Às 7:26 AM de 3/25/2017, Corentin Labbe escreveu: > > On Fri, Mar 24, 2017 at 05:16:45PM +0000, Joao Pinto wrote: > >> For cores that have more than 1 TX queue configured, the kernel would crash, > >> since only one TX queue is permitted by default. > >> > >> Signed-off-by: Joao Pinto <jpinto@synopsys.com> > >> --- > >> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > >> index 3827952..1eab084 100644 > >> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > >> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > >> @@ -3429,7 +3429,7 @@ static int stmmac_poll(struct napi_struct *napi, int budget) > >> struct stmmac_rx_queue *rx_q = > >> container_of(napi, struct stmmac_rx_queue, napi); > >> struct stmmac_priv *priv = rx_q->priv_data; > >> - u32 tx_count = priv->dma_cap.number_tx_queues; > >> + u32 tx_count = priv->plat->tx_queues_to_use; > >> u32 chan = rx_q->queue_index; > >> u32 work_done = 0; > >> u32 queue = 0; > >> -- > >> 2.9.3 > >> > > > > This patch fix the performance issue on dwmac-sun8i only. > > Ok, great! > Sorry, in the we, I see that my gigabit dwmac-sun8i didnt work... (but didnt have time to find why). > > The dwmac-sunxi is still broken. > > > > What is the difference between the setups? dwmac-sun8i use chain mode, dwmac-sunxi use ring mode
Às 10:09 AM de 3/27/2017, Corentin Labbe escreveu: > On Mon, Mar 27, 2017 at 10:04:57AM +0100, Joao Pinto wrote: >> Às 7:26 AM de 3/25/2017, Corentin Labbe escreveu: >>> On Fri, Mar 24, 2017 at 05:16:45PM +0000, Joao Pinto wrote: >>>> For cores that have more than 1 TX queue configured, the kernel would crash, >>>> since only one TX queue is permitted by default. >>>> >>>> Signed-off-by: Joao Pinto <jpinto@synopsys.com> >>>> --- >>>> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- >>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>> >>>> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >>>> index 3827952..1eab084 100644 >>>> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >>>> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >>>> @@ -3429,7 +3429,7 @@ static int stmmac_poll(struct napi_struct *napi, int budget) >>>> struct stmmac_rx_queue *rx_q = >>>> container_of(napi, struct stmmac_rx_queue, napi); >>>> struct stmmac_priv *priv = rx_q->priv_data; >>>> - u32 tx_count = priv->dma_cap.number_tx_queues; >>>> + u32 tx_count = priv->plat->tx_queues_to_use; >>>> u32 chan = rx_q->queue_index; >>>> u32 work_done = 0; >>>> u32 queue = 0; >>>> -- >>>> 2.9.3 >>>> >>> >>> This patch fix the performance issue on dwmac-sun8i only. >> >> Ok, great! >> > > Sorry, in the we, I see that my gigabit dwmac-sun8i didnt work... (but didnt have time to find why). > >>> The dwmac-sunxi is still broken. Ok, let's see what others report. >>> >> >> What is the difference between the setups? > > dwmac-sun8i use chain mode, dwmac-sunxi use ring mode > @Thierry and Niklas: Hi! Your setup is working well with these 2 fix patches? Thnaks.
On 03/27/2017 11:12 AM, Joao Pinto wrote: > Às 10:09 AM de 3/27/2017, Corentin Labbe escreveu: >> On Mon, Mar 27, 2017 at 10:04:57AM +0100, Joao Pinto wrote: >>> Às 7:26 AM de 3/25/2017, Corentin Labbe escreveu: >>>> On Fri, Mar 24, 2017 at 05:16:45PM +0000, Joao Pinto wrote: >>>>> For cores that have more than 1 TX queue configured, the kernel would crash, >>>>> since only one TX queue is permitted by default. >>>>> >>>>> Signed-off-by: Joao Pinto <jpinto@synopsys.com> >>>>> --- >>>>> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- >>>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>>> >>>>> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >>>>> index 3827952..1eab084 100644 >>>>> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >>>>> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >>>>> @@ -3429,7 +3429,7 @@ static int stmmac_poll(struct napi_struct *napi, int budget) >>>>> struct stmmac_rx_queue *rx_q = >>>>> container_of(napi, struct stmmac_rx_queue, napi); >>>>> struct stmmac_priv *priv = rx_q->priv_data; >>>>> - u32 tx_count = priv->dma_cap.number_tx_queues; >>>>> + u32 tx_count = priv->plat->tx_queues_to_use; >>>>> u32 chan = rx_q->queue_index; >>>>> u32 work_done = 0; >>>>> u32 queue = 0; >>>>> -- >>>>> 2.9.3 >>>>> >>>> >>>> This patch fix the performance issue on dwmac-sun8i only. >>> >>> Ok, great! >>> >> >> Sorry, in the we, I see that my gigabit dwmac-sun8i didnt work... (but didnt have time to find why). >> >>>> The dwmac-sunxi is still broken. > > Ok, let's see what others report. > >>>> >>> >>> What is the difference between the setups? >> >> dwmac-sun8i use chain mode, dwmac-sunxi use ring mode >> > > @Thierry and Niklas: Hi! Your setup is working well with these 2 fix patches? > Hello Joao, I have not tested these 2 patches. Previously, when I tested next-20170321, artpec-6 SoC got TX queue timeouts. When testing today's linux-next, next-20170327, things are working again :) So I guess one of the following patches fixed our problem: 270c7759fbbc net: stmmac: add set_mac to the stmmac_ops b4f0a6615556 net: stmmac: fix dma operation mode config for older versions 33e85b8dd69e net: stmmac: Restore DT backwards-compatibility f39768744fd6 net: stmmac: Always enable MAC RX queues abe80fdc6ee6 net: stmmac: RX queue routing configuration a8f5102af2a7 net: stmmac: TX and RX queue priority configuration aff3d9eff843 net: stmmac: enable multiple buffers Regards, Niklas
Às 2:28 PM de 3/27/2017, Niklas Cassel escreveu: > > > On 03/27/2017 11:12 AM, Joao Pinto wrote: >> Às 10:09 AM de 3/27/2017, Corentin Labbe escreveu: >>> On Mon, Mar 27, 2017 at 10:04:57AM +0100, Joao Pinto wrote: >>>> Às 7:26 AM de 3/25/2017, Corentin Labbe escreveu: >>>>> On Fri, Mar 24, 2017 at 05:16:45PM +0000, Joao Pinto wrote: >>>>>> For cores that have more than 1 TX queue configured, the kernel would crash, >>>>>> since only one TX queue is permitted by default. >>>>>> >>>>>> Signed-off-by: Joao Pinto <jpinto@synopsys.com> >>>>>> --- >>>>>> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- >>>>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>>>> >>>>>> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >>>>>> index 3827952..1eab084 100644 >>>>>> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >>>>>> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >>>>>> @@ -3429,7 +3429,7 @@ static int stmmac_poll(struct napi_struct *napi, int budget) >>>>>> struct stmmac_rx_queue *rx_q = >>>>>> container_of(napi, struct stmmac_rx_queue, napi); >>>>>> struct stmmac_priv *priv = rx_q->priv_data; >>>>>> - u32 tx_count = priv->dma_cap.number_tx_queues; >>>>>> + u32 tx_count = priv->plat->tx_queues_to_use; >>>>>> u32 chan = rx_q->queue_index; >>>>>> u32 work_done = 0; >>>>>> u32 queue = 0; >>>>>> -- >>>>>> 2.9.3 >>>>>> >>>>> >>>>> This patch fix the performance issue on dwmac-sun8i only. >>>> >>>> Ok, great! >>>> >>> >>> Sorry, in the we, I see that my gigabit dwmac-sun8i didnt work... (but didnt have time to find why). >>> >>>>> The dwmac-sunxi is still broken. >> >> Ok, let's see what others report. >> >>>>> >>>> >>>> What is the difference between the setups? >>> >>> dwmac-sun8i use chain mode, dwmac-sunxi use ring mode >>> >> >> @Thierry and Niklas: Hi! Your setup is working well with these 2 fix patches? >> > > Hello Joao, > > I have not tested these 2 patches. > > Previously, when I tested next-20170321, artpec-6 SoC got TX queue timeouts. > When testing today's linux-next, next-20170327, things are working again :) > > > So I guess one of the following patches fixed our problem: > > 270c7759fbbc net: stmmac: add set_mac to the stmmac_ops > b4f0a6615556 net: stmmac: fix dma operation mode config for older versions > 33e85b8dd69e net: stmmac: Restore DT backwards-compatibility > f39768744fd6 net: stmmac: Always enable MAC RX queues > abe80fdc6ee6 net: stmmac: RX queue routing configuration > a8f5102af2a7 net: stmmac: TX and RX queue priority configuration > aff3d9eff843 net: stmmac: enable multiple buffers Yes for sure :) Great! Thanks. > > Regards, > Niklas >
Hin Thierry, Às 2:34 PM de 3/27/2017, Joao Pinto escreveu: > Às 2:28 PM de 3/27/2017, Niklas Cassel escreveu: >> >> >> On 03/27/2017 11:12 AM, Joao Pinto wrote: >>> Às 10:09 AM de 3/27/2017, Corentin Labbe escreveu: >>>> On Mon, Mar 27, 2017 at 10:04:57AM +0100, Joao Pinto wrote: >>>>> Às 7:26 AM de 3/25/2017, Corentin Labbe escreveu: >>>>>> On Fri, Mar 24, 2017 at 05:16:45PM +0000, Joao Pinto wrote: >>>>>>> For cores that have more than 1 TX queue configured, the kernel would crash, >>>>>>> since only one TX queue is permitted by default. >>>>>>> >>>>>>> Signed-off-by: Joao Pinto <jpinto@synopsys.com> >>>>>>> --- >>>>>>> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- >>>>>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>>>>> >>>>>>> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >>>>>>> index 3827952..1eab084 100644 >>>>>>> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >>>>>>> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >>>>>>> @@ -3429,7 +3429,7 @@ static int stmmac_poll(struct napi_struct *napi, int budget) >>>>>>> struct stmmac_rx_queue *rx_q = >>>>>>> container_of(napi, struct stmmac_rx_queue, napi); >>>>>>> struct stmmac_priv *priv = rx_q->priv_data; >>>>>>> - u32 tx_count = priv->dma_cap.number_tx_queues; >>>>>>> + u32 tx_count = priv->plat->tx_queues_to_use; >>>>>>> u32 chan = rx_q->queue_index; >>>>>>> u32 work_done = 0; >>>>>>> u32 queue = 0; >>>>>>> -- >>>>>>> 2.9.3 >>>>>>> >>>>>> >>>>>> This patch fix the performance issue on dwmac-sun8i only. >>>>> >>>>> Ok, great! >>>>> >>>> >>>> Sorry, in the we, I see that my gigabit dwmac-sun8i didnt work... (but didnt have time to find why). >>>> >>>>>> The dwmac-sunxi is still broken. >>> >>> Ok, let's see what others report. >>> >>>>>> >>>>> >>>>> What is the difference between the setups? >>>> >>>> dwmac-sun8i use chain mode, dwmac-sunxi use ring mode >>>> >>> >>> @Thierry and Niklas: Hi! Your setup is working well with these 2 fix patches? >>> >> >> Hello Joao, >> >> I have not tested these 2 patches. >> >> Previously, when I tested next-20170321, artpec-6 SoC got TX queue timeouts. >> When testing today's linux-next, next-20170327, things are working again :) >> >> >> So I guess one of the following patches fixed our problem: >> >> 270c7759fbbc net: stmmac: add set_mac to the stmmac_ops >> b4f0a6615556 net: stmmac: fix dma operation mode config for older versions >> 33e85b8dd69e net: stmmac: Restore DT backwards-compatibility >> f39768744fd6 net: stmmac: Always enable MAC RX queues >> abe80fdc6ee6 net: stmmac: RX queue routing configuration >> a8f5102af2a7 net: stmmac: TX and RX queue priority configuration >> aff3d9eff843 net: stmmac: enable multiple buffers > > Yes for sure :) Great! Thanks. Could you please confirm your setup works with these final 2 patches? Thanks. > >> >> Regards, >> Niklas >> >
Hi David, Às 7:26 AM de 3/25/2017, Corentin Labbe escreveu: > On Fri, Mar 24, 2017 at 05:16:45PM +0000, Joao Pinto wrote: >> For cores that have more than 1 TX queue configured, the kernel would crash, >> since only one TX queue is permitted by default. >> >> Signed-off-by: Joao Pinto <jpinto@synopsys.com> >> --- >> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >> index 3827952..1eab084 100644 >> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >> @@ -3429,7 +3429,7 @@ static int stmmac_poll(struct napi_struct *napi, int budget) >> struct stmmac_rx_queue *rx_q = >> container_of(napi, struct stmmac_rx_queue, napi); >> struct stmmac_priv *priv = rx_q->priv_data; >> - u32 tx_count = priv->dma_cap.number_tx_queues; >> + u32 tx_count = priv->plat->tx_queues_to_use; >> u32 chan = rx_q->queue_index; >> u32 work_done = 0; >> u32 queue = 0; >> -- >> 2.9.3 >> > > This patch fix the performance issue on dwmac-sun8i only. > The dwmac-sunxi is still broken. > This patch series can be upstreamed please, since they make 2 fixes, one of them solving the problem in dwmac-sun8i. Thanks.
On Mon, Mar 27, 2017 at 04:26:48PM +0100, Joao Pinto wrote: > Hi David, > > Às 7:26 AM de 3/25/2017, Corentin Labbe escreveu: > > On Fri, Mar 24, 2017 at 05:16:45PM +0000, Joao Pinto wrote: > >> For cores that have more than 1 TX queue configured, the kernel would crash, > >> since only one TX queue is permitted by default. > >> > >> Signed-off-by: Joao Pinto <jpinto@synopsys.com> > >> --- > >> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > >> index 3827952..1eab084 100644 > >> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > >> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > >> @@ -3429,7 +3429,7 @@ static int stmmac_poll(struct napi_struct *napi, int budget) > >> struct stmmac_rx_queue *rx_q = > >> container_of(napi, struct stmmac_rx_queue, napi); > >> struct stmmac_priv *priv = rx_q->priv_data; > >> - u32 tx_count = priv->dma_cap.number_tx_queues; > >> + u32 tx_count = priv->plat->tx_queues_to_use; > >> u32 chan = rx_q->queue_index; > >> u32 work_done = 0; > >> u32 queue = 0; > >> -- > >> 2.9.3 > >> > > > > This patch fix the performance issue on dwmac-sun8i only. > > The dwmac-sunxi is still broken. > > > > This patch series can be upstreamed please, since they make 2 fixes, one of them > solving the problem in dwmac-sun8i. > > Thanks. As I said in a previous answer, finaly dwmac-sun8i is still broken. Adding thoses 2 patch will just made the revert harder. Regards
Às 6:00 PM de 3/27/2017, Corentin Labbe escreveu: > On Mon, Mar 27, 2017 at 04:26:48PM +0100, Joao Pinto wrote: >> Hi David, >> >> Às 7:26 AM de 3/25/2017, Corentin Labbe escreveu: >>> On Fri, Mar 24, 2017 at 05:16:45PM +0000, Joao Pinto wrote: >>>> For cores that have more than 1 TX queue configured, the kernel would crash, >>>> since only one TX queue is permitted by default. >>>> >>>> Signed-off-by: Joao Pinto <jpinto@synopsys.com> >>>> --- >>>> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- >>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>> >>>> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >>>> index 3827952..1eab084 100644 >>>> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >>>> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >>>> @@ -3429,7 +3429,7 @@ static int stmmac_poll(struct napi_struct *napi, int budget) >>>> struct stmmac_rx_queue *rx_q = >>>> container_of(napi, struct stmmac_rx_queue, napi); >>>> struct stmmac_priv *priv = rx_q->priv_data; >>>> - u32 tx_count = priv->dma_cap.number_tx_queues; >>>> + u32 tx_count = priv->plat->tx_queues_to_use; >>>> u32 chan = rx_q->queue_index; >>>> u32 work_done = 0; >>>> u32 queue = 0; >>>> -- >>>> 2.9.3 >>>> >>> >>> This patch fix the performance issue on dwmac-sun8i only. >>> The dwmac-sunxi is still broken. >>> >> >> This patch series can be upstreamed please, since they make 2 fixes, one of them >> solving the problem in dwmac-sun8i. >> >> Thanks. > > As I said in a previous answer, finaly dwmac-sun8i is still broken. > Adding thoses 2 patch will just made the revert harder. Oh, ok. You are using version >=4.00 or older versions? > > Regards >
From: Corentin Labbe <clabbe.montjoie@gmail.com> Date: Mon, 27 Mar 2017 19:00:58 +0200 > On Mon, Mar 27, 2017 at 04:26:48PM +0100, Joao Pinto wrote: >> Hi David, >> >> Às 7:26 AM de 3/25/2017, Corentin Labbe escreveu: >> > On Fri, Mar 24, 2017 at 05:16:45PM +0000, Joao Pinto wrote: >> >> For cores that have more than 1 TX queue configured, the kernel would crash, >> >> since only one TX queue is permitted by default. >> >> >> >> Signed-off-by: Joao Pinto <jpinto@synopsys.com> >> >> --- >> >> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- >> >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> >> >> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >> >> index 3827952..1eab084 100644 >> >> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >> >> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >> >> @@ -3429,7 +3429,7 @@ static int stmmac_poll(struct napi_struct *napi, int budget) >> >> struct stmmac_rx_queue *rx_q = >> >> container_of(napi, struct stmmac_rx_queue, napi); >> >> struct stmmac_priv *priv = rx_q->priv_data; >> >> - u32 tx_count = priv->dma_cap.number_tx_queues; >> >> + u32 tx_count = priv->plat->tx_queues_to_use; >> >> u32 chan = rx_q->queue_index; >> >> u32 work_done = 0; >> >> u32 queue = 0; >> >> -- >> >> 2.9.3 >> >> >> > >> > This patch fix the performance issue on dwmac-sun8i only. >> > The dwmac-sunxi is still broken. >> > >> >> This patch series can be upstreamed please, since they make 2 fixes, one of them >> solving the problem in dwmac-sun8i. >> >> Thanks. > > As I said in a previous answer, finaly dwmac-sun8i is still broken. > Adding thoses 2 patch will just made the revert harder. I agree.
Às 6:28 PM de 3/27/2017, David Miller escreveu: > From: Corentin Labbe <clabbe.montjoie@gmail.com> > Date: Mon, 27 Mar 2017 19:00:58 +0200 > >> On Mon, Mar 27, 2017 at 04:26:48PM +0100, Joao Pinto wrote: >>> Hi David, >>> >>> Às 7:26 AM de 3/25/2017, Corentin Labbe escreveu: >>>> On Fri, Mar 24, 2017 at 05:16:45PM +0000, Joao Pinto wrote: >>>>> For cores that have more than 1 TX queue configured, the kernel would crash, >>>>> since only one TX queue is permitted by default. >>>>> >>>>> Signed-off-by: Joao Pinto <jpinto@synopsys.com> >>>>> --- >>>>> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- >>>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>>> >>>>> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >>>>> index 3827952..1eab084 100644 >>>>> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >>>>> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >>>>> @@ -3429,7 +3429,7 @@ static int stmmac_poll(struct napi_struct *napi, int budget) >>>>> struct stmmac_rx_queue *rx_q = >>>>> container_of(napi, struct stmmac_rx_queue, napi); >>>>> struct stmmac_priv *priv = rx_q->priv_data; >>>>> - u32 tx_count = priv->dma_cap.number_tx_queues; >>>>> + u32 tx_count = priv->plat->tx_queues_to_use; >>>>> u32 chan = rx_q->queue_index; >>>>> u32 work_done = 0; >>>>> u32 queue = 0; >>>>> -- >>>>> 2.9.3 >>>>> >>>> >>>> This patch fix the performance issue on dwmac-sun8i only. >>>> The dwmac-sunxi is still broken. >>>> >>> >>> This patch series can be upstreamed please, since they make 2 fixes, one of them >>> solving the problem in dwmac-sun8i. >>> >>> Thanks. >> >> As I said in a previous answer, finaly dwmac-sun8i is still broken. >> Adding thoses 2 patch will just made the revert harder. > > I agree. For what I am understanding, SoCs base on Core versions >= 4.00 are working properly and for some reason SoCs based on older versions are not working. This fix is necessary, since if you have a diferent configured tx_queues_to_use in the driver and priv->dma_cap.number_tx_queues in the core, this can lead to kernel crashes. The other fix (netdev resources release) is also necessary, since when you release the driver its crashes, because the rx queue struct is freed before releasing the netdevs. We can revert, but I think it might not solve the issue. We can break the "multiple buffers" patch into "rx multilple buffers" and "tx multiple buffers", but will that actually work? We can give it a try, I don't mind making a new multiple buffers patch broken into 2, that can be tested by new cores and older cores. Joao
On Mon, Mar 27, 2017 at 06:06:05PM +0100, Joao Pinto wrote: > Às 6:00 PM de 3/27/2017, Corentin Labbe escreveu: > > On Mon, Mar 27, 2017 at 04:26:48PM +0100, Joao Pinto wrote: > >> Hi David, > >> > >> Às 7:26 AM de 3/25/2017, Corentin Labbe escreveu: > >>> On Fri, Mar 24, 2017 at 05:16:45PM +0000, Joao Pinto wrote: > >>>> For cores that have more than 1 TX queue configured, the kernel would crash, > >>>> since only one TX queue is permitted by default. > >>>> > >>>> Signed-off-by: Joao Pinto <jpinto@synopsys.com> > >>>> --- > >>>> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- > >>>> 1 file changed, 1 insertion(+), 1 deletion(-) > >>>> > >>>> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > >>>> index 3827952..1eab084 100644 > >>>> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > >>>> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > >>>> @@ -3429,7 +3429,7 @@ static int stmmac_poll(struct napi_struct *napi, int budget) > >>>> struct stmmac_rx_queue *rx_q = > >>>> container_of(napi, struct stmmac_rx_queue, napi); > >>>> struct stmmac_priv *priv = rx_q->priv_data; > >>>> - u32 tx_count = priv->dma_cap.number_tx_queues; > >>>> + u32 tx_count = priv->plat->tx_queues_to_use; > >>>> u32 chan = rx_q->queue_index; > >>>> u32 work_done = 0; > >>>> u32 queue = 0; > >>>> -- > >>>> 2.9.3 > >>>> > >>> > >>> This patch fix the performance issue on dwmac-sun8i only. > >>> The dwmac-sunxi is still broken. > >>> > >> > >> This patch series can be upstreamed please, since they make 2 fixes, one of them > >> solving the problem in dwmac-sun8i. > >> > >> Thanks. > > > > As I said in a previous answer, finaly dwmac-sun8i is still broken. > > Adding thoses 2 patch will just made the revert harder. > > Oh, ok. You are using version >=4.00 or older versions? > older for both
On Mon, Mar 27, 2017 at 06:44:22PM +0100, Joao Pinto wrote: > Às 6:28 PM de 3/27/2017, David Miller escreveu: > > From: Corentin Labbe <clabbe.montjoie@gmail.com> > > Date: Mon, 27 Mar 2017 19:00:58 +0200 > > > >> On Mon, Mar 27, 2017 at 04:26:48PM +0100, Joao Pinto wrote: > >>> Hi David, > >>> > >>> Às 7:26 AM de 3/25/2017, Corentin Labbe escreveu: > >>>> On Fri, Mar 24, 2017 at 05:16:45PM +0000, Joao Pinto wrote: > >>>>> For cores that have more than 1 TX queue configured, the kernel would crash, > >>>>> since only one TX queue is permitted by default. > >>>>> > >>>>> Signed-off-by: Joao Pinto <jpinto@synopsys.com> > >>>>> --- > >>>>> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- > >>>>> 1 file changed, 1 insertion(+), 1 deletion(-) > >>>>> > >>>>> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > >>>>> index 3827952..1eab084 100644 > >>>>> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > >>>>> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > >>>>> @@ -3429,7 +3429,7 @@ static int stmmac_poll(struct napi_struct *napi, int budget) > >>>>> struct stmmac_rx_queue *rx_q = > >>>>> container_of(napi, struct stmmac_rx_queue, napi); > >>>>> struct stmmac_priv *priv = rx_q->priv_data; > >>>>> - u32 tx_count = priv->dma_cap.number_tx_queues; > >>>>> + u32 tx_count = priv->plat->tx_queues_to_use; > >>>>> u32 chan = rx_q->queue_index; > >>>>> u32 work_done = 0; > >>>>> u32 queue = 0; > >>>>> -- > >>>>> 2.9.3 > >>>>> > >>>> > >>>> This patch fix the performance issue on dwmac-sun8i only. > >>>> The dwmac-sunxi is still broken. > >>>> > >>> > >>> This patch series can be upstreamed please, since they make 2 fixes, one of them > >>> solving the problem in dwmac-sun8i. > >>> > >>> Thanks. > >> > >> As I said in a previous answer, finaly dwmac-sun8i is still broken. > >> Adding thoses 2 patch will just made the revert harder. > > > > I agree. > > For what I am understanding, SoCs base on Core versions >= 4.00 are working > properly and for some reason SoCs based on older versions are not working. > > This fix is necessary, since if you have a diferent configured tx_queues_to_use > in the driver and priv->dma_cap.number_tx_queues in the core, this can lead to > kernel crashes. > > The other fix (netdev resources release) is also necessary, since when you > release the driver its crashes, because the rx queue struct is freed before > releasing the netdevs. > > We can revert, but I think it might not solve the issue. We can break the > "multiple buffers" patch into "rx multilple buffers" and "tx multiple buffers", > but will that actually work? We can give it a try, I don't mind making a new > multiple buffers patch broken into 2, that can be tested by new cores and older > cores. > Reverting at least will bring back my archs to good status:) Spliting will not solve magically the issue, but will permit to easily detect which part is faulty. And I am sure that it is possible to split more than in 2. The more small the patch will be, the easier it will. Regards
From: Joao Pinto <Joao.Pinto@synopsys.com> Date: Mon, 27 Mar 2017 18:44:22 +0100 > For what I am understanding, SoCs base on Core versions >= 4.00 are working > properly and for some reason SoCs based on older versions are not working. Please send me a revert, and work offline with these people to resolve all of the regressions you introduced. Once you resolved all of the regressions, we can put the changes back in. Thank you.
On 03/27/2017 07:44 PM, Joao Pinto wrote: > Às 6:28 PM de 3/27/2017, David Miller escreveu: >> From: Corentin Labbe <clabbe.montjoie@gmail.com> >> Date: Mon, 27 Mar 2017 19:00:58 +0200 >> >>> On Mon, Mar 27, 2017 at 04:26:48PM +0100, Joao Pinto wrote: >>>> Hi David, >>>> >>>> Às 7:26 AM de 3/25/2017, Corentin Labbe escreveu: >>>>> On Fri, Mar 24, 2017 at 05:16:45PM +0000, Joao Pinto wrote: >>>>>> For cores that have more than 1 TX queue configured, the kernel would crash, >>>>>> since only one TX queue is permitted by default. >>>>>> >>>>>> Signed-off-by: Joao Pinto <jpinto@synopsys.com> >>>>>> --- >>>>>> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- >>>>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>>>> >>>>>> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >>>>>> index 3827952..1eab084 100644 >>>>>> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >>>>>> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >>>>>> @@ -3429,7 +3429,7 @@ static int stmmac_poll(struct napi_struct *napi, int budget) >>>>>> struct stmmac_rx_queue *rx_q = >>>>>> container_of(napi, struct stmmac_rx_queue, napi); >>>>>> struct stmmac_priv *priv = rx_q->priv_data; >>>>>> - u32 tx_count = priv->dma_cap.number_tx_queues; >>>>>> + u32 tx_count = priv->plat->tx_queues_to_use; >>>>>> u32 chan = rx_q->queue_index; >>>>>> u32 work_done = 0; >>>>>> u32 queue = 0; >>>>>> -- >>>>>> 2.9.3 >>>>>> >>>>> >>>>> This patch fix the performance issue on dwmac-sun8i only. >>>>> The dwmac-sunxi is still broken. >>>>> >>>> >>>> This patch series can be upstreamed please, since they make 2 fixes, one of them >>>> solving the problem in dwmac-sun8i. >>>> >>>> Thanks. >>> >>> As I said in a previous answer, finaly dwmac-sun8i is still broken. >>> Adding thoses 2 patch will just made the revert harder. >> >> I agree. > > For what I am understanding, SoCs base on Core versions >= 4.00 are working > properly and for some reason SoCs based on older versions are not working. > > This fix is necessary, since if you have a diferent configured tx_queues_to_use > in the driver and priv->dma_cap.number_tx_queues in the core, this can lead to > kernel crashes. > > The other fix (netdev resources release) is also necessary, since when you > release the driver its crashes, because the rx queue struct is freed before > releasing the netdevs. > > We can revert, but I think it might not solve the issue. We can break the > "multiple buffers" patch into "rx multilple buffers" and "tx multiple buffers", > but will that actually work? We can give it a try, I don't mind making a new > multiple buffers patch broken into 2, that can be tested by new cores and older > cores. I've hit a bug on stmmac where RX is broken after boot. Sometimes it works, and sometimes it doesn't. I usually notice that DHCP never receives an offer, but it's possible to reproduce the problem without DHCP, where a simple ping will not work after setting an address manually. I've bisected it to commit aff3d9eff843 ("net: stmmac: enable multiple buffers"). (Note that I had to cherry-pick 22446ad8e118 ("net: stmmac: Restore DT backwards-compatibility") to avoid TX queue timeouts, and the patch included in the beginning of this mail thread "net: stmmac: fix number of tx queues in stmmac_poll" to avoid random crashes in stmmac_tx_clean. Looking at wireshark I can see that we send out a DHCP discover, so TX seems to be working. A DHCP offer is sent out from the server, but it is never received. Our setup has 1 RX queue and 2 TX queues. According to the databook, the field Receive Queue Size in register MTL_RxQ0_Operation_Mode is read-only when number of RX queues == 1, so I guess the problem is not related to RX queue size. It's quite annoying since it does not trigger every single boot. Has anyone else noticed broken RX after boot since commit aff3d9eff843 and newer?
On Tue, Mar 28, 2017 at 03:34:58PM +0200, Niklas Cassel wrote: > > > On 03/27/2017 07:44 PM, Joao Pinto wrote: > > Às 6:28 PM de 3/27/2017, David Miller escreveu: > >> From: Corentin Labbe <clabbe.montjoie@gmail.com> > >> Date: Mon, 27 Mar 2017 19:00:58 +0200 > >> > >>> On Mon, Mar 27, 2017 at 04:26:48PM +0100, Joao Pinto wrote: > >>>> Hi David, > >>>> > >>>> Às 7:26 AM de 3/25/2017, Corentin Labbe escreveu: > >>>>> On Fri, Mar 24, 2017 at 05:16:45PM +0000, Joao Pinto wrote: > >>>>>> For cores that have more than 1 TX queue configured, the kernel would crash, > >>>>>> since only one TX queue is permitted by default. > >>>>>> > >>>>>> Signed-off-by: Joao Pinto <jpinto@synopsys.com> > >>>>>> --- > >>>>>> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- > >>>>>> 1 file changed, 1 insertion(+), 1 deletion(-) > >>>>>> > >>>>>> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > >>>>>> index 3827952..1eab084 100644 > >>>>>> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > >>>>>> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > >>>>>> @@ -3429,7 +3429,7 @@ static int stmmac_poll(struct napi_struct *napi, int budget) > >>>>>> struct stmmac_rx_queue *rx_q = > >>>>>> container_of(napi, struct stmmac_rx_queue, napi); > >>>>>> struct stmmac_priv *priv = rx_q->priv_data; > >>>>>> - u32 tx_count = priv->dma_cap.number_tx_queues; > >>>>>> + u32 tx_count = priv->plat->tx_queues_to_use; > >>>>>> u32 chan = rx_q->queue_index; > >>>>>> u32 work_done = 0; > >>>>>> u32 queue = 0; > >>>>>> -- > >>>>>> 2.9.3 > >>>>>> > >>>>> > >>>>> This patch fix the performance issue on dwmac-sun8i only. > >>>>> The dwmac-sunxi is still broken. > >>>>> > >>>> > >>>> This patch series can be upstreamed please, since they make 2 fixes, one of them > >>>> solving the problem in dwmac-sun8i. > >>>> > >>>> Thanks. > >>> > >>> As I said in a previous answer, finaly dwmac-sun8i is still broken. > >>> Adding thoses 2 patch will just made the revert harder. > >> > >> I agree. > > > > For what I am understanding, SoCs base on Core versions >= 4.00 are working > > properly and for some reason SoCs based on older versions are not working. > > > > This fix is necessary, since if you have a diferent configured tx_queues_to_use > > in the driver and priv->dma_cap.number_tx_queues in the core, this can lead to > > kernel crashes. > > > > The other fix (netdev resources release) is also necessary, since when you > > release the driver its crashes, because the rx queue struct is freed before > > releasing the netdevs. > > > > We can revert, but I think it might not solve the issue. We can break the > > "multiple buffers" patch into "rx multilple buffers" and "tx multiple buffers", > > but will that actually work? We can give it a try, I don't mind making a new > > multiple buffers patch broken into 2, that can be tested by new cores and older > > cores. > > I've hit a bug on stmmac where RX is broken after boot. > Sometimes it works, and sometimes it doesn't. > I usually notice that DHCP never receives an offer, > but it's possible to reproduce the problem without DHCP, > where a simple ping will not work after setting an address manually. > > I've bisected it to commit aff3d9eff843 ("net: stmmac: enable multiple buffers"). > (Note that I had to cherry-pick 22446ad8e118 ("net: stmmac: Restore DT backwards-compatibility") > to avoid TX queue timeouts, and the patch included in the beginning of this > mail thread "net: stmmac: fix number of tx queues in stmmac_poll" to avoid > random crashes in stmmac_tx_clean. > > Looking at wireshark I can see that we send out a DHCP discover, > so TX seems to be working. > A DHCP offer is sent out from the server, but it is never received. > > Our setup has 1 RX queue and 2 TX queues. > According to the databook, the field Receive Queue Size in register > MTL_RxQ0_Operation_Mode is read-only when number of RX queues == 1, > so I guess the problem is not related to RX queue size. > It's quite annoying since it does not trigger every single boot. > > Has anyone else noticed broken RX after boot since commit aff3d9eff843 and newer? Yeah, I've been hitting the same, or at least very similar, issue. I'm going to attach my local stack of three patches, of which the first is only cleanup, the second is the same as the one that Joao had sent out earlier and patch three seems to be the one that gets things back on track for me. I haven't quite figured out why yet, but it'd be interesting to see if it fixes things for others. Thierry
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 3827952..1eab084 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3429,7 +3429,7 @@ static int stmmac_poll(struct napi_struct *napi, int budget) struct stmmac_rx_queue *rx_q = container_of(napi, struct stmmac_rx_queue, napi); struct stmmac_priv *priv = rx_q->priv_data; - u32 tx_count = priv->dma_cap.number_tx_queues; + u32 tx_count = priv->plat->tx_queues_to_use; u32 chan = rx_q->queue_index; u32 work_done = 0; u32 queue = 0;
For cores that have more than 1 TX queue configured, the kernel would crash, since only one TX queue is permitted by default. Signed-off-by: Joao Pinto <jpinto@synopsys.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)