Lines Matching +full:tcam +full:- +full:based
1 // SPDX-License-Identifier: GPL-2.0
133 struct fbnic_dev *fbd = fbn->fbd; in fbnic_get_drvinfo()
135 fbnic_get_fw_ver_commit_str(fbd, drvinfo->fw_version, in fbnic_get_drvinfo()
136 sizeof(drvinfo->fw_version)); in fbnic_get_drvinfo()
143 return fbnic_csr_regs_len(fbn->fbd) * sizeof(u32); in fbnic_get_regs_len()
151 fbnic_csr_get_regs(fbn->fbd, data, ®s->version); in fbnic_get_regs()
162 memset(clone->tx, 0, sizeof(clone->tx)); in fbnic_clone_create()
163 memset(clone->rx, 0, sizeof(clone->rx)); in fbnic_clone_create()
164 memset(clone->napi, 0, sizeof(clone->napi)); in fbnic_clone_create()
171 swap(clone->rcq_size, orig->rcq_size); in fbnic_clone_swap_cfg()
172 swap(clone->hpq_size, orig->hpq_size); in fbnic_clone_swap_cfg()
173 swap(clone->ppq_size, orig->ppq_size); in fbnic_clone_swap_cfg()
174 swap(clone->txq_size, orig->txq_size); in fbnic_clone_swap_cfg()
175 swap(clone->num_rx_queues, orig->num_rx_queues); in fbnic_clone_swap_cfg()
176 swap(clone->num_tx_queues, orig->num_tx_queues); in fbnic_clone_swap_cfg()
177 swap(clone->num_napi, orig->num_napi); in fbnic_clone_swap_cfg()
178 swap(clone->hds_thresh, orig->hds_thresh); in fbnic_clone_swap_cfg()
186 for (i = 0; i < nv->txt_count; i++) { in fbnic_aggregate_vector_counters()
187 fbnic_aggregate_ring_tx_counters(fbn, &nv->qt[i].sub0); in fbnic_aggregate_vector_counters()
188 fbnic_aggregate_ring_xdp_counters(fbn, &nv->qt[i].sub1); in fbnic_aggregate_vector_counters()
189 fbnic_aggregate_ring_tx_counters(fbn, &nv->qt[i].cmpl); in fbnic_aggregate_vector_counters()
192 for (j = 0; j < nv->rxt_count; j++, i++) { in fbnic_aggregate_vector_counters()
193 fbnic_aggregate_ring_bdq_counters(fbn, &nv->qt[i].sub0); in fbnic_aggregate_vector_counters()
194 fbnic_aggregate_ring_bdq_counters(fbn, &nv->qt[i].sub1); in fbnic_aggregate_vector_counters()
195 fbnic_aggregate_ring_rx_counters(fbn, &nv->qt[i].cmpl); in fbnic_aggregate_vector_counters()
202 struct fbnic_dev *fbd = orig->fbd; in fbnic_clone_swap()
205 for (i = 0; i < max(clone->num_napi, orig->num_napi); i++) in fbnic_clone_swap()
207 for (i = 0; i < orig->num_napi; i++) in fbnic_clone_swap()
208 fbnic_aggregate_vector_counters(orig, orig->napi[i]); in fbnic_clone_swap()
212 for (i = 0; i < ARRAY_SIZE(orig->napi); i++) in fbnic_clone_swap()
213 swap(clone->napi[i], orig->napi[i]); in fbnic_clone_swap()
214 for (i = 0; i < ARRAY_SIZE(orig->tx); i++) in fbnic_clone_swap()
215 swap(clone->tx[i], orig->tx[i]); in fbnic_clone_swap()
216 for (i = 0; i < ARRAY_SIZE(orig->rx); i++) in fbnic_clone_swap()
217 swap(clone->rx[i], orig->rx[i]); in fbnic_clone_swap()
232 ec->tx_coalesce_usecs = fbn->tx_usecs; in fbnic_get_coalesce()
233 ec->rx_coalesce_usecs = fbn->rx_usecs; in fbnic_get_coalesce()
234 ec->rx_max_coalesced_frames = fbn->rx_max_frames; in fbnic_get_coalesce()
247 if (ec->rx_coalesce_usecs > FIELD_MAX(FBNIC_INTR_CQ_REARM_RCQ_TIMEOUT)) { in fbnic_set_coalesce()
249 return -EINVAL; in fbnic_set_coalesce()
251 if (ec->tx_coalesce_usecs > FIELD_MAX(FBNIC_INTR_CQ_REARM_TCQ_TIMEOUT)) { in fbnic_set_coalesce()
253 return -EINVAL; in fbnic_set_coalesce()
255 if (ec->rx_max_coalesced_frames > in fbnic_set_coalesce()
259 return -EINVAL; in fbnic_set_coalesce()
262 fbn->tx_usecs = ec->tx_coalesce_usecs; in fbnic_set_coalesce()
263 fbn->rx_usecs = ec->rx_coalesce_usecs; in fbnic_set_coalesce()
264 fbn->rx_max_frames = ec->rx_max_coalesced_frames; in fbnic_set_coalesce()
269 for (i = 0; i < fbn->num_napi; i++) { in fbnic_set_coalesce()
270 struct fbnic_napi_vector *nv = fbn->napi[i]; in fbnic_set_coalesce()
287 ring->rx_max_pending = FBNIC_QUEUE_SIZE_MAX; in fbnic_get_ringparam()
288 ring->rx_mini_max_pending = FBNIC_QUEUE_SIZE_MAX; in fbnic_get_ringparam()
289 ring->rx_jumbo_max_pending = FBNIC_QUEUE_SIZE_MAX; in fbnic_get_ringparam()
290 ring->tx_max_pending = FBNIC_QUEUE_SIZE_MAX; in fbnic_get_ringparam()
292 ring->rx_pending = fbn->rcq_size; in fbnic_get_ringparam()
293 ring->rx_mini_pending = fbn->hpq_size; in fbnic_get_ringparam()
294 ring->rx_jumbo_pending = fbn->ppq_size; in fbnic_get_ringparam()
295 ring->tx_pending = fbn->txq_size; in fbnic_get_ringparam()
297 kernel_ring->tcp_data_split = ETHTOOL_TCP_DATA_SPLIT_ENABLED; in fbnic_get_ringparam()
298 kernel_ring->hds_thresh_max = FBNIC_HDS_THRESH_MAX; in fbnic_get_ringparam()
299 kernel_ring->hds_thresh = fbn->hds_thresh; in fbnic_get_ringparam()
306 fbn->rcq_size = ring->rx_pending; in fbnic_set_rings()
307 fbn->hpq_size = ring->rx_mini_pending; in fbnic_set_rings()
308 fbn->ppq_size = ring->rx_jumbo_pending; in fbnic_set_rings()
309 fbn->txq_size = ring->tx_pending; in fbnic_set_rings()
310 fbn->hds_thresh = kernel_ring->hds_thresh; in fbnic_set_rings()
323 ring->rx_pending = roundup_pow_of_two(ring->rx_pending); in fbnic_set_ringparam()
324 ring->rx_mini_pending = roundup_pow_of_two(ring->rx_mini_pending); in fbnic_set_ringparam()
325 ring->rx_jumbo_pending = roundup_pow_of_two(ring->rx_jumbo_pending); in fbnic_set_ringparam()
326 ring->tx_pending = roundup_pow_of_two(ring->tx_pending); in fbnic_set_ringparam()
333 if (ring->rx_pending < max(FBNIC_QUEUE_SIZE_MIN, FBNIC_RX_DESC_MIN) || in fbnic_set_ringparam()
334 ring->rx_mini_pending < FBNIC_QUEUE_SIZE_MIN || in fbnic_set_ringparam()
335 ring->rx_jumbo_pending < FBNIC_QUEUE_SIZE_MIN || in fbnic_set_ringparam()
336 ring->tx_pending < max(FBNIC_QUEUE_SIZE_MIN, FBNIC_TX_DESC_MIN)) { in fbnic_set_ringparam()
338 return -EINVAL; in fbnic_set_ringparam()
341 if (kernel_ring->tcp_data_split == ETHTOOL_TCP_DATA_SPLIT_DISABLED) { in fbnic_set_ringparam()
343 return -EINVAL; in fbnic_set_ringparam()
350 if (fbnic_check_split_frames(fbn->xdp_prog, netdev->mtu, in fbnic_set_ringparam()
351 kernel_ring->hds_thresh)) { in fbnic_set_ringparam()
353 "Use higher HDS threshold or multi-buf capable program"); in fbnic_set_ringparam()
354 return -EINVAL; in fbnic_set_ringparam()
364 return -ENOMEM; in fbnic_set_ringparam()
377 err = fbnic_wait_all_queues_idle(fbn->fbd, true); in fbnic_set_ringparam()
416 ethtool_sprintf(data, stat->string, idx); in fbnic_get_rxb_enqueue_strings()
426 ethtool_sprintf(data, stat->string, idx); in fbnic_get_rxb_fifo_strings()
436 ethtool_sprintf(data, stat->string, idx); in fbnic_get_rxb_dequeue_strings()
446 ethtool_sprintf(data, stat->string, idx); in fbnic_get_xdp_queue_strings()
472 ethtool_sprintf(&data, stat->string, idx); in fbnic_get_strings()
484 while (len--) { in fbnic_report_hw_stats()
485 u8 *curr = (u8 *)base + stat->offset; in fbnic_report_hw_stats()
506 u8 *p = (u8 *)ring + stat->offset; in fbnic_get_xdp_queue_stats()
516 struct fbnic_dev *fbd = fbn->fbd; in fbnic_get_ethtool_stats()
519 fbnic_get_hw_stats(fbn->fbd); in fbnic_get_ethtool_stats()
521 spin_lock(&fbd->hw_stats.lock); in fbnic_get_ethtool_stats()
522 fbnic_report_hw_stats(fbnic_gstrings_hw_stats, &fbd->hw_stats, in fbnic_get_ethtool_stats()
528 enq = &fbd->hw_stats.rxb.enq[i]; in fbnic_get_ethtool_stats()
537 fifo = &fbd->hw_stats.rxb.fifo[i]; in fbnic_get_ethtool_stats()
546 deq = &fbd->hw_stats.rxb.deq[i]; in fbnic_get_ethtool_stats()
553 const struct fbnic_hw_q_stats *hw_q = &fbd->hw_stats.hw_q[i]; in fbnic_get_ethtool_stats()
558 spin_unlock(&fbd->hw_stats.lock); in fbnic_get_ethtool_stats()
561 fbnic_get_xdp_queue_stats(fbn->tx[i + FBNIC_MAX_TXQS], &data); in fbnic_get_ethtool_stats()
570 return -EOPNOTSUPP; in fbnic_get_sset_count()
603 return -1; in fbnic_get_rss_hash_idx()
610 struct fbnic_dev *fbd = fbn->fbd; in fbnic_get_cls_rule_all()
614 cmd->data = FBNIC_RPC_ACT_TBL_NFC_ENTRIES; in fbnic_get_cls_rule_all()
620 act_tcam = &fbd->act_tcam[idx]; in fbnic_get_cls_rule_all()
621 if (act_tcam->state != FBNIC_TCAM_S_VALID) in fbnic_get_cls_rule_all()
625 if (cnt == cmd->rule_cnt) in fbnic_get_cls_rule_all()
626 return -EMSGSIZE; in fbnic_get_cls_rule_all()
640 struct fbnic_dev *fbd = fbn->fbd; in fbnic_get_cls_rule()
644 fsp = (struct ethtool_rx_flow_spec *)&cmd->fs; in fbnic_get_cls_rule()
646 if (fsp->location >= FBNIC_RPC_ACT_TBL_NFC_ENTRIES) in fbnic_get_cls_rule()
647 return -EINVAL; in fbnic_get_cls_rule()
649 idx = fsp->location + FBNIC_RPC_ACT_TBL_NFC_OFFSET; in fbnic_get_cls_rule()
650 act_tcam = &fbd->act_tcam[idx]; in fbnic_get_cls_rule()
652 if (act_tcam->state != FBNIC_TCAM_S_VALID) in fbnic_get_cls_rule()
653 return -EINVAL; in fbnic_get_cls_rule()
656 cmd->data = FBNIC_RPC_ACT_TBL_NFC_ENTRIES; in fbnic_get_cls_rule()
659 if (!(act_tcam->value.tcam[1] & FBNIC_RPC_TCAM_ACT1_IP_VALID)) { in fbnic_get_cls_rule()
660 fsp->flow_type = ETHER_FLOW; in fbnic_get_cls_rule()
662 act_tcam->mask.tcam[1])) { in fbnic_get_cls_rule()
666 act_tcam->value.tcam[1]); in fbnic_get_cls_rule()
667 mac_addr = &fbd->mac_addr[idx]; in fbnic_get_cls_rule()
669 ether_addr_copy(fsp->h_u.ether_spec.h_dest, in fbnic_get_cls_rule()
670 mac_addr->value.addr8); in fbnic_get_cls_rule()
671 eth_broadcast_addr(fsp->m_u.ether_spec.h_dest); in fbnic_get_cls_rule()
673 } else if (act_tcam->value.tcam[1] & in fbnic_get_cls_rule()
675 fsp->flow_type = IPV6_USER_FLOW; in fbnic_get_cls_rule()
676 fsp->h_u.usr_ip6_spec.l4_proto = IPPROTO_IPV6; in fbnic_get_cls_rule()
677 fsp->m_u.usr_ip6_spec.l4_proto = 0xff; in fbnic_get_cls_rule()
680 act_tcam->mask.tcam[0])) { in fbnic_get_cls_rule()
685 act_tcam->value.tcam[0]); in fbnic_get_cls_rule()
686 ip_addr = &fbd->ipo_src[idx]; in fbnic_get_cls_rule()
689 fsp->h_u.usr_ip6_spec.ip6src[i] = in fbnic_get_cls_rule()
690 ip_addr->value.s6_addr32[i]; in fbnic_get_cls_rule()
691 fsp->m_u.usr_ip6_spec.ip6src[i] = in fbnic_get_cls_rule()
692 ~ip_addr->mask.s6_addr32[i]; in fbnic_get_cls_rule()
697 act_tcam->mask.tcam[0])) { in fbnic_get_cls_rule()
702 act_tcam->value.tcam[0]); in fbnic_get_cls_rule()
703 ip_addr = &fbd->ipo_dst[idx]; in fbnic_get_cls_rule()
706 fsp->h_u.usr_ip6_spec.ip6dst[i] = in fbnic_get_cls_rule()
707 ip_addr->value.s6_addr32[i]; in fbnic_get_cls_rule()
708 fsp->m_u.usr_ip6_spec.ip6dst[i] = in fbnic_get_cls_rule()
709 ~ip_addr->mask.s6_addr32[i]; in fbnic_get_cls_rule()
712 } else if ((act_tcam->value.tcam[1] & FBNIC_RPC_TCAM_ACT1_IP_IS_V6)) { in fbnic_get_cls_rule()
713 if (act_tcam->value.tcam[1] & FBNIC_RPC_TCAM_ACT1_L4_VALID) { in fbnic_get_cls_rule()
714 if (act_tcam->value.tcam[1] & in fbnic_get_cls_rule()
716 fsp->flow_type = UDP_V6_FLOW; in fbnic_get_cls_rule()
718 fsp->flow_type = TCP_V6_FLOW; in fbnic_get_cls_rule()
719 fsp->h_u.tcp_ip6_spec.psrc = in fbnic_get_cls_rule()
720 cpu_to_be16(act_tcam->value.tcam[3]); in fbnic_get_cls_rule()
721 fsp->m_u.tcp_ip6_spec.psrc = in fbnic_get_cls_rule()
722 cpu_to_be16(~act_tcam->mask.tcam[3]); in fbnic_get_cls_rule()
723 fsp->h_u.tcp_ip6_spec.pdst = in fbnic_get_cls_rule()
724 cpu_to_be16(act_tcam->value.tcam[4]); in fbnic_get_cls_rule()
725 fsp->m_u.tcp_ip6_spec.pdst = in fbnic_get_cls_rule()
726 cpu_to_be16(~act_tcam->mask.tcam[4]); in fbnic_get_cls_rule()
728 fsp->flow_type = IPV6_USER_FLOW; in fbnic_get_cls_rule()
732 act_tcam->mask.tcam[0])) { in fbnic_get_cls_rule()
737 act_tcam->value.tcam[0]); in fbnic_get_cls_rule()
738 ip_addr = &fbd->ip_src[idx]; in fbnic_get_cls_rule()
741 fsp->h_u.usr_ip6_spec.ip6src[i] = in fbnic_get_cls_rule()
742 ip_addr->value.s6_addr32[i]; in fbnic_get_cls_rule()
743 fsp->m_u.usr_ip6_spec.ip6src[i] = in fbnic_get_cls_rule()
744 ~ip_addr->mask.s6_addr32[i]; in fbnic_get_cls_rule()
749 act_tcam->mask.tcam[0])) { in fbnic_get_cls_rule()
754 act_tcam->value.tcam[0]); in fbnic_get_cls_rule()
755 ip_addr = &fbd->ip_dst[idx]; in fbnic_get_cls_rule()
758 fsp->h_u.usr_ip6_spec.ip6dst[i] = in fbnic_get_cls_rule()
759 ip_addr->value.s6_addr32[i]; in fbnic_get_cls_rule()
760 fsp->m_u.usr_ip6_spec.ip6dst[i] = in fbnic_get_cls_rule()
761 ~ip_addr->mask.s6_addr32[i]; in fbnic_get_cls_rule()
765 if (act_tcam->value.tcam[1] & FBNIC_RPC_TCAM_ACT1_L4_VALID) { in fbnic_get_cls_rule()
766 if (act_tcam->value.tcam[1] & in fbnic_get_cls_rule()
768 fsp->flow_type = UDP_V4_FLOW; in fbnic_get_cls_rule()
770 fsp->flow_type = TCP_V4_FLOW; in fbnic_get_cls_rule()
771 fsp->h_u.tcp_ip4_spec.psrc = in fbnic_get_cls_rule()
772 cpu_to_be16(act_tcam->value.tcam[3]); in fbnic_get_cls_rule()
773 fsp->m_u.tcp_ip4_spec.psrc = in fbnic_get_cls_rule()
774 cpu_to_be16(~act_tcam->mask.tcam[3]); in fbnic_get_cls_rule()
775 fsp->h_u.tcp_ip4_spec.pdst = in fbnic_get_cls_rule()
776 cpu_to_be16(act_tcam->value.tcam[4]); in fbnic_get_cls_rule()
777 fsp->m_u.tcp_ip4_spec.pdst = in fbnic_get_cls_rule()
778 cpu_to_be16(~act_tcam->mask.tcam[4]); in fbnic_get_cls_rule()
780 fsp->flow_type = IPV4_USER_FLOW; in fbnic_get_cls_rule()
781 fsp->h_u.usr_ip4_spec.ip_ver = ETH_RX_NFC_IP4; in fbnic_get_cls_rule()
785 act_tcam->mask.tcam[0])) { in fbnic_get_cls_rule()
789 act_tcam->value.tcam[0]); in fbnic_get_cls_rule()
790 ip_addr = &fbd->ip_src[idx]; in fbnic_get_cls_rule()
792 fsp->h_u.usr_ip4_spec.ip4src = in fbnic_get_cls_rule()
793 ip_addr->value.s6_addr32[3]; in fbnic_get_cls_rule()
794 fsp->m_u.usr_ip4_spec.ip4src = in fbnic_get_cls_rule()
795 ~ip_addr->mask.s6_addr32[3]; in fbnic_get_cls_rule()
799 act_tcam->mask.tcam[0])) { in fbnic_get_cls_rule()
803 act_tcam->value.tcam[0]); in fbnic_get_cls_rule()
804 ip_addr = &fbd->ip_dst[idx]; in fbnic_get_cls_rule()
806 fsp->h_u.usr_ip4_spec.ip4dst = in fbnic_get_cls_rule()
807 ip_addr->value.s6_addr32[3]; in fbnic_get_cls_rule()
808 fsp->m_u.usr_ip4_spec.ip4dst = in fbnic_get_cls_rule()
809 ~ip_addr->mask.s6_addr32[3]; in fbnic_get_cls_rule()
814 if (act_tcam->dest & FBNIC_RPC_ACT_TBL0_DROP) in fbnic_get_cls_rule()
815 fsp->ring_cookie = RX_CLS_FLOW_DISC; in fbnic_get_cls_rule()
816 else if (act_tcam->dest & FBNIC_RPC_ACT_TBL0_Q_SEL) in fbnic_get_cls_rule()
817 fsp->ring_cookie = FIELD_GET(FBNIC_RPC_ACT_TBL0_Q_ID, in fbnic_get_cls_rule()
818 act_tcam->dest); in fbnic_get_cls_rule()
820 fsp->flow_type |= FLOW_RSS; in fbnic_get_cls_rule()
822 cmd->rss_context = FIELD_GET(FBNIC_RPC_ACT_TBL0_RSS_CTXT_ID, in fbnic_get_cls_rule()
823 act_tcam->dest); in fbnic_get_cls_rule()
832 int ret = -EOPNOTSUPP; in fbnic_get_rxnfc()
835 switch (cmd->cmd) { in fbnic_get_rxnfc()
837 cmd->data = fbn->num_rx_queues; in fbnic_get_rxnfc()
852 cmd->data |= special; in fbnic_get_rxnfc()
853 cmd->rule_cnt = ret; in fbnic_get_rxnfc()
865 for (i = FBNIC_RPC_ACT_TBL_NFC_ENTRIES; i--;) { in fbnic_cls_rule_any_loc()
868 if (fbd->act_tcam[idx].state != FBNIC_TCAM_S_VALID) in fbnic_cls_rule_any_loc()
872 return -ENOSPC; in fbnic_cls_rule_any_loc()
886 struct fbnic_dev *fbd = fbn->fbd; in fbnic_set_cls_rule_ins()
894 fsp = (struct ethtool_rx_flow_spec *)&cmd->fs; in fbnic_set_cls_rule_ins()
896 if (fsp->location != RX_CLS_LOC_ANY) in fbnic_set_cls_rule_ins()
897 return -EINVAL; in fbnic_set_cls_rule_ins()
902 if (fsp->ring_cookie == RX_CLS_FLOW_DISC) { in fbnic_set_cls_rule_ins()
904 } else if (fsp->flow_type & FLOW_RSS) { in fbnic_set_cls_rule_ins()
905 if (cmd->rss_context == 1) in fbnic_set_cls_rule_ins()
908 u32 ring_idx = ethtool_get_flow_spec_ring(fsp->ring_cookie); in fbnic_set_cls_rule_ins()
910 if (ring_idx >= fbn->num_rx_queues) in fbnic_set_cls_rule_ins()
911 return -EINVAL; in fbnic_set_cls_rule_ins()
918 act_tcam = &fbd->act_tcam[idx]; in fbnic_set_cls_rule_ins()
924 if (act_tcam->state != FBNIC_TCAM_S_DISABLED) in fbnic_set_cls_rule_ins()
925 return -EBUSY; in fbnic_set_cls_rule_ins()
927 flow_type = fsp->flow_type & ~(FLOW_EXT | FLOW_RSS); in fbnic_set_cls_rule_ins()
941 sport = be16_to_cpu(fsp->h_u.tcp_ip4_spec.psrc); in fbnic_set_cls_rule_ins()
942 sport_mask = ~be16_to_cpu(fsp->m_u.tcp_ip4_spec.psrc); in fbnic_set_cls_rule_ins()
943 dport = be16_to_cpu(fsp->h_u.tcp_ip4_spec.pdst); in fbnic_set_cls_rule_ins()
944 dport_mask = ~be16_to_cpu(fsp->m_u.tcp_ip4_spec.pdst); in fbnic_set_cls_rule_ins()
947 if (!fsp->m_u.usr_ip4_spec.proto) in fbnic_set_cls_rule_ins()
949 if (fsp->m_u.usr_ip4_spec.proto != 0xff) in fbnic_set_cls_rule_ins()
950 return -EINVAL; in fbnic_set_cls_rule_ins()
951 if (fsp->h_u.usr_ip4_spec.proto == IPPROTO_UDP) in fbnic_set_cls_rule_ins()
953 if (fsp->h_u.usr_ip4_spec.proto == IPPROTO_TCP) in fbnic_set_cls_rule_ins()
955 return -EINVAL; in fbnic_set_cls_rule_ins()
957 addr4 = (struct in_addr *)&fsp->h_u.usr_ip4_spec.ip4src; in fbnic_set_cls_rule_ins()
958 mask4 = (struct in_addr *)&fsp->m_u.usr_ip4_spec.ip4src; in fbnic_set_cls_rule_ins()
959 if (mask4->s_addr) { in fbnic_set_cls_rule_ins()
960 ip_src = __fbnic_ip4_sync(fbd, fbd->ip_src, in fbnic_set_cls_rule_ins()
963 return -ENOSPC; in fbnic_set_cls_rule_ins()
965 set_bit(idx, ip_src->act_tcam); in fbnic_set_cls_rule_ins()
968 ip_src - fbd->ip_src); in fbnic_set_cls_rule_ins()
973 addr4 = (struct in_addr *)&fsp->h_u.usr_ip4_spec.ip4dst; in fbnic_set_cls_rule_ins()
974 mask4 = (struct in_addr *)&fsp->m_u.usr_ip4_spec.ip4dst; in fbnic_set_cls_rule_ins()
975 if (mask4->s_addr) { in fbnic_set_cls_rule_ins()
976 ip_dst = __fbnic_ip4_sync(fbd, fbd->ip_dst, in fbnic_set_cls_rule_ins()
979 if (ip_src && ip_src->state == FBNIC_TCAM_S_ADD) in fbnic_set_cls_rule_ins()
981 return -ENOSPC; in fbnic_set_cls_rule_ins()
984 set_bit(idx, ip_dst->act_tcam); in fbnic_set_cls_rule_ins()
987 ip_dst - fbd->ip_dst); in fbnic_set_cls_rule_ins()
1007 sport = be16_to_cpu(fsp->h_u.tcp_ip6_spec.psrc); in fbnic_set_cls_rule_ins()
1008 sport_mask = ~be16_to_cpu(fsp->m_u.tcp_ip6_spec.psrc); in fbnic_set_cls_rule_ins()
1009 dport = be16_to_cpu(fsp->h_u.tcp_ip6_spec.pdst); in fbnic_set_cls_rule_ins()
1010 dport_mask = ~be16_to_cpu(fsp->m_u.tcp_ip6_spec.pdst); in fbnic_set_cls_rule_ins()
1013 if (!fsp->m_u.usr_ip6_spec.l4_proto) in fbnic_set_cls_rule_ins()
1016 if (fsp->m_u.usr_ip6_spec.l4_proto != 0xff) in fbnic_set_cls_rule_ins()
1017 return -EINVAL; in fbnic_set_cls_rule_ins()
1018 if (fsp->h_u.usr_ip6_spec.l4_proto == IPPROTO_UDP) in fbnic_set_cls_rule_ins()
1020 if (fsp->h_u.usr_ip6_spec.l4_proto == IPPROTO_TCP) in fbnic_set_cls_rule_ins()
1022 if (fsp->h_u.usr_ip6_spec.l4_proto != IPPROTO_IPV6) in fbnic_set_cls_rule_ins()
1023 return -EINVAL; in fbnic_set_cls_rule_ins()
1025 addr6 = (struct in6_addr *)fsp->h_u.usr_ip6_spec.ip6src; in fbnic_set_cls_rule_ins()
1026 mask6 = (struct in6_addr *)fsp->m_u.usr_ip6_spec.ip6src; in fbnic_set_cls_rule_ins()
1028 ip_src = __fbnic_ip6_sync(fbd, fbd->ipo_src, in fbnic_set_cls_rule_ins()
1031 return -ENOSPC; in fbnic_set_cls_rule_ins()
1033 set_bit(idx, ip_src->act_tcam); in fbnic_set_cls_rule_ins()
1037 ip_src - fbd->ipo_src); in fbnic_set_cls_rule_ins()
1043 addr6 = (struct in6_addr *)fsp->h_u.usr_ip6_spec.ip6dst; in fbnic_set_cls_rule_ins()
1044 mask6 = (struct in6_addr *)fsp->m_u.usr_ip6_spec.ip6dst; in fbnic_set_cls_rule_ins()
1046 ip_dst = __fbnic_ip6_sync(fbd, fbd->ipo_dst, in fbnic_set_cls_rule_ins()
1049 if (ip_src && ip_src->state == FBNIC_TCAM_S_ADD) in fbnic_set_cls_rule_ins()
1051 return -ENOSPC; in fbnic_set_cls_rule_ins()
1054 set_bit(idx, ip_dst->act_tcam); in fbnic_set_cls_rule_ins()
1058 ip_dst - fbd->ipo_dst); in fbnic_set_cls_rule_ins()
1066 addr6 = (struct in6_addr *)fsp->h_u.usr_ip6_spec.ip6src; in fbnic_set_cls_rule_ins()
1067 mask6 = (struct in6_addr *)fsp->m_u.usr_ip6_spec.ip6src; in fbnic_set_cls_rule_ins()
1069 ip_src = __fbnic_ip6_sync(fbd, fbd->ip_src, in fbnic_set_cls_rule_ins()
1072 return -ENOSPC; in fbnic_set_cls_rule_ins()
1074 set_bit(idx, ip_src->act_tcam); in fbnic_set_cls_rule_ins()
1077 ip_src - fbd->ip_src); in fbnic_set_cls_rule_ins()
1082 addr6 = (struct in6_addr *)fsp->h_u.usr_ip6_spec.ip6dst; in fbnic_set_cls_rule_ins()
1083 mask6 = (struct in6_addr *)fsp->m_u.usr_ip6_spec.ip6dst; in fbnic_set_cls_rule_ins()
1085 ip_dst = __fbnic_ip6_sync(fbd, fbd->ip_dst, in fbnic_set_cls_rule_ins()
1088 if (ip_src && ip_src->state == FBNIC_TCAM_S_ADD) in fbnic_set_cls_rule_ins()
1090 return -ENOSPC; in fbnic_set_cls_rule_ins()
1093 set_bit(idx, ip_dst->act_tcam); in fbnic_set_cls_rule_ins()
1096 ip_dst - fbd->ip_dst); in fbnic_set_cls_rule_ins()
1109 if (!is_zero_ether_addr(fsp->m_u.ether_spec.h_dest)) { in fbnic_set_cls_rule_ins()
1110 u8 *addr = fsp->h_u.ether_spec.h_dest; in fbnic_set_cls_rule_ins()
1111 u8 *mask = fsp->m_u.ether_spec.h_dest; in fbnic_set_cls_rule_ins()
1115 return -EINVAL; in fbnic_set_cls_rule_ins()
1121 return -EINVAL; in fbnic_set_cls_rule_ins()
1129 return -ENOSPC; in fbnic_set_cls_rule_ins()
1131 set_bit(idx, mac_addr->act_tcam); in fbnic_set_cls_rule_ins()
1134 mac_addr - fbd->mac_addr); in fbnic_set_cls_rule_ins()
1142 return -EINVAL; in fbnic_set_cls_rule_ins()
1146 act_tcam->dest = dest; in fbnic_set_cls_rule_ins()
1147 act_tcam->rss_en_mask = fbnic_flow_hash_2_rss_en_mask(fbn, hash_idx); in fbnic_set_cls_rule_ins()
1150 act_tcam->value.tcam[0] = ip_value; in fbnic_set_cls_rule_ins()
1151 act_tcam->mask.tcam[0] = ip_mask; in fbnic_set_cls_rule_ins()
1154 act_tcam->value.tcam[1] = flow_value; in fbnic_set_cls_rule_ins()
1155 act_tcam->mask.tcam[1] = flow_mask; in fbnic_set_cls_rule_ins()
1158 act_tcam->value.tcam[2] = misc; in fbnic_set_cls_rule_ins()
1159 act_tcam->mask.tcam[2] = misc_mask; in fbnic_set_cls_rule_ins()
1162 act_tcam->value.tcam[3] = sport; in fbnic_set_cls_rule_ins()
1163 act_tcam->mask.tcam[3] = sport_mask; in fbnic_set_cls_rule_ins()
1164 act_tcam->value.tcam[4] = dport; in fbnic_set_cls_rule_ins()
1165 act_tcam->mask.tcam[4] = dport_mask; in fbnic_set_cls_rule_ins()
1168 act_tcam->mask.tcam[j] = 0xffff; in fbnic_set_cls_rule_ins()
1170 act_tcam->state = FBNIC_TCAM_S_UPDATE; in fbnic_set_cls_rule_ins()
1171 fsp->location = location; in fbnic_set_cls_rule_ins()
1173 if (netif_running(fbn->netdev)) { in fbnic_set_cls_rule_ins()
1187 struct fbnic_dev *fbd = fbn->fbd; in fbnic_clear_nfc_macda()
1190 for (idx = ARRAY_SIZE(fbd->mac_addr); idx--;) in fbnic_clear_nfc_macda()
1191 __fbnic_xc_unsync(&fbd->mac_addr[idx], tcam_idx); in fbnic_clear_nfc_macda()
1194 if (netif_running(fbn->netdev)) in fbnic_clear_nfc_macda()
1201 struct fbnic_dev *fbd = fbn->fbd; in fbnic_clear_nfc_ip_addr()
1204 for (idx = ARRAY_SIZE(fbd->ip_src); idx--;) in fbnic_clear_nfc_ip_addr()
1205 __fbnic_ip_unsync(&fbd->ip_src[idx], tcam_idx); in fbnic_clear_nfc_ip_addr()
1206 for (idx = ARRAY_SIZE(fbd->ip_dst); idx--;) in fbnic_clear_nfc_ip_addr()
1207 __fbnic_ip_unsync(&fbd->ip_dst[idx], tcam_idx); in fbnic_clear_nfc_ip_addr()
1208 for (idx = ARRAY_SIZE(fbd->ipo_src); idx--;) in fbnic_clear_nfc_ip_addr()
1209 __fbnic_ip_unsync(&fbd->ipo_src[idx], tcam_idx); in fbnic_clear_nfc_ip_addr()
1210 for (idx = ARRAY_SIZE(fbd->ipo_dst); idx--;) in fbnic_clear_nfc_ip_addr()
1211 __fbnic_ip_unsync(&fbd->ipo_dst[idx], tcam_idx); in fbnic_clear_nfc_ip_addr()
1214 if (netif_running(fbn->netdev)) in fbnic_clear_nfc_ip_addr()
1222 struct fbnic_dev *fbd = fbn->fbd; in fbnic_set_cls_rule_del()
1226 fsp = (struct ethtool_rx_flow_spec *)&cmd->fs; in fbnic_set_cls_rule_del()
1228 if (fsp->location >= FBNIC_RPC_ACT_TBL_NFC_ENTRIES) in fbnic_set_cls_rule_del()
1229 return -EINVAL; in fbnic_set_cls_rule_del()
1231 idx = fsp->location + FBNIC_RPC_ACT_TBL_NFC_OFFSET; in fbnic_set_cls_rule_del()
1232 act_tcam = &fbd->act_tcam[idx]; in fbnic_set_cls_rule_del()
1234 if (act_tcam->state != FBNIC_TCAM_S_VALID) in fbnic_set_cls_rule_del()
1235 return -EINVAL; in fbnic_set_cls_rule_del()
1237 act_tcam->state = FBNIC_TCAM_S_DELETE; in fbnic_set_cls_rule_del()
1239 if ((act_tcam->value.tcam[1] & FBNIC_RPC_TCAM_ACT1_L2_MACDA_VALID) && in fbnic_set_cls_rule_del()
1240 (~act_tcam->mask.tcam[1] & FBNIC_RPC_TCAM_ACT1_L2_MACDA_IDX)) in fbnic_set_cls_rule_del()
1243 if ((act_tcam->value.tcam[0] & in fbnic_set_cls_rule_del()
1248 (~act_tcam->mask.tcam[0] & in fbnic_set_cls_rule_del()
1255 if (netif_running(fbn->netdev)) in fbnic_set_cls_rule_del()
1264 int ret = -EOPNOTSUPP; in fbnic_set_rxnfc()
1266 switch (cmd->cmd) { in fbnic_set_rxnfc()
1294 rxfh->hfunc = ETH_RSS_HASH_TOP; in fbnic_get_rxfh()
1296 if (rxfh->key) { in fbnic_get_rxfh()
1298 u32 rss_key = fbn->rss_key[i / 4] << ((i % 4) * 8); in fbnic_get_rxfh()
1300 rxfh->key[i] = rss_key >> 24; in fbnic_get_rxfh()
1304 if (rxfh->indir) { in fbnic_get_rxfh()
1306 rxfh->indir[i] = fbn->indir_tbl[0][i]; in fbnic_get_rxfh()
1318 if (fbn->indir_tbl[idx][i] == indir[i]) in fbnic_set_indir()
1321 fbn->indir_tbl[idx][i] = indir[i]; in fbnic_set_indir()
1335 if (rxfh->hfunc != ETH_RSS_HASH_NO_CHANGE && in fbnic_set_rxfh()
1336 rxfh->hfunc != ETH_RSS_HASH_TOP) in fbnic_set_rxfh()
1337 return -EINVAL; in fbnic_set_rxfh()
1339 if (rxfh->key) { in fbnic_set_rxfh()
1342 for (i = FBNIC_RPC_RSS_KEY_BYTE_LEN; i--;) { in fbnic_set_rxfh()
1344 rss_key |= (u32)(rxfh->key[i]) << 24; in fbnic_set_rxfh()
1349 if (fbn->rss_key[i / 4] == rss_key) in fbnic_set_rxfh()
1352 fbn->rss_key[i / 4] = rss_key; in fbnic_set_rxfh()
1357 if (rxfh->indir) in fbnic_set_rxfh()
1358 changes += fbnic_set_indir(fbn, 0, rxfh->indir); in fbnic_set_rxfh()
1361 fbnic_rss_reinit_hw(fbn->fbd, fbn); in fbnic_set_rxfh()
1370 int hash_opt_idx = fbnic_get_rss_hash_idx(cmd->flow_type); in fbnic_get_rss_hash_opts()
1374 return -EINVAL; in fbnic_get_rss_hash_opts()
1377 cmd->data = fbn->rss_flow_hash[hash_opt_idx]; in fbnic_get_rss_hash_opts()
1398 hash_opt_idx = fbnic_get_rss_hash_idx(cmd->flow_type); in fbnic_set_rss_hash_opts()
1400 return -EINVAL; in fbnic_set_rss_hash_opts()
1402 /* Verify the fields asked for can actually be assigned based on type */ in fbnic_set_rss_hash_opts()
1403 if (cmd->data & ~FBNIC_L4_HASH_OPTIONS || in fbnic_set_rss_hash_opts()
1405 cmd->data & ~FBNIC_L3_HASH_OPTIONS) || in fbnic_set_rss_hash_opts()
1407 cmd->data & ~FBNIC_L2_HASH_OPTIONS)) in fbnic_set_rss_hash_opts()
1408 return -EINVAL; in fbnic_set_rss_hash_opts()
1410 fbn->rss_flow_hash[hash_opt_idx] = cmd->data; in fbnic_set_rss_hash_opts()
1412 if (netif_running(fbn->netdev)) { in fbnic_set_rss_hash_opts()
1413 fbnic_rss_reinit(fbn->fbd, fbn); in fbnic_set_rss_hash_opts()
1414 fbnic_write_rules(fbn->fbd); in fbnic_set_rss_hash_opts()
1427 const u32 *indir = rxfh->indir; in fbnic_modify_rxfh_context()
1433 changes = fbnic_set_indir(fbn, rxfh->rss_context, indir); in fbnic_modify_rxfh_context()
1435 fbnic_rss_reinit_hw(fbn->fbd, fbn); in fbnic_modify_rxfh_context()
1448 if (rxfh->hfunc && rxfh->hfunc != ETH_RSS_HASH_TOP) { in fbnic_create_rxfh_context()
1450 return -EOPNOTSUPP; in fbnic_create_rxfh_context()
1452 ctx->hfunc = ETH_RSS_HASH_TOP; in fbnic_create_rxfh_context()
1454 if (!rxfh->indir) { in fbnic_create_rxfh_context()
1456 unsigned int num_rx = fbn->num_rx_queues; in fbnic_create_rxfh_context()
1479 struct fbnic_dev *fbd = fbn->fbd; in fbnic_get_channels()
1481 ch->max_rx = fbd->max_num_queues; in fbnic_get_channels()
1482 ch->max_tx = fbd->max_num_queues; in fbnic_get_channels()
1483 ch->max_combined = min(ch->max_rx, ch->max_tx); in fbnic_get_channels()
1484 ch->max_other = FBNIC_NON_NAPI_VECTORS; in fbnic_get_channels()
1486 if (fbn->num_rx_queues > fbn->num_napi || in fbnic_get_channels()
1487 fbn->num_tx_queues > fbn->num_napi) in fbnic_get_channels()
1488 ch->combined_count = min(fbn->num_rx_queues, in fbnic_get_channels()
1489 fbn->num_tx_queues); in fbnic_get_channels()
1491 ch->combined_count = in fbnic_get_channels()
1492 fbn->num_rx_queues + fbn->num_tx_queues - fbn->num_napi; in fbnic_get_channels()
1493 ch->rx_count = fbn->num_rx_queues - ch->combined_count; in fbnic_get_channels()
1494 ch->tx_count = fbn->num_tx_queues - ch->combined_count; in fbnic_get_channels()
1495 ch->other_count = FBNIC_NON_NAPI_VECTORS; in fbnic_get_channels()
1501 fbn->num_rx_queues = ch->rx_count + ch->combined_count; in fbnic_set_queues()
1502 fbn->num_tx_queues = ch->tx_count + ch->combined_count; in fbnic_set_queues()
1503 fbn->num_napi = min(ch->rx_count + ch->tx_count + ch->combined_count, in fbnic_set_queues()
1512 struct fbnic_dev *fbd = fbn->fbd; in fbnic_set_channels()
1516 max_napis = fbd->num_irqs - FBNIC_NON_NAPI_VECTORS; in fbnic_set_channels()
1517 standalone = ch->rx_count + ch->tx_count; in fbnic_set_channels()
1520 * - each queue has its own NAPI (num_napi >= rx + tx + combined) in fbnic_set_channels()
1521 * - combining queues (combined not 0, rx or tx must be 0) in fbnic_set_channels()
1523 if ((ch->rx_count && ch->tx_count && ch->combined_count) || in fbnic_set_channels()
1524 (standalone && standalone + ch->combined_count > max_napis) || in fbnic_set_channels()
1525 ch->rx_count + ch->combined_count > fbd->max_num_queues || in fbnic_set_channels()
1526 ch->tx_count + ch->combined_count > fbd->max_num_queues || in fbnic_set_channels()
1527 ch->other_count != FBNIC_NON_NAPI_VECTORS) in fbnic_set_channels()
1528 return -EINVAL; in fbnic_set_channels()
1538 return -ENOMEM; in fbnic_set_channels()
1551 err = fbnic_wait_all_queues_idle(fbn->fbd, true); in fbnic_set_channels()
1592 tsinfo->phc_index = ptp_clock_index(fbn->fbd->ptp); in fbnic_get_ts_info()
1594 tsinfo->so_timestamping = in fbnic_get_ts_info()
1600 tsinfo->tx_types = in fbnic_get_ts_info()
1604 tsinfo->rx_filters = in fbnic_get_ts_info()
1624 ts_stats->pkts = fbn->tx_stats.twq.ts_packets; in fbnic_get_ts_stats()
1625 ts_stats->lost = fbn->tx_stats.twq.ts_lost; in fbnic_get_ts_stats()
1626 for (i = 0; i < fbn->num_tx_queues; i++) { in fbnic_get_ts_stats()
1627 ring = fbn->tx[i]; in fbnic_get_ts_stats()
1629 start = u64_stats_fetch_begin(&ring->stats.syncp); in fbnic_get_ts_stats()
1630 ts_packets = ring->stats.twq.ts_packets; in fbnic_get_ts_stats()
1631 ts_lost = ring->stats.twq.ts_lost; in fbnic_get_ts_stats()
1632 } while (u64_stats_fetch_retry(&ring->stats.syncp, start)); in fbnic_get_ts_stats()
1633 ts_stats->pkts += ts_packets; in fbnic_get_ts_stats()
1634 ts_stats->lost += ts_lost; in fbnic_get_ts_stats()
1645 struct fbnic_dev *fbd = fbn->fbd; in fbnic_get_module_eeprom_by_page()
1648 if (page_data->i2c_address != 0x50) { in fbnic_get_module_eeprom_by_page()
1651 return -EINVAL; in fbnic_get_module_eeprom_by_page()
1655 page_data->length); in fbnic_get_module_eeprom_by_page()
1657 return -ENOMEM; in fbnic_get_module_eeprom_by_page()
1660 fw_cmpl->u.qsfp.length = page_data->length; in fbnic_get_module_eeprom_by_page()
1661 fw_cmpl->u.qsfp.offset = page_data->offset; in fbnic_get_module_eeprom_by_page()
1662 fw_cmpl->u.qsfp.page = page_data->page; in fbnic_get_module_eeprom_by_page()
1663 fw_cmpl->u.qsfp.bank = page_data->bank; in fbnic_get_module_eeprom_by_page()
1665 err = fbnic_fw_xmit_qsfp_read_msg(fbd, fw_cmpl, page_data->page, in fbnic_get_module_eeprom_by_page()
1666 page_data->bank, page_data->offset, in fbnic_get_module_eeprom_by_page()
1667 page_data->length); in fbnic_get_module_eeprom_by_page()
1674 if (!wait_for_completion_timeout(&fw_cmpl->done, 2 * HZ)) { in fbnic_get_module_eeprom_by_page()
1675 err = -ETIMEDOUT; in fbnic_get_module_eeprom_by_page()
1681 if (fw_cmpl->result) { in fbnic_get_module_eeprom_by_page()
1682 err = fw_cmpl->result; in fbnic_get_module_eeprom_by_page()
1687 memcpy(page_data->data, fw_cmpl->u.qsfp.data, page_data->length); in fbnic_get_module_eeprom_by_page()
1694 return err ? : page_data->length; in fbnic_get_module_eeprom_by_page()
1699 if (counter->reported) in fbnic_set_counter()
1700 *stat = counter->value; in fbnic_set_counter()
1709 struct fbnic_dev *fbd = fbn->fbd; in fbnic_get_pause_stats()
1711 mac_stats = &fbd->hw_stats.mac; in fbnic_get_pause_stats()
1713 fbd->mac->get_pause_stats(fbd, false, &mac_stats->pause); in fbnic_get_pause_stats()
1715 pause_stats->tx_pause_frames = mac_stats->pause.tx_pause_frames.value; in fbnic_get_pause_stats()
1716 pause_stats->rx_pause_frames = mac_stats->pause.rx_pause_frames.value; in fbnic_get_pause_stats()
1726 struct fbnic_dev *fbd = fbn->fbd; in fbnic_get_fec_stats()
1729 phy_stats = &fbd->hw_stats.phy; in fbnic_get_fec_stats()
1731 spin_lock(&fbd->hw_stats.lock); in fbnic_get_fec_stats()
1732 fec_stats->corrected_blocks.total = in fbnic_get_fec_stats()
1733 phy_stats->fec.corrected_blocks.value; in fbnic_get_fec_stats()
1734 fec_stats->uncorrectable_blocks.total = in fbnic_get_fec_stats()
1735 phy_stats->fec.uncorrectable_blocks.value; in fbnic_get_fec_stats()
1736 spin_unlock(&fbd->hw_stats.lock); in fbnic_get_fec_stats()
1745 struct fbnic_dev *fbd = fbn->fbd; in fbnic_get_eth_phy_stats()
1750 phy_stats = &fbd->hw_stats.phy; in fbnic_get_eth_phy_stats()
1752 spin_lock(&fbd->hw_stats.lock); in fbnic_get_eth_phy_stats()
1754 total += phy_stats->pcs.SymbolErrorDuringCarrier.lanes[i].value; in fbnic_get_eth_phy_stats()
1756 eth_phy_stats->SymbolErrorDuringCarrier = total; in fbnic_get_eth_phy_stats()
1757 spin_unlock(&fbd->hw_stats.lock); in fbnic_get_eth_phy_stats()
1766 struct fbnic_dev *fbd = fbn->fbd; in fbnic_get_eth_mac_stats()
1769 mac_stats = &fbd->hw_stats.mac; in fbnic_get_eth_mac_stats()
1770 mac = fbd->mac; in fbnic_get_eth_mac_stats()
1772 mac->get_eth_mac_stats(fbd, false, &mac_stats->eth_mac); in fbnic_get_eth_mac_stats()
1774 fbnic_set_counter(ð_mac_stats->FramesTransmittedOK, in fbnic_get_eth_mac_stats()
1775 &mac_stats->eth_mac.FramesTransmittedOK); in fbnic_get_eth_mac_stats()
1776 fbnic_set_counter(ð_mac_stats->FramesReceivedOK, in fbnic_get_eth_mac_stats()
1777 &mac_stats->eth_mac.FramesReceivedOK); in fbnic_get_eth_mac_stats()
1778 fbnic_set_counter(ð_mac_stats->FrameCheckSequenceErrors, in fbnic_get_eth_mac_stats()
1779 &mac_stats->eth_mac.FrameCheckSequenceErrors); in fbnic_get_eth_mac_stats()
1780 fbnic_set_counter(ð_mac_stats->AlignmentErrors, in fbnic_get_eth_mac_stats()
1781 &mac_stats->eth_mac.AlignmentErrors); in fbnic_get_eth_mac_stats()
1782 fbnic_set_counter(ð_mac_stats->OctetsTransmittedOK, in fbnic_get_eth_mac_stats()
1783 &mac_stats->eth_mac.OctetsTransmittedOK); in fbnic_get_eth_mac_stats()
1784 fbnic_set_counter(ð_mac_stats->FramesLostDueToIntMACXmitError, in fbnic_get_eth_mac_stats()
1785 &mac_stats->eth_mac.FramesLostDueToIntMACXmitError); in fbnic_get_eth_mac_stats()
1786 fbnic_set_counter(ð_mac_stats->OctetsReceivedOK, in fbnic_get_eth_mac_stats()
1787 &mac_stats->eth_mac.OctetsReceivedOK); in fbnic_get_eth_mac_stats()
1788 fbnic_set_counter(ð_mac_stats->FramesLostDueToIntMACRcvError, in fbnic_get_eth_mac_stats()
1789 &mac_stats->eth_mac.FramesLostDueToIntMACRcvError); in fbnic_get_eth_mac_stats()
1790 fbnic_set_counter(ð_mac_stats->MulticastFramesXmittedOK, in fbnic_get_eth_mac_stats()
1791 &mac_stats->eth_mac.MulticastFramesXmittedOK); in fbnic_get_eth_mac_stats()
1792 fbnic_set_counter(ð_mac_stats->BroadcastFramesXmittedOK, in fbnic_get_eth_mac_stats()
1793 &mac_stats->eth_mac.BroadcastFramesXmittedOK); in fbnic_get_eth_mac_stats()
1794 fbnic_set_counter(ð_mac_stats->MulticastFramesReceivedOK, in fbnic_get_eth_mac_stats()
1795 &mac_stats->eth_mac.MulticastFramesReceivedOK); in fbnic_get_eth_mac_stats()
1796 fbnic_set_counter(ð_mac_stats->BroadcastFramesReceivedOK, in fbnic_get_eth_mac_stats()
1797 &mac_stats->eth_mac.BroadcastFramesReceivedOK); in fbnic_get_eth_mac_stats()
1798 fbnic_set_counter(ð_mac_stats->FrameTooLongErrors, in fbnic_get_eth_mac_stats()
1799 &mac_stats->eth_mac.FrameTooLongErrors); in fbnic_get_eth_mac_stats()
1808 struct fbnic_dev *fbd = fbn->fbd; in fbnic_get_eth_ctrl_stats()
1810 mac_stats = &fbd->hw_stats.mac; in fbnic_get_eth_ctrl_stats()
1812 fbd->mac->get_eth_ctrl_stats(fbd, false, &mac_stats->eth_ctrl); in fbnic_get_eth_ctrl_stats()
1814 eth_ctrl_stats->MACControlFramesReceived = in fbnic_get_eth_ctrl_stats()
1815 mac_stats->eth_ctrl.MACControlFramesReceived.value; in fbnic_get_eth_ctrl_stats()
1816 eth_ctrl_stats->MACControlFramesTransmitted = in fbnic_get_eth_ctrl_stats()
1817 mac_stats->eth_ctrl.MACControlFramesTransmitted.value; in fbnic_get_eth_ctrl_stats()
1842 struct fbnic_dev *fbd = fbn->fbd; in fbnic_get_rmon_stats()
1845 mac_stats = &fbd->hw_stats.mac; in fbnic_get_rmon_stats()
1847 fbd->mac->get_rmon_stats(fbd, false, &mac_stats->rmon); in fbnic_get_rmon_stats()
1849 rmon_stats->undersize_pkts = in fbnic_get_rmon_stats()
1850 mac_stats->rmon.undersize_pkts.value; in fbnic_get_rmon_stats()
1851 rmon_stats->oversize_pkts = in fbnic_get_rmon_stats()
1852 mac_stats->rmon.oversize_pkts.value; in fbnic_get_rmon_stats()
1853 rmon_stats->fragments = in fbnic_get_rmon_stats()
1854 mac_stats->rmon.fragments.value; in fbnic_get_rmon_stats()
1855 rmon_stats->jabbers = in fbnic_get_rmon_stats()
1856 mac_stats->rmon.jabbers.value; in fbnic_get_rmon_stats()
1859 rmon_stats->hist[i] = mac_stats->rmon.hist[i].value; in fbnic_get_rmon_stats()
1860 rmon_stats->hist_tx[i] = mac_stats->rmon.hist_tx[i].value; in fbnic_get_rmon_stats()
1914 dev->ethtool_ops = &fbnic_ethtool_ops; in fbnic_set_ethtool_ops()