1. 21 5月, 2021 10 次提交
    • G
      net: hns3: refactor dump qos pri map of debugfs · 28d3bada
      Guangbin Huang 提交于
      Currently, user gets priority map by implementing debugfs command
      "echo dump qos pri map > cmd", this command will dump info in dmesg.
      It's unnecessary and heavy.
      
      To optimize it, create a single file "qos_pri_map" in tm directory
      and use cat command to get info. It will return info to userspace,
      rather than record in dmesg.
      
      The display style is below:
      $ cat qos_pri_map
      vlan_to_pri: 0
      PRI    TC
      0       0
      1       1
      2       2
      3       3
      4       0
      5       1
      6       2
      Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com>
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      28d3bada
    • G
      net: hns3: refactor dump qos pause cfg of debugfs · 6571ec2e
      Guangbin Huang 提交于
      Currently, user gets pause config by implementing debugfs command
      "echo dump qos pause cfg > cmd", this command will dump info in dmesg.
      It's unnecessary and heavy.
      
      To optimize it, create a single file "qos_pause_cfg" in tm directory
      and use cat command to get info. It will return info to userspace,
      rather than record in dmesg.
      
      The display style is below:
      $ cat qos_pause_cfg
      pause_trans_gap: 0x7f
      pause_trans_time: 0xffff
      Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com>
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6571ec2e
    • G
      net: hns3: refactor dump tc of debugfs · 0e32038d
      Guangbin Huang 提交于
      Currently, user gets tc schedule info by implementing debugfs command
      "echo dump tc > cmd", this command will dump info in dmesg. It's
      unnecessary and heavy.
      
      To optimize it, create a single file "tc_sch_info" and use cat command
      to get info. It will return info to userspace, rather than record in
      dmesg.
      
      The display style is below:
      $ cat tc_sch_info
      enabled tc number: 4
      weight_offset: 14
      TC    MODE  WEIGHT
      0     dwrr     25
      1     dwrr     25
      2     dwrr     25
      3     dwrr     25
      4     dwrr      0
      5     dwrr      0
      6     dwrr      0
      7     dwrr      0
      Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com>
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0e32038d
    • G
      net: hns3: refactor dump tm of debugfs · cad7c215
      Guangbin Huang 提交于
      Currently, user gets some tm info by implementing debugfs command
      "echo dump tm > cmd", this command will dump info in dmesg. It's
      unnecessary and heavy.
      
      In addition, the info of this command mixes info of qset, priority,
      pg and port. Qset and priority have their own command to get info of
      themself, so can remove info of qset and priority from this command.
      
      To optimize it, create two new files "tm_pg", "tm_port" in tm directory
      and use cat command to separately get info of pg and port.
      
      The display style is below:
      $ cat tm_pg
      ID  PRI_MAP  MODE DWRR  C_IR_B  C_IR_U  C_IR_S  C_BS_B  C_BS_S ...
      00   0x1f    dwrr  1       75       9       0      31      20  ...
      
      $ cat tm_port
      IR_B  IR_U  IR_S  BS_B  BS_S  FLAG  RATE(Mbps)
      75     9     0    31    20    1     200000
      Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com>
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cad7c215
    • G
      net: hns3: refactor dump tm map of debugfs · 7679f28e
      Guangbin Huang 提交于
      Currently, the debugfs command for tm map is implemented by
      "echo xxxx > cmd", and record the information in dmesg. It's
      unnecessary and heavy. To improve it, create a single file
      "tm_map" for it, and query it by command "cat tm_map",
      return the result to userspace, rather than record in dmesg.
      
      As user can't specify queue id in cat command, driver will return info
      of all queue id.
      
      The display style is below:
      $ cat tm_map
      queue_id   qset_id   pri_id   tc_id
      0000         0000      00       00
      INDEX | TM BP QSET MAPPING:
      0000  | 00000000:00000000:00000000:00000000:00000000:00000000:00000000
      0256  | 00000000:00000000:00000000:00000000:00000000:00000002:00000000
      0512  | 00000000:00000000:00000000:00000004:00000000:00000000:00000000
      0768  | 00000000:00000008:00000000:00000000:00000000:00000000:00000000
      Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com>
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7679f28e
    • H
      net: hns3: refactor dump fd tcam of debugfs · b5a0b70d
      Hao Chen 提交于
      Currently, the debugfs command for fd tcam is implemented by
      "echo xxxx > cmd", and record the information in dmesg. It's
      unnecessary and heavy. To improve it, create a single file
      "fd_tcam" for it, and query it by command "cat fd_tcam",
      return the result to userspace, rather than record in dmesg.
      
      The display style is below:
      $ cat fd_tcam
      read result tcam key x(31):
      00000000
      00000000
      00000000
      08000000
      00000600
      00000000
      00000000
      00000000
      00000000
      00000000
      00000000
      00000000
      00000000
      read result tcam key y(31):
      00000000
      00000000
      00000000
      f7ff0000
      0000f900
      00000000
      00000000
      00000000
      00000000
      00000000
      00000000
      00000000
      0000fff8
      Signed-off-by: NHao Chen <chenhao288@hisilicon.com>
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b5a0b70d
    • H
      net: hns3: refactor queue info of debugfs · e44c495d
      Hao Chen 提交于
      Currently, the debugfs command for queue info is implemented by
      "echo xxxx > cmd", and record the information in dmesg. It's
      unnecessary and heavy. To improve it, create two files
      "rx_queue_info" and "tx_queue_info" for it, and query it
      by command "cat rx_queue_info" and "cat tx_queue_info",
      return the result to userspace, rather than record in dmesg.
      
      The display style is below:
      $ cat rx_queue_info
      QUEUE_ID  BD_NUM  BD_LEN  TAIL  HEAD  FBDNUM  PKTNUM   ...
      0           0       0     0     0       0       0      ...
      1           0       0     0     0       0       0      ...
      2           0       0     0     0       0       0      ...
      
      $ cat tx_queue_info
      QUEUE_ID  BD_NUM  TC  TAIL  HEAD  FBDNUM  OFFSET  PKTNUM  ...
      0           0     0     0     0       0       0        0  ...
      1           0     0     0     0       0       0        0  ...
      2           0     0     0     0       0       0        0  ...
      Signed-off-by: NHao Chen <chenhao288@hisilicon.com>
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e44c495d
    • H
      net: hns3: refactor queue map of debugfs · d2f737cf
      Hao Chen 提交于
      Currently, the debugfs command for queue map is implemented by
      "echo xxxx > cmd", and record the information in dmesg. It's
      unnecessary and heavy. To improve it, create a single file
      "queue_map" for it, and query it by command "cat queue_map",
      return the result to userspace, rather than record in dmesg.
      
      The display style is below:
      $ cat queue_map
      local_queue_id   global_queue_id   vector_id
      0                0                 341
      Signed-off-by: NHao Chen <chenhao288@hisilicon.com>
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d2f737cf
    • Y
      net: hns3: refactor dump reg dcb info of debugfs · 365e860a
      Yufeng Mo 提交于
      Currently, the debugfs command for reg dcb info is implemented by
      "echo xxxx > cmd", and record the information in dmesg. It's
      unnecessary and heavy. To improve it, create a single file
      "dcb" for it, and query it by command "cat dcb",
      return the result to userspace, rather than record in dmesg.
      
      The display style is below:
      $ cat dcb
      qset_id  roce_qset_mask  nic_qset_mask  qset_shaping_pass  qset_bp_status
      0000           0x1            0x1             0x1               0x0
      0001           0x1            0x1             0x1               0x0
      0002           0x1            0x1             0x1               0x0
      0003           0x1            0x1             0x1               0x0
      0004           0x1            0x1             0x1               0x0
      0005           0x1            0x1             0x1               0x0
      0006           0x1            0x1             0x1               0x0
      0007           0x1            0x1             0x1               0x0
      pri_id  pri_mask  pri_cshaping_pass  pri_pshaping_pass
      000       0x1           0x0                0x1
      001       0x1           0x0                0x0
      002       0x1           0x0                0x0
      003       0x1           0x0                0x0
      004       0x1           0x0                0x0
      005       0x1           0x0                0x0
      006       0x1           0x0                0x0
      007       0x1           0x0                0x0
      pg_id  pg_mask  pg_cshaping_pass  pg_pshaping_pass
      000      0x1           0x0               0x1
      Signed-off-by: NYufeng Mo <moyufeng@huawei.com>
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      365e860a
    • Y
      net: hns3: refactor dump reg of debugfs · d96b0e59
      Yufeng Mo 提交于
      Currently, the debugfs command for reg is implemented by
      "echo xxxx > cmd", and record the information in dmesg. It's
      unnecessary and heavy. To improve it, create some files
      "bios_common/ssu/igu_egu/rpu/ncsi/rtc/ppp/rcb/tqp/mac" for it,
      and query it by command "cat xxx", return the result to
      userspace, rather than record in dmesg.
      
      The display style is below:
      $ cat bios_common
      BP_CPU_STATE: 0x0
      DFX_MSIX_INFO_NIC_0: 0xc000
      DFX_MSIX_INFO_NIC_1: 0x0
      DFX_MSIX_INFO_NIC_2: 0x0
      DFX_MSIX_INFO_NIC_3: 0x0
      DFX_MSIX_INFO_ROC_0: 0xc000
      DFX_MSIX_INFO_ROC_1: 0x0
      DFX_MSIX_INFO_ROC_2: 0x0
      DFX_MSIX_INFO_ROC_3: 0x0
      Signed-off-by: NYufeng Mo <moyufeng@huawei.com>
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d96b0e59
  2. 18 5月, 2021 1 次提交
    • Y
      net: hisilicon: hns: Fix wrong function name in comments · 5a9594cf
      Yang Shen 提交于
      Fixes the following W=1 kernel build warning(s):
      
       drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c:121: warning: expecting prototype for hns_mac_is_adjust_link(). Prototype was for hns_mac_need_adjust_link() instead
       drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c:386: warning: expecting prototype for hns_mac_queue_config_bc_en(). Prototype was for hns_mac_port_config_bc_en() instead
       drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c:607: warning: expecting prototype for hns_mac_set_autoneg(). Prototype was for hns_mac_set_pauseparam() instead
       drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c:236: warning: expecting prototype for hns_ppe_qid_cfg(). Prototype was for hns_dsaf_ppe_qid_cfg() instead
       drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c:623: warning: expecting prototype for dsaf_tbl_tcam_mcast_cfg(). Prototype was for hns_dsaf_tbl_tcam_mcast_cfg() instead
       drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c:1220: warning: expecting prototype for hns_dsaf_tbl_tcam_init(). Prototype was for hns_dsaf_comm_init() instead
       drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c:2121: warning: expecting prototype for dsaf_pfc_unit_cnt(). Prototype was for hns_dsaf_pfc_unit_cnt() instead
       drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c:2153: warning: expecting prototype for dsaf_port_work_rate_cfg(). Prototype was for hns_dsaf_port_work_rate_cfg() instead
       drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c:2745: warning: expecting prototype for hns_dsaf_get_sset_count(). Prototype was for hns_dsaf_get_regs_count() instead
       drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c:2957: warning: expecting prototype for dsaf_probe(). Prototype was for hns_dsaf_probe() instead
       drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c:3011: warning: expecting prototype for dsaf_remove(). Prototype was for hns_dsaf_remove() instead
       drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c:366: warning: expecting prototype for hns_dsaf_srst_chns(). Prototype was for hns_dsaf_srst_chns_acpi() instead
       drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c:509: warning: expecting prototype for hns_mac_get_sds_mode(). Prototype was for hns_mac_get_phy_if() instead
       drivers/net/ethernet/hisilicon/hns/hns_dsaf_ppe.c:303: warning: expecting prototype for ppe_init_hw(). Prototype was for hns_ppe_init_hw() instead
       drivers/net/ethernet/hisilicon/hns/hns_dsaf_ppe.c:350: warning: expecting prototype for ppe_uninit_hw(). Prototype was for hns_ppe_uninit_hw() instead
       drivers/net/ethernet/hisilicon/hns/hns_dsaf_ppe.c:391: warning: expecting prototype for hns_ppe_reset(). Prototype was for hns_ppe_reset_common() instead
       drivers/net/ethernet/hisilicon/hns/hns_dsaf_ppe.c:464: warning: expecting prototype for ppe_get_strings(). Prototype was for hns_ppe_get_strings() instead
       drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c:920: warning: expecting prototype for rcb_get_sset_count(). Prototype was for hns_rcb_get_ring_regs_count() instead
       drivers/net/ethernet/hisilicon/hns/hns_dsaf_xgmac.c:112: warning: expecting prototype for hns_xgmac_tx_lf_rf_insert(). Prototype was for hns_xgmac_lf_rf_insert() instead
       drivers/net/ethernet/hisilicon/hns/hns_dsaf_xgmac.c:122: warning: expecting prototype for hns_xgmac__lf_rf_control_init(). Prototype was for hns_xgmac_lf_rf_control_init() instead
       drivers/net/ethernet/hisilicon/hns/hns_enet.c:777: warning: expecting prototype for hns_nic_adp_coalesce(). Prototype was for hns_nic_adpt_coalesce() instead
       drivers/net/ethernet/hisilicon/hns/hns_ethtool.c:202: warning: expecting prototype for hns_nic_set_link_settings(). Prototype was for hns_nic_set_link_ksettings() instead
       drivers/net/ethernet/hisilicon/hns/hns_ethtool.c:837: warning: expecting prototype for get_ethtool_stats(). Prototype was for hns_get_ethtool_stats() instead
       drivers/net/ethernet/hisilicon/hns/hns_ethtool.c:894: warning: expecting prototype for get_strings(). Prototype was for hns_get_strings() instead
      
      Cc: Yisen Zhuang <yisen.zhuang@huawei.com>
      Cc: Salil Mehta <salil.mehta@huawei.com>
      Signed-off-by: NYang Shen <shenyang39@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5a9594cf
  3. 15 5月, 2021 16 次提交
  4. 01 5月, 2021 4 次提交
  5. 30 4月, 2021 3 次提交
  6. 20 4月, 2021 3 次提交
  7. 16 4月, 2021 2 次提交
  8. 14 4月, 2021 1 次提交
    • M
      of: net: pass the dst buffer to of_get_mac_address() · 83216e39
      Michael Walle 提交于
      of_get_mac_address() returns a "const void*" pointer to a MAC address.
      Lately, support to fetch the MAC address by an NVMEM provider was added.
      But this will only work with platform devices. It will not work with
      PCI devices (e.g. of an integrated root complex) and esp. not with DSA
      ports.
      
      There is an of_* variant of the nvmem binding which works without
      devices. The returned data of a nvmem_cell_read() has to be freed after
      use. On the other hand the return of_get_mac_address() points to some
      static data without a lifetime. The trick for now, was to allocate a
      device resource managed buffer which is then returned. This will only
      work if we have an actual device.
      
      Change it, so that the caller of of_get_mac_address() has to supply a
      buffer where the MAC address is written to. Unfortunately, this will
      touch all drivers which use the of_get_mac_address().
      
      Usually the code looks like:
      
        const char *addr;
        addr = of_get_mac_address(np);
        if (!IS_ERR(addr))
          ether_addr_copy(ndev->dev_addr, addr);
      
      This can then be simply rewritten as:
      
        of_get_mac_address(np, ndev->dev_addr);
      
      Sometimes is_valid_ether_addr() is used to test the MAC address.
      of_get_mac_address() already makes sure, it just returns a valid MAC
      address. Thus we can just test its return code. But we have to be
      careful if there are still other sources for the MAC address before the
      of_get_mac_address(). In this case we have to keep the
      is_valid_ether_addr() call.
      
      The following coccinelle patch was used to convert common cases to the
      new style. Afterwards, I've manually gone over the drivers and fixed the
      return code variable: either used a new one or if one was already
      available use that. Mansour Moufid, thanks for that coccinelle patch!
      
      <spml>
      @a@
      identifier x;
      expression y, z;
      @@
      - x = of_get_mac_address(y);
      + x = of_get_mac_address(y, z);
        <...
      - ether_addr_copy(z, x);
        ...>
      
      @@
      identifier a.x;
      @@
      - if (<+... x ...+>) {}
      
      @@
      identifier a.x;
      @@
        if (<+... x ...+>) {
            ...
        }
      - else {}
      
      @@
      identifier a.x;
      expression e;
      @@
      - if (<+... x ...+>@e)
      -     {}
      - else
      + if (!(e))
            {...}
      
      @@
      expression x, y, z;
      @@
      - x = of_get_mac_address(y, z);
      + of_get_mac_address(y, z);
        ... when != x
      </spml>
      
      All drivers, except drivers/net/ethernet/aeroflex/greth.c, were
      compile-time tested.
      Suggested-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NMichael Walle <michael@walle.cc>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      83216e39