Skip to content

Commit 0a6ce1e

Browse files
committed
Merge tag 'shared-for-4.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma
Saeed Mahameed says: ==================== Mellanox mlx5 core driver updates 2016-10-25 This series contains some updates and fixes of mlx5 core and IB drivers with the addition of two features that demand new low level commands and infrastructure updates. - SRIOV VF max rate limit support - mlx5e tc support for FWD rules with counter. Needed for both net and rdma subsystems. Updates and Fixes: From Saeed Mahameed (2): - mlx5 IB: Skip handling unknown mlx5 events - Add ConnectX-5 PCIe 4.0 VF device ID From Artemy Kovalyov (2): - Update struct mlx5_ifc_xrqc_bits - Ensure SRQ physical address structure endianness From Eugenia Emantayev (1): - Fix length of async_event_mask New Features: From Mohamad Haj Yahia (3): mlx5 SRIOV VF max rate limit support - Introduce TSAR manipulation firmware commands - Introduce E-switch QoS management - Add SRIOV VF max rate configuration support From Mark Bloch (7): mlx5e Tc support for FWD rule with counter - Don't unlock fte while still using it - Use fte status to decide on firmware command - Refactor find_flow_rule - Group similar rules under the same fte - Add multi dest support - Add option to add fwd rule with counter - mlx5e tc support for FWD rule with counter Mark here fixed two trivial issues with the flow steering core, and did some refactoring in the flow steering API to support adding mulit destination rules to the same hardware flow table entry at once. In the last two patches added the ability to populate a flow rule with a flow counter to the same flow entry. V2: Dropped some patches that added new structures without adding any usage of them. Added SRIOV VF max rate configuration support patch that introduces the usage of the TSAR infrastructure. Added flow steering fixes and refactoring in addition to mlx5 tc support for forward rule with counter. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents d46b634 + e37a79e commit 0a6ce1e

File tree

22 files changed

+927
-289
lines changed

22 files changed

+927
-289
lines changed

drivers/infiniband/hw/mlx5/main.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1771,13 +1771,13 @@ static int mlx5_ib_destroy_flow(struct ib_flow *flow_id)
17711771
mutex_lock(&dev->flow_db.lock);
17721772

17731773
list_for_each_entry_safe(iter, tmp, &handler->list, list) {
1774-
mlx5_del_flow_rule(iter->rule);
1774+
mlx5_del_flow_rules(iter->rule);
17751775
put_flow_table(dev, iter->prio, true);
17761776
list_del(&iter->list);
17771777
kfree(iter);
17781778
}
17791779

1780-
mlx5_del_flow_rule(handler->rule);
1780+
mlx5_del_flow_rules(handler->rule);
17811781
put_flow_table(dev, handler->prio, true);
17821782
mutex_unlock(&dev->flow_db.lock);
17831783

@@ -1907,10 +1907,10 @@ static struct mlx5_ib_flow_handler *create_flow_rule(struct mlx5_ib_dev *dev,
19071907
spec->match_criteria_enable = get_match_criteria_enable(spec->match_criteria);
19081908
action = dst ? MLX5_FLOW_CONTEXT_ACTION_FWD_DEST :
19091909
MLX5_FLOW_CONTEXT_ACTION_FWD_NEXT_PRIO;
1910-
handler->rule = mlx5_add_flow_rule(ft, spec,
1910+
handler->rule = mlx5_add_flow_rules(ft, spec,
19111911
action,
19121912
MLX5_FS_DEFAULT_FLOW_TAG,
1913-
dst);
1913+
dst, 1);
19141914

19151915
if (IS_ERR(handler->rule)) {
19161916
err = PTR_ERR(handler->rule);
@@ -1941,7 +1941,7 @@ static struct mlx5_ib_flow_handler *create_dont_trap_rule(struct mlx5_ib_dev *de
19411941
handler_dst = create_flow_rule(dev, ft_prio,
19421942
flow_attr, dst);
19431943
if (IS_ERR(handler_dst)) {
1944-
mlx5_del_flow_rule(handler->rule);
1944+
mlx5_del_flow_rules(handler->rule);
19451945
ft_prio->refcount--;
19461946
kfree(handler);
19471947
handler = handler_dst;
@@ -2004,7 +2004,7 @@ static struct mlx5_ib_flow_handler *create_leftovers_rule(struct mlx5_ib_dev *de
20042004
&leftovers_specs[LEFTOVERS_UC].flow_attr,
20052005
dst);
20062006
if (IS_ERR(handler_ucast)) {
2007-
mlx5_del_flow_rule(handler->rule);
2007+
mlx5_del_flow_rules(handler->rule);
20082008
ft_prio->refcount--;
20092009
kfree(handler);
20102010
handler = handler_ucast;
@@ -2046,7 +2046,7 @@ static struct mlx5_ib_flow_handler *create_sniffer_rule(struct mlx5_ib_dev *dev,
20462046
return handler_rx;
20472047

20482048
err_tx:
2049-
mlx5_del_flow_rule(handler_rx->rule);
2049+
mlx5_del_flow_rules(handler_rx->rule);
20502050
ft_rx->refcount--;
20512051
kfree(handler_rx);
20522052
err:
@@ -2358,6 +2358,8 @@ static void mlx5_ib_event(struct mlx5_core_dev *dev, void *context,
23582358
ibev.event = IB_EVENT_CLIENT_REREGISTER;
23592359
port = (u8)param;
23602360
break;
2361+
default:
2362+
return;
23612363
}
23622364

23632365
ibev.device = &ibdev->ib_dev;

drivers/infiniband/hw/mlx5/mlx5_ib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ struct mlx5_ib_flow_handler {
153153
struct list_head list;
154154
struct ib_flow ibflow;
155155
struct mlx5_ib_flow_prio *prio;
156-
struct mlx5_flow_rule *rule;
156+
struct mlx5_flow_handle *rule;
157157
};
158158

159159
struct mlx5_ib_flow_db {

drivers/net/ethernet/mellanox/mlx5/core/cmd.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,8 @@ static int mlx5_internal_err_ret_value(struct mlx5_core_dev *dev, u16 op,
318318
case MLX5_CMD_OP_SET_FLOW_TABLE_ENTRY:
319319
case MLX5_CMD_OP_SET_FLOW_TABLE_ROOT:
320320
case MLX5_CMD_OP_DEALLOC_ENCAP_HEADER:
321+
case MLX5_CMD_OP_DESTROY_SCHEDULING_ELEMENT:
322+
case MLX5_CMD_OP_DESTROY_QOS_PARA_VPORT:
321323
return MLX5_CMD_STAT_OK;
322324

323325
case MLX5_CMD_OP_QUERY_HCA_CAP:
@@ -419,11 +421,14 @@ static int mlx5_internal_err_ret_value(struct mlx5_core_dev *dev, u16 op,
419421
case MLX5_CMD_OP_QUERY_FLOW_TABLE:
420422
case MLX5_CMD_OP_CREATE_FLOW_GROUP:
421423
case MLX5_CMD_OP_QUERY_FLOW_GROUP:
422-
423424
case MLX5_CMD_OP_QUERY_FLOW_TABLE_ENTRY:
424425
case MLX5_CMD_OP_ALLOC_FLOW_COUNTER:
425426
case MLX5_CMD_OP_QUERY_FLOW_COUNTER:
426427
case MLX5_CMD_OP_ALLOC_ENCAP_HEADER:
428+
case MLX5_CMD_OP_CREATE_SCHEDULING_ELEMENT:
429+
case MLX5_CMD_OP_QUERY_SCHEDULING_ELEMENT:
430+
case MLX5_CMD_OP_MODIFY_SCHEDULING_ELEMENT:
431+
case MLX5_CMD_OP_CREATE_QOS_PARA_VPORT:
427432
*status = MLX5_DRIVER_STATUS_ABORTED;
428433
*synd = MLX5_DRIVER_SYND;
429434
return -EIO;
@@ -580,6 +585,12 @@ const char *mlx5_command_str(int command)
580585
MLX5_COMMAND_STR_CASE(MODIFY_FLOW_TABLE);
581586
MLX5_COMMAND_STR_CASE(ALLOC_ENCAP_HEADER);
582587
MLX5_COMMAND_STR_CASE(DEALLOC_ENCAP_HEADER);
588+
MLX5_COMMAND_STR_CASE(CREATE_SCHEDULING_ELEMENT);
589+
MLX5_COMMAND_STR_CASE(DESTROY_SCHEDULING_ELEMENT);
590+
MLX5_COMMAND_STR_CASE(QUERY_SCHEDULING_ELEMENT);
591+
MLX5_COMMAND_STR_CASE(MODIFY_SCHEDULING_ELEMENT);
592+
MLX5_COMMAND_STR_CASE(CREATE_QOS_PARA_VPORT);
593+
MLX5_COMMAND_STR_CASE(DESTROY_QOS_PARA_VPORT);
583594
default: return "unknown command opcode";
584595
}
585596
}

drivers/net/ethernet/mellanox/mlx5/core/en.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ struct mlx5e_vxlan_db {
524524

525525
struct mlx5e_l2_rule {
526526
u8 addr[ETH_ALEN + 2];
527-
struct mlx5_flow_rule *rule;
527+
struct mlx5_flow_handle *rule;
528528
};
529529

530530
struct mlx5e_flow_table {
@@ -545,10 +545,10 @@ struct mlx5e_tc_table {
545545
struct mlx5e_vlan_table {
546546
struct mlx5e_flow_table ft;
547547
unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)];
548-
struct mlx5_flow_rule *active_vlans_rule[VLAN_N_VID];
549-
struct mlx5_flow_rule *untagged_rule;
550-
struct mlx5_flow_rule *any_vlan_rule;
551-
bool filter_disabled;
548+
struct mlx5_flow_handle *active_vlans_rule[VLAN_N_VID];
549+
struct mlx5_flow_handle *untagged_rule;
550+
struct mlx5_flow_handle *any_vlan_rule;
551+
bool filter_disabled;
552552
};
553553

554554
struct mlx5e_l2_table {
@@ -566,14 +566,14 @@ struct mlx5e_l2_table {
566566
/* L3/L4 traffic type classifier */
567567
struct mlx5e_ttc_table {
568568
struct mlx5e_flow_table ft;
569-
struct mlx5_flow_rule *rules[MLX5E_NUM_TT];
569+
struct mlx5_flow_handle *rules[MLX5E_NUM_TT];
570570
};
571571

572572
#define ARFS_HASH_SHIFT BITS_PER_BYTE
573573
#define ARFS_HASH_SIZE BIT(BITS_PER_BYTE)
574574
struct arfs_table {
575575
struct mlx5e_flow_table ft;
576-
struct mlx5_flow_rule *default_rule;
576+
struct mlx5_flow_handle *default_rule;
577577
struct hlist_head rules_hash[ARFS_HASH_SIZE];
578578
};
579579

drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ struct arfs_tuple {
5656
struct arfs_rule {
5757
struct mlx5e_priv *priv;
5858
struct work_struct arfs_work;
59-
struct mlx5_flow_rule *rule;
59+
struct mlx5_flow_handle *rule;
6060
struct hlist_node hlist;
6161
int rxq;
6262
/* Flow ID passed to ndo_rx_flow_steer */
@@ -104,7 +104,7 @@ static int arfs_disable(struct mlx5e_priv *priv)
104104
tt = arfs_get_tt(i);
105105
/* Modify ttc rules destination to bypass the aRFS tables*/
106106
err = mlx5_modify_rule_destination(priv->fs.ttc.rules[tt],
107-
&dest);
107+
&dest, NULL);
108108
if (err) {
109109
netdev_err(priv->netdev,
110110
"%s: modify ttc destination failed\n",
@@ -137,7 +137,7 @@ int mlx5e_arfs_enable(struct mlx5e_priv *priv)
137137
tt = arfs_get_tt(i);
138138
/* Modify ttc rules destination to point on the aRFS FTs */
139139
err = mlx5_modify_rule_destination(priv->fs.ttc.rules[tt],
140-
&dest);
140+
&dest, NULL);
141141
if (err) {
142142
netdev_err(priv->netdev,
143143
"%s: modify ttc destination failed err=%d\n",
@@ -151,7 +151,7 @@ int mlx5e_arfs_enable(struct mlx5e_priv *priv)
151151

152152
static void arfs_destroy_table(struct arfs_table *arfs_t)
153153
{
154-
mlx5_del_flow_rule(arfs_t->default_rule);
154+
mlx5_del_flow_rules(arfs_t->default_rule);
155155
mlx5e_destroy_flow_table(&arfs_t->ft);
156156
}
157157

@@ -205,10 +205,10 @@ static int arfs_add_default_rule(struct mlx5e_priv *priv,
205205
goto out;
206206
}
207207

208-
arfs_t->default_rule = mlx5_add_flow_rule(arfs_t->ft.t, spec,
209-
MLX5_FLOW_CONTEXT_ACTION_FWD_DEST,
210-
MLX5_FS_DEFAULT_FLOW_TAG,
211-
&dest);
208+
arfs_t->default_rule = mlx5_add_flow_rules(arfs_t->ft.t, spec,
209+
MLX5_FLOW_CONTEXT_ACTION_FWD_DEST,
210+
MLX5_FS_DEFAULT_FLOW_TAG,
211+
&dest, 1);
212212
if (IS_ERR(arfs_t->default_rule)) {
213213
err = PTR_ERR(arfs_t->default_rule);
214214
arfs_t->default_rule = NULL;
@@ -396,7 +396,7 @@ static void arfs_may_expire_flow(struct mlx5e_priv *priv)
396396
spin_unlock_bh(&priv->fs.arfs.arfs_lock);
397397
hlist_for_each_entry_safe(arfs_rule, htmp, &del_list, hlist) {
398398
if (arfs_rule->rule)
399-
mlx5_del_flow_rule(arfs_rule->rule);
399+
mlx5_del_flow_rules(arfs_rule->rule);
400400
hlist_del(&arfs_rule->hlist);
401401
kfree(arfs_rule);
402402
}
@@ -420,7 +420,7 @@ static void arfs_del_rules(struct mlx5e_priv *priv)
420420
hlist_for_each_entry_safe(rule, htmp, &del_list, hlist) {
421421
cancel_work_sync(&rule->arfs_work);
422422
if (rule->rule)
423-
mlx5_del_flow_rule(rule->rule);
423+
mlx5_del_flow_rules(rule->rule);
424424
hlist_del(&rule->hlist);
425425
kfree(rule);
426426
}
@@ -462,12 +462,12 @@ static struct arfs_table *arfs_get_table(struct mlx5e_arfs_tables *arfs,
462462
return NULL;
463463
}
464464

465-
static struct mlx5_flow_rule *arfs_add_rule(struct mlx5e_priv *priv,
466-
struct arfs_rule *arfs_rule)
465+
static struct mlx5_flow_handle *arfs_add_rule(struct mlx5e_priv *priv,
466+
struct arfs_rule *arfs_rule)
467467
{
468468
struct mlx5e_arfs_tables *arfs = &priv->fs.arfs;
469469
struct arfs_tuple *tuple = &arfs_rule->tuple;
470-
struct mlx5_flow_rule *rule = NULL;
470+
struct mlx5_flow_handle *rule = NULL;
471471
struct mlx5_flow_destination dest;
472472
struct arfs_table *arfs_table;
473473
struct mlx5_flow_spec *spec;
@@ -544,9 +544,9 @@ static struct mlx5_flow_rule *arfs_add_rule(struct mlx5e_priv *priv,
544544
}
545545
dest.type = MLX5_FLOW_DESTINATION_TYPE_TIR;
546546
dest.tir_num = priv->direct_tir[arfs_rule->rxq].tirn;
547-
rule = mlx5_add_flow_rule(ft, spec, MLX5_FLOW_CONTEXT_ACTION_FWD_DEST,
548-
MLX5_FS_DEFAULT_FLOW_TAG,
549-
&dest);
547+
rule = mlx5_add_flow_rules(ft, spec, MLX5_FLOW_CONTEXT_ACTION_FWD_DEST,
548+
MLX5_FS_DEFAULT_FLOW_TAG,
549+
&dest, 1);
550550
if (IS_ERR(rule)) {
551551
err = PTR_ERR(rule);
552552
netdev_err(priv->netdev, "%s: add rule(filter id=%d, rq idx=%d) failed, err=%d\n",
@@ -559,14 +559,14 @@ static struct mlx5_flow_rule *arfs_add_rule(struct mlx5e_priv *priv,
559559
}
560560

561561
static void arfs_modify_rule_rq(struct mlx5e_priv *priv,
562-
struct mlx5_flow_rule *rule, u16 rxq)
562+
struct mlx5_flow_handle *rule, u16 rxq)
563563
{
564564
struct mlx5_flow_destination dst;
565565
int err = 0;
566566

567567
dst.type = MLX5_FLOW_DESTINATION_TYPE_TIR;
568568
dst.tir_num = priv->direct_tir[rxq].tirn;
569-
err = mlx5_modify_rule_destination(rule, &dst);
569+
err = mlx5_modify_rule_destination(rule, &dst, NULL);
570570
if (err)
571571
netdev_warn(priv->netdev,
572572
"Failed to modfiy aRFS rule destination to rq=%d\n", rxq);
@@ -578,7 +578,7 @@ static void arfs_handle_work(struct work_struct *work)
578578
struct arfs_rule,
579579
arfs_work);
580580
struct mlx5e_priv *priv = arfs_rule->priv;
581-
struct mlx5_flow_rule *rule;
581+
struct mlx5_flow_handle *rule;
582582

583583
mutex_lock(&priv->state_lock);
584584
if (!test_bit(MLX5E_STATE_OPENED, &priv->state)) {

0 commit comments

Comments
 (0)