Commit 0697fecf authored by David S. Miller's avatar David S. Miller

Merge branch 'dpaa2-eth-add-a-dpaa2_eth_-prefix-to-all-functions'

Ioana Ciornei says:

====================
dpaa2-eth: add a dpaa2_eth_ prefix to all functions

This is just a quick cleanup that aims at adding a dpaa2_eth_ prefix to
all functions within the dpaa2-eth driver even if those are static and
private to the driver. The main reason for doing this is that looking a
perf top, for example, is becoming an inconvenience because one cannot
easily determine which entries are dpaa2-eth related or not.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents e0afe914 8d138373
......@@ -17,12 +17,12 @@ static int dpaa2_eth_dcbnl_ieee_getpfc(struct net_device *net_dev,
return 0;
}
static inline bool is_prio_enabled(u8 pfc_en, u8 tc)
static inline bool dpaa2_eth_is_prio_enabled(u8 pfc_en, u8 tc)
{
return !!(pfc_en & (1 << tc));
}
static int set_pfc_cn(struct dpaa2_eth_priv *priv, u8 pfc_en)
static int dpaa2_eth_set_pfc_cn(struct dpaa2_eth_priv *priv, u8 pfc_en)
{
struct dpni_congestion_notification_cfg cfg = {0};
int i, err;
......@@ -33,7 +33,7 @@ static int set_pfc_cn(struct dpaa2_eth_priv *priv, u8 pfc_en)
cfg.message_ctx = 0ULL;
for (i = 0; i < dpaa2_eth_tc_count(priv); i++) {
if (is_prio_enabled(pfc_en, i)) {
if (dpaa2_eth_is_prio_enabled(pfc_en, i)) {
cfg.threshold_entry = DPAA2_ETH_CN_THRESH_ENTRY(priv);
cfg.threshold_exit = DPAA2_ETH_CN_THRESH_EXIT(priv);
} else {
......@@ -93,7 +93,7 @@ static int dpaa2_eth_dcbnl_ieee_setpfc(struct net_device *net_dev,
}
/* Configure congestion notifications for the enabled priorities */
err = set_pfc_cn(priv, pfc->pfc_en);
err = dpaa2_eth_set_pfc_cn(priv, pfc->pfc_en);
if (err)
return err;
......
......@@ -316,7 +316,7 @@ static void dpaa2_eth_get_ethtool_stats(struct net_device *net_dev,
dpaa2_mac_get_ethtool_stats(priv->mac, data + i);
}
static int prep_eth_rule(struct ethhdr *eth_value, struct ethhdr *eth_mask,
static int dpaa2_eth_prep_eth_rule(struct ethhdr *eth_value, struct ethhdr *eth_mask,
void *key, void *mask, u64 *fields)
{
int off;
......@@ -345,7 +345,7 @@ static int prep_eth_rule(struct ethhdr *eth_value, struct ethhdr *eth_mask,
return 0;
}
static int prep_uip_rule(struct ethtool_usrip4_spec *uip_value,
static int dpaa2_eth_prep_uip_rule(struct ethtool_usrip4_spec *uip_value,
struct ethtool_usrip4_spec *uip_mask,
void *key, void *mask, u64 *fields)
{
......@@ -400,7 +400,7 @@ static int prep_uip_rule(struct ethtool_usrip4_spec *uip_value,
return 0;
}
static int prep_l4_rule(struct ethtool_tcpip4_spec *l4_value,
static int dpaa2_eth_prep_l4_rule(struct ethtool_tcpip4_spec *l4_value,
struct ethtool_tcpip4_spec *l4_mask,
void *key, void *mask, u8 l4_proto, u64 *fields)
{
......@@ -451,7 +451,7 @@ static int prep_l4_rule(struct ethtool_tcpip4_spec *l4_value,
return 0;
}
static int prep_ext_rule(struct ethtool_flow_ext *ext_value,
static int dpaa2_eth_prep_ext_rule(struct ethtool_flow_ext *ext_value,
struct ethtool_flow_ext *ext_mask,
void *key, void *mask, u64 *fields)
{
......@@ -470,7 +470,7 @@ static int prep_ext_rule(struct ethtool_flow_ext *ext_value,
return 0;
}
static int prep_mac_ext_rule(struct ethtool_flow_ext *ext_value,
static int dpaa2_eth_prep_mac_ext_rule(struct ethtool_flow_ext *ext_value,
struct ethtool_flow_ext *ext_mask,
void *key, void *mask, u64 *fields)
{
......@@ -486,30 +486,30 @@ static int prep_mac_ext_rule(struct ethtool_flow_ext *ext_value,
return 0;
}
static int prep_cls_rule(struct ethtool_rx_flow_spec *fs, void *key, void *mask,
u64 *fields)
static int dpaa2_eth_prep_cls_rule(struct ethtool_rx_flow_spec *fs, void *key,
void *mask, u64 *fields)
{
int err;
switch (fs->flow_type & 0xFF) {
case ETHER_FLOW:
err = prep_eth_rule(&fs->h_u.ether_spec, &fs->m_u.ether_spec,
err = dpaa2_eth_prep_eth_rule(&fs->h_u.ether_spec, &fs->m_u.ether_spec,
key, mask, fields);
break;
case IP_USER_FLOW:
err = prep_uip_rule(&fs->h_u.usr_ip4_spec,
err = dpaa2_eth_prep_uip_rule(&fs->h_u.usr_ip4_spec,
&fs->m_u.usr_ip4_spec, key, mask, fields);
break;
case TCP_V4_FLOW:
err = prep_l4_rule(&fs->h_u.tcp_ip4_spec, &fs->m_u.tcp_ip4_spec,
err = dpaa2_eth_prep_l4_rule(&fs->h_u.tcp_ip4_spec, &fs->m_u.tcp_ip4_spec,
key, mask, IPPROTO_TCP, fields);
break;
case UDP_V4_FLOW:
err = prep_l4_rule(&fs->h_u.udp_ip4_spec, &fs->m_u.udp_ip4_spec,
err = dpaa2_eth_prep_l4_rule(&fs->h_u.udp_ip4_spec, &fs->m_u.udp_ip4_spec,
key, mask, IPPROTO_UDP, fields);
break;
case SCTP_V4_FLOW:
err = prep_l4_rule(&fs->h_u.sctp_ip4_spec,
err = dpaa2_eth_prep_l4_rule(&fs->h_u.sctp_ip4_spec,
&fs->m_u.sctp_ip4_spec, key, mask,
IPPROTO_SCTP, fields);
break;
......@@ -521,14 +521,14 @@ static int prep_cls_rule(struct ethtool_rx_flow_spec *fs, void *key, void *mask,
return err;
if (fs->flow_type & FLOW_EXT) {
err = prep_ext_rule(&fs->h_ext, &fs->m_ext, key, mask, fields);
err = dpaa2_eth_prep_ext_rule(&fs->h_ext, &fs->m_ext, key, mask, fields);
if (err)
return err;
}
if (fs->flow_type & FLOW_MAC_EXT) {
err = prep_mac_ext_rule(&fs->h_ext, &fs->m_ext, key, mask,
fields);
err = dpaa2_eth_prep_mac_ext_rule(&fs->h_ext, &fs->m_ext, key,
mask, fields);
if (err)
return err;
}
......@@ -536,7 +536,7 @@ static int prep_cls_rule(struct ethtool_rx_flow_spec *fs, void *key, void *mask,
return 0;
}
static int do_cls_rule(struct net_device *net_dev,
static int dpaa2_eth_do_cls_rule(struct net_device *net_dev,
struct ethtool_rx_flow_spec *fs,
bool add)
{
......@@ -561,7 +561,7 @@ static int do_cls_rule(struct net_device *net_dev,
return -ENOMEM;
/* Fill the key and mask memory areas */
err = prep_cls_rule(fs, key_buf, key_buf + rule_cfg.key_size, &fields);
err = dpaa2_eth_prep_cls_rule(fs, key_buf, key_buf + rule_cfg.key_size, &fields);
if (err)
goto free_mem;
......@@ -629,7 +629,7 @@ static int do_cls_rule(struct net_device *net_dev,
return err;
}
static int num_rules(struct dpaa2_eth_priv *priv)
static int dpaa2_eth_num_cls_rules(struct dpaa2_eth_priv *priv)
{
int i, rules = 0;
......@@ -640,7 +640,7 @@ static int num_rules(struct dpaa2_eth_priv *priv)
return rules;
}
static int update_cls_rule(struct net_device *net_dev,
static int dpaa2_eth_update_cls_rule(struct net_device *net_dev,
struct ethtool_rx_flow_spec *new_fs,
unsigned int location)
{
......@@ -658,13 +658,14 @@ static int update_cls_rule(struct net_device *net_dev,
/* If a rule is present at the specified location, delete it. */
if (rule->in_use) {
err = do_cls_rule(net_dev, &rule->fs, false);
err = dpaa2_eth_do_cls_rule(net_dev, &rule->fs, false);
if (err)
return err;
rule->in_use = 0;
if (!dpaa2_eth_fs_mask_enabled(priv) && !num_rules(priv))
if (!dpaa2_eth_fs_mask_enabled(priv) &&
!dpaa2_eth_num_cls_rules(priv))
priv->rx_cls_fields = 0;
}
......@@ -672,7 +673,7 @@ static int update_cls_rule(struct net_device *net_dev,
if (!new_fs)
return err;
err = do_cls_rule(net_dev, new_fs, true);
err = dpaa2_eth_do_cls_rule(net_dev, new_fs, true);
if (err)
return err;
......@@ -702,7 +703,7 @@ static int dpaa2_eth_get_rxnfc(struct net_device *net_dev,
break;
case ETHTOOL_GRXCLSRLCNT:
rxnfc->rule_cnt = 0;
rxnfc->rule_cnt = num_rules(priv);
rxnfc->rule_cnt = dpaa2_eth_num_cls_rules(priv);
rxnfc->data = max_rules;
break;
case ETHTOOL_GRXCLSRULE:
......@@ -744,10 +745,10 @@ static int dpaa2_eth_set_rxnfc(struct net_device *net_dev,
err = dpaa2_eth_set_hash(net_dev, rxnfc->data);
break;
case ETHTOOL_SRXCLSRLINS:
err = update_cls_rule(net_dev, &rxnfc->fs, rxnfc->fs.location);
err = dpaa2_eth_update_cls_rule(net_dev, &rxnfc->fs, rxnfc->fs.location);
break;
case ETHTOOL_SRXCLSRLDEL:
err = update_cls_rule(net_dev, NULL, rxnfc->fs.location);
err = dpaa2_eth_update_cls_rule(net_dev, NULL, rxnfc->fs.location);
break;
default:
err = -EOPNOTSUPP;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment