aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mlx5
diff options
context:
space:
mode:
authorMohamad Haj Yahia <mohamad@mellanox.com>2016-11-17 06:45:55 -0500
committerDavid S. Miller <davem@davemloft.net>2016-11-18 12:08:56 -0500
commit0ac3ea70897fb9f84b620aeda074ecccf481629d (patch)
treebde6967a5c1435e260b38eff63275b6f85af95f9 /include/linux/mlx5
parent7a8bca043cf1bb0433aa43d008b6c4de6c07d6a2 (diff)
net/mlx5: Make the command interface cache more flexible
Add more cache command size sets and more entries for each set based on the current commands set different sizes and commands frequency. Fixes: e126ba97dba9 ('mlx5: Add driver for Mellanox Connect-IB adapters') Signed-off-by: Mohamad Haj Yahia <mohamad@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/mlx5')
-rw-r--r--include/linux/mlx5/driver.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index ecc451d89ccd..5e7dbbcf47f0 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -208,7 +208,7 @@ struct mlx5_cmd_first {
208 208
209struct mlx5_cmd_msg { 209struct mlx5_cmd_msg {
210 struct list_head list; 210 struct list_head list;
211 struct cache_ent *cache; 211 struct cmd_msg_cache *parent;
212 u32 len; 212 u32 len;
213 struct mlx5_cmd_first first; 213 struct mlx5_cmd_first first;
214 struct mlx5_cmd_mailbox *next; 214 struct mlx5_cmd_mailbox *next;
@@ -228,17 +228,17 @@ struct mlx5_cmd_debug {
228 u16 outlen; 228 u16 outlen;
229}; 229};
230 230
231struct cache_ent { 231struct cmd_msg_cache {
232 /* protect block chain allocations 232 /* protect block chain allocations
233 */ 233 */
234 spinlock_t lock; 234 spinlock_t lock;
235 struct list_head head; 235 struct list_head head;
236 unsigned int max_inbox_size;
237 unsigned int num_ent;
236}; 238};
237 239
238struct cmd_msg_cache { 240enum {
239 struct cache_ent large; 241 MLX5_NUM_COMMAND_CACHES = 5,
240 struct cache_ent med;
241
242}; 242};
243 243
244struct mlx5_cmd_stats { 244struct mlx5_cmd_stats {
@@ -281,7 +281,7 @@ struct mlx5_cmd {
281 struct mlx5_cmd_work_ent *ent_arr[MLX5_MAX_COMMANDS]; 281 struct mlx5_cmd_work_ent *ent_arr[MLX5_MAX_COMMANDS];
282 struct pci_pool *pool; 282 struct pci_pool *pool;
283 struct mlx5_cmd_debug dbg; 283 struct mlx5_cmd_debug dbg;
284 struct cmd_msg_cache cache; 284 struct cmd_msg_cache cache[MLX5_NUM_COMMAND_CACHES];
285 int checksum_disabled; 285 int checksum_disabled;
286 struct mlx5_cmd_stats stats[MLX5_CMD_OP_MAX]; 286 struct mlx5_cmd_stats stats[MLX5_CMD_OP_MAX];
287}; 287};