summaryrefslogtreecommitdiff
path: root/drivers/net/i40e
diff options
context:
space:
mode:
authorOlivier Matz <olivier.matz@6wind.com>2019-05-21 18:13:04 +0200
committerFerruh Yigit <ferruh.yigit@intel.com>2019-05-24 13:34:45 +0200
commit538da7a1cad25fbdffe298c8ca76fc4dbd262d1b (patch)
treec658a60595b1dec44557da57a2b6259a3d286854 /drivers/net/i40e
parent6d13ea8e8e49ab957deae2bba5ecf4a4bfe747d1 (diff)
downloaddpdk-538da7a1cad25fbdffe298c8ca76fc4dbd262d1b.zip
dpdk-538da7a1cad25fbdffe298c8ca76fc4dbd262d1b.tar.gz
dpdk-538da7a1cad25fbdffe298c8ca76fc4dbd262d1b.tar.xz
net: add rte prefix to ether functions
Add 'rte_' prefix to functions: - rename is_same_ether_addr() as rte_is_same_ether_addr(). - rename is_zero_ether_addr() as rte_is_zero_ether_addr(). - rename is_unicast_ether_addr() as rte_is_unicast_ether_addr(). - rename is_multicast_ether_addr() as rte_is_multicast_ether_addr(). - rename is_broadcast_ether_addr() as rte_is_broadcast_ether_addr(). - rename is_universal_ether_addr() as rte_is_universal_ether_addr(). - rename is_local_admin_ether_addr() as rte_is_local_admin_ether_addr(). - rename is_valid_assigned_ether_addr() as rte_is_valid_assigned_ether_addr(). - rename eth_random_addr() as rte_eth_random_addr(). - rename ether_addr_copy() as rte_ether_addr_copy(). - rename ether_format_addr() as rte_ether_format_addr(). Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Diffstat (limited to 'drivers/net/i40e')
-rw-r--r--drivers/net/i40e/i40e_ethdev.c43
-rw-r--r--drivers/net/i40e/i40e_ethdev_vf.c17
-rw-r--r--drivers/net/i40e/i40e_flow.c24
-rw-r--r--drivers/net/i40e/i40e_pf.c6
-rw-r--r--drivers/net/i40e/rte_pmd_i40e.c10
5 files changed, 53 insertions, 47 deletions
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 85fdf35..3aba03d 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -1469,7 +1469,7 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused)
goto err_get_mac_addr;
}
/* Copy the permanent MAC address */
- ether_addr_copy((struct rte_ether_addr *)hw->mac.addr,
+ rte_ether_addr_copy((struct rte_ether_addr *)hw->mac.addr,
(struct rte_ether_addr *)hw->mac.perm_addr);
/* Disable flow control */
@@ -1521,7 +1521,7 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused)
"Failed to allocated memory for storing mac address");
goto err_mac_alloc;
}
- ether_addr_copy((struct rte_ether_addr *)hw->mac.perm_addr,
+ rte_ether_addr_copy((struct rte_ether_addr *)hw->mac.perm_addr,
&dev->data->mac_addrs[0]);
/* Init dcb to sw mode by default */
@@ -4123,7 +4123,7 @@ i40e_vf_mac_filter_set(struct i40e_pf *pf,
new_mac = &filter->mac_addr;
- if (is_zero_ether_addr(new_mac)) {
+ if (rte_is_zero_ether_addr(new_mac)) {
PMD_DRV_LOG(ERR, "Invalid ethernet address.");
return -EINVAL;
}
@@ -4136,7 +4136,7 @@ i40e_vf_mac_filter_set(struct i40e_pf *pf,
}
vf = &pf->vfs[vf_id];
- if (add && is_same_ether_addr(new_mac, &(pf->dev_addr))) {
+ if (add && rte_is_same_ether_addr(new_mac, &pf->dev_addr)) {
PMD_DRV_LOG(INFO, "Ignore adding permanent MAC address.");
return -EINVAL;
}
@@ -4154,7 +4154,7 @@ i40e_vf_mac_filter_set(struct i40e_pf *pf,
PMD_DRV_LOG(ERR, "Failed to add MAC filter.");
return -1;
}
- ether_addr_copy(new_mac, &pf->dev_addr);
+ rte_ether_addr_copy(new_mac, &pf->dev_addr);
} else {
rte_memcpy(hw->mac.addr, hw->mac.perm_addr,
ETHER_ADDR_LEN);
@@ -4165,7 +4165,7 @@ i40e_vf_mac_filter_set(struct i40e_pf *pf,
}
/* Clear device address as it has been removed */
- if (is_same_ether_addr(&(pf->dev_addr), new_mac))
+ if (rte_is_same_ether_addr(&pf->dev_addr, new_mac))
memset(&pf->dev_addr, 0, sizeof(struct rte_ether_addr));
}
@@ -6913,7 +6913,7 @@ i40e_find_mac_filter(struct i40e_vsi *vsi,
struct i40e_mac_filter *f;
TAILQ_FOREACH(f, &vsi->mac_list, next) {
- if (is_same_ether_addr(macaddr, &f->mac_info.mac_addr))
+ if (rte_is_same_ether_addr(macaddr, &f->mac_info.mac_addr))
return f;
}
@@ -7586,9 +7586,11 @@ i40e_tunnel_filter_convert(
struct i40e_aqc_cloud_filters_element_bb *cld_filter,
struct i40e_tunnel_filter *tunnel_filter)
{
- ether_addr_copy((struct rte_ether_addr *)&cld_filter->element.outer_mac,
+ rte_ether_addr_copy((struct rte_ether_addr *)
+ &cld_filter->element.outer_mac,
(struct rte_ether_addr *)&tunnel_filter->input.outer_mac);
- ether_addr_copy((struct rte_ether_addr *)&cld_filter->element.inner_mac,
+ rte_ether_addr_copy((struct rte_ether_addr *)
+ &cld_filter->element.inner_mac,
(struct rte_ether_addr *)&tunnel_filter->input.inner_mac);
tunnel_filter->input.inner_vlan = cld_filter->element.inner_vlan;
if ((rte_le_to_cpu_16(cld_filter->element.flags) &
@@ -7697,9 +7699,9 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf,
}
pfilter = cld_filter;
- ether_addr_copy(&tunnel_filter->outer_mac,
+ rte_ether_addr_copy(&tunnel_filter->outer_mac,
(struct rte_ether_addr *)&pfilter->element.outer_mac);
- ether_addr_copy(&tunnel_filter->inner_mac,
+ rte_ether_addr_copy(&tunnel_filter->inner_mac,
(struct rte_ether_addr *)&pfilter->element.inner_mac);
pfilter->element.inner_vlan =
@@ -8144,9 +8146,9 @@ i40e_dev_consistent_tunnel_filter_set(struct i40e_pf *pf,
}
pfilter = cld_filter;
- ether_addr_copy(&tunnel_filter->outer_mac,
+ rte_ether_addr_copy(&tunnel_filter->outer_mac,
(struct rte_ether_addr *)&pfilter->element.outer_mac);
- ether_addr_copy(&tunnel_filter->inner_mac,
+ rte_ether_addr_copy(&tunnel_filter->inner_mac,
(struct rte_ether_addr *)&pfilter->element.inner_mac);
pfilter->element.inner_vlan =
@@ -8627,13 +8629,13 @@ i40e_tunnel_filter_param_check(struct i40e_pf *pf,
}
if ((filter->filter_type & ETH_TUNNEL_FILTER_OMAC) &&
- (is_zero_ether_addr(&filter->outer_mac))) {
+ (rte_is_zero_ether_addr(&filter->outer_mac))) {
PMD_DRV_LOG(ERR, "Cannot add NULL outer MAC address");
return -EINVAL;
}
if ((filter->filter_type & ETH_TUNNEL_FILTER_IMAC) &&
- (is_zero_ether_addr(&filter->inner_mac))) {
+ (rte_is_zero_ether_addr(&filter->inner_mac))) {
PMD_DRV_LOG(ERR, "Cannot add NULL inner MAC address");
return -EINVAL;
}
@@ -11960,13 +11962,14 @@ static int i40e_set_default_mac_addr(struct rte_eth_dev *dev,
struct i40e_mac_filter *f;
int ret;
- if (!is_valid_assigned_ether_addr(mac_addr)) {
+ if (!rte_is_valid_assigned_ether_addr(mac_addr)) {
PMD_DRV_LOG(ERR, "Tried to set invalid MAC address.");
return -EINVAL;
}
TAILQ_FOREACH(f, &vsi->mac_list, next) {
- if (is_same_ether_addr(&pf->dev_addr, &f->mac_info.mac_addr))
+ if (rte_is_same_ether_addr(&pf->dev_addr,
+ &f->mac_info.mac_addr))
break;
}
@@ -12084,9 +12087,11 @@ i40e_tunnel_filter_restore(struct i40e_pf *pf)
vsi = vf->vsi;
}
memset(&cld_filter, 0, sizeof(cld_filter));
- ether_addr_copy((struct rte_ether_addr *)&f->input.outer_mac,
+ rte_ether_addr_copy((struct rte_ether_addr *)
+ &f->input.outer_mac,
(struct rte_ether_addr *)&cld_filter.element.outer_mac);
- ether_addr_copy((struct rte_ether_addr *)&f->input.inner_mac,
+ rte_ether_addr_copy((struct rte_ether_addr *)
+ &f->input.inner_mac,
(struct rte_ether_addr *)&cld_filter.element.inner_mac);
cld_filter.element.inner_vlan = f->input.inner_vlan;
cld_filter.element.flags = f->input.flags;
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 0b05ddb..f7f193c 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -788,7 +788,7 @@ i40evf_add_mac_addr(struct rte_eth_dev *dev,
int err;
struct vf_cmd_info args;
- if (is_zero_ether_addr(addr)) {
+ if (rte_is_zero_ether_addr(addr)) {
PMD_DRV_LOG(ERR, "Invalid mac:%x:%x:%x:%x:%x:%x",
addr->addr_bytes[0], addr->addr_bytes[1],
addr->addr_bytes[2], addr->addr_bytes[3],
@@ -1274,10 +1274,11 @@ i40evf_init_vf(struct rte_eth_dev *dev)
vf->vsi.adapter = I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
/* Store the MAC address configured by host, or generate random one */
- if (is_valid_assigned_ether_addr((struct rte_ether_addr *)hw->mac.addr))
+ if (rte_is_valid_assigned_ether_addr(
+ (struct rte_ether_addr *)hw->mac.addr))
vf->flags |= I40E_FLAG_VF_MAC_BY_PF;
else
- eth_random_addr(hw->mac.addr); /* Generate a random one */
+ rte_eth_random_addr(hw->mac.addr); /* Generate a random one */
I40E_WRITE_REG(hw, I40E_VFINT_DYN_CTL01,
(I40E_ITR_INDEX_DEFAULT <<
@@ -1512,7 +1513,7 @@ i40evf_dev_init(struct rte_eth_dev *eth_dev)
ETHER_ADDR_LEN * I40E_NUM_MACADDR_MAX);
return -ENOMEM;
}
- ether_addr_copy((struct rte_ether_addr *)hw->mac.addr,
+ rte_ether_addr_copy((struct rte_ether_addr *)hw->mac.addr,
&eth_dev->data->mac_addrs[0]);
return 0;
@@ -1937,7 +1938,7 @@ i40evf_add_del_all_mac_addr(struct rte_eth_dev *dev, bool add)
j = 0;
len = sizeof(struct virtchnl_ether_addr_list);
for (i = begin; i < I40E_NUM_MACADDR_MAX; i++, next_begin++) {
- if (is_zero_ether_addr(&dev->data->mac_addrs[i]))
+ if (rte_is_zero_ether_addr(&dev->data->mac_addrs[i]))
continue;
len += sizeof(struct virtchnl_ether_addr);
if (len >= I40E_AQ_BUF_SZ) {
@@ -1954,7 +1955,7 @@ i40evf_add_del_all_mac_addr(struct rte_eth_dev *dev, bool add)
for (i = begin; i < next_begin; i++) {
addr = &dev->data->mac_addrs[i];
- if (is_zero_ether_addr(addr))
+ if (rte_is_zero_ether_addr(addr))
continue;
rte_memcpy(list->list[j].addr, addr->addr_bytes,
sizeof(addr->addr_bytes));
@@ -2707,7 +2708,7 @@ i40evf_set_default_mac_addr(struct rte_eth_dev *dev,
struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
- if (!is_valid_assigned_ether_addr(mac_addr)) {
+ if (!rte_is_valid_assigned_ether_addr(mac_addr)) {
PMD_DRV_LOG(ERR, "Tried to set invalid MAC address.");
return -EINVAL;
}
@@ -2720,7 +2721,7 @@ i40evf_set_default_mac_addr(struct rte_eth_dev *dev,
if (i40evf_add_mac_addr(dev, mac_addr, 0, 0) != 0)
return -EIO;
- ether_addr_copy(mac_addr, (struct rte_ether_addr *)hw->mac.addr);
+ rte_ether_addr_copy(mac_addr, (struct rte_ether_addr *)hw->mac.addr);
return 0;
}
diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 559ca92..73778a9 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -2006,9 +2006,9 @@ i40e_flow_parse_ethertype_pattern(struct rte_eth_dev *dev,
* Mask bits of destination MAC address must be full
* of 1 or full of 0.
*/
- if (!is_zero_ether_addr(&eth_mask->src) ||
- (!is_zero_ether_addr(&eth_mask->dst) &&
- !is_broadcast_ether_addr(&eth_mask->dst))) {
+ if (!rte_is_zero_ether_addr(&eth_mask->src) ||
+ (!rte_is_zero_ether_addr(&eth_mask->dst) &&
+ !rte_is_broadcast_ether_addr(&eth_mask->dst))) {
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ITEM,
item,
@@ -2027,7 +2027,7 @@ i40e_flow_parse_ethertype_pattern(struct rte_eth_dev *dev,
/* If mask bits of destination MAC address
* are full of 1, set RTE_ETHTYPE_FLAGS_MAC.
*/
- if (is_broadcast_ether_addr(&eth_mask->dst)) {
+ if (rte_is_broadcast_ether_addr(&eth_mask->dst)) {
filter->mac_addr = eth_spec->dst;
filter->flags |= RTE_ETHTYPE_FLAGS_MAC;
} else {
@@ -2484,8 +2484,8 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
eth_mask = item->mask;
if (eth_spec && eth_mask) {
- if (!is_zero_ether_addr(&eth_mask->src) ||
- !is_zero_ether_addr(&eth_mask->dst)) {
+ if (!rte_is_zero_ether_addr(&eth_mask->src) ||
+ !rte_is_zero_ether_addr(&eth_mask->dst)) {
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ITEM,
item,
@@ -3325,8 +3325,8 @@ i40e_flow_parse_vxlan_pattern(__rte_unused struct rte_eth_dev *dev,
/* DST address of inner MAC shouldn't be masked.
* SRC address of Inner MAC should be masked.
*/
- if (!is_broadcast_ether_addr(&eth_mask->dst) ||
- !is_zero_ether_addr(&eth_mask->src) ||
+ if (!rte_is_broadcast_ether_addr(&eth_mask->dst) ||
+ !rte_is_zero_ether_addr(&eth_mask->src) ||
eth_mask->type) {
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ITEM,
@@ -3555,8 +3555,8 @@ i40e_flow_parse_nvgre_pattern(__rte_unused struct rte_eth_dev *dev,
/* DST address of inner MAC shouldn't be masked.
* SRC address of Inner MAC should be masked.
*/
- if (!is_broadcast_ether_addr(&eth_mask->dst) ||
- !is_zero_ether_addr(&eth_mask->src) ||
+ if (!rte_is_broadcast_ether_addr(&eth_mask->dst) ||
+ !rte_is_zero_ether_addr(&eth_mask->src) ||
eth_mask->type) {
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ITEM,
@@ -4810,9 +4810,9 @@ i40e_flow_destroy_tunnel_filter(struct i40e_pf *pf,
int ret = 0;
memset(&cld_filter, 0, sizeof(cld_filter));
- ether_addr_copy((struct rte_ether_addr *)&filter->input.outer_mac,
+ rte_ether_addr_copy((struct rte_ether_addr *)&filter->input.outer_mac,
(struct rte_ether_addr *)&cld_filter.element.outer_mac);
- ether_addr_copy((struct rte_ether_addr *)&filter->input.inner_mac,
+ rte_ether_addr_copy((struct rte_ether_addr *)&filter->input.inner_mac,
(struct rte_ether_addr *)&cld_filter.element.inner_mac);
cld_filter.element.inner_vlan = filter->input.inner_vlan;
cld_filter.element.flags = filter->input.flags;
diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c
index 4d7001d..b7636c7 100644
--- a/drivers/net/i40e/i40e_pf.c
+++ b/drivers/net/i40e/i40e_pf.c
@@ -348,7 +348,7 @@ i40e_pf_host_process_cmd_get_vf_resource(struct i40e_pf_vf *vf, uint8_t *msg,
vf_res->vsi_res[0].vsi_type = VIRTCHNL_VSI_SRIOV;
vf_res->vsi_res[0].vsi_id = vf->vsi->vsi_id;
vf_res->vsi_res[0].num_queue_pairs = vf->vsi->nb_qps;
- ether_addr_copy(&vf->mac_addr,
+ rte_ether_addr_copy(&vf->mac_addr,
(struct rte_ether_addr *)vf_res->vsi_res[0].default_mac_addr);
send_msg:
@@ -845,7 +845,7 @@ i40e_pf_host_process_cmd_add_ether_address(struct i40e_pf_vf *vf,
mac = (struct rte_ether_addr *)(addr_list->list[i].addr);
rte_memcpy(&filter.mac_addr, mac, ETHER_ADDR_LEN);
filter.filter_type = RTE_MACVLAN_PERFECT_MATCH;
- if (is_zero_ether_addr(mac) ||
+ if (rte_is_zero_ether_addr(mac) ||
i40e_vsi_add_mac(vf->vsi, &filter)) {
ret = I40E_ERR_INVALID_MAC_ADDR;
goto send_msg;
@@ -887,7 +887,7 @@ i40e_pf_host_process_cmd_del_ether_address(struct i40e_pf_vf *vf,
for (i = 0; i < addr_list->num_elements; i++) {
mac = (struct rte_ether_addr *)(addr_list->list[i].addr);
- if(is_zero_ether_addr(mac) ||
+ if (rte_is_zero_ether_addr(mac) ||
i40e_vsi_delete_mac(vf->vsi, mac)) {
ret = I40E_ERR_INVALID_MAC_ADDR;
goto send_msg;
diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c
index 8e56255..3d66b63 100644
--- a/drivers/net/i40e/rte_pmd_i40e.c
+++ b/drivers/net/i40e/rte_pmd_i40e.c
@@ -560,7 +560,7 @@ rte_pmd_i40e_set_vf_mac_addr(uint16_t port, uint16_t vf_id,
return -EINVAL;
}
- ether_addr_copy(mac_addr, &vf->mac_addr);
+ rte_ether_addr_copy(mac_addr, &vf->mac_addr);
/* Remove all existing mac */
TAILQ_FOREACH_SAFE(f, &vsi->mac_list, next, temp)
@@ -604,9 +604,9 @@ rte_pmd_i40e_remove_vf_mac_addr(uint16_t port, uint16_t vf_id,
return -EINVAL;
}
- if (is_same_ether_addr(mac_addr, &vf->mac_addr))
+ if (rte_is_same_ether_addr(mac_addr, &vf->mac_addr))
/* Reset the mac with NULL address */
- ether_addr_copy(&null_mac_addr, &vf->mac_addr);
+ rte_ether_addr_copy(&null_mac_addr, &vf->mac_addr);
/* Remove the mac */
i40e_vsi_delete_mac(vsi, mac_addr);
@@ -2387,7 +2387,7 @@ rte_pmd_i40e_add_vf_mac_addr(uint16_t port, uint16_t vf_id,
}
mac_filter.filter_type = RTE_MACVLAN_PERFECT_MATCH;
- ether_addr_copy(mac_addr, &mac_filter.mac_addr);
+ rte_ether_addr_copy(mac_addr, &mac_filter.mac_addr);
ret = i40e_vsi_add_mac(vsi, &mac_filter);
if (ret != I40E_SUCCESS) {
PMD_DRV_LOG(ERR, "Failed to add MAC filter.");
@@ -2515,7 +2515,7 @@ rte_pmd_i40e_query_vfid_by_mac(uint16_t port,
vf = &pf->vfs[vf_id];
mac = &vf->mac_addr;
- if (is_same_ether_addr(mac, vf_mac))
+ if (rte_is_same_ether_addr(mac, vf_mac))
return vf_id;
}