mbox series

[v3,net-next,00/12] net: stmmac: Clean-up and tune-up

Message ID cover.1526651009.git.joabreu@synopsys.com
Headers show
Series net: stmmac: Clean-up and tune-up | expand

Message

Jose Abreu May 18, 2018, 1:55 p.m. UTC
This targets to uniformize the handling of the different GMAC versions in
stmmac_main.c file and also tune-up the HW.

Currently there are some if/else conditions in the main source file which
calls different callbacks depending on the ID of GMAC.

With the introducion of a generic HW interface handling which automatically
selects the GMAC callbacks to be used, it is now unpleasant to see if
conditions in the main code because this should be completely agnostic of the
GMAC version.

This series removes most of these conditions. There are some if conditions
that remain untouched but the callbacks handling are now uniformized.

Tested in GMAC5, hope I didn't break any previous versions.

Please check [1] for performance analisys of patches 3-12.

---
David,

This will probably generate a merge conflict with [2] (which was not merged
yet). I'm waiting for Corentin input and then, if this series is merged
before, I will rebase [2]. Or the other way around if you prefer :D

Thanks
---

Cc: David S. Miller <davem@davemloft.net>
Cc: Joao Pinto <jpinto@synopsys.com>
Cc: Vitor Soares <soares@synopsys.com>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>

[1] https://marc.info/?l=linux-netdev&m=152656352607905&w=2
[2] https://patchwork.ozlabs.org/patch/915286/

Jose Abreu (12):
  net: stmmac: Enable OSP for GMAC4
  net: stmmac: Do not keep rearming the coalesce timer in stmmac_xmit
  net: stmmac: Let descriptor code set skbuff address
  net: stmmac: Let descriptor code clear the descriptor
  net: stmmac: Uniformize the use of dma_{rx/tx}_mode callbacks
  net: stmmac: Remove uneeded checks for GMAC version
  net: stmmac: Move PTP and MMC base address calculation to hwif.c
  net: stmmac: Uniformize the use of dma_init_* callbacks
  net: stmmac: Remove uneeded check for GMAC version in stmmac_xmit
  net: stmmac: Uniformize set_rx_owner()
  net: stmmac: Let descriptor code get skbuff address
  net: stmmac: Remove if condition by taking advantage of hwif return
    code

 drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c  |   82 +++++---
 .../net/ethernet/stmicro/stmmac/dwmac1000_dma.c    |   92 ++++++----
 drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c |   35 +++--
 drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c |   34 +++-
 drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c   |    7 +-
 drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.h   |    1 -
 drivers/net/ethernet/stmicro/stmmac/enh_desc.c     |   20 ++-
 drivers/net/ethernet/stmicro/stmmac/hwif.c         |   34 ++++
 drivers/net/ethernet/stmicro/stmmac/hwif.h         |   27 ++-
 drivers/net/ethernet/stmicro/stmmac/norm_desc.c    |   20 ++-
 drivers/net/ethernet/stmicro/stmmac/stmmac.h       |    1 +
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c  |  198 +++++++-------------
 12 files changed, 323 insertions(+), 228 deletions(-)

Comments

Corentin Labbe May 18, 2018, 2:12 p.m. UTC | #1
On Fri, May 18, 2018 at 02:55:57PM +0100, Jose Abreu wrote:
> This targets to uniformize the handling of the different GMAC versions in
> stmmac_main.c file and also tune-up the HW.
> 
> Currently there are some if/else conditions in the main source file which
> calls different callbacks depending on the ID of GMAC.
> 
> With the introducion of a generic HW interface handling which automatically
> selects the GMAC callbacks to be used, it is now unpleasant to see if
> conditions in the main code because this should be completely agnostic of the
> GMAC version.
> 
> This series removes most of these conditions. There are some if conditions
> that remain untouched but the callbacks handling are now uniformized.
> 
> Tested in GMAC5, hope I didn't break any previous versions.
> 
> Please check [1] for performance analisys of patches 3-12.
> 
> ---
> David,
> 
> This will probably generate a merge conflict with [2] (which was not merged
> yet). I'm waiting for Corentin input and then, if this series is merged
> before, I will rebase [2]. Or the other way around if you prefer :D
> 
> Thanks
> ---
> 
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Joao Pinto <jpinto@synopsys.com>
> Cc: Vitor Soares <soares@synopsys.com>
> Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
> Cc: Alexandre Torgue <alexandre.torgue@st.com>
> 
> [1] https://marc.info/?l=linux-netdev&m=152656352607905&w=2
> [2] https://patchwork.ozlabs.org/patch/915286/
> 
> Jose Abreu (12):
>   net: stmmac: Enable OSP for GMAC4
>   net: stmmac: Do not keep rearming the coalesce timer in stmmac_xmit
>   net: stmmac: Let descriptor code set skbuff address
>   net: stmmac: Let descriptor code clear the descriptor
>   net: stmmac: Uniformize the use of dma_{rx/tx}_mode callbacks
>   net: stmmac: Remove uneeded checks for GMAC version
>   net: stmmac: Move PTP and MMC base address calculation to hwif.c
>   net: stmmac: Uniformize the use of dma_init_* callbacks
>   net: stmmac: Remove uneeded check for GMAC version in stmmac_xmit
>   net: stmmac: Uniformize set_rx_owner()
>   net: stmmac: Let descriptor code get skbuff address
>   net: stmmac: Remove if condition by taking advantage of hwif return
>     code
> 
>  drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c  |   82 +++++---
>  .../net/ethernet/stmicro/stmmac/dwmac1000_dma.c    |   92 ++++++----
>  drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c |   35 +++--
>  drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c |   34 +++-
>  drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c   |    7 +-
>  drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.h   |    1 -
>  drivers/net/ethernet/stmicro/stmmac/enh_desc.c     |   20 ++-
>  drivers/net/ethernet/stmicro/stmmac/hwif.c         |   34 ++++
>  drivers/net/ethernet/stmicro/stmmac/hwif.h         |   27 ++-
>  drivers/net/ethernet/stmicro/stmmac/norm_desc.c    |   20 ++-
>  drivers/net/ethernet/stmicro/stmmac/stmmac.h       |    1 +
>  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c  |  198 +++++++-------------
>  12 files changed, 323 insertions(+), 228 deletions(-)
> 
> 

Hello

You didnt have put in CC linux-kernel@vger.kernel.org as required by get_maintener.pl letting more people to see this series.
Since this series touch dwmac-sun8i.c you should have also added Chen-Yu Tsai/Maxime Ripard (as also asked by get_maintainer).

Regards
Jose Abreu May 18, 2018, 2:23 p.m. UTC | #2
Hi Corentin,

On 18-05-2018 15:12, Corentin Labbe wrote:
> On Fri, May 18, 2018 at 02:55:57PM +0100, Jose Abreu wrote:
>> This targets to uniformize the handling of the different GMAC versions in
>> stmmac_main.c file and also tune-up the HW.
>>
>> Currently there are some if/else conditions in the main source file which
>> calls different callbacks depending on the ID of GMAC.
>>
>> With the introducion of a generic HW interface handling which automatically
>> selects the GMAC callbacks to be used, it is now unpleasant to see if
>> conditions in the main code because this should be completely agnostic of the
>> GMAC version.
>>
>> This series removes most of these conditions. There are some if conditions
>> that remain untouched but the callbacks handling are now uniformized.
>>
>> Tested in GMAC5, hope I didn't break any previous versions.
>>
>> Please check [1] for performance analisys of patches 3-12.
>>
>> ---
>> David,
>>
>> This will probably generate a merge conflict with [2] (which was not merged
>> yet). I'm waiting for Corentin input and then, if this series is merged
>> before, I will rebase [2]. Or the other way around if you prefer :D
>>
>> Thanks
>> ---
>>
>> Cc: David S. Miller <davem@davemloft.net>
>> Cc: Joao Pinto <jpinto@synopsys.com>
>> Cc: Vitor Soares <soares@synopsys.com>
>> Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
>> Cc: Alexandre Torgue <alexandre.torgue@st.com>
>>
>> [1] https://urldefense.proofpoint.com/v2/url?u=https-3A__marc.info_-3Fl-3Dlinux-2Dnetdev-26m-3D152656352607905-26w-3D2&d=DwIBAg&c=DPL6_X_6JkXFx7AXWqB0tg&r=WHDsc6kcWAl4i96Vm5hJ_19IJiuxx_p_Rzo2g-uHDKw&m=a7bgrSQpisaMSa5fT-je94smZ_TM7QTxNFKqkvI5Nns&s=Tr23Xj_UCR_PaJp8AYiy18hfhbILnsaCsKDT5_4m2z4&e=
>> [2] https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_915286_&d=DwIBAg&c=DPL6_X_6JkXFx7AXWqB0tg&r=WHDsc6kcWAl4i96Vm5hJ_19IJiuxx_p_Rzo2g-uHDKw&m=a7bgrSQpisaMSa5fT-je94smZ_TM7QTxNFKqkvI5Nns&s=Q0SV-ZR35zIJWjiaLNXqlOWchppQ2CsO-Fh-BFCjCB8&e=
>>
>> Jose Abreu (12):
>>   net: stmmac: Enable OSP for GMAC4
>>   net: stmmac: Do not keep rearming the coalesce timer in stmmac_xmit
>>   net: stmmac: Let descriptor code set skbuff address
>>   net: stmmac: Let descriptor code clear the descriptor
>>   net: stmmac: Uniformize the use of dma_{rx/tx}_mode callbacks
>>   net: stmmac: Remove uneeded checks for GMAC version
>>   net: stmmac: Move PTP and MMC base address calculation to hwif.c
>>   net: stmmac: Uniformize the use of dma_init_* callbacks
>>   net: stmmac: Remove uneeded check for GMAC version in stmmac_xmit
>>   net: stmmac: Uniformize set_rx_owner()
>>   net: stmmac: Let descriptor code get skbuff address
>>   net: stmmac: Remove if condition by taking advantage of hwif return
>>     code
>>
>>  drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c  |   82 +++++---
>>  .../net/ethernet/stmicro/stmmac/dwmac1000_dma.c    |   92 ++++++----
>>  drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c |   35 +++--
>>  drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c |   34 +++-
>>  drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c   |    7 +-
>>  drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.h   |    1 -
>>  drivers/net/ethernet/stmicro/stmmac/enh_desc.c     |   20 ++-
>>  drivers/net/ethernet/stmicro/stmmac/hwif.c         |   34 ++++
>>  drivers/net/ethernet/stmicro/stmmac/hwif.h         |   27 ++-
>>  drivers/net/ethernet/stmicro/stmmac/norm_desc.c    |   20 ++-
>>  drivers/net/ethernet/stmicro/stmmac/stmmac.h       |    1 +
>>  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c  |  198 +++++++-------------
>>  12 files changed, 323 insertions(+), 228 deletions(-)
>>
>>
> Hello
>
> You didnt have put in CC linux-kernel@vger.kernel.org as required by get_maintener.pl letting more people to see this series.
> Since this series touch dwmac-sun8i.c you should have also added Chen-Yu Tsai/Maxime Ripard (as also asked by get_maintainer).

Usually I just cc according to MAINTAINERS file but thanks for
noticing. Added in cc now.

Thanks and Best Regards,
Jose Miguel Abreu

>
> Regards
Corentin Labbe May 18, 2018, 2:28 p.m. UTC | #3
On Fri, May 18, 2018 at 03:23:44PM +0100, Jose Abreu wrote:
> Hi Corentin,
> 
> On 18-05-2018 15:12, Corentin Labbe wrote:
> > On Fri, May 18, 2018 at 02:55:57PM +0100, Jose Abreu wrote:
> >> This targets to uniformize the handling of the different GMAC versions in
> >> stmmac_main.c file and also tune-up the HW.
> >>
> >> Currently there are some if/else conditions in the main source file which
> >> calls different callbacks depending on the ID of GMAC.
> >>
> >> With the introducion of a generic HW interface handling which automatically
> >> selects the GMAC callbacks to be used, it is now unpleasant to see if
> >> conditions in the main code because this should be completely agnostic of the
> >> GMAC version.
> >>
> >> This series removes most of these conditions. There are some if conditions
> >> that remain untouched but the callbacks handling are now uniformized.
> >>
> >> Tested in GMAC5, hope I didn't break any previous versions.
> >>
> >> Please check [1] for performance analisys of patches 3-12.
> >>
> >> ---
> >> David,
> >>
> >> This will probably generate a merge conflict with [2] (which was not merged
> >> yet). I'm waiting for Corentin input and then, if this series is merged
> >> before, I will rebase [2]. Or the other way around if you prefer :D
> >>
> >> Thanks
> >> ---
> >>
> >> Cc: David S. Miller <davem@davemloft.net>
> >> Cc: Joao Pinto <jpinto@synopsys.com>
> >> Cc: Vitor Soares <soares@synopsys.com>
> >> Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
> >> Cc: Alexandre Torgue <alexandre.torgue@st.com>
> >>
> >> [1] https://urldefense.proofpoint.com/v2/url?u=https-3A__marc.info_-3Fl-3Dlinux-2Dnetdev-26m-3D152656352607905-26w-3D2&d=DwIBAg&c=DPL6_X_6JkXFx7AXWqB0tg&r=WHDsc6kcWAl4i96Vm5hJ_19IJiuxx_p_Rzo2g-uHDKw&m=a7bgrSQpisaMSa5fT-je94smZ_TM7QTxNFKqkvI5Nns&s=Tr23Xj_UCR_PaJp8AYiy18hfhbILnsaCsKDT5_4m2z4&e=
> >> [2] https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_915286_&d=DwIBAg&c=DPL6_X_6JkXFx7AXWqB0tg&r=WHDsc6kcWAl4i96Vm5hJ_19IJiuxx_p_Rzo2g-uHDKw&m=a7bgrSQpisaMSa5fT-je94smZ_TM7QTxNFKqkvI5Nns&s=Q0SV-ZR35zIJWjiaLNXqlOWchppQ2CsO-Fh-BFCjCB8&e=
> >>
> >> Jose Abreu (12):
> >>   net: stmmac: Enable OSP for GMAC4
> >>   net: stmmac: Do not keep rearming the coalesce timer in stmmac_xmit
> >>   net: stmmac: Let descriptor code set skbuff address
> >>   net: stmmac: Let descriptor code clear the descriptor
> >>   net: stmmac: Uniformize the use of dma_{rx/tx}_mode callbacks
> >>   net: stmmac: Remove uneeded checks for GMAC version
> >>   net: stmmac: Move PTP and MMC base address calculation to hwif.c
> >>   net: stmmac: Uniformize the use of dma_init_* callbacks
> >>   net: stmmac: Remove uneeded check for GMAC version in stmmac_xmit
> >>   net: stmmac: Uniformize set_rx_owner()
> >>   net: stmmac: Let descriptor code get skbuff address
> >>   net: stmmac: Remove if condition by taking advantage of hwif return
> >>     code
> >>
> >>  drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c  |   82 +++++---
> >>  .../net/ethernet/stmicro/stmmac/dwmac1000_dma.c    |   92 ++++++----
> >>  drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c |   35 +++--
> >>  drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c |   34 +++-
> >>  drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c   |    7 +-
> >>  drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.h   |    1 -
> >>  drivers/net/ethernet/stmicro/stmmac/enh_desc.c     |   20 ++-
> >>  drivers/net/ethernet/stmicro/stmmac/hwif.c         |   34 ++++
> >>  drivers/net/ethernet/stmicro/stmmac/hwif.h         |   27 ++-
> >>  drivers/net/ethernet/stmicro/stmmac/norm_desc.c    |   20 ++-
> >>  drivers/net/ethernet/stmicro/stmmac/stmmac.h       |    1 +
> >>  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c  |  198 +++++++-------------
> >>  12 files changed, 323 insertions(+), 228 deletions(-)
> >>
> >>
> > Hello
> >
> > You didnt have put in CC linux-kernel@vger.kernel.org as required by get_maintener.pl letting more people to see this series.
> > Since this series touch dwmac-sun8i.c you should have also added Chen-Yu Tsai/Maxime Ripard (as also asked by get_maintainer).
> 
> Usually I just cc according to MAINTAINERS file but thanks for
> noticing. Added in cc now.
> 

./scripts/get_maintainer.pl does this for you (and it use MAINTAINERS).
You have to use it at least, since it handle regex that could be easily unseen like for dwmac-sun8i.
David Miller May 18, 2018, 3:09 p.m. UTC | #4
From: Jose Abreu <Jose.Abreu@synopsys.com>
Date: Fri, 18 May 2018 14:55:57 +0100

> This targets to uniformize the handling of the different GMAC versions in
> stmmac_main.c file and also tune-up the HW.
> 
> Currently there are some if/else conditions in the main source file which
> calls different callbacks depending on the ID of GMAC.
> 
> With the introducion of a generic HW interface handling which automatically
> selects the GMAC callbacks to be used, it is now unpleasant to see if
> conditions in the main code because this should be completely agnostic of the
> GMAC version.
> 
> This series removes most of these conditions. There are some if conditions
> that remain untouched but the callbacks handling are now uniformized.
> 
> Tested in GMAC5, hope I didn't break any previous versions.
> 
> Please check [1] for performance analisys of patches 3-12.

This looks a lot better, series applied, thanks.


> This will probably generate a merge conflict with [2] (which was not merged
> yet). I'm waiting for Corentin input and then, if this series is merged
> before, I will rebase [2]. Or the other way around if you prefer :D

Since I just merged this, please rebase 2.

Thank you.