Lines Matching +full:port +full:- +full:number

7  * Copyright (c) 2003-2008 Cavium Networks
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
44 * - PKO indexes are no longer stored in the FAU. A large
48 * - The PKO <b>use_locking</b> parameter can now have a global
52 * - PKO 3 word commands are now supported. Use
60 #include <asm/octeon/cvmx-fpa.h>
61 #include <asm/octeon/cvmx-pow.h>
62 #include <asm/octeon/cvmx-cmd-queue.h>
63 #include <asm/octeon/cvmx-pko-defs.h>
136 /* The ID of the device on the non-coherent bus */
143 * The hardware likes to have the output port in
146 uint64_t port:6; member
148 * The output queue to send the packet to (0-127 are
157 uint64_t port:9;
176 * The size of the reg1 operation - could be 8, 16,
181 * The size of the reg0 operation - could be 8, 16,
192 * non-zero.
197 /* The register, subtract will be done if reg0 is non-zero */
222 * If ipoffp1 is non zero, (ipoffp1-1) is the number
238 * The total number of segs in the packet, if gather
265 /* CSR typedefs have been moved to cvmx-csr-*.h */
299 * Configure a output port and the associated queues for use.
301 * @port: Port to configure.
302 * @base_queue: First queue number to associate with this port.
303 * @num_queues: Number of queues t oassociate with this port
305 * allowed to be 1-8. A value of 8 get 8 times the traffic
309 extern cvmx_pko_status_t cvmx_pko_config_port(uint64_t port,
320 * @port: Port the packet is for
324 static inline void cvmx_pko_doorbell(uint64_t port, uint64_t queue, in cvmx_pko_doorbell() argument
333 ptr.s.port = port; in cvmx_pko_doorbell()
349 * and must be called with the same port/queue/use_locking arguments.
353 * - CVMX_PKO_LOCK_NONE
354 * - PKO doesn't do any locking. It is the responsibility
357 * - CVMX_PKO_LOCK_ATOMIC_TAG
358 * - PKO performs an atomic tagswitch to insure exclusive
361 * - CVMX_PKO_LOCK_CMD_QUEUE
362 * - PKO uses the common command queue locks to insure
370 * @port: Port to send it on
376 static inline void cvmx_pko_send_packet_prepare(uint64_t port, uint64_t queue, in cvmx_pko_send_packet_prepare() argument
388 * which these fake values can be used - this is not a in cvmx_pko_send_packet_prepare()
406 * @port: Port to send it on
418 uint64_t port, in cvmx_pko_send_packet_finish() argument
431 cvmx_pko_doorbell(port, queue, 2); in cvmx_pko_send_packet_finish()
447 * @port: Port to send it on
461 uint64_t port, in cvmx_pko_send_packet_finish3() argument
475 cvmx_pko_doorbell(port, queue, 3); in cvmx_pko_send_packet_finish3()
486 * Return the pko output queue associated with a port and a specific core.
490 * @port: Port number
493 * Returns Core-specific output queue
495 static inline int cvmx_pko_get_base_queue_per_core(int port, int core) in cvmx_pko_get_base_queue_per_core() argument
504 if (port < CVMX_PKO_MAX_PORTS_INTERFACE0) in cvmx_pko_get_base_queue_per_core()
505 return port * CVMX_PKO_QUEUES_PER_PORT_INTERFACE0 + core; in cvmx_pko_get_base_queue_per_core()
506 else if (port >= 16 && port < 16 + CVMX_PKO_MAX_PORTS_INTERFACE1) in cvmx_pko_get_base_queue_per_core()
508 CVMX_PKO_QUEUES_PER_PORT_INTERFACE0 + (port - in cvmx_pko_get_base_queue_per_core()
511 else if ((port >= 32) && (port < 36)) in cvmx_pko_get_base_queue_per_core()
515 CVMX_PKO_QUEUES_PER_PORT_INTERFACE1 + (port - in cvmx_pko_get_base_queue_per_core()
518 else if ((port >= 36) && (port < 40)) in cvmx_pko_get_base_queue_per_core()
523 4 * CVMX_PKO_QUEUES_PER_PORT_PCI + (port - in cvmx_pko_get_base_queue_per_core()
527 /* Given the limit on the number of ports we can map to in cvmx_pko_get_base_queue_per_core()
530 * are assigned an illegal queue number */ in cvmx_pko_get_base_queue_per_core()
535 * For a given port number, return the base pko output queue
536 * for the port.
538 * @port: Port number
541 static inline int cvmx_pko_get_base_queue(int port) in cvmx_pko_get_base_queue() argument
544 return port; in cvmx_pko_get_base_queue()
546 return cvmx_pko_get_base_queue_per_core(port, 0); in cvmx_pko_get_base_queue()
550 * For a given port number, return the number of pko output queues.
552 * @port: Port number
553 * Returns Number of output queues
555 static inline int cvmx_pko_get_num_queues(int port) in cvmx_pko_get_num_queues() argument
557 if (port < 16) in cvmx_pko_get_num_queues()
559 else if (port < 32) in cvmx_pko_get_num_queues()
561 else if (port < 36) in cvmx_pko_get_num_queues()
563 else if (port < 40) in cvmx_pko_get_num_queues()
570 * Get the status counters for a port.
572 * @port_num: Port number to get statistics for.
588 status->packets = pko_mem_count0.s.count; in cvmx_pko_get_port_status()
595 status->octets = pko_mem_count1.s.count; in cvmx_pko_get_port_status()
606 status->doorbell = debug9.cn38xx.doorbell; in cvmx_pko_get_port_status()
612 status->doorbell = debug8.cn50xx.doorbell; in cvmx_pko_get_port_status()
617 * Rate limit a PKO port to a max packets/sec. This function is only
620 * @port: Port to rate limit
622 * @burst: Maximum number of packets to burst in a row before rate
627 extern int cvmx_pko_rate_limit_packets(int port, int packets_s, int burst);
630 * Rate limit a PKO port to a max bits/sec. This function is only
633 * @port: Port to rate limit
635 * @burst: Maximum number of bits to burst before rate
640 extern int cvmx_pko_rate_limit_bits(int port, uint64_t bits_s, int burst);