git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net: add rte prefix to ether functions
[dpdk.git]
/
drivers
/
net
/
i40e
/
rte_pmd_i40e.c
diff --git
a/drivers/net/i40e/rte_pmd_i40e.c
b/drivers/net/i40e/rte_pmd_i40e.c
index
7aa1a75
..
3d66b63
100644
(file)
--- a/
drivers/net/i40e/rte_pmd_i40e.c
+++ b/
drivers/net/i40e/rte_pmd_i40e.c
@@
-2,6
+2,7
@@
* Copyright(c) 2010-2017 Intel Corporation
*/
* Copyright(c) 2010-2017 Intel Corporation
*/
+#include <rte_string_fns.h>
#include <rte_malloc.h>
#include <rte_tailq.h>
#include <rte_malloc.h>
#include <rte_tailq.h>
@@
-338,7
+339,7
@@
i40e_vsi_set_tx_loopback(struct i40e_vsi *vsi, uint8_t on)
hw = I40E_VSI_TO_HW(vsi);
/* Use the FW API if FW >= v5.0 */
hw = I40E_VSI_TO_HW(vsi);
/* Use the FW API if FW >= v5.0 */
- if (hw->aq.fw_maj_ver < 5) {
+ if (hw->aq.fw_maj_ver < 5
&& hw->mac.type != I40E_MAC_X722
) {
PMD_INIT_LOG(ERR, "FW < v5.0, cannot enable loopback");
return -ENOTSUP;
}
PMD_INIT_LOG(ERR, "FW < v5.0, cannot enable loopback");
return -ENOTSUP;
}
@@
-528,7
+529,7
@@
rte_pmd_i40e_set_vf_multicast_promisc(uint16_t port, uint16_t vf_id, uint8_t on)
int
rte_pmd_i40e_set_vf_mac_addr(uint16_t port, uint16_t vf_id,
int
rte_pmd_i40e_set_vf_mac_addr(uint16_t port, uint16_t vf_id,
- struct ether_addr *mac_addr)
+ struct
rte_
ether_addr *mac_addr)
{
struct i40e_mac_filter *f;
struct rte_eth_dev *dev;
{
struct i40e_mac_filter *f;
struct rte_eth_dev *dev;
@@
-559,7
+560,7
@@
rte_pmd_i40e_set_vf_mac_addr(uint16_t port, uint16_t vf_id,
return -EINVAL;
}
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)
/* Remove all existing mac */
TAILQ_FOREACH_SAFE(f, &vsi->mac_list, next, temp)
@@
-570,11
+571,11
@@
rte_pmd_i40e_set_vf_mac_addr(uint16_t port, uint16_t vf_id,
return 0;
}
return 0;
}
-static const struct ether_addr null_mac_addr;
+static const struct
rte_
ether_addr null_mac_addr;
int
rte_pmd_i40e_remove_vf_mac_addr(uint16_t port, uint16_t vf_id,
int
rte_pmd_i40e_remove_vf_mac_addr(uint16_t port, uint16_t vf_id,
- struct ether_addr *mac_addr)
+ struct
rte_
ether_addr *mac_addr)
{
struct rte_eth_dev *dev;
struct i40e_pf_vf *vf;
{
struct rte_eth_dev *dev;
struct i40e_pf_vf *vf;
@@
-603,9
+604,9
@@
rte_pmd_i40e_remove_vf_mac_addr(uint16_t port, uint16_t vf_id,
return -EINVAL;
}
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 */
/* 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);
/* Remove the mac */
i40e_vsi_delete_mac(vsi, mac_addr);
@@
-723,7
+724,7
@@
int rte_pmd_i40e_set_vf_broadcast(uint16_t port, uint16_t vf_id,
struct i40e_vsi *vsi;
struct i40e_hw *hw;
struct i40e_mac_filter_info filter;
struct i40e_vsi *vsi;
struct i40e_hw *hw;
struct i40e_mac_filter_info filter;
- struct ether_addr broadcast = {
+ struct
rte_
ether_addr broadcast = {
.addr_bytes = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff} };
int ret;
.addr_bytes = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff} };
int ret;
@@
-1709,6
+1710,7
@@
rte_pmd_i40e_process_ddp_package(uint16_t port, uint8_t *buff,
PMD_DRV_LOG(ERR, "Profile of group 0 already exists.");
else if (is_exist == 3)
PMD_DRV_LOG(ERR, "Profile of different group already exists");
PMD_DRV_LOG(ERR, "Profile of group 0 already exists.");
else if (is_exist == 3)
PMD_DRV_LOG(ERR, "Profile of different group already exists");
+ i40e_update_customized_info(dev, buff, size, op);
rte_free(profile_info_sec);
return -EEXIST;
}
rte_free(profile_info_sec);
return -EEXIST;
}
@@
-1982,8
+1984,8
@@
int rte_pmd_i40e_get_ddp_info(uint8_t *pkg_buff, uint32_t pkg_size,
tlv = (struct i40e_profile_tlv_section_record *)&proto[1];
for (i = j = 0; i < nb_rec; j++) {
pinfo[j].proto_id = tlv->data[0];
tlv = (struct i40e_profile_tlv_section_record *)&proto[1];
for (i = j = 0; i < nb_rec; j++) {
pinfo[j].proto_id = tlv->data[0];
- s
nprintf(pinfo[j].name, I40E_DDP_NAME_SIZE, "%s"
,
-
(const char *)&tlv->data[1]
);
+ s
trlcpy(pinfo[j].name, (const char *)&tlv->data[1]
,
+
I40E_DDP_NAME_SIZE
);
i += tlv->len;
tlv = &tlv[tlv->len];
}
i += tlv->len;
tlv = &tlv[tlv->len];
}
@@
-2353,7
+2355,7
@@
int rte_pmd_i40e_ptype_mapping_replace(uint16_t port,
int
rte_pmd_i40e_add_vf_mac_addr(uint16_t port, uint16_t vf_id,
int
rte_pmd_i40e_add_vf_mac_addr(uint16_t port, uint16_t vf_id,
- struct ether_addr *mac_addr)
+ struct
rte_
ether_addr *mac_addr)
{
struct rte_eth_dev *dev;
struct i40e_pf_vf *vf;
{
struct rte_eth_dev *dev;
struct i40e_pf_vf *vf;
@@
-2385,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;
}
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.");
ret = i40e_vsi_add_mac(vsi, &mac_filter);
if (ret != I40E_SUCCESS) {
PMD_DRV_LOG(ERR, "Failed to add MAC filter.");
@@
-2490,10
+2492,11
@@
rte_pmd_i40e_flow_type_mapping_update(
}
int
}
int
-rte_pmd_i40e_query_vfid_by_mac(uint16_t port, const struct ether_addr *vf_mac)
+rte_pmd_i40e_query_vfid_by_mac(uint16_t port,
+ const struct rte_ether_addr *vf_mac)
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- struct ether_addr *mac;
+ struct
rte_
ether_addr *mac;
struct i40e_pf *pf;
int vf_id;
struct i40e_pf_vf *vf;
struct i40e_pf *pf;
int vf_id;
struct i40e_pf_vf *vf;
@@
-2512,7
+2515,7
@@
rte_pmd_i40e_query_vfid_by_mac(uint16_t port, const struct ether_addr *vf_mac)
vf = &pf->vfs[vf_id];
mac = &vf->mac_addr;
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;
}
return vf_id;
}
@@
-2817,13
+2820,23
@@
i40e_queue_region_dcb_configure(struct i40e_hw *hw,
struct i40e_dcbx_config *old_cfg = &hw->local_dcbx_config;
int32_t ret = -EINVAL;
uint16_t i, j, prio_index, region_index;
struct i40e_dcbx_config *old_cfg = &hw->local_dcbx_config;
int32_t ret = -EINVAL;
uint16_t i, j, prio_index, region_index;
- uint8_t tc_map, tc_bw, bw_lf;
+ uint8_t tc_map, tc_bw, bw_lf
, dcb_flag = 0
;
if (!info->queue_region_number) {
PMD_DRV_LOG(ERR, "No queue region been set before");
return ret;
}
if (!info->queue_region_number) {
PMD_DRV_LOG(ERR, "No queue region been set before");
return ret;
}
+ for (i = 0; i < info->queue_region_number; i++) {
+ if (info->region[i].user_priority_num) {
+ dcb_flag = 1;
+ break;
+ }
+ }
+
+ if (dcb_flag == 0)
+ return 0;
+
dcb_cfg = &dcb_cfg_local;
memset(dcb_cfg, 0, sizeof(struct i40e_dcbx_config));
dcb_cfg = &dcb_cfg_local;
memset(dcb_cfg, 0, sizeof(struct i40e_dcbx_config));
@@
-3162,8
+3175,6
@@
rte_pmd_i40e_inset_set(uint16_t port, uint8_t pctype,
i40e_check_write_global_reg(hw,
I40E_GLQF_HASH_MSK(i, pctype),
mask_reg[i]);
i40e_check_write_global_reg(hw,
I40E_GLQF_HASH_MSK(i, pctype),
mask_reg[i]);
- i40e_global_cfg_warning(I40E_WARNING_HASH_INSET);
- i40e_global_cfg_warning(I40E_WARNING_HASH_MSK);
break;
case INSET_FDIR:
i40e_check_write_reg(hw, I40E_PRTQF_FD_INSET(pctype, 0),
break;
case INSET_FDIR:
i40e_check_write_reg(hw, I40E_PRTQF_FD_INSET(pctype, 0),
@@
-3175,7
+3186,6
@@
rte_pmd_i40e_inset_set(uint16_t port, uint8_t pctype,
i40e_check_write_global_reg(hw,
I40E_GLQF_FD_MSK(i, pctype),
mask_reg[i]);
i40e_check_write_global_reg(hw,
I40E_GLQF_FD_MSK(i, pctype),
mask_reg[i]);
- i40e_global_cfg_warning(I40E_WARNING_FD_MSK);
break;
case INSET_FDIR_FLX:
i40e_check_write_reg(hw, I40E_PRTQF_FD_FLXINSET(pctype),
break;
case INSET_FDIR_FLX:
i40e_check_write_reg(hw, I40E_PRTQF_FD_FLXINSET(pctype),