History

Merge tag 'mlx5-fixes-2019-08-08' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux

Saeed Mahameed says: ==================== Mellanox, mlx5 fixes 2019-08-08 This series introduces some fixes to mlx5 driver. Highlights: 1) From Tariq, Critical mlx5 kTLS fixes to better align with hw specs. 2) From Aya, Fixes to mlx5 tx devlink health reporter. 3) From Maxim, aRFs parsing to use flow dissector to avoid relying on invalid skb fields. Please pull and let me know if there is any problem. For -stable v4.3 ('net/mlx5e: Only support tx/rx pause setting for port owner') For -stable v4.9 ('net/mlx5e: Use flow keys dissector to parse packets for ARFS') For -stable v5.1 ('net/mlx5e: Fix false negative indication on tx reporter CQE recovery') ('net/mlx5e: Remove redundant check in CQE recovery flow of tx reporter') ('net/mlx5e: ethtool, Avoid setting speed to 56GBASE when autoneg off') Note: when merged with net-next this minor conflict will pop up: ++<<<<<<< (net-next) + if (is_eswitch_flow) { + flow->esw_attr->match_level = match_level; + flow->esw_attr->tunnel_match_level = tunnel_match_level; ++======= + if (flow->flags & MLX5E_TC_FLOW_ESWITCH) { + flow->esw_attr->inner_match_level = inner_match_level; + flow->esw_attr->outer_match_level = outer_match_level; ++>>>>>>> (net) To resolve, use hunks from net (2nd) and replace: if (flow->flags & MLX5E_TC_FLOW_ESWITCH) with if (is_eswitch_flow) ====================

David S. Miller committed 7 years ago

Commit 9566e652 parents 8b63816 a4e508c13 files · +101 −109Browse files

Unified · Split

13 files
  1. drivers/net/ethernet/mellanox/mlx5/core/en.h +7 −2
  2. drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c +9 −10
  3. drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.h +4 −2
  4. drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c +5 −5
  5. drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c +34 −63
  6. drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +11 −0
  7. drivers/net/ethernet/mellanox/mlx5/core/en_main.c +0 −1
  8. drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +20 −11
  9. drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +2 −2
  10. drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +4 −8
  11. drivers/net/ethernet/mellanox/mlx5/core/lib/crypto.c +1 −0
  12. include/linux/mlx5/device.h +2 −2
  13. include/linux/mlx5/mlx5_ifc.h +2 −3
drivers/net/ethernet/mellanox/mlx5/core/en.h+7−2
@@ -184,8 +184,13 @@ static inline int mlx5e_get_max_num_channels(struct mlx5_core_dev *mdev) · 183 unmodified lines
184184
185185 struct mlx5e_tx_wqe {
186186 struct mlx5_wqe_ctrl_seg ctrl;
187− struct mlx5_wqe_eth_seg eth;
188− struct mlx5_wqe_data_seg data[0];
187+ union {
188+ struct {
189+ struct mlx5_wqe_eth_seg eth;
190+ struct mlx5_wqe_data_seg data[0];
191+ };
192+ u8 tls_progress_params_ctx[0];
193+ };
189194 };
190195
191196 struct mlx5e_rx_wqe_ll {
drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c+9−10
@@ -76,26 +76,21 @@ static int mlx5e_tx_reporter_err_cqe_recover(struct mlx5e_txqsq *sq) · 75 unmodified lines
7676 u8 state;
7777 int err;
7878
79− if (!test_bit(MLX5E_SQ_STATE_RECOVERING, &sq->state))
80− return 0;
81−
8279 err = mlx5_core_query_sq_state(mdev, sq->sqn, &state);
8380 if (err) {
8481 netdev_err(dev, "Failed to query SQ 0x%x state. err = %d\n",
8582 sq->sqn, err);
86− return err;
83+ goto out;
8784 }
8885
89− if (state != MLX5_SQC_STATE_ERR) {
90− netdev_err(dev, "SQ 0x%x not in ERROR state\n", sq->sqn);
91− return -EINVAL;
92− }
86+ if (state != MLX5_SQC_STATE_ERR)
87+ goto out;
9388
9489 mlx5e_tx_disable_queue(sq->txq);
9590
9691 err = mlx5e_wait_for_sq_flush(sq);
9792 if (err)
98− return err;
93+ goto out;
9994
10095 /* At this point, no new packets will arrive from the stack as TXQ is
10196 * marked with QUEUE_STATE_DRV_XOFF. In addition, NAPI cleared all
@@ -104,13 +99,17 @@ static int mlx5e_tx_reporter_err_cqe_recover(struct mlx5e_txqsq *sq) · 2 unmodified lines
10499
105100 err = mlx5e_sq_to_ready(sq, state);
106101 if (err)
107− return err;
102+ goto out;
108103
109104 mlx5e_reset_txqsq_cc_pc(sq);
110105 sq->stats->recover++;
106+ clear_bit(MLX5E_SQ_STATE_RECOVERING, &sq->state);
111107 mlx5e_activate_txqsq(sq);
112108
113109 return 0;
110+out:
111+ clear_bit(MLX5E_SQ_STATE_RECOVERING, &sq->state);
112+ return err;
114113 }
115114
116115 static int mlx5_tx_health_report(struct devlink_health_reporter *tx_reporter,
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.h+4−2
@@ -11,12 +11,14 @@ · 10 unmodified lines
1111 #include "accel/tls.h"
1212
1313 #define MLX5E_KTLS_STATIC_UMR_WQE_SZ \
14− (sizeof(struct mlx5e_umr_wqe) + MLX5_ST_SZ_BYTES(tls_static_params))
14+ (offsetof(struct mlx5e_umr_wqe, tls_static_params_ctx) + \
15+ MLX5_ST_SZ_BYTES(tls_static_params))
1516 #define MLX5E_KTLS_STATIC_WQEBBS \
1617 (DIV_ROUND_UP(MLX5E_KTLS_STATIC_UMR_WQE_SZ, MLX5_SEND_WQE_BB))
1718
1819 #define MLX5E_KTLS_PROGRESS_WQE_SZ \
19− (sizeof(struct mlx5e_tx_wqe) + MLX5_ST_SZ_BYTES(tls_progress_params))
20+ (offsetof(struct mlx5e_tx_wqe, tls_progress_params_ctx) + \
21+ MLX5_ST_SZ_BYTES(tls_progress_params))
2022 #define MLX5E_KTLS_PROGRESS_WQEBBS \
2123 (DIV_ROUND_UP(MLX5E_KTLS_PROGRESS_WQE_SZ, MLX5_SEND_WQE_BB))
2224 #define MLX5E_KTLS_MAX_DUMP_WQEBBS 2
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c+5−5
@@ -69,7 +69,7 @@ build_static_params(struct mlx5e_umr_wqe *wqe, u16 pc, u32 sqn, · 68 unmodified lines
6969 cseg->qpn_ds = cpu_to_be32((sqn << MLX5_WQE_CTRL_QPN_SHIFT) |
7070 STATIC_PARAMS_DS_CNT);
7171 cseg->fm_ce_se = fence ? MLX5_FENCE_MODE_INITIATOR_SMALL : 0;
72− cseg->imm = cpu_to_be32(priv_tx->tisn);
72+ cseg->tisn = cpu_to_be32(priv_tx->tisn << 8);
7373
7474 ucseg->flags = MLX5_UMR_INLINE;
7575 ucseg->bsf_octowords = cpu_to_be16(MLX5_ST_SZ_BYTES(tls_static_params) / 16);
@@ -80,7 +80,7 @@ build_static_params(struct mlx5e_umr_wqe *wqe, u16 pc, u32 sqn, · 4 unmodified lines
8080 static void
8181 fill_progress_params_ctx(void *ctx, struct mlx5e_ktls_offload_context_tx *priv_tx)
8282 {
83− MLX5_SET(tls_progress_params, ctx, pd, priv_tx->tisn);
83+ MLX5_SET(tls_progress_params, ctx, tisn, priv_tx->tisn);
8484 MLX5_SET(tls_progress_params, ctx, record_tracker_state,
8585 MLX5E_TLS_PROGRESS_PARAMS_RECORD_TRACKER_STATE_START);
8686 MLX5_SET(tls_progress_params, ctx, auth_state,
@@ -104,7 +104,7 @@ build_progress_params(struct mlx5e_tx_wqe *wqe, u16 pc, u32 sqn, · 17 unmodified lines
104104 PROGRESS_PARAMS_DS_CNT);
105105 cseg->fm_ce_se = fence ? MLX5_FENCE_MODE_INITIATOR_SMALL : 0;
106106
107− fill_progress_params_ctx(wqe->data, priv_tx);
107+ fill_progress_params_ctx(wqe->tls_progress_params_ctx, priv_tx);
108108 }
109109
110110 static void tx_fill_wi(struct mlx5e_txqsq *sq,
@@ -278,7 +278,7 @@ tx_post_resync_dump(struct mlx5e_txqsq *sq, struct sk_buff *skb, · 167 unmodified lines
278278
279279 cseg->opmod_idx_opcode = cpu_to_be32((sq->pc << 8) | MLX5_OPCODE_DUMP);
280280 cseg->qpn_ds = cpu_to_be32((sq->sqn << 8) | ds_cnt);
281− cseg->imm = cpu_to_be32(tisn);
281+ cseg->tisn = cpu_to_be32(tisn << 8);
282282 cseg->fm_ce_se = first ? MLX5_FENCE_MODE_INITIATOR_SMALL : 0;
283283
284284 eseg->inline_hdr.sz = cpu_to_be16(ihs);
@@ -434,7 +434,7 @@ struct sk_buff *mlx5e_ktls_handle_tx_skb(struct net_device *netdev, · 149 unmodified lines
434434 priv_tx->expected_seq = seq + datalen;
435435
436436 cseg = &(*wqe)->ctrl;
437− cseg->imm = cpu_to_be32(priv_tx->tisn);
437+ cseg->tisn = cpu_to_be32(priv_tx->tisn << 8);
438438
439439 stats->tls_encrypted_packets += skb_is_gso(skb) ? skb_shinfo(skb)->gso_segs : 1;
440440 stats->tls_encrypted_bytes += datalen;
drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c+34−63
@@ -437,12 +437,6 @@ arfs_hash_bucket(struct arfs_table *arfs_t, __be16 src_port, · 436 unmodified lines
437437 return &arfs_t->rules_hash[bucket_idx];
438438 }
439439
440−static u8 arfs_get_ip_proto(const struct sk_buff *skb)
441−{
442− return (skb->protocol == htons(ETH_P_IP)) ?
443− ip_hdr(skb)->protocol : ipv6_hdr(skb)->nexthdr;
444−}
445−
446440 static struct arfs_table *arfs_get_table(struct mlx5e_arfs_tables *arfs,
447441 u8 ip_proto, __be16 etype)
448442 {
@@ -602,31 +596,9 @@ out: · 153 unmodified lines
602596 arfs_may_expire_flow(priv);
603597 }
604598
605−/* return L4 destination port from ip4/6 packets */
606−static __be16 arfs_get_dst_port(const struct sk_buff *skb)
607−{
608− char *transport_header;
609−
610− transport_header = skb_transport_header(skb);
611− if (arfs_get_ip_proto(skb) == IPPROTO_TCP)
612− return ((struct tcphdr *)transport_header)->dest;
613− return ((struct udphdr *)transport_header)->dest;
614−}
615−
616−/* return L4 source port from ip4/6 packets */
617−static __be16 arfs_get_src_port(const struct sk_buff *skb)
618−{
619− char *transport_header;
620−
621− transport_header = skb_transport_header(skb);
622− if (arfs_get_ip_proto(skb) == IPPROTO_TCP)
623− return ((struct tcphdr *)transport_header)->source;
624− return ((struct udphdr *)transport_header)->source;
625−}
626−
627599 static struct arfs_rule *arfs_alloc_rule(struct mlx5e_priv *priv,
628600 struct arfs_table *arfs_t,
629− const struct sk_buff *skb,
601+ const struct flow_keys *fk,
630602 u16 rxq, u32 flow_id)
631603 {
632604 struct arfs_rule *rule;
@@ -641,19 +613,19 @@ static struct arfs_rule *arfs_alloc_rule(struct mlx5e_priv *priv, · 8 unmodified lines
641613 INIT_WORK(&rule->arfs_work, arfs_handle_work);
642614
643615 tuple = &rule->tuple;
644− tuple->etype = skb->protocol;
616+ tuple->etype = fk->basic.n_proto;
617+ tuple->ip_proto = fk->basic.ip_proto;
645618 if (tuple->etype == htons(ETH_P_IP)) {
646− tuple->src_ipv4 = ip_hdr(skb)->saddr;
647− tuple->dst_ipv4 = ip_hdr(skb)->daddr;
619+ tuple->src_ipv4 = fk->addrs.v4addrs.src;
620+ tuple->dst_ipv4 = fk->addrs.v4addrs.dst;
648621 } else {
649− memcpy(&tuple->src_ipv6, &ipv6_hdr(skb)->saddr,
622+ memcpy(&tuple->src_ipv6, &fk->addrs.v6addrs.src,
650623 sizeof(struct in6_addr));
651− memcpy(&tuple->dst_ipv6, &ipv6_hdr(skb)->daddr,
624+ memcpy(&tuple->dst_ipv6, &fk->addrs.v6addrs.dst,
652625 sizeof(struct in6_addr));
653626 }
654− tuple->ip_proto = arfs_get_ip_proto(skb);
655− tuple->src_port = arfs_get_src_port(skb);
656− tuple->dst_port = arfs_get_dst_port(skb);
627+ tuple->src_port = fk->ports.src;
628+ tuple->dst_port = fk->ports.dst;
657629
658630 rule->flow_id = flow_id;
659631 rule->filter_id = priv->fs.arfs.last_filter_id++ % RPS_NO_FILTER;
@@ -664,37 +636,33 @@ static struct arfs_rule *arfs_alloc_rule(struct mlx5e_priv *priv, · 4 unmodified lines
664636 return rule;
665637 }
666638
667−static bool arfs_cmp_ips(struct arfs_tuple *tuple,
668− const struct sk_buff *skb)
639+static bool arfs_cmp(const struct arfs_tuple *tuple, const struct flow_keys *fk)
669640 {
670− if (tuple->etype == htons(ETH_P_IP) &&
671− tuple->src_ipv4 == ip_hdr(skb)->saddr &&
672− tuple->dst_ipv4 == ip_hdr(skb)->daddr)
673− return true;
674− if (tuple->etype == htons(ETH_P_IPV6) &&
675− (!memcmp(&tuple->src_ipv6, &ipv6_hdr(skb)->saddr,
676− sizeof(struct in6_addr))) &&
677− (!memcmp(&tuple->dst_ipv6, &ipv6_hdr(skb)->daddr,
678− sizeof(struct in6_addr))))
679− return true;
641+ if (tuple->src_port != fk->ports.src || tuple->dst_port != fk->ports.dst)
642+ return false;
643+ if (tuple->etype != fk->basic.n_proto)
644+ return false;
645+ if (tuple->etype == htons(ETH_P_IP))
646+ return tuple->src_ipv4 == fk->addrs.v4addrs.src &&
647+ tuple->dst_ipv4 == fk->addrs.v4addrs.dst;
648+ if (tuple->etype == htons(ETH_P_IPV6))
649+ return !memcmp(&tuple->src_ipv6, &fk->addrs.v6addrs.src,
650+ sizeof(struct in6_addr)) &&
651+ !memcmp(&tuple->dst_ipv6, &fk->addrs.v6addrs.dst,
652+ sizeof(struct in6_addr));
680653 return false;
681654 }
682655
683656 static struct arfs_rule *arfs_find_rule(struct arfs_table *arfs_t,
684− const struct sk_buff *skb)
657+ const struct flow_keys *fk)
685658 {
686659 struct arfs_rule *arfs_rule;
687660 struct hlist_head *head;
688− __be16 src_port = arfs_get_src_port(skb);
689− __be16 dst_port = arfs_get_dst_port(skb);
690661
691− head = arfs_hash_bucket(arfs_t, src_port, dst_port);
662+ head = arfs_hash_bucket(arfs_t, fk->ports.src, fk->ports.dst);
692663 hlist_for_each_entry(arfs_rule, head, hlist) {
693− if (arfs_rule->tuple.src_port == src_port &&
694− arfs_rule->tuple.dst_port == dst_port &&
695− arfs_cmp_ips(&arfs_rule->tuple, skb)) {
664+ if (arfs_cmp(&arfs_rule->tuple, fk))
696665 return arfs_rule;
697− }
698666 }
699667
700668 return NULL;
@@ -707,20 +675,24 @@ int mlx5e_rx_flow_steer(struct net_device *dev, const struct sk_buff *skb, · 6 unmodified lines
707675 struct mlx5e_arfs_tables *arfs = &priv->fs.arfs;
708676 struct arfs_table *arfs_t;
709677 struct arfs_rule *arfs_rule;
678+ struct flow_keys fk;
679+
680+ if (!skb_flow_dissect_flow_keys(skb, &fk, 0))
681+ return -EPROTONOSUPPORT;
710682
711− if (skb->protocol != htons(ETH_P_IP) &&
712− skb->protocol != htons(ETH_P_IPV6))
683+ if (fk.basic.n_proto != htons(ETH_P_IP) &&
684+ fk.basic.n_proto != htons(ETH_P_IPV6))
713685 return -EPROTONOSUPPORT;
714686
715687 if (skb->encapsulation)
716688 return -EPROTONOSUPPORT;
717689
718− arfs_t = arfs_get_table(arfs, arfs_get_ip_proto(skb), skb->protocol);
690+ arfs_t = arfs_get_table(arfs, fk.basic.ip_proto, fk.basic.n_proto);
719691 if (!arfs_t)
720692 return -EPROTONOSUPPORT;
721693
722694 spin_lock_bh(&arfs->arfs_lock);
723− arfs_rule = arfs_find_rule(arfs_t, skb);
695+ arfs_rule = arfs_find_rule(arfs_t, &fk);
724696 if (arfs_rule) {
725697 if (arfs_rule->rxq == rxq_index) {
726698 spin_unlock_bh(&arfs->arfs_lock);
@@ -728,8 +700,7 @@ int mlx5e_rx_flow_steer(struct net_device *dev, const struct sk_buff *skb, · 1 unmodified line
728700 }
729701 arfs_rule->rxq = rxq_index;
730702 } else {
731− arfs_rule = arfs_alloc_rule(priv, arfs_t, skb,
732− rxq_index, flow_id);
703+ arfs_rule = arfs_alloc_rule(priv, arfs_t, &fk, rxq_index, flow_id);
733704 if (!arfs_rule) {
734705 spin_unlock_bh(&arfs->arfs_lock);
735706 return -ENOMEM;
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c+11−0
@@ -1081,6 +1081,14 @@ int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv, · 1080 unmodified lines
10811081 link_modes = autoneg == AUTONEG_ENABLE ? ethtool2ptys_adver_func(adver) :
10821082 mlx5e_port_speed2linkmodes(mdev, speed, !ext);
10831083
1084+ if ((link_modes & MLX5E_PROT_MASK(MLX5E_56GBASE_R4)) &&
1085+ autoneg != AUTONEG_ENABLE) {
1086+ netdev_err(priv->netdev, "%s: 56G link speed requires autoneg enabled\n",
1087+ __func__);
1088+ err = -EINVAL;
1089+ goto out;
1090+ }
1091+
10841092 link_modes = link_modes & eproto.cap;
10851093 if (!link_modes) {
10861094 netdev_err(priv->netdev, "%s: Not supported link mode(s) requested",
@@ -1338,6 +1346,9 @@ int mlx5e_ethtool_set_pauseparam(struct mlx5e_priv *priv, · 251 unmodified lines
13381346 struct mlx5_core_dev *mdev = priv->mdev;
13391347 int err;
13401348
1349+ if (!MLX5_CAP_GEN(mdev, vport_group_manager))
1350+ return -EOPNOTSUPP;
1351+
13411352 if (pauseparam->autoneg)
13421353 return -EINVAL;
13431354
drivers/net/ethernet/mellanox/mlx5/core/en_main.c+0−1
@@ -1321,7 +1321,6 @@ err_free_txqsq: · 1320 unmodified lines
13211321 void mlx5e_activate_txqsq(struct mlx5e_txqsq *sq)
13221322 {
13231323 sq->txq = netdev_get_tx_queue(sq->channel->netdev, sq->txq_ix);
1324− clear_bit(MLX5E_SQ_STATE_RECOVERING, &sq->state);
13251324 set_bit(MLX5E_SQ_STATE_ENABLED, &sq->state);
13261325 netdev_tx_reset_queue(sq->txq);
13271326 netif_tx_start_queue(sq->txq);
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c+20−11
@@ -1480,7 +1480,7 @@ static int __parse_cls_flower(struct mlx5e_priv *priv, · 1479 unmodified lines
14801480 struct mlx5_flow_spec *spec,
14811481 struct flow_cls_offload *f,
14821482 struct net_device *filter_dev,
1483− u8 *match_level, u8 *tunnel_match_level)
1483+ u8 *inner_match_level, u8 *outer_match_level)
14841484 {
14851485 struct netlink_ext_ack *extack = f->common.extack;
14861486 void *headers_c = MLX5_ADDR_OF(fte_match_param, spec->match_criteria,
@@ -1495,8 +1495,9 @@ static int __parse_cls_flower(struct mlx5e_priv *priv, · 8 unmodified lines
14951495 struct flow_dissector *dissector = rule->match.dissector;
14961496 u16 addr_type = 0;
14971497 u8 ip_proto = 0;
1498+ u8 *match_level;
14981499
1499− *match_level = MLX5_MATCH_NONE;
1500+ match_level = outer_match_level;
15001501
15011502 if (dissector->used_keys &
15021503 ~(BIT(FLOW_DISSECTOR_KEY_META) |
@@ -1524,12 +1525,14 @@ static int __parse_cls_flower(struct mlx5e_priv *priv, · 21 unmodified lines
15241525 }
15251526
15261527 if (mlx5e_get_tc_tun(filter_dev)) {
1527− if (parse_tunnel_attr(priv, spec, f, filter_dev, tunnel_match_level))
1528+ if (parse_tunnel_attr(priv, spec, f, filter_dev,
1529+ outer_match_level))
15281530 return -EOPNOTSUPP;
15291531
1530− /* In decap flow, header pointers should point to the inner
1532+ /* At this point, header pointers should point to the inner
15311533 * headers, outer header were already set by parse_tunnel_attr
15321534 */
1535+ match_level = inner_match_level;
15331536 headers_c = get_match_headers_criteria(MLX5_FLOW_CONTEXT_ACTION_DECAP,
15341537 spec);
15351538 headers_v = get_match_headers_value(MLX5_FLOW_CONTEXT_ACTION_DECAP,
@@ -1831,35 +1834,41 @@ static int parse_cls_flower(struct mlx5e_priv *priv, · 295 unmodified lines
18311834 struct flow_cls_offload *f,
18321835 struct net_device *filter_dev)
18331836 {
1837+ u8 inner_match_level, outer_match_level, non_tunnel_match_level;
18341838 struct netlink_ext_ack *extack = f->common.extack;
18351839 struct mlx5_core_dev *dev = priv->mdev;
18361840 struct mlx5_eswitch *esw = dev->priv.eswitch;
18371841 struct mlx5e_rep_priv *rpriv = priv->ppriv;
1838− u8 match_level, tunnel_match_level = MLX5_MATCH_NONE;
18391842 struct mlx5_eswitch_rep *rep;
18401843 int err;
18411844
1842− err = __parse_cls_flower(priv, spec, f, filter_dev, &match_level, &tunnel_match_level);
1845+ inner_match_level = MLX5_MATCH_NONE;
1846+ outer_match_level = MLX5_MATCH_NONE;
1847+
1848+ err = __parse_cls_flower(priv, spec, f, filter_dev, &inner_match_level,
1849+ &outer_match_level);
1850+ non_tunnel_match_level = (inner_match_level == MLX5_MATCH_NONE) ?
1851+ outer_match_level : inner_match_level;
18431852
18441853 if (!err && (flow->flags & MLX5E_TC_FLOW_ESWITCH)) {
18451854 rep = rpriv->rep;
18461855 if (rep->vport != MLX5_VPORT_UPLINK &&
18471856 (esw->offloads.inline_mode != MLX5_INLINE_MODE_NONE &&
1848− esw->offloads.inline_mode < match_level)) {
1857+ esw->offloads.inline_mode < non_tunnel_match_level)) {
18491858 NL_SET_ERR_MSG_MOD(extack,
18501859 "Flow is not offloaded due to min inline setting");
18511860 netdev_warn(priv->netdev,
18521861 "Flow is not offloaded due to min inline setting, required %d actual %d\n",
1853− match_level, esw->offloads.inline_mode);
1862+ non_tunnel_match_level, esw->offloads.inline_mode);
18541863 return -EOPNOTSUPP;
18551864 }
18561865 }
18571866
18581867 if (flow->flags & MLX5E_TC_FLOW_ESWITCH) {
1859− flow->esw_attr->match_level = match_level;
1860− flow->esw_attr->tunnel_match_level = tunnel_match_level;
1868+ flow->esw_attr->inner_match_level = inner_match_level;
1869+ flow->esw_attr->outer_match_level = outer_match_level;
18611870 } else {
1862− flow->nic_attr->match_level = match_level;
1871+ flow->nic_attr->match_level = non_tunnel_match_level;
18631872 }
18641873
18651874 return err;
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h+2−2
@@ -377,8 +377,8 @@ struct mlx5_esw_flow_attr { · 376 unmodified lines
377377 struct mlx5_termtbl_handle *termtbl;
378378 } dests[MLX5_MAX_FLOW_FWD_VPORTS];
379379 u32 mod_hdr_id;
380− u8 match_level;
381− u8 tunnel_match_level;
380+ u8 inner_match_level;
381+ u8 outer_match_level;
382382 struct mlx5_fc *counter;
383383 u32 chain;
384384 u16 prio;
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c+4−8
@@ -207,14 +207,10 @@ mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw, · 206 unmodified lines
207207
208208 mlx5_eswitch_set_rule_source_port(esw, spec, attr);
209209
210− if (flow_act.action & MLX5_FLOW_CONTEXT_ACTION_DECAP) {
211− if (attr->tunnel_match_level != MLX5_MATCH_NONE)
212− spec->match_criteria_enable |= MLX5_MATCH_OUTER_HEADERS;
213− if (attr->match_level != MLX5_MATCH_NONE)
214− spec->match_criteria_enable |= MLX5_MATCH_INNER_HEADERS;
215− } else if (attr->match_level != MLX5_MATCH_NONE) {
210+ if (attr->outer_match_level != MLX5_MATCH_NONE)
216211 spec->match_criteria_enable |= MLX5_MATCH_OUTER_HEADERS;
217− }
212+ if (attr->inner_match_level != MLX5_MATCH_NONE)
213+ spec->match_criteria_enable |= MLX5_MATCH_INNER_HEADERS;
218214
219215 if (flow_act.action & MLX5_FLOW_CONTEXT_ACTION_MOD_HDR)
220216 flow_act.modify_id = attr->mod_hdr_id;
@@ -290,7 +286,7 @@ mlx5_eswitch_add_fwd_rule(struct mlx5_eswitch *esw, · 69 unmodified lines
290286 mlx5_eswitch_set_rule_source_port(esw, spec, attr);
291287
292288 spec->match_criteria_enable |= MLX5_MATCH_MISC_PARAMETERS;
293− if (attr->match_level != MLX5_MATCH_NONE)
289+ if (attr->outer_match_level != MLX5_MATCH_NONE)
294290 spec->match_criteria_enable |= MLX5_MATCH_OUTER_HEADERS;
295291
296292 rule = mlx5_add_flow_rules(fast_fdb, spec, &flow_act, dest, i);
drivers/net/ethernet/mellanox/mlx5/core/lib/crypto.c+1−0
@@ -27,6 +27,7 @@ int mlx5_create_encryption_key(struct mlx5_core_dev *mdev, · 26 unmodified lines
2727 case 128:
2828 general_obj_key_size =
2929 MLX5_GENERAL_OBJECT_TYPE_ENCRYPTION_KEY_KEY_SIZE_128;
30+ key_p += sz_bytes;
3031 break;
3132 case 256:
3233 general_obj_key_size =
include/linux/mlx5/device.h+2−2
@@ -446,11 +446,11 @@ enum { · 445 unmodified lines
446446 };
447447
448448 enum {
449− MLX5_OPC_MOD_TLS_TIS_STATIC_PARAMS = 0x20,
449+ MLX5_OPC_MOD_TLS_TIS_STATIC_PARAMS = 0x1,
450450 };
451451
452452 enum {
453− MLX5_OPC_MOD_TLS_TIS_PROGRESS_PARAMS = 0x20,
453+ MLX5_OPC_MOD_TLS_TIS_PROGRESS_PARAMS = 0x1,
454454 };
455455
456456 enum {
include/linux/mlx5/mlx5_ifc.h+2−3
@@ -10054,9 +10054,8 @@ struct mlx5_ifc_tls_static_params_bits { · 10053 unmodified lines
1005410054 };
1005510055
1005610056 struct mlx5_ifc_tls_progress_params_bits {
10057− u8 valid[0x1];
10058− u8 reserved_at_1[0x7];
10059− u8 pd[0x18];
10057+ u8 reserved_at_0[0x8];
10058+ u8 tisn[0x18];
1006010059
1006110060 u8 next_record_tcp_sn[0x20];
1006210061

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t