RSS get requests are supported in secondary process.
Prepare to make sfc_adapter primary process private data.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
static int
sfc_rss_attach(struct sfc_adapter *sa)
{
- struct sfc_rss *rss = &sa->rss;
+ struct sfc_rss *rss = &sfc_sa2shared(sa)->rss;
int rc;
rc = efx_intr_init(sa->nic, sa->intr.type, NULL);
unsigned int txq_count;
struct sfc_txq_info *txq_info;
+ struct sfc_rss rss;
+
struct rte_pci_addr pci_addr;
uint16_t port_id;
boolean_t tso;
uint32_t rxd_wait_timeout_ns;
-
- struct sfc_rss rss;
};
static inline struct sfc_adapter_shared *
sfc_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
{
const struct sfc_adapter_priv *sap = sfc_adapter_priv_by_eth_dev(dev);
+ struct sfc_adapter_shared *sas = sfc_adapter_shared_by_eth_dev(dev);
struct sfc_adapter *sa = dev->data->dev_private;
- struct sfc_rss *rss = &sa->rss;
+ struct sfc_rss *rss = &sas->rss;
uint64_t txq_offloads_def = 0;
sfc_log_init(sa, "entry");
sfc_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
struct rte_eth_rss_conf *rss_conf)
{
+ struct sfc_adapter_shared *sas = sfc_adapter_shared_by_eth_dev(dev);
struct sfc_adapter *sa = dev->data->dev_private;
- struct sfc_rss *rss = &sa->rss;
+ struct sfc_rss *rss = &sas->rss;
if (rss->context_type != EFX_RX_SCALE_EXCLUSIVE)
return -ENOTSUP;
* flags which corresponds to the active EFX configuration stored
* locally in 'sfc_adapter' and kept up-to-date
*/
- rss_conf->rss_hf = sfc_rx_hf_efx_to_rte(sa, rss->hash_types);
+ rss_conf->rss_hf = sfc_rx_hf_efx_to_rte(rss, rss->hash_types);
rss_conf->rss_key_len = EFX_RSS_KEY_SIZE;
if (rss_conf->rss_key != NULL)
rte_memcpy(rss_conf->rss_key, rss->key, EFX_RSS_KEY_SIZE);
struct rte_eth_rss_conf *rss_conf)
{
struct sfc_adapter *sa = dev->data->dev_private;
- struct sfc_rss *rss = &sa->rss;
+ struct sfc_rss *rss = &sfc_sa2shared(sa)->rss;
struct sfc_port *port = &sa->port;
unsigned int efx_hash_types;
int rc = 0;
struct rte_eth_rss_reta_entry64 *reta_conf,
uint16_t reta_size)
{
+ struct sfc_adapter_shared *sas = sfc_adapter_shared_by_eth_dev(dev);
struct sfc_adapter *sa = dev->data->dev_private;
- struct sfc_rss *rss = &sa->rss;
+ struct sfc_rss *rss = &sas->rss;
struct sfc_port *port = &sa->port;
int entry;
uint16_t reta_size)
{
struct sfc_adapter *sa = dev->data->dev_private;
- struct sfc_rss *rss = &sa->rss;
+ struct sfc_rss *rss = &sfc_sa2shared(sa)->rss;
struct sfc_port *port = &sa->port;
unsigned int *rss_tbl_new;
uint16_t entry;
const struct rte_flow_action_rss *action_rss,
struct rte_flow *flow)
{
- struct sfc_rss *rss = &sa->rss;
+ struct sfc_adapter_shared * const sas = sfc_sa2shared(sa);
+ struct sfc_rss *rss = &sas->rss;
unsigned int rxq_sw_index;
struct sfc_rxq *rxq;
unsigned int rxq_hw_index_min;
sfc_flow_filter_insert(struct sfc_adapter *sa,
struct rte_flow *flow)
{
- struct sfc_rss *rss = &sa->rss;
+ struct sfc_adapter_shared * const sas = sfc_sa2shared(sa);
+ struct sfc_rss *rss = &sas->rss;
struct sfc_flow_rss *flow_rss = &flow->rss_conf;
uint32_t efs_rss_context = EFX_RSS_CONTEXT_DEFAULT;
unsigned int i;
static int
sfc_rx_default_rxq_set_filter(struct sfc_adapter *sa, struct sfc_rxq *rxq)
{
- struct sfc_rss *rss = &sa->rss;
+ struct sfc_rss *rss = &sfc_sa2shared(sa)->rss;
boolean_t need_rss = (rss->channels > 0) ? B_TRUE : B_FALSE;
struct sfc_port *port = &sa->port;
int rc;
struct rte_mempool *mb_pool)
{
const efx_nic_cfg_t *encp = efx_nic_cfg_get(sa->nic);
- struct sfc_rss *rss = &sa->rss;
+ struct sfc_rss *rss = &sfc_sa2shared(sa)->rss;
int rc;
unsigned int rxq_entries;
unsigned int evq_entries;
int
sfc_rx_hash_init(struct sfc_adapter *sa)
{
- struct sfc_rss *rss = &sa->rss;
+ struct sfc_rss *rss = &sfc_sa2shared(sa)->rss;
const efx_nic_cfg_t *encp = efx_nic_cfg_get(sa->nic);
uint32_t alg_mask = encp->enc_rx_scale_hash_alg_mask;
efx_rx_hash_alg_t alg;
void
sfc_rx_hash_fini(struct sfc_adapter *sa)
{
- struct sfc_rss *rss = &sa->rss;
+ struct sfc_rss *rss = &sfc_sa2shared(sa)->rss;
rte_free(rss->hf_map);
}
sfc_rx_hf_rte_to_efx(struct sfc_adapter *sa, uint64_t rte,
efx_rx_hash_type_t *efx)
{
- struct sfc_rss *rss = &sa->rss;
+ struct sfc_rss *rss = &sfc_sa2shared(sa)->rss;
efx_rx_hash_type_t hash_types = 0;
unsigned int i;
}
uint64_t
-sfc_rx_hf_efx_to_rte(struct sfc_adapter *sa, efx_rx_hash_type_t efx)
+sfc_rx_hf_efx_to_rte(struct sfc_rss *rss, efx_rx_hash_type_t efx)
{
- struct sfc_rss *rss = &sa->rss;
uint64_t rte = 0;
unsigned int i;
sfc_rx_process_adv_conf_rss(struct sfc_adapter *sa,
struct rte_eth_rss_conf *conf)
{
- struct sfc_rss *rss = &sa->rss;
+ struct sfc_rss *rss = &sfc_sa2shared(sa)->rss;
efx_rx_hash_type_t efx_hash_types = rss->hash_types;
- uint64_t rss_hf = sfc_rx_hf_efx_to_rte(sa, efx_hash_types);
+ uint64_t rss_hf = sfc_rx_hf_efx_to_rte(rss, efx_hash_types);
int rc;
if (rss->context_type != EFX_RX_SCALE_EXCLUSIVE) {
static int
sfc_rx_rss_config(struct sfc_adapter *sa)
{
- struct sfc_rss *rss = &sa->rss;
+ struct sfc_rss *rss = &sfc_sa2shared(sa)->rss;
int rc = 0;
if (rss->channels > 0) {
static int
sfc_rx_check_mode(struct sfc_adapter *sa, struct rte_eth_rxmode *rxmode)
{
+ struct sfc_adapter_shared * const sas = sfc_sa2shared(sa);
uint64_t offloads_supported = sfc_rx_get_dev_offload_caps(sa) |
sfc_rx_get_queue_offload_caps(sa);
- struct sfc_rss *rss = &sa->rss;
+ struct sfc_rss *rss = &sas->rss;
int rc = 0;
switch (rxmode->mq_mode) {
sfc_rx_configure(struct sfc_adapter *sa)
{
struct sfc_adapter_shared * const sas = sfc_sa2shared(sa);
- struct sfc_rss *rss = &sa->rss;
+ struct sfc_rss *rss = &sas->rss;
struct rte_eth_conf *dev_conf = &sa->eth_dev->data->dev_conf;
const unsigned int nb_rx_queues = sa->eth_dev->data->nb_rx_queues;
int rc;
void
sfc_rx_close(struct sfc_adapter *sa)
{
- struct sfc_rss *rss = &sa->rss;
+ struct sfc_rss *rss = &sfc_sa2shared(sa)->rss;
sfc_rx_fini_queues(sa, 0);
void sfc_rx_hash_fini(struct sfc_adapter *sa);
int sfc_rx_hf_rte_to_efx(struct sfc_adapter *sa, uint64_t rte,
efx_rx_hash_type_t *efx);
-uint64_t sfc_rx_hf_efx_to_rte(struct sfc_adapter *sa,
- efx_rx_hash_type_t efx);
+uint64_t sfc_rx_hf_efx_to_rte(struct sfc_rss *rss, efx_rx_hash_type_t efx);
#ifdef __cplusplus
}