{
int ret;
struct dpaa2_dev_priv *priv = dev->data->dev_private;
- struct fsl_mc_io *dpni = priv->hw;
+ struct fsl_mc_io *dpni = dev->process_private;
PMD_INIT_FUNC_TRACE();
dpaa2_vlan_offload_set(struct rte_eth_dev *dev, int mask)
{
struct dpaa2_dev_priv *priv = dev->data->dev_private;
- struct fsl_mc_io *dpni = priv->hw;
+ struct fsl_mc_io *dpni = dev->process_private;
int ret;
PMD_INIT_FUNC_TRACE();
uint16_t tpid)
{
struct dpaa2_dev_priv *priv = dev->data->dev_private;
- struct fsl_mc_io *dpni = priv->hw;
+ struct fsl_mc_io *dpni = dev->process_private;
int ret = -ENOTSUP;
PMD_INIT_FUNC_TRACE();
size_t fw_size)
{
int ret;
- struct dpaa2_dev_priv *priv = dev->data->dev_private;
- struct fsl_mc_io *dpni = priv->hw;
+ struct fsl_mc_io *dpni = dev->process_private;
struct mc_soc_version mc_plat_info = {0};
struct mc_version mc_ver_info = {0};
dpaa2_eth_dev_configure(struct rte_eth_dev *dev)
{
struct dpaa2_dev_priv *priv = dev->data->dev_private;
- struct fsl_mc_io *dpni = priv->hw;
+ struct fsl_mc_io *dpni = dev->process_private;
struct rte_eth_conf *eth_conf = &dev->data->dev_conf;
uint64_t rx_offloads = eth_conf->rxmode.offloads;
uint64_t tx_offloads = eth_conf->txmode.offloads;
struct rte_mempool *mb_pool)
{
struct dpaa2_dev_priv *priv = dev->data->dev_private;
- struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw;
+ struct fsl_mc_io *dpni = (struct fsl_mc_io *)dev->process_private;
struct dpaa2_queue *dpaa2_q;
struct dpni_queue cfg;
uint8_t options = 0;
priv->tx_vq[tx_queue_id];
struct dpaa2_queue *dpaa2_tx_conf_q = (struct dpaa2_queue *)
priv->tx_conf_vq[tx_queue_id];
- struct fsl_mc_io *dpni = priv->hw;
+ struct fsl_mc_io *dpni = dev->process_private;
struct dpni_queue tx_conf_cfg;
struct dpni_queue tx_flow_cfg;
uint8_t options = 0, flow_id;
{
struct dpaa2_queue *dpaa2_q = (struct dpaa2_queue *)q;
struct dpaa2_dev_priv *priv = dpaa2_q->eth_data->dev_private;
- struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw;
+ struct fsl_mc_io *dpni =
+ (struct fsl_mc_io *)priv->eth_dev->process_private;
uint8_t options = 0;
int ret;
struct dpni_queue cfg;
{
struct rte_eth_dev *dev = param;
struct dpaa2_dev_priv *priv = dev->data->dev_private;
- struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw;
+ struct fsl_mc_io *dpni = (struct fsl_mc_io *)dev->process_private;
int ret;
int irq_index = DPNI_IRQ_INDEX;
unsigned int status = 0, clear = 0;
{
int err = 0;
struct dpaa2_dev_priv *priv = dev->data->dev_private;
- struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw;
+ struct fsl_mc_io *dpni = (struct fsl_mc_io *)dev->process_private;
int irq_index = DPNI_IRQ_INDEX;
unsigned int mask = DPNI_IRQ_EVENT_LINK_CHANGED;
struct rte_dpaa2_device *dpaa2_dev;
struct rte_eth_dev_data *data = dev->data;
struct dpaa2_dev_priv *priv = data->dev_private;
- struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw;
+ struct fsl_mc_io *dpni = (struct fsl_mc_io *)dev->process_private;
struct dpni_queue cfg;
struct dpni_error_cfg err_cfg;
uint16_t qdid;
dpaa2_dev_stop(struct rte_eth_dev *dev)
{
struct dpaa2_dev_priv *priv = dev->data->dev_private;
- struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw;
+ struct fsl_mc_io *dpni = (struct fsl_mc_io *)dev->process_private;
int ret;
struct rte_eth_link link;
struct rte_intr_handle *intr_handle = dev->intr_handle;
dpaa2_dev_close(struct rte_eth_dev *dev)
{
struct dpaa2_dev_priv *priv = dev->data->dev_private;
- struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw;
+ struct fsl_mc_io *dpni = (struct fsl_mc_io *)dev->process_private;
int ret;
struct rte_eth_link link;
{
int ret;
struct dpaa2_dev_priv *priv = dev->data->dev_private;
- struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw;
+ struct fsl_mc_io *dpni = (struct fsl_mc_io *)dev->process_private;
PMD_INIT_FUNC_TRACE();
{
int ret;
struct dpaa2_dev_priv *priv = dev->data->dev_private;
- struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw;
+ struct fsl_mc_io *dpni = (struct fsl_mc_io *)dev->process_private;
PMD_INIT_FUNC_TRACE();
{
int ret;
struct dpaa2_dev_priv *priv = dev->data->dev_private;
- struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw;
+ struct fsl_mc_io *dpni = (struct fsl_mc_io *)dev->process_private;
PMD_INIT_FUNC_TRACE();
{
int ret;
struct dpaa2_dev_priv *priv = dev->data->dev_private;
- struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw;
+ struct fsl_mc_io *dpni = (struct fsl_mc_io *)dev->process_private;
PMD_INIT_FUNC_TRACE();
{
int ret;
struct dpaa2_dev_priv *priv = dev->data->dev_private;
- struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw;
+ struct fsl_mc_io *dpni = (struct fsl_mc_io *)dev->process_private;
uint32_t frame_size = mtu + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN
+ VLAN_TAG_SIZE;
{
int ret;
struct dpaa2_dev_priv *priv = dev->data->dev_private;
- struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw;
+ struct fsl_mc_io *dpni = (struct fsl_mc_io *)dev->process_private;
PMD_INIT_FUNC_TRACE();
{
int ret;
struct dpaa2_dev_priv *priv = dev->data->dev_private;
- struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw;
+ struct fsl_mc_io *dpni = (struct fsl_mc_io *)dev->process_private;
struct rte_eth_dev_data *data = dev->data;
struct rte_ether_addr *macaddr;
{
int ret;
struct dpaa2_dev_priv *priv = dev->data->dev_private;
- struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw;
+ struct fsl_mc_io *dpni = (struct fsl_mc_io *)dev->process_private;
PMD_INIT_FUNC_TRACE();
struct rte_eth_stats *stats)
{
struct dpaa2_dev_priv *priv = dev->data->dev_private;
- struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw;
+ struct fsl_mc_io *dpni = (struct fsl_mc_io *)dev->process_private;
int32_t retcode;
uint8_t page0 = 0, page1 = 1, page2 = 2;
union dpni_statistics value;
unsigned int n)
{
struct dpaa2_dev_priv *priv = dev->data->dev_private;
- struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw;
+ struct fsl_mc_io *dpni = (struct fsl_mc_io *)dev->process_private;
int32_t retcode;
union dpni_statistics value[5] = {};
unsigned int i = 0, num = RTE_DIM(dpaa2_xstats_strings);
if (!ids) {
struct dpaa2_dev_priv *priv = dev->data->dev_private;
- struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw;
+ struct fsl_mc_io *dpni =
+ (struct fsl_mc_io *)dev->process_private;
int32_t retcode;
union dpni_statistics value[5] = {};
dpaa2_dev_stats_reset(struct rte_eth_dev *dev)
{
struct dpaa2_dev_priv *priv = dev->data->dev_private;
- struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw;
+ struct fsl_mc_io *dpni = (struct fsl_mc_io *)dev->process_private;
int retcode;
int i;
struct dpaa2_queue *dpaa2_q;
{
int ret;
struct dpaa2_dev_priv *priv = dev->data->dev_private;
- struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw;
+ struct fsl_mc_io *dpni = (struct fsl_mc_io *)dev->process_private;
struct rte_eth_link link;
struct dpni_link_state state = {0};
struct dpni_link_state state = {0};
priv = dev->data->dev_private;
- dpni = (struct fsl_mc_io *)priv->hw;
+ dpni = (struct fsl_mc_io *)dev->process_private;
if (dpni == NULL) {
DPAA2_PMD_ERR("dpni is NULL");
PMD_INIT_FUNC_TRACE();
priv = dev->data->dev_private;
- dpni = (struct fsl_mc_io *)priv->hw;
+ dpni = (struct fsl_mc_io *)dev->process_private;
if (dpni == NULL) {
DPAA2_PMD_ERR("Device has not yet been configured");
PMD_INIT_FUNC_TRACE();
priv = dev->data->dev_private;
- dpni = (struct fsl_mc_io *)priv->hw;
+ dpni = (struct fsl_mc_io *)dev->process_private;
if (dpni == NULL || fc_conf == NULL) {
DPAA2_PMD_ERR("device not configured");
PMD_INIT_FUNC_TRACE();
priv = dev->data->dev_private;
- dpni = (struct fsl_mc_io *)priv->hw;
+ dpni = (struct fsl_mc_io *)dev->process_private;
if (dpni == NULL) {
DPAA2_PMD_ERR("dpni is NULL");
const struct rte_event_eth_rx_adapter_queue_conf *queue_conf)
{
struct dpaa2_dev_priv *eth_priv = dev->data->dev_private;
- struct fsl_mc_io *dpni = (struct fsl_mc_io *)eth_priv->hw;
+ struct fsl_mc_io *dpni = (struct fsl_mc_io *)dev->process_private;
struct dpaa2_queue *dpaa2_ethq = eth_priv->rx_vq[eth_rx_queue_id];
uint8_t flow_id = dpaa2_ethq->flow_id;
struct dpni_queue cfg;
int eth_rx_queue_id)
{
struct dpaa2_dev_priv *eth_priv = dev->data->dev_private;
- struct fsl_mc_io *dpni = (struct fsl_mc_io *)eth_priv->hw;
+ struct fsl_mc_io *dpni = (struct fsl_mc_io *)dev->process_private;
struct dpaa2_queue *dpaa2_ethq = eth_priv->rx_vq[eth_rx_queue_id];
uint8_t flow_id = dpaa2_ethq->flow_id;
struct dpni_queue cfg;
PMD_INIT_FUNC_TRACE();
+ dpni_dev = rte_malloc(NULL, sizeof(struct fsl_mc_io), 0);
+ if (!dpni_dev) {
+ DPAA2_PMD_ERR("Memory allocation failed for dpni device");
+ return -1;
+ }
+ dpni_dev->regs = rte_mcp_ptr_list[0];
+ eth_dev->process_private = (void *)dpni_dev;
+
/* For secondary processes, the primary has done all the work */
if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
/* In case of secondary, only burst and ops API need to be
dpaa2_dev = container_of(dev, struct rte_dpaa2_device, device);
hw_id = dpaa2_dev->object_id;
-
- dpni_dev = rte_malloc(NULL, sizeof(struct fsl_mc_io), 0);
- if (!dpni_dev) {
- DPAA2_PMD_ERR("Memory allocation failed for dpni device");
- return -1;
- }
-
- dpni_dev->regs = rte_mcp_ptr_list[0];
ret = dpni_open(dpni_dev, CMD_PRI_LOW, hw_id, &priv->token);
if (ret) {
DPAA2_PMD_ERR(
dpaa2_dev_uninit(struct rte_eth_dev *eth_dev)
{
struct dpaa2_dev_priv *priv = eth_dev->data->dev_private;
- struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw;
+ struct fsl_mc_io *dpni = (struct fsl_mc_io *)eth_dev->process_private;
int i, ret;
PMD_INIT_FUNC_TRACE();
/* Free the allocated memory for ethernet private data and dpni*/
priv->hw = NULL;
+ eth_dev->process_private = NULL;
rte_free(dpni);
for (i = 0; i < MAX_TCS; i++) {
struct rte_dpaa2_device *dpaa2_dev)
{
struct rte_eth_dev *eth_dev;
- struct dpaa2_dev_priv *priv;
+ struct dpaa2_dev_priv *dev_priv;
int diag;
if ((DPAA2_MBUF_HW_ANNOTATION + DPAA2_FD_PTA_SIZE) >
eth_dev = rte_eth_dev_allocate(dpaa2_dev->device.name);
if (!eth_dev)
return -ENODEV;
- eth_dev->data->dev_private = rte_zmalloc(
- "ethdev private structure",
- sizeof(struct dpaa2_dev_priv),
- RTE_CACHE_LINE_SIZE);
- if (eth_dev->data->dev_private == NULL) {
+ dev_priv = rte_zmalloc("ethdev private structure",
+ sizeof(struct dpaa2_dev_priv),
+ RTE_CACHE_LINE_SIZE);
+ if (dev_priv == NULL) {
DPAA2_PMD_CRIT(
"Unable to allocate memory for private data");
rte_eth_dev_release_port(eth_dev);
return -ENOMEM;
}
+ eth_dev->data->dev_private = (void *)dev_priv;
+ /* Store a pointer to eth_dev in dev_private */
+ dev_priv->eth_dev = eth_dev;
+ dev_priv->tx_conf_en = 0;
} else {
eth_dev = rte_eth_dev_attach_secondary(dpaa2_dev->device.name);
- if (!eth_dev)
+ if (!eth_dev) {
+ DPAA2_PMD_DEBUG("returning enodev");
return -ENODEV;
+ }
}
eth_dev->device = &dpaa2_dev->device;
return 0;
}
- priv = eth_dev->data->dev_private;
- priv->tx_conf_en = 0;
-
rte_eth_dev_release_port(eth_dev);
return diag;
}