Lines Matching +full:queue +full:- +full:rx

1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (C) 2021 Gerhard Engleder <gerhard@engleder-embedded.com> */
83 strscpy(drvinfo->driver, TSNEP, sizeof(drvinfo->driver)); in tsnep_ethtool_get_drvinfo()
84 strscpy(drvinfo->bus_info, dev_name(&adapter->pdev->dev), in tsnep_ethtool_get_drvinfo()
85 sizeof(drvinfo->bus_info)); in tsnep_ethtool_get_drvinfo()
96 /* first queue pair is within TSNEP_MAC_SIZE, only queues additional to in tsnep_ethtool_get_regs_len()
97 * the first queue pair extend the register length by TSNEP_QUEUE_SIZE in tsnep_ethtool_get_regs_len()
100 max(adapter->num_tx_queues, adapter->num_rx_queues) - 1; in tsnep_ethtool_get_regs_len()
112 regs->version = 1; in tsnep_ethtool_get_regs()
114 memcpy_fromio(p, adapter->addr, regs->len); in tsnep_ethtool_get_regs()
121 return adapter->msg_enable; in tsnep_ethtool_get_msglevel()
128 adapter->msg_enable = data; in tsnep_ethtool_set_msglevel()
135 int rx_count = adapter->num_rx_queues; in tsnep_ethtool_get_strings()
136 int tx_count = adapter->num_tx_queues; in tsnep_ethtool_get_strings()
171 int rx_count = adapter->num_rx_queues; in tsnep_ethtool_get_ethtool_stats()
172 int tx_count = adapter->num_tx_queues; in tsnep_ethtool_get_ethtool_stats()
180 for (i = 0; i < adapter->num_rx_queues; i++) { in tsnep_ethtool_get_ethtool_stats()
181 tsnep_stats.rx_packets += adapter->rx[i].packets; in tsnep_ethtool_get_ethtool_stats()
182 tsnep_stats.rx_bytes += adapter->rx[i].bytes; in tsnep_ethtool_get_ethtool_stats()
183 tsnep_stats.rx_dropped += adapter->rx[i].dropped; in tsnep_ethtool_get_ethtool_stats()
184 tsnep_stats.rx_multicast += adapter->rx[i].multicast; in tsnep_ethtool_get_ethtool_stats()
185 tsnep_stats.rx_alloc_failed += adapter->rx[i].alloc_failed; in tsnep_ethtool_get_ethtool_stats()
187 reg = ioread32(adapter->addr + ECM_STAT); in tsnep_ethtool_get_ethtool_stats()
194 for (i = 0; i < adapter->num_tx_queues; i++) { in tsnep_ethtool_get_ethtool_stats()
195 tsnep_stats.tx_packets += adapter->tx[i].packets; in tsnep_ethtool_get_ethtool_stats()
196 tsnep_stats.tx_bytes += adapter->tx[i].bytes; in tsnep_ethtool_get_ethtool_stats()
197 tsnep_stats.tx_dropped += adapter->tx[i].dropped; in tsnep_ethtool_get_ethtool_stats()
204 tsnep_rx_queue_stats.rx_packets = adapter->rx[i].packets; in tsnep_ethtool_get_ethtool_stats()
205 tsnep_rx_queue_stats.rx_bytes = adapter->rx[i].bytes; in tsnep_ethtool_get_ethtool_stats()
206 tsnep_rx_queue_stats.rx_dropped = adapter->rx[i].dropped; in tsnep_ethtool_get_ethtool_stats()
207 tsnep_rx_queue_stats.rx_multicast = adapter->rx[i].multicast; in tsnep_ethtool_get_ethtool_stats()
209 adapter->rx[i].alloc_failed; in tsnep_ethtool_get_ethtool_stats()
210 reg = ioread32(adapter->addr + TSNEP_QUEUE(i) + in tsnep_ethtool_get_ethtool_stats()
231 tsnep_tx_queue_stats.tx_packets += adapter->tx[i].packets; in tsnep_ethtool_get_ethtool_stats()
232 tsnep_tx_queue_stats.tx_bytes += adapter->tx[i].bytes; in tsnep_ethtool_get_ethtool_stats()
233 tsnep_tx_queue_stats.tx_dropped += adapter->tx[i].dropped; in tsnep_ethtool_get_ethtool_stats()
248 rx_count = adapter->num_rx_queues; in tsnep_ethtool_get_sset_count()
249 tx_count = adapter->num_tx_queues; in tsnep_ethtool_get_sset_count()
256 return -EOPNOTSUPP; in tsnep_ethtool_get_sset_count()
265 switch (cmd->cmd) { in tsnep_ethtool_get_rxnfc()
267 cmd->data = adapter->num_rx_queues; in tsnep_ethtool_get_rxnfc()
270 cmd->rule_cnt = adapter->rxnfc_count; in tsnep_ethtool_get_rxnfc()
271 cmd->data = adapter->rxnfc_max; in tsnep_ethtool_get_rxnfc()
272 cmd->data |= RX_CLS_LOC_SPECIAL; in tsnep_ethtool_get_rxnfc()
279 return -EOPNOTSUPP; in tsnep_ethtool_get_rxnfc()
288 switch (cmd->cmd) { in tsnep_ethtool_set_rxnfc()
294 return -EOPNOTSUPP; in tsnep_ethtool_set_rxnfc()
303 ch->max_combined = adapter->num_queues; in tsnep_ethtool_get_channels()
304 ch->combined_count = adapter->num_queues; in tsnep_ethtool_get_channels()
312 info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE | in tsnep_ethtool_get_ts_info()
317 if (adapter->ptp_clock) in tsnep_ethtool_get_ts_info()
318 info->phc_index = ptp_clock_index(adapter->ptp_clock); in tsnep_ethtool_get_ts_info()
320 info->tx_types = BIT(HWTSTAMP_TX_OFF) | in tsnep_ethtool_get_ts_info()
322 info->rx_filters = BIT(HWTSTAMP_FILTER_NONE) | in tsnep_ethtool_get_ts_info()
333 for (i = 0; i < adapter->num_queues; i++) { in tsnep_get_queue_with_tx()
334 if (adapter->queue[i].tx) { in tsnep_get_queue_with_tx()
336 return &adapter->queue[i]; in tsnep_get_queue_with_tx()
338 index--; in tsnep_get_queue_with_tx()
350 for (i = 0; i < adapter->num_queues; i++) { in tsnep_get_queue_with_rx()
351 if (adapter->queue[i].rx) { in tsnep_get_queue_with_rx()
353 return &adapter->queue[i]; in tsnep_get_queue_with_rx()
355 index--; in tsnep_get_queue_with_rx()
368 struct tsnep_queue *queue; in tsnep_ethtool_get_coalesce() local
370 queue = tsnep_get_queue_with_rx(adapter, 0); in tsnep_ethtool_get_coalesce()
371 if (queue) in tsnep_ethtool_get_coalesce()
372 ec->rx_coalesce_usecs = tsnep_get_irq_coalesce(queue); in tsnep_ethtool_get_coalesce()
374 queue = tsnep_get_queue_with_tx(adapter, 0); in tsnep_ethtool_get_coalesce()
375 if (queue) in tsnep_ethtool_get_coalesce()
376 ec->tx_coalesce_usecs = tsnep_get_irq_coalesce(queue); in tsnep_ethtool_get_coalesce()
390 for (i = 0; i < adapter->num_queues; i++) { in tsnep_ethtool_set_coalesce()
391 /* RX coalesce has priority for queues with TX and RX */ in tsnep_ethtool_set_coalesce()
392 if (adapter->queue[i].rx) in tsnep_ethtool_set_coalesce()
393 retval = tsnep_set_irq_coalesce(&adapter->queue[i], in tsnep_ethtool_set_coalesce()
394 ec->rx_coalesce_usecs); in tsnep_ethtool_set_coalesce()
396 retval = tsnep_set_irq_coalesce(&adapter->queue[i], in tsnep_ethtool_set_coalesce()
397 ec->tx_coalesce_usecs); in tsnep_ethtool_set_coalesce()
406 u32 queue, in tsnep_ethtool_get_per_queue_coalesce() argument
413 if (queue >= max(adapter->num_tx_queues, adapter->num_rx_queues)) in tsnep_ethtool_get_per_queue_coalesce()
414 return -EINVAL; in tsnep_ethtool_get_per_queue_coalesce()
416 queue_with_rx = tsnep_get_queue_with_rx(adapter, queue); in tsnep_ethtool_get_per_queue_coalesce()
418 ec->rx_coalesce_usecs = tsnep_get_irq_coalesce(queue_with_rx); in tsnep_ethtool_get_per_queue_coalesce()
420 queue_with_tx = tsnep_get_queue_with_tx(adapter, queue); in tsnep_ethtool_get_per_queue_coalesce()
422 ec->tx_coalesce_usecs = tsnep_get_irq_coalesce(queue_with_tx); in tsnep_ethtool_get_per_queue_coalesce()
428 u32 queue, in tsnep_ethtool_set_per_queue_coalesce() argument
436 if (queue >= max(adapter->num_tx_queues, adapter->num_rx_queues)) in tsnep_ethtool_set_per_queue_coalesce()
437 return -EINVAL; in tsnep_ethtool_set_per_queue_coalesce()
439 queue_with_rx = tsnep_get_queue_with_rx(adapter, queue); in tsnep_ethtool_set_per_queue_coalesce()
441 retval = tsnep_set_irq_coalesce(queue_with_rx, ec->rx_coalesce_usecs); in tsnep_ethtool_set_per_queue_coalesce()
446 /* RX coalesce has priority for queues with TX and RX */ in tsnep_ethtool_set_per_queue_coalesce()
447 queue_with_tx = tsnep_get_queue_with_tx(adapter, queue); in tsnep_ethtool_set_per_queue_coalesce()
448 if (queue_with_tx && !queue_with_tx->rx) { in tsnep_ethtool_set_per_queue_coalesce()
449 retval = tsnep_set_irq_coalesce(queue_with_tx, ec->tx_coalesce_usecs); in tsnep_ethtool_set_per_queue_coalesce()