mbox series

[net-next,v4,00/10] net: create dynamic software irq moderation library

Message ID 1515531981-14461-1-git-send-email-andy@greyhouse.net
Headers show
Series net: create dynamic software irq moderation library | expand

Message

Andy Gospodarek Jan. 9, 2018, 9:06 p.m. UTC
From: Andy Gospodarek <gospo@broadcom.com>

This converts the dynamic interrupt moderation library from the mlx5e
driver into a library so it can be used by any driver.  The penultimate
patch in this set adds support for this new dynamic interrupt moderation
library in the bnxt_en driver and the last patch creates an entry in the
MAINTAINERS file for this library.

The main purpose of this code is to allow an administrator to make sure
that default coalesce settings are optimized for low latency, but
quickly adapt to handle high throughput/bulk traffic by altering how
much time passes before popping an interrupt.

For any new driver the following changes would be needed to use this
library:

- add elements in ring struct to track items needed by this library
- create function that can be called to actually set coalesce settings
  for the driver

Credit to Rob Rice and Lee Reed for doing some of the initial proof of
concept and testing for this patch and Tal Gilboa and Or Gerlitz for
their comments, etc on this set.

v4: Fix build breakage for VF representers noticed by kbuild test robot.
Thanks for being so courteous, kbuild test robot!

v3: bnxt_en fix from Michael Chan, comment suggestion from Vasundhara
Volam, and small mlx5e header file fix from Tal Gilboa.

v2: Spelling fixes from Stephen Hemminger, bnxt_en suggestions from
Michael Chan, spelling and formatting fixes from Or Gerlitz, and
spelling and mlx5e changes suggested by Tal Gilboa.

Andy Gospodarek (10):
  net/mlx5e: Move interrupt moderation structs to new file
  net/mlx5e: Move interrupt moderation forward declarations
  net/mlx5e: Remove rq references in mlx5e_rx_am
  net/mlx5e: Move AM logic enums
  net/mlx5e: Move generic functions to new file
  net/mlx5e: Change Mellanox references in DIM code
  net/mlx5e: Move dynamic interrupt coalescing code to include/linux
  net/dim: use struct net_dim_sample as arg to net_dim
  bnxt_en: add support for software dynamic interrupt moderation
  MAINTAINERS: add entry for Dynamic Interrupt Moderation

 MAINTAINERS                                        |   5 +
 drivers/net/ethernet/broadcom/bnxt/Makefile        |   2 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt.c          |  50 +++
 drivers/net/ethernet/broadcom/bnxt/bnxt.h          |  34 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt_dim.c      |  33 ++
 drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c  |  12 +
 drivers/net/ethernet/mellanox/mlx5/core/Makefile   |   2 +-
 drivers/net/ethernet/mellanox/mlx5/core/en.h       |  46 +--
 drivers/net/ethernet/mellanox/mlx5/core/en_dim.c   |  49 +++
 .../net/ethernet/mellanox/mlx5/core/en_ethtool.c   |   6 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c  |  40 ++-
 drivers/net/ethernet/mellanox/mlx5/core/en_rep.c   |   2 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_rx_am.c | 341 -------------------
 drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c  |  10 +-
 include/linux/net_dim.h                            | 373 +++++++++++++++++++++
 15 files changed, 594 insertions(+), 411 deletions(-)
 create mode 100644 drivers/net/ethernet/broadcom/bnxt/bnxt_dim.c
 create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/en_dim.c
 delete mode 100644 drivers/net/ethernet/mellanox/mlx5/core/en_rx_am.c
 create mode 100644 include/linux/net_dim.h

Comments

Tal Gilboa Jan. 9, 2018, 9:55 p.m. UTC | #1
On 1/9/2018 11:06 PM, Andy Gospodarek wrote:
> From: Andy Gospodarek <gospo@broadcom.com>
> 
> This converts the dynamic interrupt moderation library from the mlx5e
> driver into a library so it can be used by any driver.  The penultimate
> patch in this set adds support for this new dynamic interrupt moderation
> library in the bnxt_en driver and the last patch creates an entry in the
> MAINTAINERS file for this library.
> 
> The main purpose of this code is to allow an administrator to make sure
> that default coalesce settings are optimized for low latency, but
> quickly adapt to handle high throughput/bulk traffic by altering how
> much time passes before popping an interrupt.
> 
> For any new driver the following changes would be needed to use this
> library:
> 
> - add elements in ring struct to track items needed by this library
> - create function that can be called to actually set coalesce settings
>    for the driver
> 
> Credit to Rob Rice and Lee Reed for doing some of the initial proof of
> concept and testing for this patch and Tal Gilboa and Or Gerlitz for
> their comments, etc on this set.
> 
> v4: Fix build breakage for VF representers noticed by kbuild test robot.
> Thanks for being so courteous, kbuild test robot!
> 
> v3: bnxt_en fix from Michael Chan, comment suggestion from Vasundhara
> Volam, and small mlx5e header file fix from Tal Gilboa.
> 
> v2: Spelling fixes from Stephen Hemminger, bnxt_en suggestions from
> Michael Chan, spelling and formatting fixes from Or Gerlitz, and
> spelling and mlx5e changes suggested by Tal Gilboa.
> 
> Andy Gospodarek (10):
>    net/mlx5e: Move interrupt moderation structs to new file
>    net/mlx5e: Move interrupt moderation forward declarations
>    net/mlx5e: Remove rq references in mlx5e_rx_am
>    net/mlx5e: Move AM logic enums
>    net/mlx5e: Move generic functions to new file
>    net/mlx5e: Change Mellanox references in DIM code
>    net/mlx5e: Move dynamic interrupt coalescing code to include/linux
>    net/dim: use struct net_dim_sample as arg to net_dim
>    bnxt_en: add support for software dynamic interrupt moderation
>    MAINTAINERS: add entry for Dynamic Interrupt Moderation
> 
>   MAINTAINERS                                        |   5 +
>   drivers/net/ethernet/broadcom/bnxt/Makefile        |   2 +-
>   drivers/net/ethernet/broadcom/bnxt/bnxt.c          |  50 +++
>   drivers/net/ethernet/broadcom/bnxt/bnxt.h          |  34 +-
>   drivers/net/ethernet/broadcom/bnxt/bnxt_dim.c      |  33 ++
>   drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c  |  12 +
>   drivers/net/ethernet/mellanox/mlx5/core/Makefile   |   2 +-
>   drivers/net/ethernet/mellanox/mlx5/core/en.h       |  46 +--
>   drivers/net/ethernet/mellanox/mlx5/core/en_dim.c   |  49 +++
>   .../net/ethernet/mellanox/mlx5/core/en_ethtool.c   |   6 +-
>   drivers/net/ethernet/mellanox/mlx5/core/en_main.c  |  40 ++-
>   drivers/net/ethernet/mellanox/mlx5/core/en_rep.c   |   2 +-
>   drivers/net/ethernet/mellanox/mlx5/core/en_rx_am.c | 341 -------------------
>   drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c  |  10 +-
>   include/linux/net_dim.h                            | 373 +++++++++++++++++++++
>   15 files changed, 594 insertions(+), 411 deletions(-)
>   create mode 100644 drivers/net/ethernet/broadcom/bnxt/bnxt_dim.c
>   create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/en_dim.c
>   delete mode 100644 drivers/net/ethernet/mellanox/mlx5/core/en_rx_am.c
>   create mode 100644 include/linux/net_dim.h
> 

+1. Great work Andy!
Florian Fainelli Jan. 9, 2018, 10:46 p.m. UTC | #2
Hey Andy,

On 01/09/2018 01:06 PM, Andy Gospodarek wrote:
> From: Andy Gospodarek <gospo@broadcom.com>
> 
> This converts the dynamic interrupt moderation library from the mlx5e
> driver into a library so it can be used by any driver.  The penultimate
> patch in this set adds support for this new dynamic interrupt moderation
> library in the bnxt_en driver and the last patch creates an entry in the
> MAINTAINERS file for this library.
> 
> The main purpose of this code is to allow an administrator to make sure
> that default coalesce settings are optimized for low latency, but
> quickly adapt to handle high throughput/bulk traffic by altering how
> much time passes before popping an interrupt.
> 
> For any new driver the following changes would be needed to use this
> library:
> 
> - add elements in ring struct to track items needed by this library
> - create function that can be called to actually set coalesce settings
>   for the driver
> 
> Credit to Rob Rice and Lee Reed for doing some of the initial proof of
> concept and testing for this patch and Tal Gilboa and Or Gerlitz for
> their comments, etc on this set.
> 
> v4: Fix build breakage for VF representers noticed by kbuild test robot.
> Thanks for being so courteous, kbuild test robot!
> 
> v3: bnxt_en fix from Michael Chan, comment suggestion from Vasundhara
> Volam, and small mlx5e header file fix from Tal Gilboa.
> 
> v2: Spelling fixes from Stephen Hemminger, bnxt_en suggestions from
> Michael Chan, spelling and formatting fixes from Or Gerlitz, and
> spelling and mlx5e changes suggested by Tal Gilboa.

Certainly not a blocking item for this patch series, but can you
consider a follow up patch adding a small bit of documentation entry
covering how the implementation works as well as possible
limitations/considerations depending on what the networking HW supports
in terms of interrupt moderation capabilities? (e.g: is it necessary to
support generating an interrupt on ring empty, a micro-second resolution
RX/TX timeout etc. etc.).

Thanks for doing this!
Tal Gilboa Jan. 9, 2018, 10:49 p.m. UTC | #3
On 1/10/2018 12:46 AM, Florian Fainelli wrote:
> Hey Andy,
> 
> On 01/09/2018 01:06 PM, Andy Gospodarek wrote:
>> From: Andy Gospodarek <gospo@broadcom.com>
>>
>> This converts the dynamic interrupt moderation library from the mlx5e
>> driver into a library so it can be used by any driver.  The penultimate
>> patch in this set adds support for this new dynamic interrupt moderation
>> library in the bnxt_en driver and the last patch creates an entry in the
>> MAINTAINERS file for this library.
>>
>> The main purpose of this code is to allow an administrator to make sure
>> that default coalesce settings are optimized for low latency, but
>> quickly adapt to handle high throughput/bulk traffic by altering how
>> much time passes before popping an interrupt.
>>
>> For any new driver the following changes would be needed to use this
>> library:
>>
>> - add elements in ring struct to track items needed by this library
>> - create function that can be called to actually set coalesce settings
>>    for the driver
>>
>> Credit to Rob Rice and Lee Reed for doing some of the initial proof of
>> concept and testing for this patch and Tal Gilboa and Or Gerlitz for
>> their comments, etc on this set.
>>
>> v4: Fix build breakage for VF representers noticed by kbuild test robot.
>> Thanks for being so courteous, kbuild test robot!
>>
>> v3: bnxt_en fix from Michael Chan, comment suggestion from Vasundhara
>> Volam, and small mlx5e header file fix from Tal Gilboa.
>>
>> v2: Spelling fixes from Stephen Hemminger, bnxt_en suggestions from
>> Michael Chan, spelling and formatting fixes from Or Gerlitz, and
>> spelling and mlx5e changes suggested by Tal Gilboa.
> 
> Certainly not a blocking item for this patch series, but can you
> consider a follow up patch adding a small bit of documentation entry
> covering how the implementation works as well as possible
> limitations/considerations depending on what the networking HW supports
> in terms of interrupt moderation capabilities? (e.g: is it necessary to
> support generating an interrupt on ring empty, a micro-second resolution
> RX/TX timeout etc. etc.).
> 
> Thanks for doing this!
> 

Hi Florian, I plan to do so right after these patches would be accepted.
Andy Gospodarek Jan. 9, 2018, 10:55 p.m. UTC | #4
On Wed, Jan 10, 2018 at 12:49:53AM +0200, Tal Gilboa wrote:
> On 1/10/2018 12:46 AM, Florian Fainelli wrote:
> > Hey Andy,
> > 
> > On 01/09/2018 01:06 PM, Andy Gospodarek wrote:
> > > From: Andy Gospodarek <gospo@broadcom.com>
> > > 
> > > This converts the dynamic interrupt moderation library from the mlx5e
> > > driver into a library so it can be used by any driver.  The penultimate
> > > patch in this set adds support for this new dynamic interrupt moderation
> > > library in the bnxt_en driver and the last patch creates an entry in the
> > > MAINTAINERS file for this library.
> > > 
> > > The main purpose of this code is to allow an administrator to make sure
> > > that default coalesce settings are optimized for low latency, but
> > > quickly adapt to handle high throughput/bulk traffic by altering how
> > > much time passes before popping an interrupt.
> > > 
> > > For any new driver the following changes would be needed to use this
> > > library:
> > > 
> > > - add elements in ring struct to track items needed by this library
> > > - create function that can be called to actually set coalesce settings
> > >    for the driver
> > > 
> > > Credit to Rob Rice and Lee Reed for doing some of the initial proof of
> > > concept and testing for this patch and Tal Gilboa and Or Gerlitz for
> > > their comments, etc on this set.
> > > 
> > > v4: Fix build breakage for VF representers noticed by kbuild test robot.
> > > Thanks for being so courteous, kbuild test robot!
> > > 
> > > v3: bnxt_en fix from Michael Chan, comment suggestion from Vasundhara
> > > Volam, and small mlx5e header file fix from Tal Gilboa.
> > > 
> > > v2: Spelling fixes from Stephen Hemminger, bnxt_en suggestions from
> > > Michael Chan, spelling and formatting fixes from Or Gerlitz, and
> > > spelling and mlx5e changes suggested by Tal Gilboa.
> > 
> > Certainly not a blocking item for this patch series, but can you
> > consider a follow up patch adding a small bit of documentation entry
> > covering how the implementation works as well as possible
> > limitations/considerations depending on what the networking HW supports
> > in terms of interrupt moderation capabilities? (e.g: is it necessary to
> > support generating an interrupt on ring empty, a micro-second resolution
> > RX/TX timeout etc. etc.).
> > 
> > Thanks for doing this!
> > 
> 
> Hi Florian, I plan to do so right after these patches would be accepted.

Thanks, Tal!
David Miller Jan. 10, 2018, 8:28 p.m. UTC | #5
From: Andy Gospodarek <andy@greyhouse.net>
Date: Tue,  9 Jan 2018 16:06:11 -0500

> From: Andy Gospodarek <gospo@broadcom.com>
> 
> This converts the dynamic interrupt moderation library from the mlx5e
> driver into a library so it can be used by any driver.  The penultimate
> patch in this set adds support for this new dynamic interrupt moderation
> library in the bnxt_en driver and the last patch creates an entry in the
> MAINTAINERS file for this library.
> 
> The main purpose of this code is to allow an administrator to make sure
> that default coalesce settings are optimized for low latency, but
> quickly adapt to handle high throughput/bulk traffic by altering how
> much time passes before popping an interrupt.
> 
> For any new driver the following changes would be needed to use this
> library:
> 
> - add elements in ring struct to track items needed by this library
> - create function that can be called to actually set coalesce settings
>   for the driver
> 
> Credit to Rob Rice and Lee Reed for doing some of the initial proof of
> concept and testing for this patch and Tal Gilboa and Or Gerlitz for
> their comments, etc on this set.
> 
> v4: Fix build breakage for VF representers noticed by kbuild test robot.
> Thanks for being so courteous, kbuild test robot!
> 
> v3: bnxt_en fix from Michael Chan, comment suggestion from Vasundhara
> Volam, and small mlx5e header file fix from Tal Gilboa.
> 
> v2: Spelling fixes from Stephen Hemminger, bnxt_en suggestions from
> Michael Chan, spelling and formatting fixes from Or Gerlitz, and
> spelling and mlx5e changes suggested by Tal Gilboa.

Nice work, series applied, thanks Andy.