net: systemport: Fix coalescing settings handling

There were a number of issues with setting the RX coalescing parameters:

- we would not be preserving values that would have been configured
  across close/open calls, instead we would always reset to no timeout
  and 1 interrupt per packet, this would also prevent DIM from setting its
  default usec/pkts values

- when adaptive RX would be turned on, we woud not be fetching the
  default parameters, we would stay with no timeout/1 packet per
  interrupt until the estimator kicks in and changes that

- finally disabling adaptive RX coalescing while providing parameters
  would not be honored, and we would stay with whatever DIM had
  previously determined instead of the user requested parameters

Fixes: b6e0e87542 ("net: systemport: Implement adaptive interrupt coalescing")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Tal Gilboa <talgi@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Florian Fainelli
2018-03-28 15:15:37 -07:00
committed by David S. Miller
parent fd41f2bfb7
commit a8cdfbdf88
2 changed files with 46 additions and 20 deletions

View File

@@ -701,8 +701,6 @@ struct bcm_sysport_net_dim {
u16 event_ctr;
unsigned long packets;
unsigned long bytes;
u32 coal_usecs;
u32 coal_pkts;
struct net_dim dim;
};
@@ -755,6 +753,8 @@ struct bcm_sysport_priv {
unsigned int rx_c_index;
struct bcm_sysport_net_dim dim;
u32 rx_max_coalesced_frames;
u32 rx_coalesce_usecs;
/* PHY device */
struct device_node *phy_dn;