netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [pull request][net 0/6] Mellanox mlx5 fixes 2017-06-11
@ 2017-06-11 14:00 Saeed Mahameed
  2017-06-11 14:00 ` [net 1/6] net/mlx5: Fix create vport flow table flow Saeed Mahameed
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Saeed Mahameed @ 2017-06-11 14:00 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Saeed Mahameed

Hi Dave,

This series contains some fixes for the mlx5 core and netdev driver.

Please pull and let me know if there's any problem.

For -stable:
("net/mlx5e: Added BW check for DIM decision mechanism")              kernels >= 4.9
("net/mlx5e: Fix wrong indications in DIM due to counter wraparound") kernels >= 4.9
("net/mlx5: Remove several module events out of ethtool stats")       kernels >= 4.10
("net/mlx5: Enable 4K UAR only when page size is bigger than 4K")     kernels >= 4.11

*all patches apply with no issue on their -stable.

BTW I never asked you if this way of marking patches to -stable is good for you ?
if you prefer another format please let me know.

Thanks,
Saeed.
---

The following changes since commit b87fa0fafef4b16495740432f4eb8262efa500d0:

  Merge branch 'mvpp2-fixes' (2017-06-10 18:22:56 -0400)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git tags/mlx5-fixes-2017-06-11

for you to fetch changes up to 91828bd89940e8145f91751a015bc11bc486aad0:

  net/mlx5: Enable 4K UAR only when page size is bigger than 4K (2017-06-11 13:10:36 +0300)

----------------------------------------------------------------
mlx5-fixes-2017-06-11

----------------------------------------------------------------
Huy Nguyen (1):
      net/mlx5: Remove several module events out of ethtool stats

Majd Dibbiny (1):
      net/mlx5: Enable 4K UAR only when page size is bigger than 4K

Mohamad Haj Yahia (2):
      net/mlx5: Fix create vport flow table flow
      net/mlx5: Continue health polling until it is explicitly stopped

Tal Gilboa (2):
      net/mlx5e: Added BW check for DIM decision mechanism
      net/mlx5e: Fix wrong indications in DIM due to counter wraparound

 drivers/net/ethernet/mellanox/mlx5/core/en.h       |  8 ++--
 drivers/net/ethernet/mellanox/mlx5/core/en_rx_am.c | 45 +++++++++++++---------
 drivers/net/ethernet/mellanox/mlx5/core/en_stats.h | 11 +-----
 drivers/net/ethernet/mellanox/mlx5/core/fs_core.c  |  2 +-
 drivers/net/ethernet/mellanox/mlx5/core/health.c   | 11 +++---
 drivers/net/ethernet/mellanox/mlx5/core/main.c     |  6 ++-
 6 files changed, 43 insertions(+), 40 deletions(-)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [net 1/6] net/mlx5: Fix create vport flow table flow
  2017-06-11 14:00 [pull request][net 0/6] Mellanox mlx5 fixes 2017-06-11 Saeed Mahameed
@ 2017-06-11 14:00 ` Saeed Mahameed
  2017-06-11 14:00 ` [net 2/6] net/mlx5: Continue health polling until it is explicitly stopped Saeed Mahameed
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Saeed Mahameed @ 2017-06-11 14:00 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Mohamad Haj Yahia, Saeed Mahameed

From: Mohamad Haj Yahia <mohamad@mellanox.com>

Send vport number to the create flow table inner method instead of
ignoring the vport argument and sending always 0.

Fixes: b3ba51498bdd ('net/mlx5: Refactor create flow table method to accept underlay QP')
Signed-off-by: Mohamad Haj Yahia <mohamad@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
index 0e487e8ca634..8f5125ccd8d4 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
@@ -862,7 +862,7 @@ struct mlx5_flow_table *mlx5_create_vport_flow_table(struct mlx5_flow_namespace
 	ft_attr.level   = level;
 	ft_attr.prio    = prio;
 
-	return __mlx5_create_flow_table(ns, &ft_attr, FS_FT_OP_MOD_NORMAL, 0);
+	return __mlx5_create_flow_table(ns, &ft_attr, FS_FT_OP_MOD_NORMAL, vport);
 }
 
 struct mlx5_flow_table*
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [net 2/6] net/mlx5: Continue health polling until it is explicitly stopped
  2017-06-11 14:00 [pull request][net 0/6] Mellanox mlx5 fixes 2017-06-11 Saeed Mahameed
  2017-06-11 14:00 ` [net 1/6] net/mlx5: Fix create vport flow table flow Saeed Mahameed
@ 2017-06-11 14:00 ` Saeed Mahameed
  2017-06-11 14:00 ` [net 3/6] net/mlx5: Remove several module events out of ethtool stats Saeed Mahameed
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Saeed Mahameed @ 2017-06-11 14:00 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Mohamad Haj Yahia, Saeed Mahameed

From: Mohamad Haj Yahia <mohamad@mellanox.com>

The issue is that when we get an assert we will stop polling the health
and thus we cant enter error state when we have a real health issue.

Fixes: fd76ee4da55a ('net/mlx5_core: Fix internal error detection conditions')
Signed-off-by: Mohamad Haj Yahia <mohamad@mellanox.com>
Reviewed-by: Daniel Jurgens <danielj@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/health.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/health.c b/drivers/net/ethernet/mellanox/mlx5/core/health.c
index 44f59b1d6f0f..f27f84ffbc85 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/health.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/health.c
@@ -275,10 +275,8 @@ static void poll_health(unsigned long data)
 	struct mlx5_core_health *health = &dev->priv.health;
 	u32 count;
 
-	if (dev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR) {
-		mod_timer(&health->timer, get_next_poll_jiffies());
-		return;
-	}
+	if (dev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR)
+		goto out;
 
 	count = ioread32be(health->health_counter);
 	if (count == health->prev)
@@ -290,8 +288,6 @@ static void poll_health(unsigned long data)
 	if (health->miss_counter == MAX_MISSES) {
 		dev_err(&dev->pdev->dev, "device's health compromised - reached miss count\n");
 		print_health_info(dev);
-	} else {
-		mod_timer(&health->timer, get_next_poll_jiffies());
 	}
 
 	if (in_fatal(dev) && !health->sick) {
@@ -305,6 +301,9 @@ static void poll_health(unsigned long data)
 				"new health works are not permitted at this stage\n");
 		spin_unlock(&health->wq_lock);
 	}
+
+out:
+	mod_timer(&health->timer, get_next_poll_jiffies());
 }
 
 void mlx5_start_health_poll(struct mlx5_core_dev *dev)
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [net 3/6] net/mlx5: Remove several module events out of ethtool stats
  2017-06-11 14:00 [pull request][net 0/6] Mellanox mlx5 fixes 2017-06-11 Saeed Mahameed
  2017-06-11 14:00 ` [net 1/6] net/mlx5: Fix create vport flow table flow Saeed Mahameed
  2017-06-11 14:00 ` [net 2/6] net/mlx5: Continue health polling until it is explicitly stopped Saeed Mahameed
@ 2017-06-11 14:00 ` Saeed Mahameed
  2017-06-11 14:00 ` [net 4/6] net/mlx5e: Added BW check for DIM decision mechanism Saeed Mahameed
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Saeed Mahameed @ 2017-06-11 14:00 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Huy Nguyen, Saeed Mahameed

From: Huy Nguyen <huyn@mellanox.com>

Remove the following module event counters out of ethtool stats. The
reason for removing these event counters is that these events do not
occur without techinician's intervention.
  module_pwr_budget_exd
  module_long_range
  module_no_eeprom
  module_enforce_part
  module_unknown_id
  module_unknown_status
  module_plug

Fixes: bedb7c909c19 ("net/mlx5e: Add port module event counters to ethtool stats")
Signed-off-by: Huy Nguyen <huyn@mellanox.com>
Reviewed by: Gal Pressman <galp@mellanox.com>

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_stats.h | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h
index 53e4992d6511..f81c3aa60b46 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h
@@ -417,20 +417,13 @@ struct mlx5e_stats {
 };
 
 static const struct counter_desc mlx5e_pme_status_desc[] = {
-	{ "module_plug", 0 },
 	{ "module_unplug", 8 },
 };
 
 static const struct counter_desc mlx5e_pme_error_desc[] = {
-	{ "module_pwr_budget_exd", 0 },  /* power budget exceed */
-	{ "module_long_range", 8 },      /* long range for non MLNX cable */
-	{ "module_bus_stuck", 16 },      /* bus stuck (I2C or data shorted) */
-	{ "module_no_eeprom", 24 },      /* no eeprom/retry time out */
-	{ "module_enforce_part", 32 },   /* enforce part number list */
-	{ "module_unknown_id", 40 },     /* unknown identifier */
-	{ "module_high_temp", 48 },      /* high temperature */
+	{ "module_bus_stuck", 16 },       /* bus stuck (I2C or data shorted) */
+	{ "module_high_temp", 48 },       /* high temperature */
 	{ "module_bad_shorted", 56 },    /* bad or shorted cable/module */
-	{ "module_unknown_status", 64 },
 };
 
 #endif /* __MLX5_EN_STATS_H__ */
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [net 4/6] net/mlx5e: Added BW check for DIM decision mechanism
  2017-06-11 14:00 [pull request][net 0/6] Mellanox mlx5 fixes 2017-06-11 Saeed Mahameed
                   ` (2 preceding siblings ...)
  2017-06-11 14:00 ` [net 3/6] net/mlx5: Remove several module events out of ethtool stats Saeed Mahameed
@ 2017-06-11 14:00 ` Saeed Mahameed
  2017-06-11 14:00 ` [net 5/6] net/mlx5e: Fix wrong indications in DIM due to counter wraparound Saeed Mahameed
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Saeed Mahameed @ 2017-06-11 14:00 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Tal Gilboa, Saeed Mahameed

From: Tal Gilboa <talgi@mellanox.com>

DIM (Dynamically-tuned Interrupt Moderation) is a mechanism designed for
changing the channel interrupt moderation values in order to reduce CPU
overhead for all traffic types.
Until now only interrupt and packet rate were sampled.
We found a scenario on which we get a false indication since a change in
DIM caused more aggregation and reduced packet rate while increasing BW.

We now regard a change as succesfull iff:
current_BW > (prev_BW + threshold) or
current_BW ~= prev_BW and current_PR > (prev_PR + threshold) or
current_BW ~= prev_BW and current_PR ~= prev_PR and
    current_IR < (prev_IR - threshold)
Where BW = Bandwidth, PR = Packet rate and IR = Interrupt rate

Improvements (ConnectX-4Lx 25GbE, single RX queue, LRO off)
    --------------------------------------------------
    packet size | before[Mb/s] | after[Mb/s] | gain  |
    2B          | 343.4        | 359.4       |  4.5% |
    16B         | 2739.7       | 2814.8      |  2.7% |
    64B         | 9739         | 10185.3     |  4.5% |

Fixes: cb3c7fd4f839 ("net/mlx5e: Support adaptive RX coalescing")
Signed-off-by: Tal Gilboa <talgi@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en.h       |  2 ++
 drivers/net/ethernet/mellanox/mlx5/core/en_rx_am.c | 37 ++++++++++++----------
 2 files changed, 22 insertions(+), 17 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h
index 2fd044b23875..429da21a583d 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h
@@ -458,12 +458,14 @@ struct mlx5e_mpw_info {
 
 struct mlx5e_rx_am_stats {
 	int ppms; /* packets per msec */
+	int bpms; /* bytes per msec */
 	int epms; /* events per msec */
 };
 
 struct mlx5e_rx_am_sample {
 	ktime_t		time;
 	unsigned int	pkt_ctr;
+	unsigned int    byte_ctr;
 	u16		event_ctr;
 };
 
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx_am.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx_am.c
index 02dd3a95ed8f..54cdda957f9a 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx_am.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx_am.c
@@ -183,28 +183,27 @@ static void mlx5e_am_exit_parking(struct mlx5e_rx_am *am)
 	mlx5e_am_step(am);
 }
 
+#define IS_SIGNIFICANT_DIFF(val, ref) \
+	(((100 * abs((val) - (ref))) / (ref)) > 10) /* more than 10% difference */
+
 static int mlx5e_am_stats_compare(struct mlx5e_rx_am_stats *curr,
 				  struct mlx5e_rx_am_stats *prev)
 {
-	int diff;
-
-	if (!prev->ppms)
-		return curr->ppms ? MLX5E_AM_STATS_BETTER :
+	if (!prev->bpms)
+		return curr->bpms ? MLX5E_AM_STATS_BETTER :
 				    MLX5E_AM_STATS_SAME;
 
-	diff = curr->ppms - prev->ppms;
-	if (((100 * abs(diff)) / prev->ppms) > 10) /* more than 10% diff */
-		return (diff > 0) ? MLX5E_AM_STATS_BETTER :
-				    MLX5E_AM_STATS_WORSE;
+	if (IS_SIGNIFICANT_DIFF(curr->bpms, prev->bpms))
+		return (curr->bpms > prev->bpms) ? MLX5E_AM_STATS_BETTER :
+						   MLX5E_AM_STATS_WORSE;
 
-	if (!prev->epms)
-		return curr->epms ? MLX5E_AM_STATS_WORSE :
-				    MLX5E_AM_STATS_SAME;
+	if (IS_SIGNIFICANT_DIFF(curr->ppms, prev->ppms))
+		return (curr->ppms > prev->ppms) ? MLX5E_AM_STATS_BETTER :
+						   MLX5E_AM_STATS_WORSE;
 
-	diff = curr->epms - prev->epms;
-	if (((100 * abs(diff)) / prev->epms) > 10) /* more than 10% diff */
-		return (diff < 0) ? MLX5E_AM_STATS_BETTER :
-				    MLX5E_AM_STATS_WORSE;
+	if (IS_SIGNIFICANT_DIFF(curr->epms, prev->epms))
+		return (curr->epms < prev->epms) ? MLX5E_AM_STATS_BETTER :
+						   MLX5E_AM_STATS_WORSE;
 
 	return MLX5E_AM_STATS_SAME;
 }
@@ -266,6 +265,7 @@ static void mlx5e_am_sample(struct mlx5e_rq *rq,
 {
 	s->time	     = ktime_get();
 	s->pkt_ctr   = rq->stats.packets;
+	s->byte_ctr  = rq->stats.bytes;
 	s->event_ctr = rq->cq.event_ctr;
 }
 
@@ -278,12 +278,15 @@ static void mlx5e_am_calc_stats(struct mlx5e_rx_am_sample *start,
 	/* u32 holds up to 71 minutes, should be enough */
 	u32 delta_us = ktime_us_delta(end->time, start->time);
 	unsigned int npkts = end->pkt_ctr - start->pkt_ctr;
+	unsigned int nbytes = end->byte_ctr - start->byte_ctr;
 
 	if (!delta_us)
 		return;
 
-	curr_stats->ppms =            (npkts * USEC_PER_MSEC) / delta_us;
-	curr_stats->epms = (MLX5E_AM_NEVENTS * USEC_PER_MSEC) / delta_us;
+	curr_stats->ppms = DIV_ROUND_UP(npkts * USEC_PER_MSEC, delta_us);
+	curr_stats->bpms = DIV_ROUND_UP(nbytes * USEC_PER_MSEC, delta_us);
+	curr_stats->epms = DIV_ROUND_UP(MLX5E_AM_NEVENTS * USEC_PER_MSEC,
+					delta_us);
 }
 
 void mlx5e_rx_am_work(struct work_struct *work)
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [net 5/6] net/mlx5e: Fix wrong indications in DIM due to counter wraparound
  2017-06-11 14:00 [pull request][net 0/6] Mellanox mlx5 fixes 2017-06-11 Saeed Mahameed
                   ` (3 preceding siblings ...)
  2017-06-11 14:00 ` [net 4/6] net/mlx5e: Added BW check for DIM decision mechanism Saeed Mahameed
@ 2017-06-11 14:00 ` Saeed Mahameed
  2017-06-11 14:00 ` [net 6/6] net/mlx5: Enable 4K UAR only when page size is bigger than 4K Saeed Mahameed
  2017-06-11 20:42 ` [pull request][net 0/6] Mellanox mlx5 fixes 2017-06-11 David Miller
  6 siblings, 0 replies; 8+ messages in thread
From: Saeed Mahameed @ 2017-06-11 14:00 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Tal Gilboa, Saeed Mahameed

From: Tal Gilboa <talgi@mellanox.com>

DIM (Dynamically-tuned Interrupt Moderation) is a mechanism designed for
changing the channel interrupt moderation values in order to reduce CPU
overhead for all traffic types.
Each iteration of the algorithm, DIM calculates the difference in
throughput, packet rate and interrupt rate from last iteration in order
to make a decision. DIM relies on counters for each metric. When these
counters get to their type's max value they wraparound. In this case
the delta between 'end' and 'start' samples is negative and when
translated to unsigned integers - very high. This results in a false
indication to the algorithm and might result in a wrong decision.

The fix calculates the 'distance' between 'end' and 'start' samples in a
cyclic way around the relevant type's max value. It can also be viewed as
an absolute value around the type's max value instead of around 0.

Testing show higher stability in DIM profile selection and no wraparound
issues.

Fixes: cb3c7fd4f839 ("net/mlx5e: Support adaptive RX coalescing")
Signed-off-by: Tal Gilboa <talgi@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en.h       |  8 ++++----
 drivers/net/ethernet/mellanox/mlx5/core/en_rx_am.c | 10 +++++++---
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h
index 429da21a583d..944fc1742464 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h
@@ -463,10 +463,10 @@ struct mlx5e_rx_am_stats {
 };
 
 struct mlx5e_rx_am_sample {
-	ktime_t		time;
-	unsigned int	pkt_ctr;
-	unsigned int    byte_ctr;
-	u16		event_ctr;
+	ktime_t	time;
+	u32	pkt_ctr;
+	u32	byte_ctr;
+	u16	event_ctr;
 };
 
 struct mlx5e_rx_am { /* Adaptive Moderation */
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx_am.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx_am.c
index 54cdda957f9a..acf32fe952cd 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx_am.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx_am.c
@@ -270,6 +270,8 @@ static void mlx5e_am_sample(struct mlx5e_rq *rq,
 }
 
 #define MLX5E_AM_NEVENTS 64
+#define BITS_PER_TYPE(type) (sizeof(type) * BITS_PER_BYTE)
+#define BIT_GAP(bits, end, start) ((((end) - (start)) + BIT_ULL(bits)) & (BIT_ULL(bits) - 1))
 
 static void mlx5e_am_calc_stats(struct mlx5e_rx_am_sample *start,
 				struct mlx5e_rx_am_sample *end,
@@ -277,8 +279,9 @@ static void mlx5e_am_calc_stats(struct mlx5e_rx_am_sample *start,
 {
 	/* u32 holds up to 71 minutes, should be enough */
 	u32 delta_us = ktime_us_delta(end->time, start->time);
-	unsigned int npkts = end->pkt_ctr - start->pkt_ctr;
-	unsigned int nbytes = end->byte_ctr - start->byte_ctr;
+	u32 npkts = BIT_GAP(BITS_PER_TYPE(u32), end->pkt_ctr, start->pkt_ctr);
+	u32 nbytes = BIT_GAP(BITS_PER_TYPE(u32), end->byte_ctr,
+			     start->byte_ctr);
 
 	if (!delta_us)
 		return;
@@ -311,7 +314,8 @@ void mlx5e_rx_am(struct mlx5e_rq *rq)
 
 	switch (am->state) {
 	case MLX5E_AM_MEASURE_IN_PROGRESS:
-		nevents = rq->cq.event_ctr - am->start_sample.event_ctr;
+		nevents = BIT_GAP(BITS_PER_TYPE(u16), rq->cq.event_ctr,
+				  am->start_sample.event_ctr);
 		if (nevents < MLX5E_AM_NEVENTS)
 			break;
 		mlx5e_am_sample(rq, &end_sample);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [net 6/6] net/mlx5: Enable 4K UAR only when page size is bigger than 4K
  2017-06-11 14:00 [pull request][net 0/6] Mellanox mlx5 fixes 2017-06-11 Saeed Mahameed
                   ` (4 preceding siblings ...)
  2017-06-11 14:00 ` [net 5/6] net/mlx5e: Fix wrong indications in DIM due to counter wraparound Saeed Mahameed
@ 2017-06-11 14:00 ` Saeed Mahameed
  2017-06-11 20:42 ` [pull request][net 0/6] Mellanox mlx5 fixes 2017-06-11 David Miller
  6 siblings, 0 replies; 8+ messages in thread
From: Saeed Mahameed @ 2017-06-11 14:00 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Majd Dibbiny, Saeed Mahameed

From: Majd Dibbiny <majd@mellanox.com>

When the page size isn't bigger than 4K, there is no added value of enabling 4K
UAR feature in the Firmware.

Modified the condition of enabling the 4K UAR accordingly.

Fixes: f502d834950a ("net/mlx5: Activate support for 4K UARs")
Signed-off-by: Majd Dibbiny <majd@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index af945edfee19..4f577a5abf88 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -537,8 +537,10 @@ static int handle_hca_cap(struct mlx5_core_dev *dev)
 	/* disable cmdif checksum */
 	MLX5_SET(cmd_hca_cap, set_hca_cap, cmdif_checksum, 0);
 
-	/* If the HCA supports 4K UARs use it */
-	if (MLX5_CAP_GEN_MAX(dev, uar_4k))
+	/* Enable 4K UAR only when HCA supports it and page size is bigger
+	 * than 4K.
+	 */
+	if (MLX5_CAP_GEN_MAX(dev, uar_4k) && PAGE_SIZE > 4096)
 		MLX5_SET(cmd_hca_cap, set_hca_cap, uar_4k, 1);
 
 	MLX5_SET(cmd_hca_cap, set_hca_cap, log_uar_page_sz, PAGE_SHIFT - 12);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [pull request][net 0/6] Mellanox mlx5 fixes 2017-06-11
  2017-06-11 14:00 [pull request][net 0/6] Mellanox mlx5 fixes 2017-06-11 Saeed Mahameed
                   ` (5 preceding siblings ...)
  2017-06-11 14:00 ` [net 6/6] net/mlx5: Enable 4K UAR only when page size is bigger than 4K Saeed Mahameed
@ 2017-06-11 20:42 ` David Miller
  6 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2017-06-11 20:42 UTC (permalink / raw)
  To: saeedm; +Cc: netdev

From: Saeed Mahameed <saeedm@mellanox.com>
Date: Sun, 11 Jun 2017 17:00:22 +0300

> This series contains some fixes for the mlx5 core and netdev driver.
> 
> Please pull and let me know if there's any problem.

Pulled, thanks.

> For -stable:
> ("net/mlx5e: Added BW check for DIM decision mechanism")              kernels >= 4.9
> ("net/mlx5e: Fix wrong indications in DIM due to counter wraparound") kernels >= 4.9
> ("net/mlx5: Remove several module events out of ethtool stats")       kernels >= 4.10
> ("net/mlx5: Enable 4K UAR only when page size is bigger than 4K")     kernels >= 4.11
> 
> *all patches apply with no issue on their -stable.
> 
> BTW I never asked you if this way of marking patches to -stable is good for you ?
> if you prefer another format please let me know.

It works fine for now, I'll let you know if it causes problems :)

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-06-11 20:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-11 14:00 [pull request][net 0/6] Mellanox mlx5 fixes 2017-06-11 Saeed Mahameed
2017-06-11 14:00 ` [net 1/6] net/mlx5: Fix create vport flow table flow Saeed Mahameed
2017-06-11 14:00 ` [net 2/6] net/mlx5: Continue health polling until it is explicitly stopped Saeed Mahameed
2017-06-11 14:00 ` [net 3/6] net/mlx5: Remove several module events out of ethtool stats Saeed Mahameed
2017-06-11 14:00 ` [net 4/6] net/mlx5e: Added BW check for DIM decision mechanism Saeed Mahameed
2017-06-11 14:00 ` [net 5/6] net/mlx5e: Fix wrong indications in DIM due to counter wraparound Saeed Mahameed
2017-06-11 14:00 ` [net 6/6] net/mlx5: Enable 4K UAR only when page size is bigger than 4K Saeed Mahameed
2017-06-11 20:42 ` [pull request][net 0/6] Mellanox mlx5 fixes 2017-06-11 David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).