nic_dev 78 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c struct hinic_dev *nic_dev = netdev_priv(netdev); nic_dev 91 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c err = hinic_port_get_cap(nic_dev, &port_cap); nic_dev 95 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c err = hinic_port_link_state(nic_dev, &link_state); nic_dev 119 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c struct hinic_dev *nic_dev = netdev_priv(netdev); nic_dev 121 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 128 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c err = hinic_get_mgmt_version(nic_dev, mgmt_ver); nic_dev 147 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c struct hinic_dev *nic_dev = netdev_priv(netdev); nic_dev 148 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 160 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c static int hinic_get_rss_hash_opts(struct hinic_dev *nic_dev, nic_dev 168 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c if (!(nic_dev->flags & HINIC_RSS_ENABLE)) nic_dev 171 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c err = hinic_get_rss_type(nic_dev, nic_dev->rss_tmpl_idx, nic_dev 241 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c static int hinic_set_rss_hash_opts(struct hinic_dev *nic_dev, nic_dev 244 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c struct hinic_rss_type *rss_type = &nic_dev->rss_type; nic_dev 247 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c if (!(nic_dev->flags & HINIC_RSS_ENABLE)) { nic_dev 263 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c err = hinic_get_rss_type(nic_dev, nic_dev 264 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c nic_dev->rss_tmpl_idx, rss_type); nic_dev 287 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c err = hinic_set_rss_type(nic_dev, nic_dev->rss_tmpl_idx, nic_dev 298 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c struct hinic_dev *nic_dev = netdev_priv(netdev); nic_dev 302 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c if (!nic_dev->rss_indir_user) { nic_dev 303 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c nic_dev->rss_indir_user = nic_dev 306 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c if (!nic_dev->rss_indir_user) nic_dev 310 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c memcpy(nic_dev->rss_indir_user, indir, nic_dev 313 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c err = hinic_rss_set_indir_tbl(nic_dev, nic_dev 314 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c nic_dev->rss_tmpl_idx, indir); nic_dev 320 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c if (!nic_dev->rss_hkey_user) { nic_dev 321 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c nic_dev->rss_hkey_user = nic_dev 324 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c if (!nic_dev->rss_hkey_user) nic_dev 328 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c memcpy(nic_dev->rss_hkey_user, key, HINIC_RSS_KEY_SIZE); nic_dev 330 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c err = hinic_rss_set_template_tbl(nic_dev, nic_dev 331 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c nic_dev->rss_tmpl_idx, key); nic_dev 342 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c struct hinic_dev *nic_dev = netdev_priv(netdev); nic_dev 347 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c cmd->data = nic_dev->num_qps; nic_dev 350 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c err = hinic_get_rss_hash_opts(nic_dev, cmd); nic_dev 362 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c struct hinic_dev *nic_dev = netdev_priv(netdev); nic_dev 367 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c err = hinic_set_rss_hash_opts(nic_dev, cmd); nic_dev 380 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c struct hinic_dev *nic_dev = netdev_priv(netdev); nic_dev 384 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c if (!(nic_dev->flags & HINIC_RSS_ENABLE)) nic_dev 388 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c err = hinic_rss_get_hash_engine(nic_dev, nic_dev 389 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c nic_dev->rss_tmpl_idx, nic_dev 398 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c err = hinic_rss_get_indir_tbl(nic_dev, nic_dev 399 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c nic_dev->rss_tmpl_idx, indir); nic_dev 405 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c err = hinic_rss_get_template_tbl(nic_dev, nic_dev 406 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c nic_dev->rss_tmpl_idx, key); nic_dev 414 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c struct hinic_dev *nic_dev = netdev_priv(netdev); nic_dev 417 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c if (!(nic_dev->flags & HINIC_RSS_ENABLE)) nic_dev 424 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c nic_dev->rss_hash_engine = (hfunc == ETH_RSS_HASH_XOR) ? nic_dev 428 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c (nic_dev, nic_dev->rss_tmpl_idx, nic_dev 429 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c nic_dev->rss_hash_engine); nic_dev 601 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c static void get_drv_queue_stats(struct hinic_dev *nic_dev, u64 *data) nic_dev 608 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c for (qid = 0; qid < nic_dev->num_qps; qid++) { nic_dev 609 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c if (!nic_dev->txqs) nic_dev 612 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c hinic_txq_get_stats(&nic_dev->txqs[qid], &txq_stats); nic_dev 621 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c for (qid = 0; qid < nic_dev->num_qps; qid++) { nic_dev 622 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c if (!nic_dev->rxqs) nic_dev 625 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c hinic_rxq_get_stats(&nic_dev->rxqs[qid], &rxq_stats); nic_dev 638 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c struct hinic_dev *nic_dev = netdev_priv(netdev); nic_dev 645 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c err = hinic_get_vport_stats(nic_dev, &vport_stats); nic_dev 647 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c netif_err(nic_dev, drv, netdev, nic_dev 664 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c err = hinic_get_phy_port_stats(nic_dev, port_stats); nic_dev 666 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c netif_err(nic_dev, drv, netdev, nic_dev 678 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c get_drv_queue_stats(nic_dev, data + i); nic_dev 683 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c struct hinic_dev *nic_dev = netdev_priv(netdev); nic_dev 688 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c q_num = nic_dev->num_qps; nic_dev 704 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c struct hinic_dev *nic_dev = netdev_priv(netdev); nic_dev 722 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c for (i = 0; i < nic_dev->num_qps; i++) { nic_dev 729 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c for (i = 0; i < nic_dev->num_qps; i++) { nic_dev 60 drivers/net/ethernet/huawei/hinic/hinic_main.c #define VLAN_BITMAP_SIZE(nic_dev) (ALIGN(VLAN_N_VID, 8) / 8) nic_dev 70 drivers/net/ethernet/huawei/hinic/hinic_main.c static int set_features(struct hinic_dev *nic_dev, nic_dev 74 drivers/net/ethernet/huawei/hinic/hinic_main.c static void update_rx_stats(struct hinic_dev *nic_dev, struct hinic_rxq *rxq) nic_dev 76 drivers/net/ethernet/huawei/hinic/hinic_main.c struct hinic_rxq_stats *nic_rx_stats = &nic_dev->rx_stats; nic_dev 94 drivers/net/ethernet/huawei/hinic/hinic_main.c static void update_tx_stats(struct hinic_dev *nic_dev, struct hinic_txq *txq) nic_dev 96 drivers/net/ethernet/huawei/hinic/hinic_main.c struct hinic_txq_stats *nic_tx_stats = &nic_dev->tx_stats; nic_dev 115 drivers/net/ethernet/huawei/hinic/hinic_main.c static void update_nic_stats(struct hinic_dev *nic_dev) nic_dev 117 drivers/net/ethernet/huawei/hinic/hinic_main.c int i, num_qps = hinic_hwdev_num_qps(nic_dev->hwdev); nic_dev 120 drivers/net/ethernet/huawei/hinic/hinic_main.c update_rx_stats(nic_dev, &nic_dev->rxqs[i]); nic_dev 123 drivers/net/ethernet/huawei/hinic/hinic_main.c update_tx_stats(nic_dev, &nic_dev->txqs[i]); nic_dev 132 drivers/net/ethernet/huawei/hinic/hinic_main.c static int create_txqs(struct hinic_dev *nic_dev) nic_dev 134 drivers/net/ethernet/huawei/hinic/hinic_main.c int err, i, j, num_txqs = hinic_hwdev_num_qps(nic_dev->hwdev); nic_dev 135 drivers/net/ethernet/huawei/hinic/hinic_main.c struct net_device *netdev = nic_dev->netdev; nic_dev 138 drivers/net/ethernet/huawei/hinic/hinic_main.c if (nic_dev->txqs) nic_dev 141 drivers/net/ethernet/huawei/hinic/hinic_main.c txq_size = num_txqs * sizeof(*nic_dev->txqs); nic_dev 142 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->txqs = devm_kzalloc(&netdev->dev, txq_size, GFP_KERNEL); nic_dev 143 drivers/net/ethernet/huawei/hinic/hinic_main.c if (!nic_dev->txqs) nic_dev 147 drivers/net/ethernet/huawei/hinic/hinic_main.c struct hinic_sq *sq = hinic_hwdev_get_sq(nic_dev->hwdev, i); nic_dev 149 drivers/net/ethernet/huawei/hinic/hinic_main.c err = hinic_init_txq(&nic_dev->txqs[i], sq, netdev); nic_dev 151 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_err(nic_dev, drv, netdev, nic_dev 161 drivers/net/ethernet/huawei/hinic/hinic_main.c hinic_clean_txq(&nic_dev->txqs[j]); nic_dev 163 drivers/net/ethernet/huawei/hinic/hinic_main.c devm_kfree(&netdev->dev, nic_dev->txqs); nic_dev 171 drivers/net/ethernet/huawei/hinic/hinic_main.c static void free_txqs(struct hinic_dev *nic_dev) nic_dev 173 drivers/net/ethernet/huawei/hinic/hinic_main.c int i, num_txqs = hinic_hwdev_num_qps(nic_dev->hwdev); nic_dev 174 drivers/net/ethernet/huawei/hinic/hinic_main.c struct net_device *netdev = nic_dev->netdev; nic_dev 176 drivers/net/ethernet/huawei/hinic/hinic_main.c if (!nic_dev->txqs) nic_dev 180 drivers/net/ethernet/huawei/hinic/hinic_main.c hinic_clean_txq(&nic_dev->txqs[i]); nic_dev 182 drivers/net/ethernet/huawei/hinic/hinic_main.c devm_kfree(&netdev->dev, nic_dev->txqs); nic_dev 183 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->txqs = NULL; nic_dev 192 drivers/net/ethernet/huawei/hinic/hinic_main.c static int create_rxqs(struct hinic_dev *nic_dev) nic_dev 194 drivers/net/ethernet/huawei/hinic/hinic_main.c int err, i, j, num_rxqs = hinic_hwdev_num_qps(nic_dev->hwdev); nic_dev 195 drivers/net/ethernet/huawei/hinic/hinic_main.c struct net_device *netdev = nic_dev->netdev; nic_dev 198 drivers/net/ethernet/huawei/hinic/hinic_main.c if (nic_dev->rxqs) nic_dev 201 drivers/net/ethernet/huawei/hinic/hinic_main.c rxq_size = num_rxqs * sizeof(*nic_dev->rxqs); nic_dev 202 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->rxqs = devm_kzalloc(&netdev->dev, rxq_size, GFP_KERNEL); nic_dev 203 drivers/net/ethernet/huawei/hinic/hinic_main.c if (!nic_dev->rxqs) nic_dev 207 drivers/net/ethernet/huawei/hinic/hinic_main.c struct hinic_rq *rq = hinic_hwdev_get_rq(nic_dev->hwdev, i); nic_dev 209 drivers/net/ethernet/huawei/hinic/hinic_main.c err = hinic_init_rxq(&nic_dev->rxqs[i], rq, netdev); nic_dev 211 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_err(nic_dev, drv, netdev, nic_dev 221 drivers/net/ethernet/huawei/hinic/hinic_main.c hinic_clean_rxq(&nic_dev->rxqs[j]); nic_dev 223 drivers/net/ethernet/huawei/hinic/hinic_main.c devm_kfree(&netdev->dev, nic_dev->rxqs); nic_dev 231 drivers/net/ethernet/huawei/hinic/hinic_main.c static void free_rxqs(struct hinic_dev *nic_dev) nic_dev 233 drivers/net/ethernet/huawei/hinic/hinic_main.c int i, num_rxqs = hinic_hwdev_num_qps(nic_dev->hwdev); nic_dev 234 drivers/net/ethernet/huawei/hinic/hinic_main.c struct net_device *netdev = nic_dev->netdev; nic_dev 236 drivers/net/ethernet/huawei/hinic/hinic_main.c if (!nic_dev->rxqs) nic_dev 240 drivers/net/ethernet/huawei/hinic/hinic_main.c hinic_clean_rxq(&nic_dev->rxqs[i]); nic_dev 242 drivers/net/ethernet/huawei/hinic/hinic_main.c devm_kfree(&netdev->dev, nic_dev->rxqs); nic_dev 243 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->rxqs = NULL; nic_dev 246 drivers/net/ethernet/huawei/hinic/hinic_main.c static int hinic_configure_max_qnum(struct hinic_dev *nic_dev) nic_dev 250 drivers/net/ethernet/huawei/hinic/hinic_main.c err = hinic_set_max_qnum(nic_dev, nic_dev->hwdev->nic_cap.max_qps); nic_dev 257 drivers/net/ethernet/huawei/hinic/hinic_main.c static int hinic_rss_init(struct hinic_dev *nic_dev) nic_dev 260 drivers/net/ethernet/huawei/hinic/hinic_main.c u8 tmpl_idx = nic_dev->rss_tmpl_idx; nic_dev 270 drivers/net/ethernet/huawei/hinic/hinic_main.c indir_tbl[i] = ethtool_rxfh_indir_default(i, nic_dev->num_rss); nic_dev 272 drivers/net/ethernet/huawei/hinic/hinic_main.c err = hinic_rss_set_template_tbl(nic_dev, tmpl_idx, default_rss_key); nic_dev 276 drivers/net/ethernet/huawei/hinic/hinic_main.c err = hinic_rss_set_indir_tbl(nic_dev, tmpl_idx, indir_tbl); nic_dev 280 drivers/net/ethernet/huawei/hinic/hinic_main.c err = hinic_set_rss_type(nic_dev, tmpl_idx, nic_dev->rss_type); nic_dev 284 drivers/net/ethernet/huawei/hinic/hinic_main.c err = hinic_rss_set_hash_engine(nic_dev, tmpl_idx, nic_dev 285 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->rss_hash_engine); nic_dev 289 drivers/net/ethernet/huawei/hinic/hinic_main.c err = hinic_rss_cfg(nic_dev, 1, tmpl_idx); nic_dev 298 drivers/net/ethernet/huawei/hinic/hinic_main.c static void hinic_rss_deinit(struct hinic_dev *nic_dev) nic_dev 300 drivers/net/ethernet/huawei/hinic/hinic_main.c hinic_rss_cfg(nic_dev, 0, nic_dev->rss_tmpl_idx); nic_dev 303 drivers/net/ethernet/huawei/hinic/hinic_main.c static void hinic_init_rss_parameters(struct hinic_dev *nic_dev) nic_dev 305 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->rss_hash_engine = HINIC_RSS_HASH_ENGINE_TYPE_XOR; nic_dev 306 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->rss_type.tcp_ipv6_ext = 1; nic_dev 307 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->rss_type.ipv6_ext = 1; nic_dev 308 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->rss_type.tcp_ipv6 = 1; nic_dev 309 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->rss_type.ipv6 = 1; nic_dev 310 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->rss_type.tcp_ipv4 = 1; nic_dev 311 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->rss_type.ipv4 = 1; nic_dev 312 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->rss_type.udp_ipv6 = 1; nic_dev 313 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->rss_type.udp_ipv4 = 1; nic_dev 316 drivers/net/ethernet/huawei/hinic/hinic_main.c static void hinic_enable_rss(struct hinic_dev *nic_dev) nic_dev 318 drivers/net/ethernet/huawei/hinic/hinic_main.c struct net_device *netdev = nic_dev->netdev; nic_dev 319 drivers/net/ethernet/huawei/hinic/hinic_main.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 325 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->max_qps = hinic_hwdev_max_num_qps(hwdev); nic_dev 326 drivers/net/ethernet/huawei/hinic/hinic_main.c if (nic_dev->max_qps <= 1) { nic_dev 327 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->flags &= ~HINIC_RSS_ENABLE; nic_dev 328 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->rss_limit = nic_dev->max_qps; nic_dev 329 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->num_qps = nic_dev->max_qps; nic_dev 330 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->num_rss = nic_dev->max_qps; nic_dev 335 drivers/net/ethernet/huawei/hinic/hinic_main.c err = hinic_rss_template_alloc(nic_dev, &nic_dev->rss_tmpl_idx); nic_dev 337 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_err(nic_dev, drv, netdev, nic_dev 339 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->flags &= ~HINIC_RSS_ENABLE; nic_dev 340 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->max_qps = 1; nic_dev 341 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->rss_limit = nic_dev->max_qps; nic_dev 342 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->num_qps = nic_dev->max_qps; nic_dev 343 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->num_rss = nic_dev->max_qps; nic_dev 348 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->flags |= HINIC_RSS_ENABLE; nic_dev 359 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->num_qps = hinic_hwdev_num_qps(hwdev); nic_dev 360 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->num_qps = min_t(u16, nic_dev->num_qps, num_cpus); nic_dev 362 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->rss_limit = nic_dev->num_qps; nic_dev 363 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->num_rss = nic_dev->num_qps; nic_dev 365 drivers/net/ethernet/huawei/hinic/hinic_main.c hinic_init_rss_parameters(nic_dev); nic_dev 366 drivers/net/ethernet/huawei/hinic/hinic_main.c err = hinic_rss_init(nic_dev); nic_dev 368 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_err(nic_dev, drv, netdev, "Failed to init rss\n"); nic_dev 373 drivers/net/ethernet/huawei/hinic/hinic_main.c struct hinic_dev *nic_dev = netdev_priv(netdev); nic_dev 377 drivers/net/ethernet/huawei/hinic/hinic_main.c if (!(nic_dev->flags & HINIC_INTF_UP)) { nic_dev 378 drivers/net/ethernet/huawei/hinic/hinic_main.c err = hinic_hwdev_ifup(nic_dev->hwdev); nic_dev 380 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_err(nic_dev, drv, netdev, nic_dev 386 drivers/net/ethernet/huawei/hinic/hinic_main.c err = create_txqs(nic_dev); nic_dev 388 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_err(nic_dev, drv, netdev, nic_dev 393 drivers/net/ethernet/huawei/hinic/hinic_main.c err = create_rxqs(nic_dev); nic_dev 395 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_err(nic_dev, drv, netdev, nic_dev 400 drivers/net/ethernet/huawei/hinic/hinic_main.c hinic_enable_rss(nic_dev); nic_dev 402 drivers/net/ethernet/huawei/hinic/hinic_main.c err = hinic_configure_max_qnum(nic_dev); nic_dev 404 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_err(nic_dev, drv, nic_dev->netdev, nic_dev 409 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_set_real_num_tx_queues(netdev, nic_dev->num_qps); nic_dev 410 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_set_real_num_rx_queues(netdev, nic_dev->num_qps); nic_dev 412 drivers/net/ethernet/huawei/hinic/hinic_main.c err = hinic_port_set_state(nic_dev, HINIC_PORT_ENABLE); nic_dev 414 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_err(nic_dev, drv, netdev, nic_dev 419 drivers/net/ethernet/huawei/hinic/hinic_main.c err = hinic_port_set_func_state(nic_dev, HINIC_FUNC_PORT_ENABLE); nic_dev 421 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_err(nic_dev, drv, netdev, nic_dev 429 drivers/net/ethernet/huawei/hinic/hinic_main.c down(&nic_dev->mgmt_lock); nic_dev 431 drivers/net/ethernet/huawei/hinic/hinic_main.c err = hinic_port_link_state(nic_dev, &link_state); nic_dev 433 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_err(nic_dev, drv, netdev, "Failed to get link state\n"); nic_dev 438 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->flags |= HINIC_LINK_UP; nic_dev 440 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->flags |= HINIC_INTF_UP; nic_dev 442 drivers/net/ethernet/huawei/hinic/hinic_main.c if ((nic_dev->flags & (HINIC_LINK_UP | HINIC_INTF_UP)) == nic_dev 444 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_info(nic_dev, drv, netdev, "link + intf UP\n"); nic_dev 449 drivers/net/ethernet/huawei/hinic/hinic_main.c up(&nic_dev->mgmt_lock); nic_dev 451 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_info(nic_dev, drv, netdev, "HINIC_INTF is UP\n"); nic_dev 455 drivers/net/ethernet/huawei/hinic/hinic_main.c up(&nic_dev->mgmt_lock); nic_dev 456 drivers/net/ethernet/huawei/hinic/hinic_main.c ret = hinic_port_set_func_state(nic_dev, HINIC_FUNC_PORT_DISABLE); nic_dev 458 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_warn(nic_dev, drv, netdev, nic_dev 462 drivers/net/ethernet/huawei/hinic/hinic_main.c ret = hinic_port_set_state(nic_dev, HINIC_PORT_DISABLE); nic_dev 464 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_warn(nic_dev, drv, netdev, nic_dev 467 drivers/net/ethernet/huawei/hinic/hinic_main.c free_rxqs(nic_dev); nic_dev 468 drivers/net/ethernet/huawei/hinic/hinic_main.c if (nic_dev->flags & HINIC_RSS_ENABLE) { nic_dev 469 drivers/net/ethernet/huawei/hinic/hinic_main.c hinic_rss_deinit(nic_dev); nic_dev 470 drivers/net/ethernet/huawei/hinic/hinic_main.c hinic_rss_template_free(nic_dev, nic_dev->rss_tmpl_idx); nic_dev 474 drivers/net/ethernet/huawei/hinic/hinic_main.c free_txqs(nic_dev); nic_dev 477 drivers/net/ethernet/huawei/hinic/hinic_main.c if (!(nic_dev->flags & HINIC_INTF_UP)) nic_dev 478 drivers/net/ethernet/huawei/hinic/hinic_main.c hinic_hwdev_ifdown(nic_dev->hwdev); nic_dev 484 drivers/net/ethernet/huawei/hinic/hinic_main.c struct hinic_dev *nic_dev = netdev_priv(netdev); nic_dev 487 drivers/net/ethernet/huawei/hinic/hinic_main.c down(&nic_dev->mgmt_lock); nic_dev 489 drivers/net/ethernet/huawei/hinic/hinic_main.c flags = nic_dev->flags; nic_dev 490 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->flags &= ~HINIC_INTF_UP; nic_dev 495 drivers/net/ethernet/huawei/hinic/hinic_main.c update_nic_stats(nic_dev); nic_dev 497 drivers/net/ethernet/huawei/hinic/hinic_main.c up(&nic_dev->mgmt_lock); nic_dev 499 drivers/net/ethernet/huawei/hinic/hinic_main.c hinic_port_set_state(nic_dev, HINIC_PORT_DISABLE); nic_dev 501 drivers/net/ethernet/huawei/hinic/hinic_main.c hinic_port_set_func_state(nic_dev, HINIC_FUNC_PORT_DISABLE); nic_dev 503 drivers/net/ethernet/huawei/hinic/hinic_main.c if (nic_dev->flags & HINIC_RSS_ENABLE) { nic_dev 504 drivers/net/ethernet/huawei/hinic/hinic_main.c hinic_rss_deinit(nic_dev); nic_dev 505 drivers/net/ethernet/huawei/hinic/hinic_main.c hinic_rss_template_free(nic_dev, nic_dev->rss_tmpl_idx); nic_dev 508 drivers/net/ethernet/huawei/hinic/hinic_main.c free_rxqs(nic_dev); nic_dev 509 drivers/net/ethernet/huawei/hinic/hinic_main.c free_txqs(nic_dev); nic_dev 512 drivers/net/ethernet/huawei/hinic/hinic_main.c hinic_hwdev_ifdown(nic_dev->hwdev); nic_dev 514 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_info(nic_dev, drv, netdev, "HINIC_INTF is DOWN\n"); nic_dev 520 drivers/net/ethernet/huawei/hinic/hinic_main.c struct hinic_dev *nic_dev = netdev_priv(netdev); nic_dev 523 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_info(nic_dev, drv, netdev, "set_mtu = %d\n", new_mtu); nic_dev 525 drivers/net/ethernet/huawei/hinic/hinic_main.c err = hinic_port_set_mtu(nic_dev, new_mtu); nic_dev 527 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_err(nic_dev, drv, netdev, "Failed to set port mtu\n"); nic_dev 543 drivers/net/ethernet/huawei/hinic/hinic_main.c struct hinic_dev *nic_dev = netdev_priv(netdev); nic_dev 550 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_info(nic_dev, drv, netdev, "change mac addr = %02x %02x %02x %02x %02x %02x\n", nic_dev 553 drivers/net/ethernet/huawei/hinic/hinic_main.c down(&nic_dev->mgmt_lock); nic_dev 556 drivers/net/ethernet/huawei/hinic/hinic_main.c err = hinic_port_del_mac(nic_dev, netdev->dev_addr, vid); nic_dev 558 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_err(nic_dev, drv, netdev, nic_dev 563 drivers/net/ethernet/huawei/hinic/hinic_main.c err = hinic_port_add_mac(nic_dev, addr, vid); nic_dev 565 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_err(nic_dev, drv, netdev, "Failed to add mac\n"); nic_dev 569 drivers/net/ethernet/huawei/hinic/hinic_main.c vid = find_next_bit(nic_dev->vlan_bitmap, VLAN_N_VID, vid + 1); nic_dev 572 drivers/net/ethernet/huawei/hinic/hinic_main.c up(&nic_dev->mgmt_lock); nic_dev 600 drivers/net/ethernet/huawei/hinic/hinic_main.c struct hinic_dev *nic_dev = netdev_priv(netdev); nic_dev 604 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_info(nic_dev, drv, netdev, "set mac addr = %02x %02x %02x %02x %02x %02x\n", nic_dev 607 drivers/net/ethernet/huawei/hinic/hinic_main.c down(&nic_dev->mgmt_lock); nic_dev 610 drivers/net/ethernet/huawei/hinic/hinic_main.c err = hinic_port_add_mac(nic_dev, addr, vid); nic_dev 612 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_err(nic_dev, drv, netdev, "Failed to add mac\n"); nic_dev 616 drivers/net/ethernet/huawei/hinic/hinic_main.c vid = find_next_bit(nic_dev->vlan_bitmap, VLAN_N_VID, vid + 1); nic_dev 619 drivers/net/ethernet/huawei/hinic/hinic_main.c up(&nic_dev->mgmt_lock); nic_dev 632 drivers/net/ethernet/huawei/hinic/hinic_main.c struct hinic_dev *nic_dev = netdev_priv(netdev); nic_dev 639 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_info(nic_dev, drv, netdev, "remove mac addr = %02x %02x %02x %02x %02x %02x\n", nic_dev 642 drivers/net/ethernet/huawei/hinic/hinic_main.c down(&nic_dev->mgmt_lock); nic_dev 645 drivers/net/ethernet/huawei/hinic/hinic_main.c err = hinic_port_del_mac(nic_dev, addr, vid); nic_dev 647 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_err(nic_dev, drv, netdev, nic_dev 652 drivers/net/ethernet/huawei/hinic/hinic_main.c vid = find_next_bit(nic_dev->vlan_bitmap, VLAN_N_VID, vid + 1); nic_dev 655 drivers/net/ethernet/huawei/hinic/hinic_main.c up(&nic_dev->mgmt_lock); nic_dev 662 drivers/net/ethernet/huawei/hinic/hinic_main.c struct hinic_dev *nic_dev = netdev_priv(netdev); nic_dev 665 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_info(nic_dev, drv, netdev, "add vid = %d\n", vid); nic_dev 667 drivers/net/ethernet/huawei/hinic/hinic_main.c down(&nic_dev->mgmt_lock); nic_dev 669 drivers/net/ethernet/huawei/hinic/hinic_main.c err = hinic_port_add_vlan(nic_dev, vid); nic_dev 671 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_err(nic_dev, drv, netdev, "Failed to add vlan\n"); nic_dev 675 drivers/net/ethernet/huawei/hinic/hinic_main.c err = hinic_port_add_mac(nic_dev, netdev->dev_addr, vid); nic_dev 677 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_err(nic_dev, drv, netdev, "Failed to set mac\n"); nic_dev 681 drivers/net/ethernet/huawei/hinic/hinic_main.c bitmap_set(nic_dev->vlan_bitmap, vid, 1); nic_dev 683 drivers/net/ethernet/huawei/hinic/hinic_main.c up(&nic_dev->mgmt_lock); nic_dev 687 drivers/net/ethernet/huawei/hinic/hinic_main.c ret = hinic_port_del_vlan(nic_dev, vid); nic_dev 689 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_err(nic_dev, drv, netdev, nic_dev 693 drivers/net/ethernet/huawei/hinic/hinic_main.c up(&nic_dev->mgmt_lock); nic_dev 700 drivers/net/ethernet/huawei/hinic/hinic_main.c struct hinic_dev *nic_dev = netdev_priv(netdev); nic_dev 703 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_info(nic_dev, drv, netdev, "remove vid = %d\n", vid); nic_dev 705 drivers/net/ethernet/huawei/hinic/hinic_main.c down(&nic_dev->mgmt_lock); nic_dev 707 drivers/net/ethernet/huawei/hinic/hinic_main.c err = hinic_port_del_vlan(nic_dev, vid); nic_dev 709 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_err(nic_dev, drv, netdev, "Failed to delete vlan\n"); nic_dev 713 drivers/net/ethernet/huawei/hinic/hinic_main.c bitmap_clear(nic_dev->vlan_bitmap, vid, 1); nic_dev 715 drivers/net/ethernet/huawei/hinic/hinic_main.c up(&nic_dev->mgmt_lock); nic_dev 719 drivers/net/ethernet/huawei/hinic/hinic_main.c up(&nic_dev->mgmt_lock); nic_dev 726 drivers/net/ethernet/huawei/hinic/hinic_main.c struct hinic_dev *nic_dev = rx_mode_work_to_nic_dev(rx_mode_work); nic_dev 728 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_info(nic_dev, drv, nic_dev->netdev, "set rx mode work\n"); nic_dev 730 drivers/net/ethernet/huawei/hinic/hinic_main.c hinic_port_set_rx_mode(nic_dev, rx_mode_work->rx_mode); nic_dev 732 drivers/net/ethernet/huawei/hinic/hinic_main.c __dev_uc_sync(nic_dev->netdev, add_mac_addr, remove_mac_addr); nic_dev 733 drivers/net/ethernet/huawei/hinic/hinic_main.c __dev_mc_sync(nic_dev->netdev, add_mac_addr, remove_mac_addr); nic_dev 738 drivers/net/ethernet/huawei/hinic/hinic_main.c struct hinic_dev *nic_dev = netdev_priv(netdev); nic_dev 742 drivers/net/ethernet/huawei/hinic/hinic_main.c rx_mode_work = &nic_dev->rx_mode_work; nic_dev 755 drivers/net/ethernet/huawei/hinic/hinic_main.c queue_work(nic_dev->workq, &rx_mode_work->work); nic_dev 760 drivers/net/ethernet/huawei/hinic/hinic_main.c struct hinic_dev *nic_dev = netdev_priv(netdev); nic_dev 762 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_err(nic_dev, drv, netdev, "Tx timeout\n"); nic_dev 768 drivers/net/ethernet/huawei/hinic/hinic_main.c struct hinic_dev *nic_dev = netdev_priv(netdev); nic_dev 772 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_rx_stats = &nic_dev->rx_stats; nic_dev 773 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_tx_stats = &nic_dev->tx_stats; nic_dev 775 drivers/net/ethernet/huawei/hinic/hinic_main.c down(&nic_dev->mgmt_lock); nic_dev 777 drivers/net/ethernet/huawei/hinic/hinic_main.c if (nic_dev->flags & HINIC_INTF_UP) nic_dev 778 drivers/net/ethernet/huawei/hinic/hinic_main.c update_nic_stats(nic_dev); nic_dev 780 drivers/net/ethernet/huawei/hinic/hinic_main.c up(&nic_dev->mgmt_lock); nic_dev 794 drivers/net/ethernet/huawei/hinic/hinic_main.c struct hinic_dev *nic_dev = netdev_priv(netdev); nic_dev 796 drivers/net/ethernet/huawei/hinic/hinic_main.c return set_features(nic_dev, nic_dev->netdev->features, nic_dev 803 drivers/net/ethernet/huawei/hinic/hinic_main.c struct hinic_dev *nic_dev = netdev_priv(netdev); nic_dev 807 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_info(nic_dev, drv, netdev, "disabling LRO as RXCSUM is off\n"); nic_dev 856 drivers/net/ethernet/huawei/hinic/hinic_main.c struct hinic_dev *nic_dev = handle; nic_dev 861 drivers/net/ethernet/huawei/hinic/hinic_main.c down(&nic_dev->mgmt_lock); nic_dev 863 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->flags |= HINIC_LINK_UP; nic_dev 865 drivers/net/ethernet/huawei/hinic/hinic_main.c if ((nic_dev->flags & (HINIC_LINK_UP | HINIC_INTF_UP)) == nic_dev 867 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_carrier_on(nic_dev->netdev); nic_dev 868 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_tx_wake_all_queues(nic_dev->netdev); nic_dev 871 drivers/net/ethernet/huawei/hinic/hinic_main.c up(&nic_dev->mgmt_lock); nic_dev 873 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_info(nic_dev, drv, nic_dev->netdev, "HINIC_Link is UP\n"); nic_dev 875 drivers/net/ethernet/huawei/hinic/hinic_main.c down(&nic_dev->mgmt_lock); nic_dev 877 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->flags &= ~HINIC_LINK_UP; nic_dev 879 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_carrier_off(nic_dev->netdev); nic_dev 880 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_tx_disable(nic_dev->netdev); nic_dev 882 drivers/net/ethernet/huawei/hinic/hinic_main.c up(&nic_dev->mgmt_lock); nic_dev 884 drivers/net/ethernet/huawei/hinic/hinic_main.c netif_info(nic_dev, drv, nic_dev->netdev, "HINIC_Link is DOWN\n"); nic_dev 893 drivers/net/ethernet/huawei/hinic/hinic_main.c static int set_features(struct hinic_dev *nic_dev, nic_dev 902 drivers/net/ethernet/huawei/hinic/hinic_main.c err = hinic_port_set_tso(nic_dev, (features & NETIF_F_TSO) ? nic_dev 906 drivers/net/ethernet/huawei/hinic/hinic_main.c err = hinic_set_rx_csum_offload(nic_dev, csum_en); nic_dev 909 drivers/net/ethernet/huawei/hinic/hinic_main.c err = hinic_set_rx_lro_state(nic_dev, nic_dev 916 drivers/net/ethernet/huawei/hinic/hinic_main.c err = hinic_set_rx_vlan_offload(nic_dev, nic_dev 934 drivers/net/ethernet/huawei/hinic/hinic_main.c struct hinic_dev *nic_dev; nic_dev 952 drivers/net/ethernet/huawei/hinic/hinic_main.c netdev = alloc_etherdev_mq(sizeof(*nic_dev), num_qps); nic_dev 963 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev = netdev_priv(netdev); nic_dev 964 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->netdev = netdev; nic_dev 965 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->hwdev = hwdev; nic_dev 966 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->msg_enable = MSG_ENABLE_DEFAULT; nic_dev 967 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->flags = 0; nic_dev 968 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->txqs = NULL; nic_dev 969 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->rxqs = NULL; nic_dev 970 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->tx_weight = tx_weight; nic_dev 971 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->rx_weight = rx_weight; nic_dev 973 drivers/net/ethernet/huawei/hinic/hinic_main.c sema_init(&nic_dev->mgmt_lock, 1); nic_dev 975 drivers/net/ethernet/huawei/hinic/hinic_main.c tx_stats = &nic_dev->tx_stats; nic_dev 976 drivers/net/ethernet/huawei/hinic/hinic_main.c rx_stats = &nic_dev->rx_stats; nic_dev 981 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->vlan_bitmap = devm_kzalloc(&pdev->dev, nic_dev 982 drivers/net/ethernet/huawei/hinic/hinic_main.c VLAN_BITMAP_SIZE(nic_dev), nic_dev 984 drivers/net/ethernet/huawei/hinic/hinic_main.c if (!nic_dev->vlan_bitmap) { nic_dev 989 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev->workq = create_singlethread_workqueue(HINIC_WQ_NAME); nic_dev 990 drivers/net/ethernet/huawei/hinic/hinic_main.c if (!nic_dev->workq) { nic_dev 997 drivers/net/ethernet/huawei/hinic/hinic_main.c err = hinic_port_get_mac(nic_dev, netdev->dev_addr); nic_dev 1001 drivers/net/ethernet/huawei/hinic/hinic_main.c err = hinic_port_add_mac(nic_dev, netdev->dev_addr, 0); nic_dev 1007 drivers/net/ethernet/huawei/hinic/hinic_main.c err = hinic_port_set_mtu(nic_dev, netdev->mtu); nic_dev 1013 drivers/net/ethernet/huawei/hinic/hinic_main.c rx_mode_work = &nic_dev->rx_mode_work; nic_dev 1020 drivers/net/ethernet/huawei/hinic/hinic_main.c hinic_hwdev_cb_register(nic_dev->hwdev, HINIC_MGMT_MSG_CMD_LINK_STATUS, nic_dev 1021 drivers/net/ethernet/huawei/hinic/hinic_main.c nic_dev, link_status_event_handler); nic_dev 1023 drivers/net/ethernet/huawei/hinic/hinic_main.c err = set_features(nic_dev, 0, nic_dev->netdev->features, true); nic_dev 1039 drivers/net/ethernet/huawei/hinic/hinic_main.c hinic_hwdev_cb_unregister(nic_dev->hwdev, nic_dev 1046 drivers/net/ethernet/huawei/hinic/hinic_main.c destroy_workqueue(nic_dev->workq); nic_dev 1120 drivers/net/ethernet/huawei/hinic/hinic_main.c struct hinic_dev *nic_dev = netdev_priv(netdev); nic_dev 1125 drivers/net/ethernet/huawei/hinic/hinic_main.c hinic_hwdev_cb_unregister(nic_dev->hwdev, nic_dev 1128 drivers/net/ethernet/huawei/hinic/hinic_main.c rx_mode_work = &nic_dev->rx_mode_work; nic_dev 1133 drivers/net/ethernet/huawei/hinic/hinic_main.c destroy_workqueue(nic_dev->workq); nic_dev 1135 drivers/net/ethernet/huawei/hinic/hinic_main.c hinic_free_hwdev(nic_dev->hwdev); nic_dev 37 drivers/net/ethernet/huawei/hinic/hinic_port.c static int change_mac(struct hinic_dev *nic_dev, const u8 *addr, nic_dev 40 drivers/net/ethernet/huawei/hinic/hinic_port.c struct net_device *netdev = nic_dev->netdev; nic_dev 41 drivers/net/ethernet/huawei/hinic/hinic_port.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 50 drivers/net/ethernet/huawei/hinic/hinic_port.c netif_err(nic_dev, drv, netdev, "Invalid VLAN number\n"); nic_dev 83 drivers/net/ethernet/huawei/hinic/hinic_port.c int hinic_port_add_mac(struct hinic_dev *nic_dev, nic_dev 86 drivers/net/ethernet/huawei/hinic/hinic_port.c return change_mac(nic_dev, addr, vlan_id, MAC_SET); nic_dev 97 drivers/net/ethernet/huawei/hinic/hinic_port.c int hinic_port_del_mac(struct hinic_dev *nic_dev, const u8 *addr, nic_dev 100 drivers/net/ethernet/huawei/hinic/hinic_port.c return change_mac(nic_dev, addr, vlan_id, MAC_DEL); nic_dev 110 drivers/net/ethernet/huawei/hinic/hinic_port.c int hinic_port_get_mac(struct hinic_dev *nic_dev, u8 *addr) nic_dev 112 drivers/net/ethernet/huawei/hinic/hinic_port.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 141 drivers/net/ethernet/huawei/hinic/hinic_port.c int hinic_port_set_mtu(struct hinic_dev *nic_dev, int new_mtu) nic_dev 143 drivers/net/ethernet/huawei/hinic/hinic_port.c struct net_device *netdev = nic_dev->netdev; nic_dev 144 drivers/net/ethernet/huawei/hinic/hinic_port.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 152 drivers/net/ethernet/huawei/hinic/hinic_port.c netif_err(nic_dev, drv, netdev, "mtu < MIN MTU size"); nic_dev 158 drivers/net/ethernet/huawei/hinic/hinic_port.c netif_err(nic_dev, drv, netdev, "mtu > MAX MTU size"); nic_dev 184 drivers/net/ethernet/huawei/hinic/hinic_port.c int hinic_port_add_vlan(struct hinic_dev *nic_dev, u16 vlan_id) nic_dev 186 drivers/net/ethernet/huawei/hinic/hinic_port.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 204 drivers/net/ethernet/huawei/hinic/hinic_port.c int hinic_port_del_vlan(struct hinic_dev *nic_dev, u16 vlan_id) nic_dev 206 drivers/net/ethernet/huawei/hinic/hinic_port.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 224 drivers/net/ethernet/huawei/hinic/hinic_port.c int hinic_port_set_rx_mode(struct hinic_dev *nic_dev, u32 rx_mode) nic_dev 226 drivers/net/ethernet/huawei/hinic/hinic_port.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 244 drivers/net/ethernet/huawei/hinic/hinic_port.c int hinic_port_link_state(struct hinic_dev *nic_dev, nic_dev 247 drivers/net/ethernet/huawei/hinic/hinic_port.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 281 drivers/net/ethernet/huawei/hinic/hinic_port.c int hinic_port_set_state(struct hinic_dev *nic_dev, enum hinic_port_state state) nic_dev 283 drivers/net/ethernet/huawei/hinic/hinic_port.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 316 drivers/net/ethernet/huawei/hinic/hinic_port.c int hinic_port_set_func_state(struct hinic_dev *nic_dev, nic_dev 320 drivers/net/ethernet/huawei/hinic/hinic_port.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 348 drivers/net/ethernet/huawei/hinic/hinic_port.c int hinic_port_get_cap(struct hinic_dev *nic_dev, nic_dev 351 drivers/net/ethernet/huawei/hinic/hinic_port.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 379 drivers/net/ethernet/huawei/hinic/hinic_port.c int hinic_port_set_tso(struct hinic_dev *nic_dev, enum hinic_tso_state state) nic_dev 381 drivers/net/ethernet/huawei/hinic/hinic_port.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 404 drivers/net/ethernet/huawei/hinic/hinic_port.c int hinic_set_rx_csum_offload(struct hinic_dev *nic_dev, u32 en) nic_dev 407 drivers/net/ethernet/huawei/hinic/hinic_port.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 434 drivers/net/ethernet/huawei/hinic/hinic_port.c int hinic_set_rx_vlan_offload(struct hinic_dev *nic_dev, u8 en) nic_dev 436 drivers/net/ethernet/huawei/hinic/hinic_port.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 464 drivers/net/ethernet/huawei/hinic/hinic_port.c int hinic_set_max_qnum(struct hinic_dev *nic_dev, u8 num_rqs) nic_dev 466 drivers/net/ethernet/huawei/hinic/hinic_port.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 490 drivers/net/ethernet/huawei/hinic/hinic_port.c static int hinic_set_rx_lro(struct hinic_dev *nic_dev, u8 ipv4_en, u8 ipv6_en, nic_dev 493 drivers/net/ethernet/huawei/hinic/hinic_port.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 518 drivers/net/ethernet/huawei/hinic/hinic_port.c static int hinic_set_rx_lro_timer(struct hinic_dev *nic_dev, u32 timer_value) nic_dev 520 drivers/net/ethernet/huawei/hinic/hinic_port.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 553 drivers/net/ethernet/huawei/hinic/hinic_port.c int hinic_set_rx_lro_state(struct hinic_dev *nic_dev, u8 lro_en, nic_dev 556 drivers/net/ethernet/huawei/hinic/hinic_port.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 567 drivers/net/ethernet/huawei/hinic/hinic_port.c err = hinic_set_rx_lro(nic_dev, ipv4_en, ipv6_en, (u8)wqe_num); nic_dev 571 drivers/net/ethernet/huawei/hinic/hinic_port.c err = hinic_set_rx_lro_timer(nic_dev, lro_timer); nic_dev 578 drivers/net/ethernet/huawei/hinic/hinic_port.c int hinic_rss_set_indir_tbl(struct hinic_dev *nic_dev, u32 tmpl_idx, nic_dev 592 drivers/net/ethernet/huawei/hinic/hinic_port.c hwdev = nic_dev->hwdev; nic_dev 649 drivers/net/ethernet/huawei/hinic/hinic_port.c int hinic_rss_get_indir_tbl(struct hinic_dev *nic_dev, u32 tmpl_idx, nic_dev 653 drivers/net/ethernet/huawei/hinic/hinic_port.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 679 drivers/net/ethernet/huawei/hinic/hinic_port.c int hinic_set_rss_type(struct hinic_dev *nic_dev, u32 tmpl_idx, nic_dev 692 drivers/net/ethernet/huawei/hinic/hinic_port.c hwdev = nic_dev->hwdev; nic_dev 739 drivers/net/ethernet/huawei/hinic/hinic_port.c int hinic_get_rss_type(struct hinic_dev *nic_dev, u32 tmpl_idx, nic_dev 743 drivers/net/ethernet/huawei/hinic/hinic_port.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 780 drivers/net/ethernet/huawei/hinic/hinic_port.c int hinic_rss_set_template_tbl(struct hinic_dev *nic_dev, u32 template_id, nic_dev 783 drivers/net/ethernet/huawei/hinic/hinic_port.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 807 drivers/net/ethernet/huawei/hinic/hinic_port.c int hinic_rss_get_template_tbl(struct hinic_dev *nic_dev, u32 tmpl_idx, nic_dev 811 drivers/net/ethernet/huawei/hinic/hinic_port.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 840 drivers/net/ethernet/huawei/hinic/hinic_port.c int hinic_rss_set_hash_engine(struct hinic_dev *nic_dev, u8 template_id, nic_dev 844 drivers/net/ethernet/huawei/hinic/hinic_port.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 867 drivers/net/ethernet/huawei/hinic/hinic_port.c int hinic_rss_get_hash_engine(struct hinic_dev *nic_dev, u8 tmpl_idx, u8 *type) nic_dev 870 drivers/net/ethernet/huawei/hinic/hinic_port.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 898 drivers/net/ethernet/huawei/hinic/hinic_port.c int hinic_rss_cfg(struct hinic_dev *nic_dev, u8 rss_en, u8 template_id) nic_dev 900 drivers/net/ethernet/huawei/hinic/hinic_port.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 925 drivers/net/ethernet/huawei/hinic/hinic_port.c int hinic_rss_template_alloc(struct hinic_dev *nic_dev, u8 *tmpl_idx) nic_dev 928 drivers/net/ethernet/huawei/hinic/hinic_port.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 951 drivers/net/ethernet/huawei/hinic/hinic_port.c int hinic_rss_template_free(struct hinic_dev *nic_dev, u8 tmpl_idx) nic_dev 954 drivers/net/ethernet/huawei/hinic/hinic_port.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 976 drivers/net/ethernet/huawei/hinic/hinic_port.c int hinic_get_vport_stats(struct hinic_dev *nic_dev, nic_dev 981 drivers/net/ethernet/huawei/hinic/hinic_port.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 1005 drivers/net/ethernet/huawei/hinic/hinic_port.c int hinic_get_phy_port_stats(struct hinic_dev *nic_dev, nic_dev 1009 drivers/net/ethernet/huawei/hinic/hinic_port.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 1042 drivers/net/ethernet/huawei/hinic/hinic_port.c int hinic_get_mgmt_version(struct hinic_dev *nic_dev, u8 *mgmt_ver) nic_dev 1044 drivers/net/ethernet/huawei/hinic/hinic_port.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 509 drivers/net/ethernet/huawei/hinic/hinic_port.h int hinic_port_add_mac(struct hinic_dev *nic_dev, const u8 *addr, nic_dev 512 drivers/net/ethernet/huawei/hinic/hinic_port.h int hinic_port_del_mac(struct hinic_dev *nic_dev, const u8 *addr, nic_dev 515 drivers/net/ethernet/huawei/hinic/hinic_port.h int hinic_port_get_mac(struct hinic_dev *nic_dev, u8 *addr); nic_dev 517 drivers/net/ethernet/huawei/hinic/hinic_port.h int hinic_port_set_mtu(struct hinic_dev *nic_dev, int new_mtu); nic_dev 519 drivers/net/ethernet/huawei/hinic/hinic_port.h int hinic_port_add_vlan(struct hinic_dev *nic_dev, u16 vlan_id); nic_dev 521 drivers/net/ethernet/huawei/hinic/hinic_port.h int hinic_port_del_vlan(struct hinic_dev *nic_dev, u16 vlan_id); nic_dev 523 drivers/net/ethernet/huawei/hinic/hinic_port.h int hinic_port_set_rx_mode(struct hinic_dev *nic_dev, u32 rx_mode); nic_dev 525 drivers/net/ethernet/huawei/hinic/hinic_port.h int hinic_port_link_state(struct hinic_dev *nic_dev, nic_dev 528 drivers/net/ethernet/huawei/hinic/hinic_port.h int hinic_port_set_state(struct hinic_dev *nic_dev, nic_dev 531 drivers/net/ethernet/huawei/hinic/hinic_port.h int hinic_port_set_func_state(struct hinic_dev *nic_dev, nic_dev 534 drivers/net/ethernet/huawei/hinic/hinic_port.h int hinic_port_get_cap(struct hinic_dev *nic_dev, nic_dev 537 drivers/net/ethernet/huawei/hinic/hinic_port.h int hinic_set_max_qnum(struct hinic_dev *nic_dev, u8 num_rqs); nic_dev 539 drivers/net/ethernet/huawei/hinic/hinic_port.h int hinic_port_set_tso(struct hinic_dev *nic_dev, enum hinic_tso_state state); nic_dev 541 drivers/net/ethernet/huawei/hinic/hinic_port.h int hinic_set_rx_csum_offload(struct hinic_dev *nic_dev, u32 en); nic_dev 543 drivers/net/ethernet/huawei/hinic/hinic_port.h int hinic_set_rx_lro_state(struct hinic_dev *nic_dev, u8 lro_en, nic_dev 546 drivers/net/ethernet/huawei/hinic/hinic_port.h int hinic_set_rss_type(struct hinic_dev *nic_dev, u32 tmpl_idx, nic_dev 549 drivers/net/ethernet/huawei/hinic/hinic_port.h int hinic_rss_set_indir_tbl(struct hinic_dev *nic_dev, u32 tmpl_idx, nic_dev 552 drivers/net/ethernet/huawei/hinic/hinic_port.h int hinic_rss_set_template_tbl(struct hinic_dev *nic_dev, u32 template_id, nic_dev 555 drivers/net/ethernet/huawei/hinic/hinic_port.h int hinic_rss_set_hash_engine(struct hinic_dev *nic_dev, u8 template_id, nic_dev 558 drivers/net/ethernet/huawei/hinic/hinic_port.h int hinic_rss_cfg(struct hinic_dev *nic_dev, u8 rss_en, u8 template_id); nic_dev 560 drivers/net/ethernet/huawei/hinic/hinic_port.h int hinic_rss_template_alloc(struct hinic_dev *nic_dev, u8 *tmpl_idx); nic_dev 562 drivers/net/ethernet/huawei/hinic/hinic_port.h int hinic_rss_template_free(struct hinic_dev *nic_dev, u8 tmpl_idx); nic_dev 566 drivers/net/ethernet/huawei/hinic/hinic_port.h int hinic_get_rss_type(struct hinic_dev *nic_dev, u32 tmpl_idx, nic_dev 569 drivers/net/ethernet/huawei/hinic/hinic_port.h int hinic_rss_get_indir_tbl(struct hinic_dev *nic_dev, u32 tmpl_idx, nic_dev 572 drivers/net/ethernet/huawei/hinic/hinic_port.h int hinic_rss_get_template_tbl(struct hinic_dev *nic_dev, u32 tmpl_idx, nic_dev 575 drivers/net/ethernet/huawei/hinic/hinic_port.h int hinic_rss_get_hash_engine(struct hinic_dev *nic_dev, u8 tmpl_idx, nic_dev 578 drivers/net/ethernet/huawei/hinic/hinic_port.h int hinic_get_phy_port_stats(struct hinic_dev *nic_dev, nic_dev 581 drivers/net/ethernet/huawei/hinic/hinic_port.h int hinic_get_vport_stats(struct hinic_dev *nic_dev, nic_dev 584 drivers/net/ethernet/huawei/hinic/hinic_port.h int hinic_set_rx_vlan_offload(struct hinic_dev *nic_dev, u8 en); nic_dev 586 drivers/net/ethernet/huawei/hinic/hinic_port.h int hinic_get_mgmt_version(struct hinic_dev *nic_dev, u8 *mgmt_ver); nic_dev 131 drivers/net/ethernet/huawei/hinic/hinic_rx.c struct hinic_dev *nic_dev = netdev_priv(rxq->netdev); nic_dev 132 drivers/net/ethernet/huawei/hinic/hinic_rx.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 168 drivers/net/ethernet/huawei/hinic/hinic_rx.c struct hinic_dev *nic_dev = netdev_priv(rxq->netdev); nic_dev 169 drivers/net/ethernet/huawei/hinic/hinic_rx.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 198 drivers/net/ethernet/huawei/hinic/hinic_rx.c struct hinic_dev *nic_dev = netdev_priv(rxq->netdev); nic_dev 210 drivers/net/ethernet/huawei/hinic/hinic_rx.c if (free_wqebbs > nic_dev->rx_weight) nic_dev 211 drivers/net/ethernet/huawei/hinic/hinic_rx.c free_wqebbs = nic_dev->rx_weight; nic_dev 426 drivers/net/ethernet/huawei/hinic/hinic_rx.c struct hinic_dev *nic_dev = netdev_priv(rxq->netdev); nic_dev 435 drivers/net/ethernet/huawei/hinic/hinic_rx.c hinic_hwdev_set_msix_state(nic_dev->hwdev, nic_dev 444 drivers/net/ethernet/huawei/hinic/hinic_rx.c struct hinic_dev *nic_dev = netdev_priv(rxq->netdev); nic_dev 446 drivers/net/ethernet/huawei/hinic/hinic_rx.c netif_napi_add(rxq->netdev, &rxq->napi, rx_poll, nic_dev->rx_weight); nic_dev 460 drivers/net/ethernet/huawei/hinic/hinic_rx.c struct hinic_dev *nic_dev; nic_dev 463 drivers/net/ethernet/huawei/hinic/hinic_rx.c nic_dev = netdev_priv(rxq->netdev); nic_dev 464 drivers/net/ethernet/huawei/hinic/hinic_rx.c hinic_hwdev_set_msix_state(nic_dev->hwdev, nic_dev 468 drivers/net/ethernet/huawei/hinic/hinic_rx.c nic_dev = netdev_priv(rxq->netdev); nic_dev 469 drivers/net/ethernet/huawei/hinic/hinic_rx.c hinic_hwdev_msix_cnt_set(nic_dev->hwdev, rq->msix_entry); nic_dev 477 drivers/net/ethernet/huawei/hinic/hinic_rx.c struct hinic_dev *nic_dev = netdev_priv(rxq->netdev); nic_dev 478 drivers/net/ethernet/huawei/hinic/hinic_rx.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 133 drivers/net/ethernet/huawei/hinic/hinic_tx.c static int tx_map_skb(struct hinic_dev *nic_dev, struct sk_buff *skb, nic_dev 136 drivers/net/ethernet/huawei/hinic/hinic_tx.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 184 drivers/net/ethernet/huawei/hinic/hinic_tx.c static void tx_unmap_skb(struct hinic_dev *nic_dev, struct sk_buff *skb, nic_dev 187 drivers/net/ethernet/huawei/hinic/hinic_tx.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 464 drivers/net/ethernet/huawei/hinic/hinic_tx.c struct hinic_dev *nic_dev = netdev_priv(netdev); nic_dev 473 drivers/net/ethernet/huawei/hinic/hinic_tx.c txq = &nic_dev->txqs[q_id]; nic_dev 497 drivers/net/ethernet/huawei/hinic/hinic_tx.c err = tx_map_skb(nic_dev, skb, txq->sges); nic_dev 512 drivers/net/ethernet/huawei/hinic/hinic_tx.c netif_wake_subqueue(nic_dev->netdev, qp->q_id); nic_dev 516 drivers/net/ethernet/huawei/hinic/hinic_tx.c tx_unmap_skb(nic_dev, skb, txq->sges); nic_dev 544 drivers/net/ethernet/huawei/hinic/hinic_tx.c tx_unmap_skb(nic_dev, skb, txq->sges); nic_dev 563 drivers/net/ethernet/huawei/hinic/hinic_tx.c static void tx_free_skb(struct hinic_dev *nic_dev, struct sk_buff *skb, nic_dev 566 drivers/net/ethernet/huawei/hinic/hinic_tx.c tx_unmap_skb(nic_dev, skb, sges); nic_dev 577 drivers/net/ethernet/huawei/hinic/hinic_tx.c struct hinic_dev *nic_dev = netdev_priv(txq->netdev); nic_dev 596 drivers/net/ethernet/huawei/hinic/hinic_tx.c tx_free_skb(nic_dev, skb, txq->free_sges); nic_dev 611 drivers/net/ethernet/huawei/hinic/hinic_tx.c struct hinic_dev *nic_dev = netdev_priv(txq->netdev); nic_dev 651 drivers/net/ethernet/huawei/hinic/hinic_tx.c tx_free_skb(nic_dev, skb, txq->free_sges); nic_dev 654 drivers/net/ethernet/huawei/hinic/hinic_tx.c if (__netif_subqueue_stopped(nic_dev->netdev, qp->q_id) && nic_dev 660 drivers/net/ethernet/huawei/hinic/hinic_tx.c netif_wake_subqueue(nic_dev->netdev, qp->q_id); nic_dev 676 drivers/net/ethernet/huawei/hinic/hinic_tx.c hinic_hwdev_set_msix_state(nic_dev->hwdev, nic_dev 700 drivers/net/ethernet/huawei/hinic/hinic_tx.c struct hinic_dev *nic_dev; nic_dev 702 drivers/net/ethernet/huawei/hinic/hinic_tx.c nic_dev = netdev_priv(txq->netdev); nic_dev 705 drivers/net/ethernet/huawei/hinic/hinic_tx.c hinic_hwdev_set_msix_state(nic_dev->hwdev, nic_dev 709 drivers/net/ethernet/huawei/hinic/hinic_tx.c hinic_hwdev_msix_cnt_set(nic_dev->hwdev, txq->sq->msix_entry); nic_dev 717 drivers/net/ethernet/huawei/hinic/hinic_tx.c struct hinic_dev *nic_dev = netdev_priv(txq->netdev); nic_dev 718 drivers/net/ethernet/huawei/hinic/hinic_tx.c struct hinic_hwdev *hwdev = nic_dev->hwdev; nic_dev 724 drivers/net/ethernet/huawei/hinic/hinic_tx.c tx_napi_add(txq, nic_dev->tx_weight); nic_dev 726 drivers/net/ethernet/huawei/hinic/hinic_tx.c hinic_hwdev_msix_set(nic_dev->hwdev, sq->msix_entry, nic_dev 761 drivers/net/ethernet/huawei/hinic/hinic_tx.c struct hinic_dev *nic_dev = netdev_priv(netdev); nic_dev 762 drivers/net/ethernet/huawei/hinic/hinic_tx.c struct hinic_hwdev *hwdev = nic_dev->hwdev;