Lines Matching +full:asym +full:- +full:pause

1 // SPDX-License-Identifier: GPL-2.0-only
4 * Copyright (C) 2014-2019 aQuantia Corporation
5 * Copyright (C) 2019-2020 Marvell International Ltd.
54 struct aq_nic_cfg_s *cfg = &self->aq_nic_cfg; in aq_nic_rss_init()
58 rss_params = &cfg->aq_rss; in aq_nic_rss_init()
60 rss_params->hash_secret_key_size = sizeof(rss_key); in aq_nic_rss_init()
61 memcpy(rss_params->hash_secret_key, rss_key, sizeof(rss_key)); in aq_nic_rss_init()
62 rss_params->indirection_table_size = AQ_CFG_RSS_INDIRECTION_TABLE_MAX; in aq_nic_rss_init()
64 for (i = rss_params->indirection_table_size; i--;) in aq_nic_rss_init()
65 rss_params->indirection_table[i] = i & (num_rss_queues - 1); in aq_nic_rss_init()
71 struct aq_nic_cfg_s *cfg = &self->aq_nic_cfg; in aq_nic_cfg_update_num_vecs()
73 cfg->vecs = min(cfg->aq_hw_caps->vecs, AQ_CFG_VECS_DEF); in aq_nic_cfg_update_num_vecs()
74 cfg->vecs = min(cfg->vecs, num_online_cpus()); in aq_nic_cfg_update_num_vecs()
75 if (self->irqvecs > AQ_HW_SERVICE_IRQS) in aq_nic_cfg_update_num_vecs()
76 cfg->vecs = min(cfg->vecs, self->irqvecs - AQ_HW_SERVICE_IRQS); in aq_nic_cfg_update_num_vecs()
77 /* cfg->vecs should be power of 2 for RSS */ in aq_nic_cfg_update_num_vecs()
78 cfg->vecs = rounddown_pow_of_two(cfg->vecs); in aq_nic_cfg_update_num_vecs()
80 if (ATL_HW_IS_CHIP_FEATURE(self->aq_hw, ANTIGUA)) { in aq_nic_cfg_update_num_vecs()
81 if (cfg->tcs > 2) in aq_nic_cfg_update_num_vecs()
82 cfg->vecs = min(cfg->vecs, 4U); in aq_nic_cfg_update_num_vecs()
85 if (cfg->vecs <= 4) in aq_nic_cfg_update_num_vecs()
86 cfg->tc_mode = AQ_TC_MODE_8TCS; in aq_nic_cfg_update_num_vecs()
88 cfg->tc_mode = AQ_TC_MODE_4TCS; in aq_nic_cfg_update_num_vecs()
91 cfg->num_rss_queues = min(cfg->vecs, AQ_CFG_NUM_RSS_QUEUES_DEF); in aq_nic_cfg_update_num_vecs()
92 aq_nic_rss_init(self, cfg->num_rss_queues); in aq_nic_cfg_update_num_vecs()
98 struct aq_nic_cfg_s *cfg = &self->aq_nic_cfg; in aq_nic_cfg_start()
101 cfg->tcs = AQ_CFG_TCS_DEF; in aq_nic_cfg_start()
103 cfg->is_polling = AQ_CFG_IS_POLLING_DEF; in aq_nic_cfg_start()
105 cfg->itr = aq_itr; in aq_nic_cfg_start()
106 cfg->tx_itr = aq_itr_tx; in aq_nic_cfg_start()
107 cfg->rx_itr = aq_itr_rx; in aq_nic_cfg_start()
109 cfg->rxpageorder = AQ_CFG_RX_PAGEORDER; in aq_nic_cfg_start()
110 cfg->is_rss = AQ_CFG_IS_RSS_DEF; in aq_nic_cfg_start()
111 cfg->aq_rss.base_cpu_number = AQ_CFG_RSS_BASE_CPU_NUM_DEF; in aq_nic_cfg_start()
112 cfg->fc.req = AQ_CFG_FC_MODE; in aq_nic_cfg_start()
113 cfg->wol = AQ_CFG_WOL_MODES; in aq_nic_cfg_start()
115 cfg->mtu = AQ_CFG_MTU_DEF; in aq_nic_cfg_start()
116 cfg->link_speed_msk = AQ_CFG_SPEED_MSK; in aq_nic_cfg_start()
117 cfg->is_autoneg = AQ_CFG_IS_AUTONEG_DEF; in aq_nic_cfg_start()
119 cfg->is_lro = AQ_CFG_IS_LRO_DEF; in aq_nic_cfg_start()
120 cfg->is_ptp = true; in aq_nic_cfg_start()
123 cfg->rxds = min(cfg->aq_hw_caps->rxds_max, AQ_CFG_RXDS_DEF); in aq_nic_cfg_start()
124 cfg->txds = min(cfg->aq_hw_caps->txds_max, AQ_CFG_TXDS_DEF); in aq_nic_cfg_start()
128 cfg->irq_type = aq_pci_func_get_irq_type(self); in aq_nic_cfg_start()
130 if ((cfg->irq_type == AQ_HW_IRQ_LEGACY) || in aq_nic_cfg_start()
131 (cfg->aq_hw_caps->vecs == 1U) || in aq_nic_cfg_start()
132 (cfg->vecs == 1U)) { in aq_nic_cfg_start()
133 cfg->is_rss = 0U; in aq_nic_cfg_start()
134 cfg->vecs = 1U; in aq_nic_cfg_start()
138 * link status IRQ. If no - we'll know link state from in aq_nic_cfg_start()
141 if (AQ_HW_SERVICE_IRQS > 0 && cfg->vecs + 1 <= self->irqvecs) in aq_nic_cfg_start()
142 cfg->link_irq_vec = cfg->vecs; in aq_nic_cfg_start()
144 cfg->link_irq_vec = 0; in aq_nic_cfg_start()
146 cfg->link_speed_msk &= cfg->aq_hw_caps->link_speed_msk; in aq_nic_cfg_start()
147 cfg->features = cfg->aq_hw_caps->hw_features; in aq_nic_cfg_start()
148 cfg->is_vlan_rx_strip = !!(cfg->features & NETIF_F_HW_VLAN_CTAG_RX); in aq_nic_cfg_start()
149 cfg->is_vlan_tx_insert = !!(cfg->features & NETIF_F_HW_VLAN_CTAG_TX); in aq_nic_cfg_start()
150 cfg->is_vlan_force_promisc = true; in aq_nic_cfg_start()
152 for (i = 0; i < sizeof(cfg->prio_tc_map); i++) in aq_nic_cfg_start()
153 cfg->prio_tc_map[i] = cfg->tcs * i / 8; in aq_nic_cfg_start()
158 int err = self->aq_fw_ops->update_link_status(self->aq_hw); in aq_nic_update_link_status()
164 if (self->aq_fw_ops->get_flow_control) in aq_nic_update_link_status()
165 self->aq_fw_ops->get_flow_control(self->aq_hw, &fc); in aq_nic_update_link_status()
166 self->aq_nic_cfg.fc.cur = fc; in aq_nic_update_link_status()
168 if (self->link_status.mbps != self->aq_hw->aq_link_status.mbps) { in aq_nic_update_link_status()
169 netdev_info(self->ndev, "%s: link change old %d new %d\n", in aq_nic_update_link_status()
170 AQ_CFG_DRV_NAME, self->link_status.mbps, in aq_nic_update_link_status()
171 self->aq_hw->aq_link_status.mbps); in aq_nic_update_link_status()
174 if (self->aq_ptp) { in aq_nic_update_link_status()
177 self->aq_hw->aq_link_status.mbps); in aq_nic_update_link_status()
185 if (self->aq_hw_ops->hw_set_fc) in aq_nic_update_link_status()
186 self->aq_hw_ops->hw_set_fc(self->aq_hw, fc, 0); in aq_nic_update_link_status()
189 self->link_status = self->aq_hw->aq_link_status; in aq_nic_update_link_status()
190 if (!netif_carrier_ok(self->ndev) && self->link_status.mbps) { in aq_nic_update_link_status()
191 aq_utils_obj_set(&self->flags, in aq_nic_update_link_status()
193 aq_utils_obj_clear(&self->flags, in aq_nic_update_link_status()
195 netif_carrier_on(self->ndev); in aq_nic_update_link_status()
199 if (self->aq_hw_ops->hw_tc_rate_limit_set) in aq_nic_update_link_status()
200 self->aq_hw_ops->hw_tc_rate_limit_set(self->aq_hw); in aq_nic_update_link_status()
202 netif_tx_wake_all_queues(self->ndev); in aq_nic_update_link_status()
204 if (netif_carrier_ok(self->ndev) && !self->link_status.mbps) { in aq_nic_update_link_status()
205 netif_carrier_off(self->ndev); in aq_nic_update_link_status()
206 netif_tx_disable(self->ndev); in aq_nic_update_link_status()
207 aq_utils_obj_set(&self->flags, AQ_NIC_LINK_DOWN); in aq_nic_update_link_status()
222 self->aq_hw_ops->hw_irq_enable(self->aq_hw, in aq_linkstate_threaded_isr()
223 BIT(self->aq_nic_cfg.link_irq_vec)); in aq_linkstate_threaded_isr()
236 if (aq_utils_obj_test(&self->flags, AQ_NIC_FLAGS_IS_NOT_READY)) in aq_nic_service_task()
247 mutex_lock(&self->fwreq_mutex); in aq_nic_service_task()
248 if (self->aq_fw_ops->update_stats) in aq_nic_service_task()
249 self->aq_fw_ops->update_stats(self->aq_hw); in aq_nic_service_task()
250 mutex_unlock(&self->fwreq_mutex); in aq_nic_service_task()
259 mod_timer(&self->service_timer, in aq_nic_service_timer_cb()
262 aq_ndev_schedule_work(&self->service_task); in aq_nic_service_timer_cb()
270 for (i = 0U; self->aq_vecs > i; ++i) in aq_nic_polling_timer_cb()
271 aq_vec_isr(i, (void *)self->aq_vec[i]); in aq_nic_polling_timer_cb()
273 mod_timer(&self->polling_timer, jiffies + in aq_nic_polling_timer_cb()
281 err = self->aq_hw_ops->hw_soft_reset(self->aq_hw); in aq_nic_hw_prepare()
285 err = self->aq_hw_ops->hw_prepare(self->aq_hw, &self->aq_fw_ops); in aq_nic_hw_prepare()
304 if (!self->ndev) { in aq_nic_ndev_register()
305 err = -EINVAL; in aq_nic_ndev_register()
317 if (platform_get_ethdev_address(&self->pdev->dev, self->ndev) != 0) { in aq_nic_ndev_register()
319 mutex_lock(&self->fwreq_mutex); in aq_nic_ndev_register()
320 err = self->aq_fw_ops->get_mac_permanent(self->aq_hw, addr); in aq_nic_ndev_register()
321 mutex_unlock(&self->fwreq_mutex); in aq_nic_ndev_register()
328 eth_hw_addr_set(self->ndev, addr); in aq_nic_ndev_register()
330 netdev_warn(self->ndev, "MAC is invalid, will use random."); in aq_nic_ndev_register()
331 eth_hw_addr_random(self->ndev); in aq_nic_ndev_register()
339 eth_hw_addr_set(self->ndev, mac_addr_permanent); in aq_nic_ndev_register()
343 for (self->aq_vecs = 0; self->aq_vecs < aq_nic_get_cfg(self)->vecs; in aq_nic_ndev_register()
344 self->aq_vecs++) { in aq_nic_ndev_register()
345 self->aq_vec[self->aq_vecs] = in aq_nic_ndev_register()
346 aq_vec_alloc(self, self->aq_vecs, aq_nic_get_cfg(self)); in aq_nic_ndev_register()
347 if (!self->aq_vec[self->aq_vecs]) { in aq_nic_ndev_register()
348 err = -ENOMEM; in aq_nic_ndev_register()
353 netif_carrier_off(self->ndev); in aq_nic_ndev_register()
355 netif_tx_disable(self->ndev); in aq_nic_ndev_register()
357 err = register_netdev(self->ndev); in aq_nic_ndev_register()
371 const struct aq_hw_caps_s *aq_hw_caps = self->aq_nic_cfg.aq_hw_caps; in aq_nic_ndev_init()
372 struct aq_nic_cfg_s *aq_nic_cfg = &self->aq_nic_cfg; in aq_nic_ndev_init()
374 self->ndev->hw_features |= aq_hw_caps->hw_features; in aq_nic_ndev_init()
375 self->ndev->features = aq_hw_caps->hw_features; in aq_nic_ndev_init()
376 self->ndev->vlan_features |= NETIF_F_HW_CSUM | NETIF_F_RXCSUM | in aq_nic_ndev_init()
379 self->ndev->gso_partial_features = NETIF_F_GSO_UDP_L4; in aq_nic_ndev_init()
380 self->ndev->priv_flags = aq_hw_caps->hw_priv_flags; in aq_nic_ndev_init()
381 self->ndev->priv_flags |= IFF_LIVE_ADDR_CHANGE; in aq_nic_ndev_init()
383 self->msg_enable = NETIF_MSG_DRV | NETIF_MSG_LINK; in aq_nic_ndev_init()
384 self->ndev->mtu = aq_nic_cfg->mtu - ETH_HLEN; in aq_nic_ndev_init()
385 self->ndev->max_mtu = aq_hw_caps->mtu - ETH_FCS_LEN - ETH_HLEN; in aq_nic_ndev_init()
392 self->aq_ring_tx[idx] = ring; in aq_nic_set_tx_ring()
397 return self->ndev; in aq_nic_get_ndev()
406 self->power_state = AQ_HW_POWER_STATE_D0; in aq_nic_init()
407 mutex_lock(&self->fwreq_mutex); in aq_nic_init()
408 err = self->aq_hw_ops->hw_reset(self->aq_hw); in aq_nic_init()
409 mutex_unlock(&self->fwreq_mutex); in aq_nic_init()
413 aq_nic_set_downshift(self, self->aq_nic_cfg.downshift_counter); in aq_nic_init()
414 aq_nic_set_media_detect(self, self->aq_nic_cfg.is_media_detect ? in aq_nic_init()
417 err = self->aq_hw_ops->hw_init(self->aq_hw, in aq_nic_init()
418 aq_nic_get_ndev(self)->dev_addr); in aq_nic_init()
422 if (ATL_HW_IS_CHIP_FEATURE(self->aq_hw, ATLANTIC) && in aq_nic_init()
423 self->aq_nic_cfg.aq_hw_caps->media_type == AQ_HW_MEDIA_TYPE_TP) { in aq_nic_init()
424 self->aq_hw->phy_id = HW_ATL_PHY_ID_MAX; in aq_nic_init()
425 err = aq_phy_init(self->aq_hw); in aq_nic_init()
432 if (self->aq_nic_cfg.aq_hw_caps->quirks & AQ_NIC_QUIRK_BAD_PTP) in aq_nic_init()
433 if (self->aq_hw->phy_id != HW_ATL_PHY_ID_MAX) in aq_nic_init()
434 aq_phy_disable_ptp(self->aq_hw); in aq_nic_init()
437 for (i = 0U; i < self->aq_vecs; i++) { in aq_nic_init()
438 aq_vec = self->aq_vec[i]; in aq_nic_init()
444 aq_vec_init(aq_vec, self->aq_hw_ops, self->aq_hw); in aq_nic_init()
447 if (aq_nic_get_cfg(self)->is_ptp) { in aq_nic_init()
448 err = aq_ptp_init(self, self->irqvecs - 1); in aq_nic_init()
461 netif_carrier_off(self->ndev); in aq_nic_init()
476 err = self->aq_hw_ops->hw_multicast_list_set(self->aq_hw, in aq_nic_start()
477 self->mc_list.ar, in aq_nic_start()
478 self->mc_list.count); in aq_nic_start()
482 err = self->aq_hw_ops->hw_packet_filter_set(self->aq_hw, in aq_nic_start()
483 self->packet_filter); in aq_nic_start()
487 for (i = 0U; self->aq_vecs > i; ++i) { in aq_nic_start()
488 aq_vec = self->aq_vec[i]; in aq_nic_start()
500 err = self->aq_hw_ops->hw_start(self->aq_hw); in aq_nic_start()
508 INIT_WORK(&self->service_task, aq_nic_service_task); in aq_nic_start()
510 timer_setup(&self->service_timer, aq_nic_service_timer_cb, 0); in aq_nic_start()
511 aq_nic_service_timer_cb(&self->service_timer); in aq_nic_start()
513 if (cfg->is_polling) { in aq_nic_start()
514 timer_setup(&self->polling_timer, aq_nic_polling_timer_cb, 0); in aq_nic_start()
515 mod_timer(&self->polling_timer, jiffies + in aq_nic_start()
518 for (i = 0U; self->aq_vecs > i; ++i) { in aq_nic_start()
519 aq_vec = self->aq_vec[i]; in aq_nic_start()
520 err = aq_pci_func_alloc_irq(self, i, self->ndev->name, in aq_nic_start()
531 if (cfg->link_irq_vec) { in aq_nic_start()
532 int irqvec = pci_irq_vector(self->pdev, in aq_nic_start()
533 cfg->link_irq_vec); in aq_nic_start()
537 self->ndev->name, self); in aq_nic_start()
540 self->msix_entry_mask |= (1 << cfg->link_irq_vec); in aq_nic_start()
543 err = self->aq_hw_ops->hw_irq_enable(self->aq_hw, in aq_nic_start()
549 err = netif_set_real_num_tx_queues(self->ndev, in aq_nic_start()
550 self->aq_vecs * cfg->tcs); in aq_nic_start()
554 err = netif_set_real_num_rx_queues(self->ndev, in aq_nic_start()
555 self->aq_vecs * cfg->tcs); in aq_nic_start()
559 for (i = 0; i < cfg->tcs; i++) { in aq_nic_start()
560 u16 offset = self->aq_vecs * i; in aq_nic_start()
562 netdev_set_tc_queue(self->ndev, i, self->aq_vecs, offset); in aq_nic_start()
564 netif_tx_start_all_queues(self->ndev); in aq_nic_start()
576 unsigned int dx = ring->sw_tail; in aq_nic_map_xdp()
584 dx_buff = &ring->buff_ring[dx]; in aq_nic_map_xdp()
585 dx_buff->flags = 0U; in aq_nic_map_xdp()
588 total_len = xdpf->len; in aq_nic_map_xdp()
589 dx_buff->len = total_len; in aq_nic_map_xdp()
591 nr_frags = sinfo->nr_frags; in aq_nic_map_xdp()
592 total_len += sinfo->xdp_frags_size; in aq_nic_map_xdp()
594 dx_buff->pa = dma_map_single(dev, xdpf->data, dx_buff->len, in aq_nic_map_xdp()
597 if (unlikely(dma_mapping_error(dev, dx_buff->pa))) in aq_nic_map_xdp()
601 dx_buff->len_pkt = total_len; in aq_nic_map_xdp()
602 dx_buff->is_sop = 1U; in aq_nic_map_xdp()
603 dx_buff->is_mapped = 1U; in aq_nic_map_xdp()
606 for (; nr_frags--; ++frag_count) { in aq_nic_map_xdp()
607 skb_frag_t *frag = &sinfo->frags[frag_count]; in aq_nic_map_xdp()
626 dx_buff = &ring->buff_ring[dx]; in aq_nic_map_xdp()
628 dx_buff->flags = 0U; in aq_nic_map_xdp()
629 dx_buff->len = buff_size; in aq_nic_map_xdp()
630 dx_buff->pa = frag_pa; in aq_nic_map_xdp()
631 dx_buff->is_mapped = 1U; in aq_nic_map_xdp()
632 dx_buff->eop_index = 0xffffU; in aq_nic_map_xdp()
634 frag_len -= buff_size; in aq_nic_map_xdp()
641 first->eop_index = dx; in aq_nic_map_xdp()
642 dx_buff->is_eop = 1U; in aq_nic_map_xdp()
643 dx_buff->skb = NULL; in aq_nic_map_xdp()
644 dx_buff->xdpf = xdpf; in aq_nic_map_xdp()
648 for (dx = ring->sw_tail; in aq_nic_map_xdp()
650 --ret, dx = aq_ring_next_dx(ring, dx)) { in aq_nic_map_xdp()
651 dx_buff = &ring->buff_ring[dx]; in aq_nic_map_xdp()
653 if (!dx_buff->pa) in aq_nic_map_xdp()
655 if (unlikely(dx_buff->is_sop)) in aq_nic_map_xdp()
656 dma_unmap_single(dev, dx_buff->pa, dx_buff->len, in aq_nic_map_xdp()
659 dma_unmap_page(dev, dx_buff->pa, dx_buff->len, in aq_nic_map_xdp()
670 unsigned int nr_frags = skb_shinfo(skb)->nr_frags; in aq_nic_map_skb()
674 u8 ipver = ip_hdr(skb)->version; in aq_nic_map_skb()
683 l4proto = ip_hdr(skb)->protocol; in aq_nic_map_skb()
685 l4proto = ipv6_hdr(skb)->nexthdr; in aq_nic_map_skb()
687 dx = ring->sw_tail; in aq_nic_map_skb()
688 dx_buff = &ring->buff_ring[dx]; in aq_nic_map_skb()
689 dx_buff->flags = 0U; in aq_nic_map_skb()
692 dx_buff->mss = skb_shinfo(skb)->gso_size; in aq_nic_map_skb()
694 dx_buff->is_gso_tcp = 1U; in aq_nic_map_skb()
695 dx_buff->len_l4 = tcp_hdrlen(skb); in aq_nic_map_skb()
697 dx_buff->is_gso_udp = 1U; in aq_nic_map_skb()
698 dx_buff->len_l4 = sizeof(struct udphdr); in aq_nic_map_skb()
700 udp_hdr(skb)->len = htons(dx_buff->mss + in aq_nic_map_skb()
701 dx_buff->len_l4); in aq_nic_map_skb()
706 dx_buff->len_pkt = skb->len; in aq_nic_map_skb()
707 dx_buff->len_l2 = ETH_HLEN; in aq_nic_map_skb()
708 dx_buff->len_l3 = skb_network_header_len(skb); in aq_nic_map_skb()
709 dx_buff->eop_index = 0xffffU; in aq_nic_map_skb()
710 dx_buff->is_ipv6 = (ipver == 6); in aq_nic_map_skb()
714 if (cfg->is_vlan_tx_insert && skb_vlan_tag_present(skb)) { in aq_nic_map_skb()
715 dx_buff->vlan_tx_tag = skb_vlan_tag_get(skb); in aq_nic_map_skb()
716 dx_buff->len_pkt = skb->len; in aq_nic_map_skb()
717 dx_buff->is_vlan = 1U; in aq_nic_map_skb()
723 dx_buff = &ring->buff_ring[dx]; in aq_nic_map_skb()
724 dx_buff->flags = 0U; in aq_nic_map_skb()
728 dx_buff->len = skb_headlen(skb); in aq_nic_map_skb()
729 dx_buff->pa = dma_map_single(dev, in aq_nic_map_skb()
730 skb->data, in aq_nic_map_skb()
731 dx_buff->len, in aq_nic_map_skb()
734 if (unlikely(dma_mapping_error(dev, dx_buff->pa))) { in aq_nic_map_skb()
740 dx_buff->len_pkt = skb->len; in aq_nic_map_skb()
741 dx_buff->is_sop = 1U; in aq_nic_map_skb()
742 dx_buff->is_mapped = 1U; in aq_nic_map_skb()
745 if (skb->ip_summed == CHECKSUM_PARTIAL) { in aq_nic_map_skb()
746 dx_buff->is_ip_cso = (htons(ETH_P_IP) == skb->protocol); in aq_nic_map_skb()
747 dx_buff->is_tcp_cso = (l4proto == IPPROTO_TCP); in aq_nic_map_skb()
748 dx_buff->is_udp_cso = (l4proto == IPPROTO_UDP); in aq_nic_map_skb()
751 for (; nr_frags--; ++frag_count) { in aq_nic_map_skb()
756 skb_frag_t *frag = &skb_shinfo(skb)->frags[frag_count]; in aq_nic_map_skb()
777 dx_buff = &ring->buff_ring[dx]; in aq_nic_map_skb()
779 dx_buff->flags = 0U; in aq_nic_map_skb()
780 dx_buff->len = buff_size; in aq_nic_map_skb()
781 dx_buff->pa = frag_pa; in aq_nic_map_skb()
782 dx_buff->is_mapped = 1U; in aq_nic_map_skb()
783 dx_buff->eop_index = 0xffffU; in aq_nic_map_skb()
785 frag_len -= buff_size; in aq_nic_map_skb()
792 first->eop_index = dx; in aq_nic_map_skb()
793 dx_buff->is_eop = 1U; in aq_nic_map_skb()
794 dx_buff->skb = skb; in aq_nic_map_skb()
795 dx_buff->xdpf = NULL; in aq_nic_map_skb()
799 for (dx = ring->sw_tail; in aq_nic_map_skb()
801 --ret, dx = aq_ring_next_dx(ring, dx)) { in aq_nic_map_skb()
802 dx_buff = &ring->buff_ring[dx]; in aq_nic_map_skb()
804 if (!(dx_buff->is_gso_tcp || dx_buff->is_gso_udp) && in aq_nic_map_skb()
805 !dx_buff->is_vlan && dx_buff->pa) { in aq_nic_map_skb()
806 if (unlikely(dx_buff->is_sop)) { in aq_nic_map_skb()
808 dx_buff->pa, in aq_nic_map_skb()
809 dx_buff->len, in aq_nic_map_skb()
813 dx_buff->pa, in aq_nic_map_skb()
814 dx_buff->len, in aq_nic_map_skb()
827 u16 queue_index = AQ_NIC_RING2QMAP(aq_nic, tx_ring->idx); in aq_nic_xmit_xdpf()
837 frags += sinfo->nr_frags; in aq_nic_xmit_xdpf()
843 nq = netdev_get_tx_queue(ndev, tx_ring->idx); in aq_nic_xmit_xdpf()
854 err = aq_nic->aq_hw_ops->hw_ring_tx_xmit(aq_nic->aq_hw, tx_ring, in aq_nic_xmit_xdpf()
865 unsigned int vec = skb->queue_mapping % cfg->vecs; in aq_nic_xmit()
866 unsigned int tc = skb->queue_mapping / cfg->vecs; in aq_nic_xmit()
871 frags = skb_shinfo(skb)->nr_frags + 1; in aq_nic_xmit()
873 ring = self->aq_ring_tx[AQ_NIC_CFG_TCVEC2RING(cfg, tc, vec)]; in aq_nic_xmit()
882 if (cfg->priv_flags & BIT(AQ_HW_LOOPBACK_DMA_NET)) { in aq_nic_xmit()
888 if (__netif_subqueue_stopped(self->ndev, in aq_nic_xmit()
889 AQ_NIC_RING2QMAP(self, ring->idx))) { in aq_nic_xmit()
897 err = self->aq_hw_ops->hw_ring_tx_xmit(self->aq_hw, in aq_nic_xmit()
909 return self->aq_hw_ops->hw_interrupt_moderation_set(self->aq_hw); in aq_nic_update_interrupt_moderation_settings()
916 err = self->aq_hw_ops->hw_packet_filter_set(self->aq_hw, flags); in aq_nic_set_packet_filter()
920 self->packet_filter = flags; in aq_nic_set_packet_filter()
928 const struct aq_hw_ops *hw_ops = self->aq_hw_ops; in aq_nic_set_multicast_list()
929 struct aq_nic_cfg_s *cfg = &self->aq_nic_cfg; in aq_nic_set_multicast_list()
930 unsigned int packet_filter = ndev->flags; in aq_nic_set_multicast_list()
935 self->mc_list.count = 0; in aq_nic_set_multicast_list()
940 ether_addr_copy(self->mc_list.ar[i++], ha->addr); in aq_nic_set_multicast_list()
944 cfg->is_mc_list_enabled = !!(packet_filter & IFF_MULTICAST); in aq_nic_set_multicast_list()
945 if (cfg->is_mc_list_enabled) { in aq_nic_set_multicast_list()
950 ether_addr_copy(self->mc_list.ar[i++], in aq_nic_set_multicast_list()
951 ha->addr); in aq_nic_set_multicast_list()
957 self->mc_list.count = i; in aq_nic_set_multicast_list()
958 err = hw_ops->hw_multicast_list_set(self->aq_hw, in aq_nic_set_multicast_list()
959 self->mc_list.ar, in aq_nic_set_multicast_list()
960 self->mc_list.count); in aq_nic_set_multicast_list()
970 self->aq_nic_cfg.mtu = new_mtu; in aq_nic_set_mtu()
977 return self->aq_hw_ops->hw_set_mac_address(self->aq_hw, ndev->dev_addr); in aq_nic_set_mac()
982 return self->link_status.mbps; in aq_nic_get_link_speed()
990 if (unlikely(!self->aq_hw_ops->hw_get_regs)) in aq_nic_get_regs()
991 return -EOPNOTSUPP; in aq_nic_get_regs()
993 regs->version = 1; in aq_nic_get_regs()
995 err = self->aq_hw_ops->hw_get_regs(self->aq_hw, in aq_nic_get_regs()
996 self->aq_nic_cfg.aq_hw_caps, in aq_nic_get_regs()
1007 if (unlikely(!self->aq_hw_ops->hw_get_regs)) in aq_nic_get_regs_count()
1010 return self->aq_nic_cfg.aq_hw_caps->mac_regs_count; in aq_nic_get_regs_count()
1020 if (self->aq_fw_ops->update_stats) { in aq_nic_get_stats()
1021 mutex_lock(&self->fwreq_mutex); in aq_nic_get_stats()
1022 self->aq_fw_ops->update_stats(self->aq_hw); in aq_nic_get_stats()
1023 mutex_unlock(&self->fwreq_mutex); in aq_nic_get_stats()
1025 stats = self->aq_hw_ops->hw_get_hw_stats(self->aq_hw); in aq_nic_get_stats()
1030 data[i] = stats->uprc + stats->mprc + stats->bprc; in aq_nic_get_stats()
1031 data[++i] = stats->uprc; in aq_nic_get_stats()
1032 data[++i] = stats->mprc; in aq_nic_get_stats()
1033 data[++i] = stats->bprc; in aq_nic_get_stats()
1034 data[++i] = stats->erpt; in aq_nic_get_stats()
1035 data[++i] = stats->uptc + stats->mptc + stats->bptc; in aq_nic_get_stats()
1036 data[++i] = stats->uptc; in aq_nic_get_stats()
1037 data[++i] = stats->mptc; in aq_nic_get_stats()
1038 data[++i] = stats->bptc; in aq_nic_get_stats()
1039 data[++i] = stats->ubrc; in aq_nic_get_stats()
1040 data[++i] = stats->ubtc; in aq_nic_get_stats()
1041 data[++i] = stats->mbrc; in aq_nic_get_stats()
1042 data[++i] = stats->mbtc; in aq_nic_get_stats()
1043 data[++i] = stats->bbrc; in aq_nic_get_stats()
1044 data[++i] = stats->bbtc; in aq_nic_get_stats()
1045 if (stats->brc) in aq_nic_get_stats()
1046 data[++i] = stats->brc; in aq_nic_get_stats()
1048 data[++i] = stats->ubrc + stats->mbrc + stats->bbrc; in aq_nic_get_stats()
1049 if (stats->btc) in aq_nic_get_stats()
1050 data[++i] = stats->btc; in aq_nic_get_stats()
1052 data[++i] = stats->ubtc + stats->mbtc + stats->bbtc; in aq_nic_get_stats()
1053 data[++i] = stats->dma_pkt_rc; in aq_nic_get_stats()
1054 data[++i] = stats->dma_pkt_tc; in aq_nic_get_stats()
1055 data[++i] = stats->dma_oct_rc; in aq_nic_get_stats()
1056 data[++i] = stats->dma_oct_tc; in aq_nic_get_stats()
1057 data[++i] = stats->dpc; in aq_nic_get_stats()
1063 for (tc = 0U; tc < self->aq_nic_cfg.tcs; tc++) { in aq_nic_get_stats()
1064 for (i = 0U; self->aq_vecs > i; ++i) { in aq_nic_get_stats()
1065 if (!self->aq_vec[i]) in aq_nic_get_stats()
1068 count = aq_vec_get_sw_stats(self->aq_vec[i], tc, data); in aq_nic_get_stats()
1080 struct aq_stats_s *stats = self->aq_hw_ops->hw_get_hw_stats(self->aq_hw); in aq_nic_update_ndev_stats()
1081 struct net_device *ndev = self->ndev; in aq_nic_update_ndev_stats()
1083 ndev->stats.rx_packets = stats->dma_pkt_rc; in aq_nic_update_ndev_stats()
1084 ndev->stats.rx_bytes = stats->dma_oct_rc; in aq_nic_update_ndev_stats()
1085 ndev->stats.rx_errors = stats->erpr; in aq_nic_update_ndev_stats()
1086 ndev->stats.rx_dropped = stats->dpc; in aq_nic_update_ndev_stats()
1087 ndev->stats.tx_packets = stats->dma_pkt_tc; in aq_nic_update_ndev_stats()
1088 ndev->stats.tx_bytes = stats->dma_oct_tc; in aq_nic_update_ndev_stats()
1089 ndev->stats.tx_errors = stats->erpt; in aq_nic_update_ndev_stats()
1090 ndev->stats.multicast = stats->mprc; in aq_nic_update_ndev_stats()
1098 if (self->aq_nic_cfg.aq_hw_caps->media_type == AQ_HW_MEDIA_TYPE_FIBRE) in aq_nic_get_link_ksettings()
1099 cmd->base.port = PORT_FIBRE; in aq_nic_get_link_ksettings()
1101 cmd->base.port = PORT_TP; in aq_nic_get_link_ksettings()
1103 cmd->base.duplex = DUPLEX_UNKNOWN; in aq_nic_get_link_ksettings()
1104 if (self->link_status.mbps) in aq_nic_get_link_ksettings()
1105 cmd->base.duplex = self->link_status.full_duplex ? in aq_nic_get_link_ksettings()
1107 cmd->base.autoneg = self->aq_nic_cfg.is_autoneg; in aq_nic_get_link_ksettings()
1111 if (self->aq_nic_cfg.aq_hw_caps->link_speed_msk & AQ_NIC_RATE_10G) in aq_nic_get_link_ksettings()
1115 if (self->aq_nic_cfg.aq_hw_caps->link_speed_msk & AQ_NIC_RATE_5G) in aq_nic_get_link_ksettings()
1119 if (self->aq_nic_cfg.aq_hw_caps->link_speed_msk & AQ_NIC_RATE_2G5) in aq_nic_get_link_ksettings()
1123 if (self->aq_nic_cfg.aq_hw_caps->link_speed_msk & AQ_NIC_RATE_1G) in aq_nic_get_link_ksettings()
1127 if (self->aq_nic_cfg.aq_hw_caps->link_speed_msk & AQ_NIC_RATE_1G_HALF) in aq_nic_get_link_ksettings()
1131 if (self->aq_nic_cfg.aq_hw_caps->link_speed_msk & AQ_NIC_RATE_100M) in aq_nic_get_link_ksettings()
1135 if (self->aq_nic_cfg.aq_hw_caps->link_speed_msk & AQ_NIC_RATE_100M_HALF) in aq_nic_get_link_ksettings()
1139 if (self->aq_nic_cfg.aq_hw_caps->link_speed_msk & AQ_NIC_RATE_10M) in aq_nic_get_link_ksettings()
1143 if (self->aq_nic_cfg.aq_hw_caps->link_speed_msk & AQ_NIC_RATE_10M_HALF) in aq_nic_get_link_ksettings()
1147 if (self->aq_nic_cfg.aq_hw_caps->flow_control) { in aq_nic_get_link_ksettings()
1149 Pause); in aq_nic_get_link_ksettings()
1156 if (self->aq_nic_cfg.aq_hw_caps->media_type == AQ_HW_MEDIA_TYPE_FIBRE) in aq_nic_get_link_ksettings()
1163 if (self->aq_nic_cfg.is_autoneg) in aq_nic_get_link_ksettings()
1166 if (self->aq_nic_cfg.link_speed_msk & AQ_NIC_RATE_10G) in aq_nic_get_link_ksettings()
1170 if (self->aq_nic_cfg.link_speed_msk & AQ_NIC_RATE_5G) in aq_nic_get_link_ksettings()
1174 if (self->aq_nic_cfg.link_speed_msk & AQ_NIC_RATE_2G5) in aq_nic_get_link_ksettings()
1178 if (self->aq_nic_cfg.link_speed_msk & AQ_NIC_RATE_1G) in aq_nic_get_link_ksettings()
1182 if (self->aq_nic_cfg.link_speed_msk & AQ_NIC_RATE_1G_HALF) in aq_nic_get_link_ksettings()
1186 if (self->aq_nic_cfg.link_speed_msk & AQ_NIC_RATE_100M) in aq_nic_get_link_ksettings()
1190 if (self->aq_nic_cfg.link_speed_msk & AQ_NIC_RATE_100M_HALF) in aq_nic_get_link_ksettings()
1194 if (self->aq_nic_cfg.link_speed_msk & AQ_NIC_RATE_10M) in aq_nic_get_link_ksettings()
1198 if (self->aq_nic_cfg.link_speed_msk & AQ_NIC_RATE_10M_HALF) in aq_nic_get_link_ksettings()
1202 if (self->aq_nic_cfg.fc.cur & AQ_NIC_FC_RX) in aq_nic_get_link_ksettings()
1204 Pause); in aq_nic_get_link_ksettings()
1206 /* Asym is when either RX or TX, but not both */ in aq_nic_get_link_ksettings()
1207 if (!!(self->aq_nic_cfg.fc.cur & AQ_NIC_FC_TX) ^ in aq_nic_get_link_ksettings()
1208 !!(self->aq_nic_cfg.fc.cur & AQ_NIC_FC_RX)) in aq_nic_get_link_ksettings()
1212 if (self->aq_nic_cfg.aq_hw_caps->media_type == AQ_HW_MEDIA_TYPE_FIBRE) in aq_nic_get_link_ksettings()
1218 lp_link_speed_msk = self->aq_hw->aq_link_status.lp_link_speed_msk; in aq_nic_get_link_ksettings()
1256 if (self->aq_hw->aq_link_status.lp_flow_control & AQ_NIC_FC_RX) in aq_nic_get_link_ksettings()
1258 Pause); in aq_nic_get_link_ksettings()
1259 if (!!(self->aq_hw->aq_link_status.lp_flow_control & AQ_NIC_FC_TX) ^ in aq_nic_get_link_ksettings()
1260 !!(self->aq_hw->aq_link_status.lp_flow_control & AQ_NIC_FC_RX)) in aq_nic_get_link_ksettings()
1268 int fduplex = (cmd->base.duplex == DUPLEX_FULL); in aq_nic_set_link_ksettings()
1269 u32 speed = cmd->base.speed; in aq_nic_set_link_ksettings()
1274 err = -EINVAL; in aq_nic_set_link_ksettings()
1278 if (cmd->base.autoneg == AUTONEG_ENABLE) { in aq_nic_set_link_ksettings()
1279 rate = self->aq_nic_cfg.aq_hw_caps->link_speed_msk; in aq_nic_set_link_ksettings()
1280 self->aq_nic_cfg.is_autoneg = true; in aq_nic_set_link_ksettings()
1309 err = -1; in aq_nic_set_link_ksettings()
1312 if (!(self->aq_nic_cfg.aq_hw_caps->link_speed_msk & rate)) { in aq_nic_set_link_ksettings()
1313 err = -1; in aq_nic_set_link_ksettings()
1317 self->aq_nic_cfg.is_autoneg = false; in aq_nic_set_link_ksettings()
1320 mutex_lock(&self->fwreq_mutex); in aq_nic_set_link_ksettings()
1321 err = self->aq_fw_ops->set_link_speed(self->aq_hw, rate); in aq_nic_set_link_ksettings()
1322 mutex_unlock(&self->fwreq_mutex); in aq_nic_set_link_ksettings()
1326 self->aq_nic_cfg.link_speed_msk = rate; in aq_nic_set_link_ksettings()
1334 return &self->aq_nic_cfg; in aq_nic_get_cfg()
1339 return self->aq_hw_ops->hw_get_fw_version(self->aq_hw); in aq_nic_get_fw_version()
1344 struct aq_nic_cfg_s *cfg = &self->aq_nic_cfg; in aq_nic_set_loopback()
1346 if (!self->aq_hw_ops->hw_set_loopback || in aq_nic_set_loopback()
1347 !self->aq_fw_ops->set_phyloopback) in aq_nic_set_loopback()
1348 return -EOPNOTSUPP; in aq_nic_set_loopback()
1350 mutex_lock(&self->fwreq_mutex); in aq_nic_set_loopback()
1351 self->aq_hw_ops->hw_set_loopback(self->aq_hw, in aq_nic_set_loopback()
1353 !!(cfg->priv_flags & in aq_nic_set_loopback()
1356 self->aq_hw_ops->hw_set_loopback(self->aq_hw, in aq_nic_set_loopback()
1358 !!(cfg->priv_flags & in aq_nic_set_loopback()
1361 self->aq_hw_ops->hw_set_loopback(self->aq_hw, in aq_nic_set_loopback()
1363 !!(cfg->priv_flags & in aq_nic_set_loopback()
1366 self->aq_fw_ops->set_phyloopback(self->aq_hw, in aq_nic_set_loopback()
1368 !!(cfg->priv_flags & in aq_nic_set_loopback()
1371 self->aq_fw_ops->set_phyloopback(self->aq_hw, in aq_nic_set_loopback()
1373 !!(cfg->priv_flags & in aq_nic_set_loopback()
1375 mutex_unlock(&self->fwreq_mutex); in aq_nic_set_loopback()
1384 netif_tx_disable(self->ndev); in aq_nic_stop()
1385 netif_carrier_off(self->ndev); in aq_nic_stop()
1387 del_timer_sync(&self->service_timer); in aq_nic_stop()
1388 cancel_work_sync(&self->service_task); in aq_nic_stop()
1390 self->aq_hw_ops->hw_irq_disable(self->aq_hw, AQ_CFG_IRQ_MASK); in aq_nic_stop()
1392 if (self->aq_nic_cfg.is_polling) in aq_nic_stop()
1393 del_timer_sync(&self->polling_timer); in aq_nic_stop()
1399 for (i = 0U; self->aq_vecs > i; ++i) in aq_nic_stop()
1400 aq_vec_stop(self->aq_vec[i]); in aq_nic_stop()
1404 return self->aq_hw_ops->hw_stop(self->aq_hw); in aq_nic_stop()
1409 if (self->power_state != AQ_HW_POWER_STATE_D0 || in aq_nic_set_power()
1410 self->aq_hw->aq_nic_cfg->wol) in aq_nic_set_power()
1411 if (likely(self->aq_fw_ops->set_power)) { in aq_nic_set_power()
1412 mutex_lock(&self->fwreq_mutex); in aq_nic_set_power()
1413 self->aq_fw_ops->set_power(self->aq_hw, in aq_nic_set_power()
1414 self->power_state, in aq_nic_set_power()
1415 self->ndev->dev_addr); in aq_nic_set_power()
1416 mutex_unlock(&self->fwreq_mutex); in aq_nic_set_power()
1428 for (i = 0U; i < self->aq_vecs; i++) { in aq_nic_deinit()
1429 aq_vec = self->aq_vec[i]; in aq_nic_deinit()
1439 if (likely(self->aq_fw_ops->deinit) && link_down) { in aq_nic_deinit()
1440 mutex_lock(&self->fwreq_mutex); in aq_nic_deinit()
1441 self->aq_fw_ops->deinit(self->aq_hw); in aq_nic_deinit()
1442 mutex_unlock(&self->fwreq_mutex); in aq_nic_deinit()
1455 for (i = ARRAY_SIZE(self->aq_vec); i--;) { in aq_nic_free_vectors()
1456 if (self->aq_vec[i]) { in aq_nic_free_vectors()
1457 aq_vec_free(self->aq_vec[i]); in aq_nic_free_vectors()
1458 self->aq_vec[i] = NULL; in aq_nic_free_vectors()
1471 for (self->aq_vecs = 0; self->aq_vecs < cfg->vecs; self->aq_vecs++) { in aq_nic_realloc_vectors()
1472 self->aq_vec[self->aq_vecs] = aq_vec_alloc(self, self->aq_vecs, in aq_nic_realloc_vectors()
1474 if (unlikely(!self->aq_vec[self->aq_vecs])) in aq_nic_realloc_vectors()
1475 return -ENOMEM; in aq_nic_realloc_vectors()
1485 if (!self->ndev) in aq_nic_shutdown()
1490 netif_device_detach(self->ndev); in aq_nic_shutdown()
1492 if (netif_running(self->ndev)) { in aq_nic_shutdown()
1497 aq_nic_deinit(self, !self->aq_hw->aq_nic_cfg->wol); in aq_nic_shutdown()
1512 location = AQ_RX_LAST_LOC_FETHERT - AQ_RX_FIRST_LOC_FETHERT - in aq_nic_reserve_filter()
1513 self->aq_hw_rx_fltrs.fet_reserved_count; in aq_nic_reserve_filter()
1514 self->aq_hw_rx_fltrs.fet_reserved_count++; in aq_nic_reserve_filter()
1517 fltr_cnt = AQ_RX_LAST_LOC_FL3L4 - AQ_RX_FIRST_LOC_FL3L4; in aq_nic_reserve_filter()
1518 n_bit = fltr_cnt - self->aq_hw_rx_fltrs.fl3l4.reserved_count; in aq_nic_reserve_filter()
1520 self->aq_hw_rx_fltrs.fl3l4.active_ipv4 |= BIT(n_bit); in aq_nic_reserve_filter()
1521 self->aq_hw_rx_fltrs.fl3l4.reserved_count++; in aq_nic_reserve_filter()
1536 self->aq_hw_rx_fltrs.fet_reserved_count--; in aq_nic_release_filter()
1539 self->aq_hw_rx_fltrs.fl3l4.reserved_count--; in aq_nic_release_filter()
1540 self->aq_hw_rx_fltrs.fl3l4.active_ipv4 &= ~BIT(location); in aq_nic_release_filter()
1550 struct aq_nic_cfg_s *cfg = &self->aq_nic_cfg; in aq_nic_set_downshift()
1552 if (!self->aq_fw_ops->set_downshift) in aq_nic_set_downshift()
1553 return -EOPNOTSUPP; in aq_nic_set_downshift()
1556 netdev_err(self->ndev, "downshift counter should be <= 15\n"); in aq_nic_set_downshift()
1557 return -EINVAL; in aq_nic_set_downshift()
1559 cfg->downshift_counter = val; in aq_nic_set_downshift()
1561 mutex_lock(&self->fwreq_mutex); in aq_nic_set_downshift()
1562 err = self->aq_fw_ops->set_downshift(self->aq_hw, cfg->downshift_counter); in aq_nic_set_downshift()
1563 mutex_unlock(&self->fwreq_mutex); in aq_nic_set_downshift()
1570 struct aq_nic_cfg_s *cfg = &self->aq_nic_cfg; in aq_nic_set_media_detect()
1573 if (!self->aq_fw_ops->set_media_detect) in aq_nic_set_media_detect()
1574 return -EOPNOTSUPP; in aq_nic_set_media_detect()
1577 netdev_err(self->ndev, "EDPD on this device could have only fixed value of %d\n", in aq_nic_set_media_detect()
1579 return -EINVAL; in aq_nic_set_media_detect()
1582 mutex_lock(&self->fwreq_mutex); in aq_nic_set_media_detect()
1583 err = self->aq_fw_ops->set_media_detect(self->aq_hw, !!val); in aq_nic_set_media_detect()
1584 mutex_unlock(&self->fwreq_mutex); in aq_nic_set_media_detect()
1586 /* msecs plays no role - configuration is always fixed in PHY */ in aq_nic_set_media_detect()
1588 cfg->is_media_detect = !!val; in aq_nic_set_media_detect()
1595 struct aq_nic_cfg_s *cfg = &self->aq_nic_cfg; in aq_nic_setup_tc_mqprio()
1596 const unsigned int prev_vecs = cfg->vecs; in aq_nic_setup_tc_mqprio()
1604 if (tcs == cfg->tcs || (tcs == 0 && !cfg->is_qos)) in aq_nic_setup_tc_mqprio()
1607 ndev_running = netif_running(self->ndev); in aq_nic_setup_tc_mqprio()
1609 dev_close(self->ndev); in aq_nic_setup_tc_mqprio()
1611 cfg->tcs = tcs; in aq_nic_setup_tc_mqprio()
1612 if (cfg->tcs == 0) in aq_nic_setup_tc_mqprio()
1613 cfg->tcs = 1; in aq_nic_setup_tc_mqprio()
1615 memcpy(cfg->prio_tc_map, prio_tc_map, sizeof(cfg->prio_tc_map)); in aq_nic_setup_tc_mqprio()
1617 for (i = 0; i < sizeof(cfg->prio_tc_map); i++) in aq_nic_setup_tc_mqprio()
1618 cfg->prio_tc_map[i] = cfg->tcs * i / 8; in aq_nic_setup_tc_mqprio()
1620 cfg->is_qos = !!tcs; in aq_nic_setup_tc_mqprio()
1621 cfg->is_ptp = (cfg->tcs <= AQ_HW_PTP_TC); in aq_nic_setup_tc_mqprio()
1622 if (!cfg->is_ptp) in aq_nic_setup_tc_mqprio()
1623 netdev_warn(self->ndev, "%s\n", in aq_nic_setup_tc_mqprio()
1626 netdev_set_num_tc(self->ndev, cfg->tcs); in aq_nic_setup_tc_mqprio()
1630 if (prev_vecs != cfg->vecs) { in aq_nic_setup_tc_mqprio()
1637 err = dev_open(self->ndev, NULL); in aq_nic_setup_tc_mqprio()
1646 struct aq_nic_cfg_s *cfg = &self->aq_nic_cfg; in aq_nic_setup_tc_max_rate()
1649 return -EINVAL; in aq_nic_setup_tc_max_rate()
1652 netdev_warn(self->ndev, in aq_nic_setup_tc_max_rate()
1655 cfg->tc_max_rate[tc] = 10; in aq_nic_setup_tc_max_rate()
1657 cfg->tc_max_rate[tc] = max_rate; in aq_nic_setup_tc_max_rate()
1666 struct aq_nic_cfg_s *cfg = &self->aq_nic_cfg; in aq_nic_setup_tc_min_rate()
1669 return -EINVAL; in aq_nic_setup_tc_min_rate()
1672 set_bit(tc, &cfg->tc_min_rate_msk); in aq_nic_setup_tc_min_rate()
1674 clear_bit(tc, &cfg->tc_min_rate_msk); in aq_nic_setup_tc_min_rate()
1677 netdev_warn(self->ndev, in aq_nic_setup_tc_min_rate()
1680 cfg->tc_min_rate[tc] = 20; in aq_nic_setup_tc_min_rate()
1682 cfg->tc_min_rate[tc] = min_rate; in aq_nic_setup_tc_min_rate()