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);
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 *sa = dev->data->dev_private;
- struct sfc_rss *rss = &sa->rss;
+ struct sfc_adapter_shared *sas = sfc_adapter_shared_by_eth_dev(dev);
+ struct sfc_adapter *sa = sfc_adapter_by_eth_dev(dev);
+ struct sfc_rss *rss = &sas->rss;
uint64_t txq_offloads_def = 0;
sfc_log_init(sa, "entry");
uint64_t txq_offloads_def = 0;
sfc_log_init(sa, "entry");
- dev_info->rx_desc_lim.nb_max = EFX_RXQ_MAXNDESCS;
- dev_info->rx_desc_lim.nb_min = EFX_RXQ_MINNDESCS;
+ dev_info->rx_desc_lim.nb_max = sa->rxq_max_entries;
+ dev_info->rx_desc_lim.nb_min = sa->rxq_min_entries;
/* The RXQ hardware requires that the descriptor count is a power
* of 2, but rx_desc_lim cannot properly describe that constraint.
*/
/* The RXQ hardware requires that the descriptor count is a power
* of 2, but rx_desc_lim cannot properly describe that constraint.
*/
/*
* The TXQ hardware requires that the descriptor count is a power
* of 2, but tx_desc_lim cannot properly describe that constraint
*/
/*
* The TXQ hardware requires that the descriptor count is a power
* of 2, but tx_desc_lim cannot properly describe that constraint
*/
sfc_dev_supported_ptypes_get(struct rte_eth_dev *dev)
{
const struct sfc_adapter_priv *sap = sfc_adapter_priv_by_eth_dev(dev);
sfc_dev_supported_ptypes_get(struct rte_eth_dev *dev)
{
const struct sfc_adapter_priv *sap = sfc_adapter_priv_by_eth_dev(dev);
boolean_t allmulti = (mode == SFC_DEV_FILTER_MODE_ALLMULTI);
const char *desc = (allmulti) ? "all-multi" : "promiscuous";
boolean_t allmulti = (mode == SFC_DEV_FILTER_MODE_ALLMULTI);
const char *desc = (allmulti) ? "all-multi" : "promiscuous";
sfc_warn(sa, "isolated mode is active on the port");
sfc_warn(sa, "the change is to be applied on the next "
"start provided that isolated mode is "
sfc_warn(sa, "isolated mode is active on the port");
sfc_warn(sa, "the change is to be applied on the next "
"start provided that isolated mode is "
const struct rte_eth_rxconf *rx_conf,
struct rte_mempool *mb_pool)
{
const struct rte_eth_rxconf *rx_conf,
struct rte_mempool *mb_pool)
{
uint16_t nb_tx_desc, unsigned int socket_id,
const struct rte_eth_txconf *tx_conf)
{
uint16_t nb_tx_desc, unsigned int socket_id,
const struct rte_eth_txconf *tx_conf)
{
int rc;
sfc_log_init(sa, "TxQ = %u, nb_tx_desc = %u, socket_id = %u",
int rc;
sfc_log_init(sa, "TxQ = %u, nb_tx_desc = %u, socket_id = %u",
sfc_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
unsigned int xstats_count)
{
sfc_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
unsigned int xstats_count)
{
struct rte_eth_xstat_name *xstats_names,
unsigned int xstats_count)
{
struct rte_eth_xstat_name *xstats_names,
unsigned int xstats_count)
{
sfc_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
uint64_t *values, unsigned int n)
{
sfc_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
uint64_t *values, unsigned int n)
{
struct rte_eth_xstat_name *xstats_names,
const uint64_t *ids, unsigned int size)
{
struct rte_eth_xstat_name *xstats_names,
const uint64_t *ids, unsigned int size)
{
struct sfc_port *port = &sa->port;
unsigned int nb_supported = 0;
unsigned int nb_written = 0;
struct sfc_port *port = &sa->port;
unsigned int nb_supported = 0;
unsigned int nb_written = 0;
unsigned int wanted_fc, link_fc;
memset(fc_conf, 0, sizeof(*fc_conf));
unsigned int wanted_fc, link_fc;
memset(fc_conf, 0, sizeof(*fc_conf));
const efx_nic_cfg_t *encp = efx_nic_cfg_get(sa->nic);
struct sfc_port *port = &sa->port;
struct ether_addr *old_addr = &dev->data->mac_addrs[0];
const efx_nic_cfg_t *encp = efx_nic_cfg_get(sa->nic);
struct sfc_port *port = &sa->port;
struct ether_addr *old_addr = &dev->data->mac_addrs[0];
sfc_warn(sa, "isolated mode is active on the port");
sfc_warn(sa, "will not set MAC address");
goto unlock;
sfc_warn(sa, "isolated mode is active on the port");
sfc_warn(sa, "will not set MAC address");
goto unlock;
sfc_err(sa, "isolated mode is active on the port");
sfc_err(sa, "will not set multicast address list");
return -ENOTSUP;
sfc_err(sa, "isolated mode is active on the port");
sfc_err(sa, "will not set multicast address list");
return -ENOTSUP;
sfc_rx_queue_info_get(struct rte_eth_dev *dev, uint16_t rx_queue_id,
struct rte_eth_rxq_info *qinfo)
{
sfc_rx_queue_info_get(struct rte_eth_dev *dev, uint16_t rx_queue_id,
struct rte_eth_rxq_info *qinfo)
{
sfc_tx_queue_info_get(struct rte_eth_dev *dev, uint16_t tx_queue_id,
struct rte_eth_txq_info *qinfo)
{
sfc_tx_queue_info_get(struct rte_eth_dev *dev, uint16_t tx_queue_id,
struct rte_eth_txq_info *qinfo)
{
qinfo->conf.tx_free_thresh = txq_info->free_thresh;
qinfo->conf.tx_deferred_start = txq_info->deferred_start;
qinfo->nb_desc = txq_info->entries;
qinfo->conf.tx_free_thresh = txq_info->free_thresh;
qinfo->conf.tx_deferred_start = txq_info->deferred_start;
qinfo->nb_desc = txq_info->entries;
sfc_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id)
{
const struct sfc_adapter_priv *sap = sfc_adapter_priv_by_eth_dev(dev);
sfc_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id)
{
const struct sfc_adapter_priv *sap = sfc_adapter_priv_by_eth_dev(dev);
sfc_log_init(sa, "RxQ=%u", rx_queue_id);
sfc_adapter_lock(sa);
sfc_rx_qstop(sa, rx_queue_id);
sfc_log_init(sa, "RxQ=%u", rx_queue_id);
sfc_adapter_lock(sa);
sfc_rx_qstop(sa, rx_queue_id);
struct rte_eth_udp_tunnel *tunnel_udp,
enum sfc_udp_tunnel_op_e op)
{
struct rte_eth_udp_tunnel *tunnel_udp,
enum sfc_udp_tunnel_op_e op)
{
static int
sfc_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
struct rte_eth_rss_conf *rss_conf)
{
static int
sfc_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
struct rte_eth_rss_conf *rss_conf)
{
/*
* Mapping of hash configuration between RTE and EFX is not one-to-one,
* hence, conversion is done here to derive a correct set of ETH_RSS
* flags which corresponds to the active EFX configuration stored
* locally in 'sfc_adapter' and kept up-to-date
*/
/*
* Mapping of hash configuration between RTE and EFX is not one-to-one,
* hence, conversion is done here to derive a correct set of ETH_RSS
* flags which corresponds to the active EFX configuration stored
* locally in 'sfc_adapter' and kept up-to-date
*/
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);
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);
sfc_dev_rss_hash_update(struct rte_eth_dev *dev,
struct rte_eth_rss_conf *rss_conf)
{
sfc_dev_rss_hash_update(struct rte_eth_dev *dev,
struct rte_eth_rss_conf *rss_conf)
{
- struct sfc_adapter *sa = dev->data->dev_private;
- struct sfc_rss *rss = &sa->rss;
- struct sfc_port *port = &sa->port;
+ struct sfc_adapter *sa = sfc_adapter_by_eth_dev(dev);
+ struct sfc_rss *rss = &sfc_sa2shared(sa)->rss;
static int
sfc_dev_rss_reta_query(struct rte_eth_dev *dev,
struct rte_eth_rss_reta_entry64 *reta_conf,
uint16_t reta_size)
{
static int
sfc_dev_rss_reta_query(struct rte_eth_dev *dev,
struct rte_eth_rss_reta_entry64 *reta_conf,
uint16_t reta_size)
{
- struct sfc_adapter *sa = dev->data->dev_private;
- struct sfc_rss *rss = &sa->rss;
- struct sfc_port *port = &sa->port;
+ struct sfc_adapter_shared *sas = sfc_adapter_shared_by_eth_dev(dev);
+ struct sfc_rss *rss = &sas->rss;
for (entry = 0; entry < reta_size; entry++) {
int grp = entry / RTE_RETA_GROUP_SIZE;
int grp_idx = entry % RTE_RETA_GROUP_SIZE;
for (entry = 0; entry < reta_size; entry++) {
int grp = entry / RTE_RETA_GROUP_SIZE;
int grp_idx = entry % RTE_RETA_GROUP_SIZE;
- struct sfc_adapter *sa = dev->data->dev_private;
- struct sfc_rss *rss = &sa->rss;
- struct sfc_port *port = &sa->port;
+ struct sfc_adapter *sa = sfc_adapter_by_eth_dev(dev);
+ struct sfc_rss *rss = &sfc_sa2shared(sa)->rss;
const struct sfc_dp_rx *dp_rx;
const struct sfc_dp_tx *dp_tx;
const efx_nic_cfg_t *encp;
const struct sfc_dp_rx *dp_rx;
const struct sfc_dp_tx *dp_tx;
const efx_nic_cfg_t *encp;
rc = sfc_kvargs_process(sa, SFC_KVARG_TX_DATAPATH,
sfc_kvarg_string_handler, &tx_name);
rc = sfc_kvargs_process(sa, SFC_KVARG_TX_DATAPATH,
sfc_kvarg_string_handler, &tx_name);
.rx_queue_count = sfc_rx_queue_count,
.rx_descriptor_done = sfc_rx_descriptor_done,
.rx_descriptor_status = sfc_rx_descriptor_status,
.tx_descriptor_status = sfc_tx_descriptor_status,
.rx_queue_count = sfc_rx_queue_count,
.rx_descriptor_done = sfc_rx_descriptor_done,
.rx_descriptor_status = sfc_rx_descriptor_status,
.tx_descriptor_status = sfc_tx_descriptor_status,
.rxq_info_get = sfc_rx_queue_info_get,
.txq_info_get = sfc_tx_queue_info_get,
};
.rxq_info_get = sfc_rx_queue_info_get,
.txq_info_get = sfc_tx_queue_info_get,
};
- /*
- * Device private data has really many process-local pointers.
- * Below code should be extremely careful to use data located
- * in shared memory only.
- */
- struct sfc_adapter *sa = dev->data->dev_private;
+ struct sfc_adapter_shared *sas = sfc_adapter_shared_by_eth_dev(dev);
struct sfc_adapter_priv *sap;
const struct sfc_dp_rx *dp_rx;
const struct sfc_dp_tx *dp_tx;
struct sfc_adapter_priv *sap;
const struct sfc_dp_rx *dp_rx;
const struct sfc_dp_tx *dp_tx;
- SFC_LOG(sa, RTE_LOG_ERR, logtype_main,
- "cannot find %s Rx datapath", sa->dp_rx_name);
+ SFC_LOG(sas, RTE_LOG_ERR, logtype_main,
+ "cannot find %s Rx datapath", sas->dp_rx_name);
- SFC_LOG(sa, RTE_LOG_ERR, logtype_main,
+ SFC_LOG(sas, RTE_LOG_ERR, logtype_main,
- SFC_LOG(sa, RTE_LOG_ERR, logtype_main,
- "cannot find %s Tx datapath", sa->dp_tx_name);
+ SFC_LOG(sas, RTE_LOG_ERR, logtype_main,
+ "cannot find %s Tx datapath", sas->dp_tx_name);
- SFC_LOG(sa, RTE_LOG_ERR, logtype_main,
+ SFC_LOG(sas, RTE_LOG_ERR, logtype_main,
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
return -sfc_eth_dev_secondary_init(dev, logtype_main);
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
return -sfc_eth_dev_secondary_init(dev, logtype_main);
- * sfc_adapter is a mixture of shared and process private data.
- * During transition period use it in both kinds. When the
- * driver becomes ready to separate it, sfc_adapter will become
- * primary process private only.
+ * Allocate process private data from heap, since it should not
+ * be located in shared memory allocated using rte_malloc() API.
fail_kvargs_parse:
sfc_log_init(sa, "failed %d", rc);
dev->process_private = NULL;
fail_kvargs_parse:
sfc_log_init(sa, "failed %d", rc);
dev->process_private = NULL;
struct rte_pci_device *pci_dev)
{
return rte_eth_dev_pci_generic_probe(pci_dev,
struct rte_pci_device *pci_dev)
{
return rte_eth_dev_pci_generic_probe(pci_dev,