mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
Grow sc_nrxfqs from 1 to the CPU total, and hash the RX 5-tuple across the range with the KG driver from the prior commit. Each FQ lands on its own per-CPU QMan channel, so a given core drains only its own share of RX work and gets frame annotation + data-head stashed into its cache. * Add alignment parameter to qman_alloc_fqid_range() to meet KeyGen requirements. * Initialize 1 frame queue (FQ) per CPU in dpaa_eth_fm_port_rx_init(), using a 5-tuple to spread the load across CPUs. * Channel ownership for TX confirms moved from rx_init/free to tx_init/free -- sc_rx_channel is now a TX-confirm-only per-port pool channel. Fallbacks/degradation: * If any per-CPU channel is -1 (no portal attached) the port fails to attach with a clear message. * If the FQID range can't be allocated aligned, the port fails attach. * If KG scheme allocation fails at port setup, the port keeps its N FQs but only FQ #0 sees traffic.
42 lines
983 B
C
42 lines
983 B
C
/*
|
|
* Copyright (c) 2026 Justin Hibbits
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#ifndef DPAA_FMAN_PORT_H
|
|
#define DPAA_FMAN_PORT_H
|
|
|
|
#define FMAN_PORT_MAX_POOLS 4
|
|
struct fman_port_buffer_pool {
|
|
uint8_t bpid;
|
|
uint16_t size;
|
|
};
|
|
|
|
struct fman_port_params {
|
|
uint32_t dflt_fqid; /* Must not be 0 */
|
|
uint32_t err_fqid;
|
|
union {
|
|
struct {
|
|
int num_pools;
|
|
struct fman_port_buffer_pool bpools[FMAN_PORT_MAX_POOLS];
|
|
} rx_params;
|
|
struct {
|
|
} tx_params;
|
|
};
|
|
};
|
|
|
|
int fman_port_get_id(device_t dev);
|
|
|
|
/*
|
|
* Runtime toggle for the RX port's parser->KeyGen routing. Default
|
|
* (RX-init time) is parser->BMI-enqueue with no KG involvement; a
|
|
* consumer flips this to true only *after* successfully binding a
|
|
* KG scheme via fman_kg_alloc_hash_scheme(). Routing to KG with no
|
|
* bound scheme drops the port's Rx traffic on the floor. Only valid
|
|
* on FMAN_PORT_TYPE_RX devices; no-op / undefined on TX/OH.
|
|
*/
|
|
void fman_port_rx_use_kg(device_t rx_port, bool enable);
|
|
|
|
#endif
|