Home
last modified time | relevance | path

Searched refs:nic_dev (Results 1 – 9 of 9) sorted by relevance

/linux-5.19.10/drivers/net/ethernet/huawei/hinic/
Dhinic_main.c79 static int set_features(struct hinic_dev *nic_dev,
110 static void gather_nic_stats(struct hinic_dev *nic_dev, in gather_nic_stats() argument
114 int i, num_qps = hinic_hwdev_num_qps(nic_dev->hwdev); in gather_nic_stats()
117 gather_rx_stats(nic_rx_stats, &nic_dev->rxqs[i]); in gather_nic_stats()
120 gather_tx_stats(nic_tx_stats, &nic_dev->txqs[i]); in gather_nic_stats()
129 static int create_txqs(struct hinic_dev *nic_dev) in create_txqs() argument
131 int err, i, j, num_txqs = hinic_hwdev_num_qps(nic_dev->hwdev); in create_txqs()
132 struct net_device *netdev = nic_dev->netdev; in create_txqs()
134 if (nic_dev->txqs) in create_txqs()
137 nic_dev->txqs = devm_kcalloc(&netdev->dev, num_txqs, in create_txqs()
[all …]
Dhinic_ethtool.c260 struct hinic_dev *nic_dev = netdev_priv(netdev); in hinic_get_link_ksettings() local
275 err = hinic_port_get_cap(nic_dev, &port_cap); in hinic_get_link_ksettings()
282 err = hinic_port_link_state(nic_dev, &link_state); in hinic_get_link_ksettings()
300 err = hinic_get_link_mode(nic_dev->hwdev, &link_mode); in hinic_get_link_ksettings()
310 if (!HINIC_IS_VF(nic_dev->hwdev->hwif)) { in hinic_get_link_ksettings()
311 err = hinic_get_hw_pause_info(nic_dev->hwdev, &pause_info); in hinic_get_link_ksettings()
366 static bool hinic_is_speed_legal(struct hinic_dev *nic_dev, u32 speed) in hinic_is_speed_legal() argument
369 struct net_device *netdev = nic_dev->netdev; in hinic_is_speed_legal()
373 err = hinic_get_link_mode(nic_dev->hwdev, &link_mode); in hinic_is_speed_legal()
384 netif_err(nic_dev, drv, netdev, in hinic_is_speed_legal()
[all …]
Dhinic_debugfs.c23 static u64 hinic_dbg_get_sq_info(struct hinic_dev *nic_dev, struct hinic_sq *sq, int idx) in hinic_dbg_get_sq_info() argument
29 return nic_dev->hwdev->func_to_io.global_qpn + sq->qid; in hinic_dbg_get_sq_info()
53 static u64 hinic_dbg_get_rq_info(struct hinic_dev *nic_dev, struct hinic_rq *rq, int idx) in hinic_dbg_get_rq_info() argument
59 return nic_dev->hwdev->func_to_io.global_qpn + rq->qid; in hinic_dbg_get_rq_info()
83 static int hinic_dbg_get_func_table(struct hinic_dev *nic_dev, int idx) in hinic_dbg_get_func_table() argument
97 read_data->lt_index = HINIC_HWIF_FUNC_IDX(nic_dev->hwdev->hwif); in hinic_dbg_get_func_table()
100 err = hinic_port_msg_cmd(nic_dev->hwdev, HINIC_PORT_CMD_RD_LINE_TBL, read_data, in hinic_dbg_get_func_table()
103 netif_err(nic_dev, drv, nic_dev->netdev, in hinic_dbg_get_func_table()
265 void hinic_sq_dbgfs_init(struct hinic_dev *nic_dev) in hinic_sq_dbgfs_init() argument
267 nic_dev->sq_dbgfs = debugfs_create_dir("SQs", nic_dev->dbgfs_root); in hinic_sq_dbgfs_init()
[all …]
Dhinic_rx.c130 struct hinic_dev *nic_dev = netdev_priv(rxq->netdev); in rx_alloc_skb() local
131 struct hinic_hwdev *hwdev = nic_dev->hwdev; in rx_alloc_skb()
165 struct hinic_dev *nic_dev = netdev_priv(rxq->netdev); in rx_unmap_skb() local
166 struct hinic_hwdev *hwdev = nic_dev->hwdev; in rx_unmap_skb()
195 struct hinic_dev *nic_dev = netdev_priv(rxq->netdev); in rx_alloc_pkts() local
207 if (free_wqebbs > nic_dev->rx_weight) in rx_alloc_pkts()
208 free_wqebbs = nic_dev->rx_weight; in rx_alloc_pkts()
314 static void hinic_copy_lp_data(struct hinic_dev *nic_dev, in hinic_copy_lp_data() argument
317 struct net_device *netdev = nic_dev->netdev; in hinic_copy_lp_data()
318 u8 *lb_buf = nic_dev->lb_test_rx_buf; in hinic_copy_lp_data()
[all …]
Dhinic_port.c37 static int change_mac(struct hinic_dev *nic_dev, const u8 *addr, in change_mac() argument
40 struct hinic_hwdev *hwdev = nic_dev->hwdev; in change_mac()
90 int hinic_port_add_mac(struct hinic_dev *nic_dev, in hinic_port_add_mac() argument
93 return change_mac(nic_dev, addr, vlan_id, MAC_SET); in hinic_port_add_mac()
104 int hinic_port_del_mac(struct hinic_dev *nic_dev, const u8 *addr, in hinic_port_del_mac() argument
107 return change_mac(nic_dev, addr, vlan_id, MAC_DEL); in hinic_port_del_mac()
117 int hinic_port_get_mac(struct hinic_dev *nic_dev, u8 *addr) in hinic_port_get_mac() argument
119 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_port_get_mac()
148 int hinic_port_set_mtu(struct hinic_dev *nic_dev, int new_mtu) in hinic_port_set_mtu() argument
150 struct net_device *netdev = nic_dev->netdev; in hinic_port_set_mtu()
[all …]
Dhinic_sriov.c499 struct hinic_dev *nic_dev = netdev_priv(netdev); in hinic_get_sriov_info_by_pcidev() local
501 return &nic_dev->sriov_info; in hinic_get_sriov_info_by_pcidev()
581 struct hinic_dev *nic_dev = netdev_priv(netdev); in hinic_ndo_get_vf_config() local
584 sriov_info = &nic_dev->sriov_info; in hinic_ndo_get_vf_config()
625 struct hinic_dev *nic_dev = netdev_priv(netdev); in hinic_ndo_set_vf_mac() local
629 sriov_info = &nic_dev->sriov_info; in hinic_ndo_set_vf_mac()
637 netif_info(nic_dev, drv, netdev, "Setting MAC %pM on VF %d\n", mac, vf); in hinic_ndo_set_vf_mac()
638 netif_info(nic_dev, drv, netdev, "Reload the VF driver to make this change effective."); in hinic_ndo_set_vf_mac()
683 static int hinic_update_mac_vlan(struct hinic_dev *nic_dev, u16 old_vlan, in hinic_update_mac_vlan() argument
690 if (!nic_dev || old_vlan >= VLAN_N_VID || new_vlan >= VLAN_N_VID) in hinic_update_mac_vlan()
[all …]
Dhinic_debugfs.h94 void hinic_sq_dbgfs_init(struct hinic_dev *nic_dev);
96 void hinic_sq_dbgfs_uninit(struct hinic_dev *nic_dev);
98 void hinic_rq_dbgfs_init(struct hinic_dev *nic_dev);
100 void hinic_rq_dbgfs_uninit(struct hinic_dev *nic_dev);
102 void hinic_func_tbl_dbgfs_init(struct hinic_dev *nic_dev);
104 void hinic_func_tbl_dbgfs_uninit(struct hinic_dev *nic_dev);
106 void hinic_dbg_init(struct hinic_dev *nic_dev);
108 void hinic_dbg_uninit(struct hinic_dev *nic_dev);
Dhinic_tx.c132 static int tx_map_skb(struct hinic_dev *nic_dev, struct sk_buff *skb, in tx_map_skb() argument
135 struct hinic_hwdev *hwdev = nic_dev->hwdev; in tx_map_skb()
183 static void tx_unmap_skb(struct hinic_dev *nic_dev, struct sk_buff *skb, in tx_unmap_skb() argument
186 struct hinic_hwdev *hwdev = nic_dev->hwdev; in tx_unmap_skb()
493 struct hinic_dev *nic_dev = netdev_priv(netdev); in hinic_lb_xmit_frame() local
502 txq = &nic_dev->txqs[q_id]; in hinic_lb_xmit_frame()
506 err = tx_map_skb(nic_dev, skb, txq->sges); in hinic_lb_xmit_frame()
518 netif_wake_subqueue(nic_dev->netdev, qp->q_id); in hinic_lb_xmit_frame()
522 tx_unmap_skb(nic_dev, skb, txq->sges); in hinic_lb_xmit_frame()
554 struct hinic_dev *nic_dev = netdev_priv(netdev); in hinic_xmit_frame() local
[all …]
Dhinic_port.h757 int hinic_port_add_mac(struct hinic_dev *nic_dev, const u8 *addr,
760 int hinic_port_del_mac(struct hinic_dev *nic_dev, const u8 *addr,
763 int hinic_port_get_mac(struct hinic_dev *nic_dev, u8 *addr);
765 int hinic_port_set_mtu(struct hinic_dev *nic_dev, int new_mtu);
767 int hinic_port_add_vlan(struct hinic_dev *nic_dev, u16 vlan_id);
769 int hinic_port_del_vlan(struct hinic_dev *nic_dev, u16 vlan_id);
771 int hinic_port_set_rx_mode(struct hinic_dev *nic_dev, u32 rx_mode);
773 int hinic_port_link_state(struct hinic_dev *nic_dev,
776 int hinic_port_set_state(struct hinic_dev *nic_dev,
779 int hinic_port_set_func_state(struct hinic_dev *nic_dev,
[all …]