Mellanox 100G SRIOV E-Switch offload and VF representors

https://lwn.net/Articles/692942/


     vport 1 (VF1)
          ||          /\
          \/          ||
rep: tirn 205     sqn 211


crash> net
   NET_DEVICE     NAME   IP ADDRESS(ES)
ffff880c5a8d0000  p2p1   1.1.1.18
ffff880597460000  eth0
crash> mlx5e_priv.ppriv ffff880c5a8d08c0
  ppriv = 0xffff88017c798e00
crash> mlx5_eswitch_rep  0xffff88017c798e00 -x
struct mlx5_eswitch_rep {
  load = 0xffffffffa00e1020 <mlx5e_add_sqs_fwd_rules+240>,
  unload = 0xffffffffa00e1080 <mlx5e_remove_sqs_fwd_rules+32>,
  vport = 0xffff,
  hw_id = "$\212\a\210", <incomplete sequence \312>,
  netdev = 0xffff880c5a8d0000,
  vport_rx_rule = 0x0,
  vport_sqs_list = {
    next = 0xffff880553bcf248,
    prev = 0xffff880553bcf068
  },
  vlan = 0x0,
  vlan_refcount = 0x0,
  valid = 0x1
}
crash> mlx5e_priv.ppriv  ffff8805974608c0
  ppriv = 0xffff88017c798e48
crash> mlx5_eswitch_rep  0xffff88017c798e48
struct mlx5_eswitch_rep {
  load = 0xffffffffa00e1140 <mlx5e_is_vf_vport_rep+32>,
  unload = 0xffffffffa00e1210 <mlx5e_vport_rep_load+192>,
  vport = 1,
  hw_id = "$\212\a\210", <incomplete sequence \312>,
  netdev = 0xffff880597460000,
  vport_rx_rule = 0xffff8806674fee30,
  vport_sqs_list = {
    next = 0xffff880553bcf7e8,
    prev = 0xffff880553bcf7e8
  },
  vlan = 0,
  vlan_refcount = 0,
  valid = true
}
crash> mlx5_flow_handle  0xffff8806674fee30
struct mlx5_flow_handle {
  num_rules = 1,
  rule = 0xffff8806674fee38
}
crash> rd 0xffff8806674fee38
ffff8806674fee38:  ffff88055703d080                    ...W....
crash> mlx5_flow_rule ffff88055703d080
struct mlx5_flow_rule {
...
    parent = 0xffff880662d39400,
  dest_attr = {
    type = MLX5_FLOW_DESTINATION_TYPE_TIR,
    {
      tir_num = 205,
    }
  },
crash> fs_fte 0xffff880662d39400 -x
    parent = 0xffff88066368b000,
  val = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
crash> mlx5_flow_group 0xffff88066368b000 -x
    parent = 0xffff880c6108c800,
  mask = {
    match_criteria_enable = 0x2,
    match_criteria = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xffff0000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}
  },
crash> mlx5_flow_table 0xffff880c6108c800
  id = 9,
  vport = 0,
  max_fte = 4,
  level = 18,
  type = FS_FT_NIC_RX,
  op_mod = FS_FT_OP_MOD_NORMAL,
crash> mlx5_eswitch.offloads 0xffff88065743a000
  offloads = {
    ft_offloads = 0xffff880c6108c800,
    vport_rx_group = 0xffff88066368b000,
    vport_reps = 0xffff88017c798e00,
crash> mlx5_eswitch 0xffff88065743a000
  fdb_table = {
    fdb = 0xffff880557e2ea00,
    {
      legacy = {
        addr_grp = 0xffff880557e2e000,
        allmulti_grp = 0xffff880c62e0ec00,
        promisc_grp = 0xffff880c62e0f800
      },
      offloads = {
        fdb = 0xffff880557e2e000,
        send_to_vport_grp = 0xffff880c62e0ec00,
        miss_grp = 0xffff880c62e0f800,
        miss_rule = 0xffff8806674fe9b0,
        vlan_push_pop_refcount = 0
      }
    }
  },
crash> mlx5_flow_table 0xffff880557e2e000
    children = {
      next = 0xffff880c62e0ec00,
      prev = 0xffff880c62e0f800
    },
  id = 8,
  vport = 0,
  max_fte = 512,
  level = 1,
  type = FS_FT_FDB,
  op_mod = FS_FT_OP_MOD_NORMAL,
crash> list 0xffff880c62e0ec00 -s mlx5_flow_group -x
    children = {
      next = 0xffff88066368d800,
      prev = 0xffff880c6127b000
    },
  mask = {
    match_criteria_enable = 0x2,
    match_criteria = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xffffff00, 0xffff0000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}
  },
  start_index = 0x0,
  max_ftes = 0x103,
  num_ftes = 0x12,
  id = 0x11
crash> list 0xffff88066368d800 -s fs_fte -x
    children = {
      next = 0xffff88055703c3c0,
      prev = 0xffff88055703c3c0
    },
  val = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8b000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 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x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},


crash> mlx5_flow_rule 0xffff88055703c3c0 -x
  dest_attr = {
    type = MLX5_FLOW_DESTINATION_TYPE_VPORT,
    {
      vport_num = 0xffff,
    }
  },
crash> mlx5_flow_rule 0xffff8805c7c718c0 -x
  dest_attr = {
    type = MLX5_FLOW_DESTINATION_TYPE_VPORT,
    {
      vport_num = 0x1,
    }
  },
crash> eval d3
hexadecimal: d3
    decimal: 211
      octal: 323
     binary: 0000000000000000000000000000000000000000000000000000000011010011
crash> mlx5e_priv  ffff8805974608c0
...
  direct_tir = {{
      tirn = 205,
      rqt = {
        rqtn = 17,
        enabled = true
      },
      list = {
        next = 0xffff880c5a8d20a0,
        prev = 0xffff880597bc1ec0
      }
    }, {
...
crash> mlx5e_priv.channel  ffff8805974608c0| less
  channel = 0xffff8806fceeaaa8
crash> mlx5e_priv.channel  ffff8805974608c0
  channel = 0xffff8806fceeaaa8
crash> rd 0xffff8806fceeaaa8
ffff8806fceeaaa8:  ffff8805ddb60000                    ........
sh> mlx5e_channel ffff8805ddb60000 | grep 211
      sqn = 211,




get all the tirn
crash> mlx5e_priv.mdev ffff880c5a8d08c0
  mdev = 0xffff8806596c0060
crash> mlx5_core_dev.mlx5e_res 0xffff8806596c0060
  mlx5e_res = {
    pdn = 1, # protection domain
    td = {
      tirs_list = {
        next = 0xffff880597bc1ec0,
        prev = 0xffff880c5a8d1d80
      },
      tdn = 1 # transport domain
    },
    mkey = {
      iova = 0,
      size = 0,
      key = 4096,
      pd = 1,
      type = 0
    }
  }
crash> mlx5_core_dev.mlx5e_res 0xffff8806596c0060 -o
struct mlx5_core_dev {
  [ffff8806596f68f8] struct mlx5e_resources mlx5e_res;
}
crash> mlx5e_resources ffff8806596f68f8 -o
struct mlx5e_resources {
  [ffff8806596f68f8] u32 pdn;
  [ffff8806596f6900] struct mlx5_td td;
  [ffff8806596f6918] struct mlx5_core_mkey mkey;
}
SIZE: 64
crash> mlx5_td ffff8806596f6900 -o
struct mlx5_td {
  [ffff8806596f6900] struct list_head tirs_list;
  [ffff8806596f6910] u32 tdn;
}
SIZE: 24
crash> list mlx5e_tir.list -H ffff8806596f6900 -s mlx5e_tir | grep tirn
  tirn = 209, # rep for vf2
  tirn = 205, # rep for vf1
  tirn = 131,
  tirn = 130,
  tirn = 129,
  tirn = 128,
  tirn = 127,
  tirn = 126,
  tirn = 125,
  tirn = 124,
  tirn = 123,
  tirn = 122,
  tirn = 121,
  tirn = 120,
  tirn = 119,
  tirn = 118,
  tirn = 117,
  tirn = 116,
  tirn = 115,
  tirn = 114,
  tirn = 113,
  tirn = 112,
  tirn = 111,
  tirn = 110,
  tirn = 109,
  tirn = 108,
  tirn = 107,
  tirn = 106,


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值