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: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -17,12 +17,12 @@ static int dpaa2_eth_dcbnl_ieee_getpfc(struct net_device *net_dev,
|
|||||||
return 0;
|
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));
|
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};
|
struct dpni_congestion_notification_cfg cfg = {0};
|
||||||
int i, err;
|
int i, err;
|
||||||
@@ -33,7 +33,7 @@ static int set_pfc_cn(struct dpaa2_eth_priv *priv, u8 pfc_en)
|
|||||||
cfg.message_ctx = 0ULL;
|
cfg.message_ctx = 0ULL;
|
||||||
|
|
||||||
for (i = 0; i < dpaa2_eth_tc_count(priv); i++) {
|
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_entry = DPAA2_ETH_CN_THRESH_ENTRY(priv);
|
||||||
cfg.threshold_exit = DPAA2_ETH_CN_THRESH_EXIT(priv);
|
cfg.threshold_exit = DPAA2_ETH_CN_THRESH_EXIT(priv);
|
||||||
} else {
|
} else {
|
||||||
@@ -93,7 +93,7 @@ static int dpaa2_eth_dcbnl_ieee_setpfc(struct net_device *net_dev,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Configure congestion notifications for the enabled priorities */
|
/* 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)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -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);
|
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)
|
void *key, void *mask, u64 *fields)
|
||||||
{
|
{
|
||||||
int off;
|
int off;
|
||||||
@@ -345,7 +345,7 @@ static int prep_eth_rule(struct ethhdr *eth_value, struct ethhdr *eth_mask,
|
|||||||
return 0;
|
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,
|
struct ethtool_usrip4_spec *uip_mask,
|
||||||
void *key, void *mask, u64 *fields)
|
void *key, void *mask, u64 *fields)
|
||||||
{
|
{
|
||||||
@@ -400,7 +400,7 @@ static int prep_uip_rule(struct ethtool_usrip4_spec *uip_value,
|
|||||||
return 0;
|
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,
|
struct ethtool_tcpip4_spec *l4_mask,
|
||||||
void *key, void *mask, u8 l4_proto, u64 *fields)
|
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;
|
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,
|
struct ethtool_flow_ext *ext_mask,
|
||||||
void *key, void *mask, u64 *fields)
|
void *key, void *mask, u64 *fields)
|
||||||
{
|
{
|
||||||
@@ -470,7 +470,7 @@ static int prep_ext_rule(struct ethtool_flow_ext *ext_value,
|
|||||||
return 0;
|
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,
|
struct ethtool_flow_ext *ext_mask,
|
||||||
void *key, void *mask, u64 *fields)
|
void *key, void *mask, u64 *fields)
|
||||||
{
|
{
|
||||||
@@ -486,30 +486,30 @@ static int prep_mac_ext_rule(struct ethtool_flow_ext *ext_value,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int prep_cls_rule(struct ethtool_rx_flow_spec *fs, void *key, void *mask,
|
static int dpaa2_eth_prep_cls_rule(struct ethtool_rx_flow_spec *fs, void *key,
|
||||||
u64 *fields)
|
void *mask, u64 *fields)
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
switch (fs->flow_type & 0xFF) {
|
switch (fs->flow_type & 0xFF) {
|
||||||
case ETHER_FLOW:
|
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);
|
key, mask, fields);
|
||||||
break;
|
break;
|
||||||
case IP_USER_FLOW:
|
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);
|
&fs->m_u.usr_ip4_spec, key, mask, fields);
|
||||||
break;
|
break;
|
||||||
case TCP_V4_FLOW:
|
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);
|
key, mask, IPPROTO_TCP, fields);
|
||||||
break;
|
break;
|
||||||
case UDP_V4_FLOW:
|
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);
|
key, mask, IPPROTO_UDP, fields);
|
||||||
break;
|
break;
|
||||||
case SCTP_V4_FLOW:
|
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,
|
&fs->m_u.sctp_ip4_spec, key, mask,
|
||||||
IPPROTO_SCTP, fields);
|
IPPROTO_SCTP, fields);
|
||||||
break;
|
break;
|
||||||
@@ -521,14 +521,14 @@ static int prep_cls_rule(struct ethtool_rx_flow_spec *fs, void *key, void *mask,
|
|||||||
return err;
|
return err;
|
||||||
|
|
||||||
if (fs->flow_type & FLOW_EXT) {
|
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)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fs->flow_type & FLOW_MAC_EXT) {
|
if (fs->flow_type & FLOW_MAC_EXT) {
|
||||||
err = prep_mac_ext_rule(&fs->h_ext, &fs->m_ext, key, mask,
|
err = dpaa2_eth_prep_mac_ext_rule(&fs->h_ext, &fs->m_ext, key,
|
||||||
fields);
|
mask, fields);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
@@ -536,7 +536,7 @@ static int prep_cls_rule(struct ethtool_rx_flow_spec *fs, void *key, void *mask,
|
|||||||
return 0;
|
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,
|
struct ethtool_rx_flow_spec *fs,
|
||||||
bool add)
|
bool add)
|
||||||
{
|
{
|
||||||
@@ -561,7 +561,7 @@ static int do_cls_rule(struct net_device *net_dev,
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
/* Fill the key and mask memory areas */
|
/* 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)
|
if (err)
|
||||||
goto free_mem;
|
goto free_mem;
|
||||||
|
|
||||||
@@ -629,7 +629,7 @@ free_mem:
|
|||||||
return err;
|
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;
|
int i, rules = 0;
|
||||||
|
|
||||||
@@ -640,7 +640,7 @@ static int num_rules(struct dpaa2_eth_priv *priv)
|
|||||||
return rules;
|
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,
|
struct ethtool_rx_flow_spec *new_fs,
|
||||||
unsigned int location)
|
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 a rule is present at the specified location, delete it. */
|
||||||
if (rule->in_use) {
|
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)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
rule->in_use = 0;
|
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;
|
priv->rx_cls_fields = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -672,7 +673,7 @@ static int update_cls_rule(struct net_device *net_dev,
|
|||||||
if (!new_fs)
|
if (!new_fs)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
err = do_cls_rule(net_dev, new_fs, true);
|
err = dpaa2_eth_do_cls_rule(net_dev, new_fs, true);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
@@ -702,7 +703,7 @@ static int dpaa2_eth_get_rxnfc(struct net_device *net_dev,
|
|||||||
break;
|
break;
|
||||||
case ETHTOOL_GRXCLSRLCNT:
|
case ETHTOOL_GRXCLSRLCNT:
|
||||||
rxnfc->rule_cnt = 0;
|
rxnfc->rule_cnt = 0;
|
||||||
rxnfc->rule_cnt = num_rules(priv);
|
rxnfc->rule_cnt = dpaa2_eth_num_cls_rules(priv);
|
||||||
rxnfc->data = max_rules;
|
rxnfc->data = max_rules;
|
||||||
break;
|
break;
|
||||||
case ETHTOOL_GRXCLSRULE:
|
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);
|
err = dpaa2_eth_set_hash(net_dev, rxnfc->data);
|
||||||
break;
|
break;
|
||||||
case ETHTOOL_SRXCLSRLINS:
|
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;
|
break;
|
||||||
case ETHTOOL_SRXCLSRLDEL:
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
err = -EOPNOTSUPP;
|
err = -EOPNOTSUPP;
|
||||||
|
|||||||
Reference in New Issue
Block a user