Lines Matching +full:rx +full:- +full:shared
4 * Copyright (C) 2008-2021, VMware, Inc. All Rights Reserved.
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
23 * Maintained by: pv-drivers@vmware.com
84 { "Rx Queue#", 0 },
85 { " LRO pkts rx", offsetof(struct UPT1_RxStats, LROPktsRxOK) },
86 { " LRO byte rx", offsetof(struct UPT1_RxStats, LROBytesRxOK) },
87 { " ucast pkts rx", offsetof(struct UPT1_RxStats, ucastPktsRxOK) },
88 { " ucast bytes rx", offsetof(struct UPT1_RxStats, ucastBytesRxOK) },
89 { " mcast pkts rx", offsetof(struct UPT1_RxStats, mcastPktsRxOK) },
90 { " mcast bytes rx", offsetof(struct UPT1_RxStats, mcastBytesRxOK) },
91 { " bcast pkts rx", offsetof(struct UPT1_RxStats, bcastPktsRxOK) },
92 { " bcast bytes rx", offsetof(struct UPT1_RxStats, bcastBytesRxOK) },
93 { " pkts rx OOB", offsetof(struct UPT1_RxStats, pktsRxOutOfBuf) },
94 { " pkts rx err", offsetof(struct UPT1_RxStats, pktsRxError) },
101 { " drv dropped rx total", offsetof(struct vmxnet3_rq_driver_stats,
107 { " rx buf alloc fail", offsetof(struct vmxnet3_rq_driver_stats,
134 /* Collect the dev stats into the shared area */ in vmxnet3_get_stats64()
135 spin_lock_irqsave(&adapter->cmd_lock, flags); in vmxnet3_get_stats64()
137 spin_unlock_irqrestore(&adapter->cmd_lock, flags); in vmxnet3_get_stats64()
139 for (i = 0; i < adapter->num_tx_queues; i++) { in vmxnet3_get_stats64()
140 devTxStats = &adapter->tqd_start[i].stats; in vmxnet3_get_stats64()
141 drvTxStats = &adapter->tx_queue[i].stats; in vmxnet3_get_stats64()
142 stats->tx_packets += devTxStats->ucastPktsTxOK + in vmxnet3_get_stats64()
143 devTxStats->mcastPktsTxOK + in vmxnet3_get_stats64()
144 devTxStats->bcastPktsTxOK; in vmxnet3_get_stats64()
145 stats->tx_bytes += devTxStats->ucastBytesTxOK + in vmxnet3_get_stats64()
146 devTxStats->mcastBytesTxOK + in vmxnet3_get_stats64()
147 devTxStats->bcastBytesTxOK; in vmxnet3_get_stats64()
148 stats->tx_errors += devTxStats->pktsTxError; in vmxnet3_get_stats64()
149 stats->tx_dropped += drvTxStats->drop_total; in vmxnet3_get_stats64()
152 for (i = 0; i < adapter->num_rx_queues; i++) { in vmxnet3_get_stats64()
153 devRxStats = &adapter->rqd_start[i].stats; in vmxnet3_get_stats64()
154 drvRxStats = &adapter->rx_queue[i].stats; in vmxnet3_get_stats64()
155 stats->rx_packets += devRxStats->ucastPktsRxOK + in vmxnet3_get_stats64()
156 devRxStats->mcastPktsRxOK + in vmxnet3_get_stats64()
157 devRxStats->bcastPktsRxOK; in vmxnet3_get_stats64()
159 stats->rx_bytes += devRxStats->ucastBytesRxOK + in vmxnet3_get_stats64()
160 devRxStats->mcastBytesRxOK + in vmxnet3_get_stats64()
161 devRxStats->bcastBytesRxOK; in vmxnet3_get_stats64()
163 stats->rx_errors += devRxStats->pktsRxError; in vmxnet3_get_stats64()
164 stats->rx_dropped += drvRxStats->drop_total; in vmxnet3_get_stats64()
165 stats->multicast += devRxStats->mcastPktsRxOK; in vmxnet3_get_stats64()
177 adapter->num_tx_queues + in vmxnet3_get_sset_count()
180 adapter->num_rx_queues + in vmxnet3_get_sset_count()
183 return -EOPNOTSUPP; in vmxnet3_get_sset_count()
189 * the version 2 of the vmxnet3 support for ethtool(8) --register-dump.
192 * --register-dump would be required.
200 (1 + adapter->intr.num_intrs) + in vmxnet3_get_regs_len()
201 (1 + adapter->num_tx_queues * 17 /* Tx queue registers */) + in vmxnet3_get_regs_len()
202 (1 + adapter->num_rx_queues * 23 /* Rx queue registers */)) * in vmxnet3_get_regs_len()
212 strlcpy(drvinfo->driver, vmxnet3_driver_name, sizeof(drvinfo->driver)); in vmxnet3_get_drvinfo()
214 strlcpy(drvinfo->version, VMXNET3_DRIVER_VERSION_REPORT, in vmxnet3_get_drvinfo()
215 sizeof(drvinfo->version)); in vmxnet3_get_drvinfo()
217 strlcpy(drvinfo->bus_info, pci_name(adapter->pdev), in vmxnet3_get_drvinfo()
218 sizeof(drvinfo->bus_info)); in vmxnet3_get_drvinfo()
228 for (j = 0; j < adapter->num_tx_queues; j++) { in vmxnet3_get_strings()
242 for (j = 0; j < adapter->num_rx_queues; j++) { in vmxnet3_get_strings()
267 /* If Rx checksum is disabled, then LRO should also be disabled */ in vmxnet3_fix_features()
282 skb->encapsulation && skb->ip_summed == CHECKSUM_PARTIAL) { in vmxnet3_features_check()
289 l4_proto = ip_hdr(skb)->protocol; in vmxnet3_features_check()
292 l4_proto = ipv6_hdr(skb)->nexthdr; in vmxnet3_features_check()
301 port = be16_to_cpu(udph->dest); in vmxnet3_features_check()
321 netdev->hw_enc_features |= NETIF_F_SG | NETIF_F_RXCSUM | in vmxnet3_enable_encap_offloads()
334 netdev->hw_enc_features &= ~(NETIF_F_SG | NETIF_F_RXCSUM | in vmxnet3_disable_encap_offloads()
346 netdev_features_t changed = features ^ netdev->features; in vmxnet3_set_features()
349 u8 udp_tun_enabled = (netdev->features & tun_offload_mask) != 0; in vmxnet3_set_features()
354 adapter->shared->devRead.misc.uptFeatures |= in vmxnet3_set_features()
357 adapter->shared->devRead.misc.uptFeatures &= in vmxnet3_set_features()
362 adapter->shared->devRead.misc.uptFeatures |= in vmxnet3_set_features()
365 adapter->shared->devRead.misc.uptFeatures &= in vmxnet3_set_features()
369 adapter->shared->devRead.misc.uptFeatures |= in vmxnet3_set_features()
372 adapter->shared->devRead.misc.uptFeatures &= in vmxnet3_set_features()
377 adapter->shared->devRead.misc.uptFeatures |= in vmxnet3_set_features()
382 adapter->shared->devRead.misc.uptFeatures &= in vmxnet3_set_features()
386 spin_lock_irqsave(&adapter->cmd_lock, flags); in vmxnet3_set_features()
389 spin_unlock_irqrestore(&adapter->cmd_lock, flags); in vmxnet3_set_features()
404 spin_lock_irqsave(&adapter->cmd_lock, flags); in vmxnet3_get_ethtool_stats()
406 spin_unlock_irqrestore(&adapter->cmd_lock, flags); in vmxnet3_get_ethtool_stats()
408 /* this does assume each counter is 64-bit wide */ in vmxnet3_get_ethtool_stats()
409 for (j = 0; j < adapter->num_tx_queues; j++) { in vmxnet3_get_ethtool_stats()
410 base = (u8 *)&adapter->tqd_start[j].stats; in vmxnet3_get_ethtool_stats()
416 base = (u8 *)&adapter->tx_queue[j].stats; in vmxnet3_get_ethtool_stats()
422 for (j = 0; j < adapter->num_rx_queues; j++) { in vmxnet3_get_ethtool_stats()
423 base = (u8 *)&adapter->rqd_start[j].stats; in vmxnet3_get_ethtool_stats()
429 base = (u8 *)&adapter->rx_queue[j].stats; in vmxnet3_get_ethtool_stats()
442 * the version 2 of the vmxnet3 support for ethtool(8) --register-dump.
445 * --register-dump would be required.
456 regs->version = 2; in vmxnet3_get_regs()
470 buf[j++] = adapter->intr.num_intrs; in vmxnet3_get_regs()
471 for (i = 0; i < adapter->intr.num_intrs; i++) { in vmxnet3_get_regs()
476 buf[j++] = adapter->num_tx_queues; in vmxnet3_get_regs()
477 for (i = 0; i < adapter->num_tx_queues; i++) { in vmxnet3_get_regs()
478 struct vmxnet3_tx_queue *tq = &adapter->tx_queue[i]; in vmxnet3_get_regs()
483 buf[j++] = VMXNET3_GET_ADDR_LO(tq->tx_ring.basePA); in vmxnet3_get_regs()
484 buf[j++] = VMXNET3_GET_ADDR_HI(tq->tx_ring.basePA); in vmxnet3_get_regs()
485 buf[j++] = tq->tx_ring.size; in vmxnet3_get_regs()
486 buf[j++] = tq->tx_ring.next2fill; in vmxnet3_get_regs()
487 buf[j++] = tq->tx_ring.next2comp; in vmxnet3_get_regs()
488 buf[j++] = tq->tx_ring.gen; in vmxnet3_get_regs()
490 buf[j++] = VMXNET3_GET_ADDR_LO(tq->data_ring.basePA); in vmxnet3_get_regs()
491 buf[j++] = VMXNET3_GET_ADDR_HI(tq->data_ring.basePA); in vmxnet3_get_regs()
492 buf[j++] = tq->data_ring.size; in vmxnet3_get_regs()
493 buf[j++] = tq->txdata_desc_size; in vmxnet3_get_regs()
495 buf[j++] = VMXNET3_GET_ADDR_LO(tq->comp_ring.basePA); in vmxnet3_get_regs()
496 buf[j++] = VMXNET3_GET_ADDR_HI(tq->comp_ring.basePA); in vmxnet3_get_regs()
497 buf[j++] = tq->comp_ring.size; in vmxnet3_get_regs()
498 buf[j++] = tq->comp_ring.next2proc; in vmxnet3_get_regs()
499 buf[j++] = tq->comp_ring.gen; in vmxnet3_get_regs()
501 buf[j++] = tq->stopped; in vmxnet3_get_regs()
504 buf[j++] = adapter->num_rx_queues; in vmxnet3_get_regs()
505 for (i = 0; i < adapter->num_rx_queues; i++) { in vmxnet3_get_regs()
506 struct vmxnet3_rx_queue *rq = &adapter->rx_queue[i]; in vmxnet3_get_regs()
513 buf[j++] = VMXNET3_GET_ADDR_LO(rq->rx_ring[0].basePA); in vmxnet3_get_regs()
514 buf[j++] = VMXNET3_GET_ADDR_HI(rq->rx_ring[0].basePA); in vmxnet3_get_regs()
515 buf[j++] = rq->rx_ring[0].size; in vmxnet3_get_regs()
516 buf[j++] = rq->rx_ring[0].next2fill; in vmxnet3_get_regs()
517 buf[j++] = rq->rx_ring[0].next2comp; in vmxnet3_get_regs()
518 buf[j++] = rq->rx_ring[0].gen; in vmxnet3_get_regs()
520 buf[j++] = VMXNET3_GET_ADDR_LO(rq->rx_ring[1].basePA); in vmxnet3_get_regs()
521 buf[j++] = VMXNET3_GET_ADDR_HI(rq->rx_ring[1].basePA); in vmxnet3_get_regs()
522 buf[j++] = rq->rx_ring[1].size; in vmxnet3_get_regs()
523 buf[j++] = rq->rx_ring[1].next2fill; in vmxnet3_get_regs()
524 buf[j++] = rq->rx_ring[1].next2comp; in vmxnet3_get_regs()
525 buf[j++] = rq->rx_ring[1].gen; in vmxnet3_get_regs()
527 buf[j++] = VMXNET3_GET_ADDR_LO(rq->data_ring.basePA); in vmxnet3_get_regs()
528 buf[j++] = VMXNET3_GET_ADDR_HI(rq->data_ring.basePA); in vmxnet3_get_regs()
529 buf[j++] = rq->rx_ring[0].size; in vmxnet3_get_regs()
530 buf[j++] = rq->data_ring.desc_size; in vmxnet3_get_regs()
532 buf[j++] = VMXNET3_GET_ADDR_LO(rq->comp_ring.basePA); in vmxnet3_get_regs()
533 buf[j++] = VMXNET3_GET_ADDR_HI(rq->comp_ring.basePA); in vmxnet3_get_regs()
534 buf[j++] = rq->comp_ring.size; in vmxnet3_get_regs()
535 buf[j++] = rq->comp_ring.next2proc; in vmxnet3_get_regs()
536 buf[j++] = rq->comp_ring.gen; in vmxnet3_get_regs()
546 wol->supported = WAKE_UCAST | WAKE_ARP | WAKE_MAGIC; in vmxnet3_get_wol()
547 wol->wolopts = adapter->wol; in vmxnet3_get_wol()
556 if (wol->wolopts & (WAKE_PHY | WAKE_MCAST | WAKE_BCAST | in vmxnet3_set_wol()
558 return -EOPNOTSUPP; in vmxnet3_set_wol()
561 adapter->wol = wol->wolopts; in vmxnet3_set_wol()
563 device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol); in vmxnet3_set_wol()
581 ecmd->base.port = PORT_TP; in vmxnet3_get_link_ksettings()
583 if (adapter->link_speed) { in vmxnet3_get_link_ksettings()
584 ecmd->base.speed = adapter->link_speed; in vmxnet3_get_link_ksettings()
585 ecmd->base.duplex = DUPLEX_FULL; in vmxnet3_get_link_ksettings()
587 ecmd->base.speed = SPEED_UNKNOWN; in vmxnet3_get_link_ksettings()
588 ecmd->base.duplex = DUPLEX_UNKNOWN; in vmxnet3_get_link_ksettings()
600 param->rx_max_pending = VMXNET3_RX_RING_MAX_SIZE; in vmxnet3_get_ringparam()
601 param->tx_max_pending = VMXNET3_TX_RING_MAX_SIZE; in vmxnet3_get_ringparam()
602 param->rx_mini_max_pending = VMXNET3_VERSION_GE_3(adapter) ? in vmxnet3_get_ringparam()
604 param->rx_jumbo_max_pending = VMXNET3_RX_RING2_MAX_SIZE; in vmxnet3_get_ringparam()
606 param->rx_pending = adapter->rx_ring_size; in vmxnet3_get_ringparam()
607 param->tx_pending = adapter->tx_ring_size; in vmxnet3_get_ringparam()
608 param->rx_mini_pending = VMXNET3_VERSION_GE_3(adapter) ? in vmxnet3_get_ringparam()
609 adapter->rxdata_desc_size : 0; in vmxnet3_get_ringparam()
610 param->rx_jumbo_pending = adapter->rx_ring2_size; in vmxnet3_get_ringparam()
624 if (param->tx_pending == 0 || param->tx_pending > in vmxnet3_set_ringparam()
626 return -EINVAL; in vmxnet3_set_ringparam()
628 if (param->rx_pending == 0 || param->rx_pending > in vmxnet3_set_ringparam()
630 return -EINVAL; in vmxnet3_set_ringparam()
632 if (param->rx_jumbo_pending == 0 || in vmxnet3_set_ringparam()
633 param->rx_jumbo_pending > VMXNET3_RX_RING2_MAX_SIZE) in vmxnet3_set_ringparam()
634 return -EINVAL; in vmxnet3_set_ringparam()
637 if (adapter->rx_buf_per_pkt == 0) { in vmxnet3_set_ringparam()
640 return -EOPNOTSUPP; in vmxnet3_set_ringparam()
644 if (param->rx_mini_pending > VMXNET3_RXDATA_DESC_MAX_SIZE) in vmxnet3_set_ringparam()
645 return -EINVAL; in vmxnet3_set_ringparam()
646 } else if (param->rx_mini_pending != 0) { in vmxnet3_set_ringparam()
647 return -EINVAL; in vmxnet3_set_ringparam()
651 new_tx_ring_size = (param->tx_pending + VMXNET3_RING_SIZE_MASK) & in vmxnet3_set_ringparam()
657 return -EINVAL; in vmxnet3_set_ringparam()
662 sz = adapter->rx_buf_per_pkt * VMXNET3_RING_SIZE_ALIGN; in vmxnet3_set_ringparam()
663 new_rx_ring_size = (param->rx_pending + sz - 1) / sz * sz; in vmxnet3_set_ringparam()
668 return -EINVAL; in vmxnet3_set_ringparam()
671 new_rx_ring2_size = (param->rx_jumbo_pending + VMXNET3_RING_SIZE_MASK) & in vmxnet3_set_ringparam()
676 /* rx data ring buffer size has to be a multiple of in vmxnet3_set_ringparam()
680 (param->rx_mini_pending + VMXNET3_RXDATA_DESC_SIZE_MASK) & in vmxnet3_set_ringparam()
685 if (new_tx_ring_size == adapter->tx_ring_size && in vmxnet3_set_ringparam()
686 new_rx_ring_size == adapter->rx_ring_size && in vmxnet3_set_ringparam()
687 new_rx_ring2_size == adapter->rx_ring2_size && in vmxnet3_set_ringparam()
688 new_rxdata_desc_size == adapter->rxdata_desc_size) { in vmxnet3_set_ringparam()
696 while (test_and_set_bit(VMXNET3_STATE_BIT_RESETTING, &adapter->state)) in vmxnet3_set_ringparam()
703 /* recreate the rx queue and the tx queue based on the in vmxnet3_set_ringparam()
710 adapter->txdata_desc_size, in vmxnet3_set_ringparam()
727 adapter->txdata_desc_size, in vmxnet3_set_ringparam()
738 netdev_err(netdev, "failed to re-activate, error %d." in vmxnet3_set_ringparam()
741 adapter->tx_ring_size = new_tx_ring_size; in vmxnet3_set_ringparam()
742 adapter->rx_ring_size = new_rx_ring_size; in vmxnet3_set_ringparam()
743 adapter->rx_ring2_size = new_rx_ring2_size; in vmxnet3_set_ringparam()
744 adapter->rxdata_desc_size = new_rxdata_desc_size; in vmxnet3_set_ringparam()
747 clear_bit(VMXNET3_STATE_BIT_RESETTING, &adapter->state); in vmxnet3_set_ringparam()
760 if (netif_running(adapter->netdev)) { in vmxnet3_get_rss_hash_opts()
763 spin_lock_irqsave(&adapter->cmd_lock, flags); in vmxnet3_get_rss_hash_opts()
768 spin_unlock_irqrestore(&adapter->cmd_lock, flags); in vmxnet3_get_rss_hash_opts()
770 rss_fields = adapter->rss_fields; in vmxnet3_get_rss_hash_opts()
773 info->data = 0; in vmxnet3_get_rss_hash_opts()
776 switch (info->flow_type) { in vmxnet3_get_rss_hash_opts()
779 info->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3 | in vmxnet3_get_rss_hash_opts()
784 info->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3; in vmxnet3_get_rss_hash_opts()
785 info->data |= RXH_IP_SRC | RXH_IP_DST; in vmxnet3_get_rss_hash_opts()
791 info->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3; in vmxnet3_get_rss_hash_opts()
795 info->data |= RXH_IP_SRC | RXH_IP_DST; in vmxnet3_get_rss_hash_opts()
799 info->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3; in vmxnet3_get_rss_hash_opts()
800 info->data |= RXH_IP_SRC | RXH_IP_DST; in vmxnet3_get_rss_hash_opts()
807 info->data |= RXH_IP_SRC | RXH_IP_DST; in vmxnet3_get_rss_hash_opts()
810 return -EINVAL; in vmxnet3_get_rss_hash_opts()
821 enum Vmxnet3_RSSField rss_fields = adapter->rss_fields; in vmxnet3_set_rss_hash_opt()
826 if (nfc->data & ~(RXH_IP_SRC | RXH_IP_DST | in vmxnet3_set_rss_hash_opt()
828 return -EINVAL; in vmxnet3_set_rss_hash_opt()
830 switch (nfc->flow_type) { in vmxnet3_set_rss_hash_opt()
833 if (!(nfc->data & RXH_IP_SRC) || in vmxnet3_set_rss_hash_opt()
834 !(nfc->data & RXH_IP_DST) || in vmxnet3_set_rss_hash_opt()
835 !(nfc->data & RXH_L4_B_0_1) || in vmxnet3_set_rss_hash_opt()
836 !(nfc->data & RXH_L4_B_2_3)) in vmxnet3_set_rss_hash_opt()
837 return -EINVAL; in vmxnet3_set_rss_hash_opt()
840 if (!(nfc->data & RXH_IP_SRC) || in vmxnet3_set_rss_hash_opt()
841 !(nfc->data & RXH_IP_DST)) in vmxnet3_set_rss_hash_opt()
842 return -EINVAL; in vmxnet3_set_rss_hash_opt()
843 switch (nfc->data & (RXH_L4_B_0_1 | RXH_L4_B_2_3)) { in vmxnet3_set_rss_hash_opt()
851 return -EINVAL; in vmxnet3_set_rss_hash_opt()
855 if (!(nfc->data & RXH_IP_SRC) || in vmxnet3_set_rss_hash_opt()
856 !(nfc->data & RXH_IP_DST)) in vmxnet3_set_rss_hash_opt()
857 return -EINVAL; in vmxnet3_set_rss_hash_opt()
858 switch (nfc->data & (RXH_L4_B_0_1 | RXH_L4_B_2_3)) { in vmxnet3_set_rss_hash_opt()
866 return -EINVAL; in vmxnet3_set_rss_hash_opt()
872 if (!(nfc->data & RXH_IP_SRC) || in vmxnet3_set_rss_hash_opt()
873 !(nfc->data & RXH_IP_DST)) in vmxnet3_set_rss_hash_opt()
874 return -EINVAL; in vmxnet3_set_rss_hash_opt()
875 switch (nfc->data & (RXH_L4_B_0_1 | RXH_L4_B_2_3)) { in vmxnet3_set_rss_hash_opt()
883 return -EINVAL; in vmxnet3_set_rss_hash_opt()
891 if (!(nfc->data & RXH_IP_SRC) || in vmxnet3_set_rss_hash_opt()
892 !(nfc->data & RXH_IP_DST) || in vmxnet3_set_rss_hash_opt()
893 (nfc->data & RXH_L4_B_0_1) || in vmxnet3_set_rss_hash_opt()
894 (nfc->data & RXH_L4_B_2_3)) in vmxnet3_set_rss_hash_opt()
895 return -EINVAL; in vmxnet3_set_rss_hash_opt()
898 return -EINVAL; in vmxnet3_set_rss_hash_opt()
902 if (rss_fields != adapter->rss_fields) { in vmxnet3_set_rss_hash_opt()
903 adapter->default_rss_fields = false; in vmxnet3_set_rss_hash_opt()
905 struct Vmxnet3_DriverShared *shared = adapter->shared; in vmxnet3_set_rss_hash_opt() local
906 union Vmxnet3_CmdInfo *cmdInfo = &shared->cu.cmdInfo; in vmxnet3_set_rss_hash_opt()
909 spin_lock_irqsave(&adapter->cmd_lock, flags); in vmxnet3_set_rss_hash_opt()
910 cmdInfo->setRssFields = rss_fields; in vmxnet3_set_rss_hash_opt()
919 adapter->rss_fields = in vmxnet3_set_rss_hash_opt()
921 spin_unlock_irqrestore(&adapter->cmd_lock, flags); in vmxnet3_set_rss_hash_opt()
926 adapter->rss_fields = rss_fields; in vmxnet3_set_rss_hash_opt()
939 switch (info->cmd) { in vmxnet3_get_rxnfc()
941 info->data = adapter->num_rx_queues; in vmxnet3_get_rxnfc()
945 err = -EOPNOTSUPP; in vmxnet3_get_rxnfc()
949 if (!adapter->rss) { in vmxnet3_get_rxnfc()
950 err = -EOPNOTSUPP; in vmxnet3_get_rxnfc()
957 err = -EOPNOTSUPP; in vmxnet3_get_rxnfc()
971 err = -EOPNOTSUPP; in vmxnet3_set_rxnfc()
975 if (!adapter->rss) { in vmxnet3_set_rxnfc()
976 err = -EOPNOTSUPP; in vmxnet3_set_rxnfc()
981 switch (info->cmd) { in vmxnet3_set_rxnfc()
986 err = -EOPNOTSUPP; in vmxnet3_set_rxnfc()
999 struct UPT1_RSSConf *rssConf = adapter->rss_conf; in vmxnet3_get_rss_indir_size()
1001 return rssConf->indTableSize; in vmxnet3_get_rss_indir_size()
1008 struct UPT1_RSSConf *rssConf = adapter->rss_conf; in vmxnet3_get_rss()
1009 unsigned int n = rssConf->indTableSize; in vmxnet3_get_rss()
1017 while (n--) in vmxnet3_get_rss()
1018 p[n] = rssConf->indTable[n]; in vmxnet3_get_rss()
1030 struct UPT1_RSSConf *rssConf = adapter->rss_conf; in vmxnet3_set_rss()
1035 return -EOPNOTSUPP; in vmxnet3_set_rss()
1038 for (i = 0; i < rssConf->indTableSize; i++) in vmxnet3_set_rss()
1039 rssConf->indTable[i] = p[i]; in vmxnet3_set_rss()
1041 spin_lock_irqsave(&adapter->cmd_lock, flags); in vmxnet3_set_rss()
1044 spin_unlock_irqrestore(&adapter->cmd_lock, flags); in vmxnet3_set_rss()
1057 return -EOPNOTSUPP; in vmxnet3_get_coalesce()
1059 switch (adapter->coal_conf->coalMode) { in vmxnet3_get_coalesce()
1064 ec->use_adaptive_rx_coalesce = true; in vmxnet3_get_coalesce()
1067 ec->tx_max_coalesced_frames = in vmxnet3_get_coalesce()
1068 adapter->coal_conf->coalPara.coalStatic.tx_comp_depth; in vmxnet3_get_coalesce()
1069 ec->rx_max_coalesced_frames = in vmxnet3_get_coalesce()
1070 adapter->coal_conf->coalPara.coalStatic.rx_depth; in vmxnet3_get_coalesce()
1075 rbc_rate = adapter->coal_conf->coalPara.coalRbc.rbc_rate; in vmxnet3_get_coalesce()
1076 ec->rx_coalesce_usecs = VMXNET3_COAL_RBC_USECS(rbc_rate); in vmxnet3_get_coalesce()
1080 return -EOPNOTSUPP; in vmxnet3_get_coalesce()
1090 struct Vmxnet3_DriverShared *shared = adapter->shared; in vmxnet3_set_coalesce() local
1091 union Vmxnet3_CmdInfo *cmdInfo = &shared->cu.cmdInfo; in vmxnet3_set_coalesce()
1095 return -EOPNOTSUPP; in vmxnet3_set_coalesce()
1097 if ((ec->rx_coalesce_usecs == 0) && in vmxnet3_set_coalesce()
1098 (ec->use_adaptive_rx_coalesce == 0) && in vmxnet3_set_coalesce()
1099 (ec->tx_max_coalesced_frames == 0) && in vmxnet3_set_coalesce()
1100 (ec->rx_max_coalesced_frames == 0)) { in vmxnet3_set_coalesce()
1101 memset(adapter->coal_conf, 0, sizeof(*adapter->coal_conf)); in vmxnet3_set_coalesce()
1102 adapter->coal_conf->coalMode = VMXNET3_COALESCE_DISABLED; in vmxnet3_set_coalesce()
1106 if (ec->rx_coalesce_usecs != 0) { in vmxnet3_set_coalesce()
1109 if ((ec->use_adaptive_rx_coalesce != 0) || in vmxnet3_set_coalesce()
1110 (ec->tx_max_coalesced_frames != 0) || in vmxnet3_set_coalesce()
1111 (ec->rx_max_coalesced_frames != 0)) { in vmxnet3_set_coalesce()
1112 return -EINVAL; in vmxnet3_set_coalesce()
1115 rbc_rate = VMXNET3_COAL_RBC_RATE(ec->rx_coalesce_usecs); in vmxnet3_set_coalesce()
1118 return -EINVAL; in vmxnet3_set_coalesce()
1121 memset(adapter->coal_conf, 0, sizeof(*adapter->coal_conf)); in vmxnet3_set_coalesce()
1122 adapter->coal_conf->coalMode = VMXNET3_COALESCE_RBC; in vmxnet3_set_coalesce()
1123 adapter->coal_conf->coalPara.coalRbc.rbc_rate = rbc_rate; in vmxnet3_set_coalesce()
1127 if (ec->use_adaptive_rx_coalesce != 0) { in vmxnet3_set_coalesce()
1128 if ((ec->rx_coalesce_usecs != 0) || in vmxnet3_set_coalesce()
1129 (ec->tx_max_coalesced_frames != 0) || in vmxnet3_set_coalesce()
1130 (ec->rx_max_coalesced_frames != 0)) { in vmxnet3_set_coalesce()
1131 return -EINVAL; in vmxnet3_set_coalesce()
1133 memset(adapter->coal_conf, 0, sizeof(*adapter->coal_conf)); in vmxnet3_set_coalesce()
1134 adapter->coal_conf->coalMode = VMXNET3_COALESCE_ADAPT; in vmxnet3_set_coalesce()
1138 if ((ec->tx_max_coalesced_frames != 0) || in vmxnet3_set_coalesce()
1139 (ec->rx_max_coalesced_frames != 0)) { in vmxnet3_set_coalesce()
1140 if ((ec->rx_coalesce_usecs != 0) || in vmxnet3_set_coalesce()
1141 (ec->use_adaptive_rx_coalesce != 0)) { in vmxnet3_set_coalesce()
1142 return -EINVAL; in vmxnet3_set_coalesce()
1145 if ((ec->tx_max_coalesced_frames > in vmxnet3_set_coalesce()
1147 (ec->rx_max_coalesced_frames > in vmxnet3_set_coalesce()
1149 return -EINVAL; in vmxnet3_set_coalesce()
1152 memset(adapter->coal_conf, 0, sizeof(*adapter->coal_conf)); in vmxnet3_set_coalesce()
1153 adapter->coal_conf->coalMode = VMXNET3_COALESCE_STATIC; in vmxnet3_set_coalesce()
1155 adapter->coal_conf->coalPara.coalStatic.tx_comp_depth = in vmxnet3_set_coalesce()
1156 (ec->tx_max_coalesced_frames ? in vmxnet3_set_coalesce()
1157 ec->tx_max_coalesced_frames : in vmxnet3_set_coalesce()
1160 adapter->coal_conf->coalPara.coalStatic.rx_depth = in vmxnet3_set_coalesce()
1161 (ec->rx_max_coalesced_frames ? in vmxnet3_set_coalesce()
1162 ec->rx_max_coalesced_frames : in vmxnet3_set_coalesce()
1165 adapter->coal_conf->coalPara.coalStatic.tx_depth = in vmxnet3_set_coalesce()
1171 adapter->default_coal_mode = false; in vmxnet3_set_coalesce()
1173 spin_lock_irqsave(&adapter->cmd_lock, flags); in vmxnet3_set_coalesce()
1174 cmdInfo->varConf.confVer = 1; in vmxnet3_set_coalesce()
1175 cmdInfo->varConf.confLen = in vmxnet3_set_coalesce()
1176 cpu_to_le32(sizeof(*adapter->coal_conf)); in vmxnet3_set_coalesce()
1177 cmdInfo->varConf.confPA = cpu_to_le64(adapter->coal_conf_pa); in vmxnet3_set_coalesce()
1180 spin_unlock_irqrestore(&adapter->cmd_lock, flags); in vmxnet3_set_coalesce()
1215 netdev->ethtool_ops = &vmxnet3_ethtool_ops; in vmxnet3_set_ethtool_ops()