Skip to contentSkip to conversation

net: mana: Set default number of queues to 16

PATCH Superseded Long Li 2 participants 3 messages Mar 20 – Mar 23

Subsystems (5)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Long Li

author
#0 lore raw

PATCH 1/1 net: mana: Set default number of queues to 16

Set the default number of queues per vPort to MANA_DEF_NUM_QUEUES (16), as 16 queues can achieve optimal throughput for typical workloads. Users can increase the number of queues up to max_queues via ethtool if needed.

---
 drivers/net/ethernet/microsoft/mana/mana_en.c | 2 +-
 include/net/mana/mana.h                       | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/microsoft/mana/mana_en.c +1 -1
index 49c65cc1697c..7cae8a7b9f31 100644
@@ -3357,7 +3357,7 @@ static int mana_probe_port(struct mana_context *ac, int port_idx,
 	apc->ac = ac;
 	apc->ndev = ndev;
 	apc->max_queues = gc->max_num_queues;
-	apc->num_queues = gc->max_num_queues;
+	apc->num_queues = min(gc->max_num_queues, MANA_DEF_NUM_QUEUES);
 	apc->tx_queue_size = DEF_TX_BUFFERS_PER_QUEUE;
 	apc->rx_queue_size = DEF_RX_BUFFERS_PER_QUEUE;
 	apc->port_handle = INVALID_MANA_HANDLE;
include/net/mana/mana.h +1 -0
index 3336688fed5e..96d21cbbdee2 100644
@@ -1007,6 +1007,7 @@ struct mana_deregister_filter_resp {
 #define STATISTICS_FLAGS_TX_ERRORS_GDMA_ERROR		0x0000000004000000
 
 #define MANA_MAX_NUM_QUEUES 64
+#define MANA_DEF_NUM_QUEUES 16
 
 #define MANA_SHORT_VPORT_OFFSET_MAX ((1U << 8) - 1)
 
Signature · 1 line
2.43.0
reviewer
#1 lore raw
Quoted 15 lines · Long Li

Set the default number of queues per vPort to MANA_DEF_NUM_QUEUES (16), as 16 queues can achieve optimal throughput for typical workloads. Users can increase the number of queues up to max_queues via ethtool if needed.

---
 drivers/net/ethernet/microsoft/mana/mana_en.c | 2 +-
 include/net/mana/mana.h                       | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/microsoft/mana/mana_en.c +0 -0
index 49c65cc1697c..7cae8a7b9f31 100644

drivers/net/ethernet/microsoft/mana/mana_en.c static int mana_probe_port(struct mana_context *ac, int port_idx, · line 3360

Quoted 5 lines
drivers/net/ethernet/microsoft/mana/mana_en.c +1 -1
@@ -3357,7 +3357,7 @@ static int mana_probe_port(struct mana_context *ac, int port_idx,
 	apc->ac = ac;
 	apc->ndev = ndev;
 	apc->max_queues = gc->max_num_queues;
-	apc->num_queues = gc->max_num_queues;
+	apc->num_queues = min(gc->max_num_queues, MANA_DEF_NUM_QUEUES);

Hi Long Li,

Maybe I am misunderstanding things. But it seems to me that this patch sets a ceiling on the default number of queues. Which is subtly different to setting the default. Even if not in practice if max_num_queues is never less than MANA_DEF_NUM_QUEUES.

If so I'm wondering if you could tweak the commit message accordingly.

Quoted 3 lines
drivers/net/ethernet/microsoft/mana/mana_en.c +0 -0
 	apc->tx_queue_size = DEF_TX_BUFFERS_PER_QUEUE;
 	apc->rx_queue_size = DEF_RX_BUFFERS_PER_QUEUE;
 	apc->port_handle = INVALID_MANA_HANDLE;

...

author
#2 lore raw
Quoted 27 lines · Long Li
Quoted 3 lines

Set the default number of queues per vPort to MANA_DEF_NUM_QUEUES (16), as 16 queues can achieve optimal throughput for typical workloads. Users can increase the number of queues up to max_queues via

ethtool if needed.

drivers/net/ethernet/microsoft/mana/mana_en.c static int mana_probe_port(struct mana_context

Quoted 13 lines
---
 drivers/net/ethernet/microsoft/mana/mana_en.c | 2 +-
 include/net/mana/mana.h                       | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/microsoft/mana/mana_en.c +0 -0
index 49c65cc1697c..7cae8a7b9f31 100644
@@ -3357,7 +3357,7 @@ static int mana_probe_port(struct mana_context

*ac, int port_idx,

drivers/net/ethernet/microsoft/mana/mana_en.c static int mana_probe_port(struct mana_context *ac, int port_idx,

Quoted 5 lines
drivers/net/ethernet/microsoft/mana/mana_en.c +1 -1
 	apc->ac = ac;
 	apc->ndev = ndev;
 	apc->max_queues = gc->max_num_queues;
-	apc->num_queues = gc->max_num_queues;
+	apc->num_queues = min(gc->max_num_queues,

MANA_DEF_NUM_QUEUES);

Quoted 8 lines

Hi Long Li,

Maybe I am misunderstanding things. But it seems to me that this patch sets a ceiling on the default number of queues. Which is subtly different to setting the default. Even if not in practice if max_num_queues is never less than MANA_DEF_NUM_QUEUES.

If so I'm wondering if you could tweak the commit message accordingly.

Yes, will tweak the commit message and resend patch.

Thanks,
Long

Quoted 6 lines
Quoted 4 lines
drivers/net/ethernet/microsoft/mana/mana_en.c +0 -0
 	apc->tx_queue_size = DEF_TX_BUFFERS_PER_QUEUE;
 	apc->rx_queue_size = DEF_RX_BUFFERS_PER_QUEUE;
 	apc->port_handle = INVALID_MANA_HANDLE;

...