Skip to content

Commit

Permalink
Merge branch 'dpaa2-eth-small-updates'
Browse files Browse the repository at this point in the history
Ioana Ciornei says:

====================
dpaa2-eth: small updates

This patch set is just a collection of small updates to the dpaa2-eth
driver.

First, we only need to check the availability of the DTS child node, not
both child and parent node. Then remove a call to
dpaa2_eth_link_state_update() which is now just a leftover and it's not
useful in how are things working now in the PHY integration. Lastly,
modify how the driver is behaving when the the flow steering table is
used between all the traffic classes.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Sep 26, 2020
2 parents bd0b68a + 5e29c16 commit 9b69e5e
Showing 4 changed files with 19 additions and 15 deletions.
25 changes: 13 additions & 12 deletions drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
Original file line number Diff line number Diff line change
@@ -1700,22 +1700,11 @@ static int dpaa2_eth_open(struct net_device *net_dev)
goto enable_err;
}

if (!priv->mac) {
/* If the DPMAC object has already processed the link up
* interrupt, we have to learn the link state ourselves.
*/
err = dpaa2_eth_link_state_update(priv);
if (err < 0) {
netdev_err(net_dev, "Can't update link state\n");
goto link_state_err;
}
} else {
if (priv->mac)
phylink_start(priv->mac->phylink);
}

return 0;

link_state_err:
enable_err:
dpaa2_eth_disable_ch_napi(priv);
dpaa2_eth_drain_pool(priv);
@@ -3465,6 +3454,12 @@ static int dpaa2_eth_config_hash_key(struct dpaa2_eth_priv *priv, dma_addr_t key
dev_err(dev, "dpni_set_rx_hash_dist failed\n");
break;
}

/* If the flow steering / hashing key is shared between all
* traffic classes, install it just once
*/
if (priv->dpni_attrs.options & DPNI_OPT_SHARED_FS)
break;
}

return err;
@@ -3491,6 +3486,12 @@ static int dpaa2_eth_config_cls_key(struct dpaa2_eth_priv *priv, dma_addr_t key)
dev_err(dev, "dpni_set_rx_fs_dist failed\n");
break;
}

/* If the flow steering / hashing key is shared between all
* traffic classes, install it just once
*/
if (priv->dpni_attrs.options & DPNI_OPT_SHARED_FS)
break;
}

return err;
2 changes: 1 addition & 1 deletion drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c
Original file line number Diff line number Diff line change
@@ -618,7 +618,7 @@ static int dpaa2_eth_do_cls_rule(struct net_device *net_dev,
err = dpni_remove_fs_entry(priv->mc_io, 0,
priv->mc_token, i,
&rule_cfg);
if (err)
if (err || priv->dpni_attrs.options & DPNI_OPT_SHARED_FS)
break;
}

3 changes: 1 addition & 2 deletions drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
Original file line number Diff line number Diff line change
@@ -267,8 +267,7 @@ static int dpaa2_pcs_create(struct dpaa2_mac *mac,
return 0;
}

if (!of_device_is_available(node) ||
!of_device_is_available(node->parent)) {
if (!of_device_is_available(node)) {
netdev_err(mac->net_dev, "pcs-handle node not available\n");
return -ENODEV;
}
4 changes: 4 additions & 0 deletions drivers/net/ethernet/freescale/dpaa2/dpni.h
Original file line number Diff line number Diff line change
@@ -75,6 +75,10 @@ struct fsl_mc_io;
* Disables the flow steering table.
*/
#define DPNI_OPT_NO_FS 0x000020
/**
* Flow steering table is shared between all traffic classes
*/
#define DPNI_OPT_SHARED_FS 0x001000

int dpni_open(struct fsl_mc_io *mc_io,
u32 cmd_flags,

0 comments on commit 9b69e5e

Please sign in to comment.