summaryrefslogtreecommitdiffstats
path: root/src/dpdk/drivers/net/i40e
diff options
context:
space:
mode:
Diffstat (limited to 'src/dpdk/drivers/net/i40e')
-rw-r--r--src/dpdk/drivers/net/i40e/i40e_ethdev.c81
-rw-r--r--src/dpdk/drivers/net/i40e/i40e_ethdev.h8
-rw-r--r--src/dpdk/drivers/net/i40e/i40e_ethdev_vf.c4
-rw-r--r--src/dpdk/drivers/net/i40e/i40e_flow.c39
-rw-r--r--src/dpdk/drivers/net/i40e/i40e_rxtx.c10
5 files changed, 104 insertions, 38 deletions
diff --git a/src/dpdk/drivers/net/i40e/i40e_ethdev.c b/src/dpdk/drivers/net/i40e/i40e_ethdev.c
index f8ee5a60..8bf8554a 100644
--- a/src/dpdk/drivers/net/i40e/i40e_ethdev.c
+++ b/src/dpdk/drivers/net/i40e/i40e_ethdev.c
@@ -1048,7 +1048,7 @@ eth_i40e_dev_init(struct rte_eth_dev *dev)
intr_handle = &pci_dev->intr_handle;
rte_eth_copy_pci_info(dev, pci_dev);
- dev->data->dev_flags = RTE_ETH_DEV_DETACHABLE;
+ dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
pf->adapter = I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
pf->adapter->eth_dev = dev;
@@ -2223,11 +2223,11 @@ i40e_dev_link_update(struct rte_eth_dev *dev,
}
link.link_status = link_status.link_info & I40E_AQ_LINK_UP;
- if (!wait_to_complete)
+ if (!wait_to_complete || link.link_status)
break;
rte_delay_ms(CHECK_INTERVAL);
- } while (!link.link_status && rep_cnt--);
+ } while (--rep_cnt);
if (!link.link_status)
goto out;
@@ -6777,6 +6777,12 @@ i40e_tunnel_filter_convert(struct i40e_aqc_add_remove_cloud_filters_element_data
ether_addr_copy((struct ether_addr *)&cld_filter->inner_mac,
(struct ether_addr *)&tunnel_filter->input.inner_mac);
tunnel_filter->input.inner_vlan = cld_filter->inner_vlan;
+ if ((rte_le_to_cpu_16(cld_filter->flags) &
+ I40E_AQC_ADD_CLOUD_FLAGS_IPV6) ==
+ I40E_AQC_ADD_CLOUD_FLAGS_IPV6)
+ tunnel_filter->input.ip_type = I40E_TUNNEL_IPTYPE_IPV6;
+ else
+ tunnel_filter->input.ip_type = I40E_TUNNEL_IPTYPE_IPV4;
tunnel_filter->input.flags = cld_filter->flags;
tunnel_filter->input.tenant_id = cld_filter->tenant_id;
tunnel_filter->queue = cld_filter->queue_number;
@@ -8804,6 +8810,10 @@ i40e_pctype_to_flowtype(enum i40e_filter_pctype pctype)
#define I40E_GL_SWR_PRI_JOIN_MAP_2_VALUE 0x011f0200
#define I40E_GL_SWR_PRI_JOIN_MAP_2 0x26CE08
+/* For X722 */
+#define I40E_X722_GL_SWR_PRI_JOIN_MAP_0_VALUE 0x20000200
+#define I40E_X722_GL_SWR_PRI_JOIN_MAP_2_VALUE 0x013F0200
+
/* For X710 */
#define I40E_GL_SWR_PM_UP_THR_EF_VALUE 0x03030303
/* For XL710 */
@@ -8826,7 +8836,6 @@ i40e_dev_sync_phy_type(struct i40e_hw *hw)
return 0;
}
-
static void
i40e_configure_registers(struct i40e_hw *hw)
{
@@ -8834,8 +8843,8 @@ i40e_configure_registers(struct i40e_hw *hw)
uint32_t addr;
uint64_t val;
} reg_table[] = {
- {I40E_GL_SWR_PRI_JOIN_MAP_0, I40E_GL_SWR_PRI_JOIN_MAP_0_VALUE},
- {I40E_GL_SWR_PRI_JOIN_MAP_2, I40E_GL_SWR_PRI_JOIN_MAP_2_VALUE},
+ {I40E_GL_SWR_PRI_JOIN_MAP_0, 0},
+ {I40E_GL_SWR_PRI_JOIN_MAP_2, 0},
{I40E_GL_SWR_PM_UP_THR, 0}, /* Compute value dynamically */
};
uint64_t reg;
@@ -8843,6 +8852,24 @@ i40e_configure_registers(struct i40e_hw *hw)
int ret;
for (i = 0; i < RTE_DIM(reg_table); i++) {
+ if (reg_table[i].addr == I40E_GL_SWR_PRI_JOIN_MAP_0) {
+ if (hw->mac.type == I40E_MAC_X722) /* For X722 */
+ reg_table[i].val =
+ I40E_X722_GL_SWR_PRI_JOIN_MAP_0_VALUE;
+ else /* For X710/XL710/XXV710 */
+ reg_table[i].val =
+ I40E_GL_SWR_PRI_JOIN_MAP_0_VALUE;
+ }
+
+ if (reg_table[i].addr == I40E_GL_SWR_PRI_JOIN_MAP_2) {
+ if (hw->mac.type == I40E_MAC_X722) /* For X722 */
+ reg_table[i].val =
+ I40E_X722_GL_SWR_PRI_JOIN_MAP_2_VALUE;
+ else /* For X710/XL710/XXV710 */
+ reg_table[i].val =
+ I40E_GL_SWR_PRI_JOIN_MAP_2_VALUE;
+ }
+
if (reg_table[i].addr == I40E_GL_SWR_PM_UP_THR) {
if (I40E_PHY_TYPE_SUPPORT_40G(hw->phy.phy_types) || /* For XL710 */
I40E_PHY_TYPE_SUPPORT_25G(hw->phy.phy_types)) /* For XXV710 */
@@ -10338,16 +10365,14 @@ i40e_filter_restore(struct i40e_pf *pf)
i40e_fdir_filter_restore(pf);
}
-static int
-is_i40e_pmd(const char *driver_name)
+static bool
+is_device_supported(struct rte_eth_dev *dev, struct eth_driver *drv)
{
- if (!strstr(driver_name, "i40e"))
- return -ENOTSUP;
-
- if (strstr(driver_name, "i40e_vf"))
- return -ENOTSUP;
+ if (strcmp(dev->driver->pci_drv.driver.name,
+ drv->pci_drv.driver.name))
+ return false;
- return 0;
+ return true;
}
int
@@ -10360,7 +10385,7 @@ rte_pmd_i40e_ping_vfs(uint8_t port, uint16_t vf)
dev = &rte_eth_devices[port];
- if (is_i40e_pmd(dev->data->drv_name))
+ if (!is_device_supported(dev, &rte_i40e_pmd))
return -ENOTSUP;
pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
@@ -10389,7 +10414,7 @@ rte_pmd_i40e_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf_id, uint8_t on)
dev = &rte_eth_devices[port];
- if (is_i40e_pmd(dev->data->drv_name))
+ if (!is_device_supported(dev, &rte_i40e_pmd))
return -ENOTSUP;
pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
@@ -10493,7 +10518,7 @@ rte_pmd_i40e_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf_id, uint8_t on)
dev = &rte_eth_devices[port];
- if (is_i40e_pmd(dev->data->drv_name))
+ if (!is_device_supported(dev, &rte_i40e_pmd))
return -ENOTSUP;
pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
@@ -10751,7 +10776,7 @@ rte_pmd_i40e_set_tx_loopback(uint8_t port, uint8_t on)
dev = &rte_eth_devices[port];
- if (is_i40e_pmd(dev->data->drv_name))
+ if (!is_device_supported(dev, &rte_i40e_pmd))
return -ENOTSUP;
pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
@@ -10793,7 +10818,7 @@ rte_pmd_i40e_set_vf_unicast_promisc(uint8_t port, uint16_t vf_id, uint8_t on)
dev = &rte_eth_devices[port];
- if (is_i40e_pmd(dev->data->drv_name))
+ if (!is_device_supported(dev, &rte_i40e_pmd))
return -ENOTSUP;
pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
@@ -10834,7 +10859,7 @@ rte_pmd_i40e_set_vf_multicast_promisc(uint8_t port, uint16_t vf_id, uint8_t on)
dev = &rte_eth_devices[port];
- if (is_i40e_pmd(dev->data->drv_name))
+ if (!is_device_supported(dev, &rte_i40e_pmd))
return -ENOTSUP;
pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
@@ -10880,7 +10905,7 @@ rte_pmd_i40e_set_vf_mac_addr(uint8_t port, uint16_t vf_id,
dev = &rte_eth_devices[port];
- if (is_i40e_pmd(dev->data->drv_name))
+ if (!is_device_supported(dev, &rte_i40e_pmd))
return -ENOTSUP;
pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
@@ -10917,7 +10942,7 @@ rte_pmd_i40e_set_vf_vlan_stripq(uint8_t port, uint16_t vf_id, uint8_t on)
dev = &rte_eth_devices[port];
- if (is_i40e_pmd(dev->data->drv_name))
+ if (!is_device_supported(dev, &rte_i40e_pmd))
return -ENOTSUP;
pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
@@ -10960,7 +10985,7 @@ int rte_pmd_i40e_set_vf_vlan_insert(uint8_t port, uint16_t vf_id,
dev = &rte_eth_devices[port];
- if (is_i40e_pmd(dev->data->drv_name))
+ if (!is_device_supported(dev, &rte_i40e_pmd))
return -ENOTSUP;
pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
@@ -11024,7 +11049,7 @@ int rte_pmd_i40e_set_vf_broadcast(uint8_t port, uint16_t vf_id,
dev = &rte_eth_devices[port];
- if (is_i40e_pmd(dev->data->drv_name))
+ if (!is_device_supported(dev, &rte_i40e_pmd))
return -ENOTSUP;
pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
@@ -11080,7 +11105,7 @@ int rte_pmd_i40e_set_vf_vlan_tag(uint8_t port, uint16_t vf_id, uint8_t on)
dev = &rte_eth_devices[port];
- if (is_i40e_pmd(dev->data->drv_name))
+ if (!is_device_supported(dev, &rte_i40e_pmd))
return -ENOTSUP;
pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
@@ -11143,7 +11168,7 @@ int rte_pmd_i40e_set_vf_vlan_filter(uint8_t port, uint16_t vlan_id,
dev = &rte_eth_devices[port];
- if (is_i40e_pmd(dev->data->drv_name))
+ if (!is_device_supported(dev, &rte_i40e_pmd))
return -ENOTSUP;
if (vlan_id > ETHER_MAX_VLAN_ID) {
@@ -11206,7 +11231,7 @@ rte_pmd_i40e_get_vf_stats(uint8_t port,
dev = &rte_eth_devices[port];
- if (is_i40e_pmd(dev->data->drv_name))
+ if (!is_device_supported(dev, &rte_i40e_pmd))
return -ENOTSUP;
pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
@@ -11250,7 +11275,7 @@ rte_pmd_i40e_reset_vf_stats(uint8_t port,
dev = &rte_eth_devices[port];
- if (is_i40e_pmd(dev->data->drv_name))
+ if (!is_device_supported(dev, &rte_i40e_pmd))
return -ENOTSUP;
pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
diff --git a/src/dpdk/drivers/net/i40e/i40e_ethdev.h b/src/dpdk/drivers/net/i40e/i40e_ethdev.h
index 9e2f7a28..f5458506 100644
--- a/src/dpdk/drivers/net/i40e/i40e_ethdev.h
+++ b/src/dpdk/drivers/net/i40e/i40e_ethdev.h
@@ -290,7 +290,7 @@ struct i40e_bw_info {
/* Relative credits within same TC with respect to other VSIs or Comps */
uint8_t bw_ets_share_credits[I40E_MAX_TRAFFIC_CLASS];
/* Bandwidth limit per TC */
- uint8_t bw_ets_credits[I40E_MAX_TRAFFIC_CLASS];
+ uint16_t bw_ets_credits[I40E_MAX_TRAFFIC_CLASS];
/* Max bandwidth limit per TC */
uint8_t bw_ets_max[I40E_MAX_TRAFFIC_CLASS];
};
@@ -499,11 +499,17 @@ struct i40e_ethertype_rule {
/* Tunnel filter number HW supports */
#define I40E_MAX_TUNNEL_FILTER_NUM 400
+enum i40e_tunnel_iptype {
+ I40E_TUNNEL_IPTYPE_IPV4,
+ I40E_TUNNEL_IPTYPE_IPV6,
+};
+
/* Tunnel filter struct */
struct i40e_tunnel_filter_input {
uint8_t outer_mac[6]; /* Outer mac address to match */
uint8_t inner_mac[6]; /* Inner mac address to match */
uint16_t inner_vlan; /* Inner vlan address to match */
+ enum i40e_tunnel_iptype ip_type;
uint16_t flags; /* Filter type flag */
uint32_t tenant_id; /* Tenant id to match */
};
diff --git a/src/dpdk/drivers/net/i40e/i40e_ethdev_vf.c b/src/dpdk/drivers/net/i40e/i40e_ethdev_vf.c
index a606aefe..55fd3442 100644
--- a/src/dpdk/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/src/dpdk/drivers/net/i40e/i40e_ethdev_vf.c
@@ -980,7 +980,7 @@ i40evf_get_statistics(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
pstats->rx_broadcast;
stats->opackets = pstats->tx_broadcast + pstats->tx_multicast +
pstats->tx_unicast;
- stats->ierrors = pstats->rx_discards;
+ stats->imissed = pstats->rx_discards;
stats->oerrors = pstats->tx_errors + pstats->tx_discards;
stats->ibytes = pstats->rx_bytes;
stats->obytes = pstats->tx_bytes;
@@ -1478,7 +1478,7 @@ i40evf_dev_init(struct rte_eth_dev *eth_dev)
}
rte_eth_copy_pci_info(eth_dev, pci_dev);
- eth_dev->data->dev_flags = RTE_ETH_DEV_DETACHABLE;
+ eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
hw->vendor_id = pci_dev->id.vendor_id;
hw->device_id = pci_dev->id.device_id;
diff --git a/src/dpdk/drivers/net/i40e/i40e_flow.c b/src/dpdk/drivers/net/i40e/i40e_flow.c
index 76bb3320..c6e4d877 100644
--- a/src/dpdk/drivers/net/i40e/i40e_flow.c
+++ b/src/dpdk/drivers/net/i40e/i40e_flow.c
@@ -1223,6 +1223,7 @@ i40e_flow_parse_vxlan_pattern(const struct rte_flow_item *pattern,
bool is_vni_masked = 0;
enum rte_flow_item_type item_type;
bool vxlan_flag = 0;
+ uint32_t tenant_id_be = 0;
for (; item->type != RTE_FLOW_ITEM_TYPE_END; item++) {
if (item->last) {
@@ -1306,16 +1307,40 @@ i40e_flow_parse_vxlan_pattern(const struct rte_flow_item *pattern,
}
break;
case RTE_FLOW_ITEM_TYPE_IPV4:
+ filter->ip_type = RTE_TUNNEL_IPTYPE_IPV4;
+ /* IPv4 is used to describe protocol,
+ * spec amd mask should be NULL.
+ */
+ if (item->spec || item->mask) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ITEM,
+ item,
+ "Invalid IPv4 item");
+ return -rte_errno;
+ }
+ break;
case RTE_FLOW_ITEM_TYPE_IPV6:
+ filter->ip_type = RTE_TUNNEL_IPTYPE_IPV6;
+ /* IPv6 is used to describe protocol,
+ * spec amd mask should be NULL.
+ */
+ if (item->spec || item->mask) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ITEM,
+ item,
+ "Invalid IPv6 item");
+ return -rte_errno;
+ }
+ break;
case RTE_FLOW_ITEM_TYPE_UDP:
- /* IPv4/IPv6/UDP are used to describe protocol,
+ /* UDP is used to describe protocol,
* spec amd mask should be NULL.
*/
if (item->spec || item->mask) {
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ITEM,
item,
- "Invalid IPv4 item");
+ "Invalid UDP item");
return -rte_errno;
}
break;
@@ -1364,8 +1389,9 @@ i40e_flow_parse_vxlan_pattern(const struct rte_flow_item *pattern,
& I40E_TCI_MASK;
if (vxlan_spec && vxlan_mask && !is_vni_masked) {
/* If there's vxlan */
- rte_memcpy(&filter->tenant_id, vxlan_spec->vni,
- RTE_DIM(vxlan_spec->vni));
+ rte_memcpy(((uint8_t *)&tenant_id_be + 1),
+ vxlan_spec->vni, 3);
+ filter->tenant_id = rte_be_to_cpu_32(tenant_id_be);
if (!o_eth_spec && !o_eth_mask &&
i_eth_spec && i_eth_mask)
filter->filter_type =
@@ -1402,8 +1428,9 @@ i40e_flow_parse_vxlan_pattern(const struct rte_flow_item *pattern,
/* If there's no inner vlan */
if (vxlan_spec && vxlan_mask && !is_vni_masked) {
/* If there's vxlan */
- rte_memcpy(&filter->tenant_id, vxlan_spec->vni,
- RTE_DIM(vxlan_spec->vni));
+ rte_memcpy(((uint8_t *)&tenant_id_be + 1),
+ vxlan_spec->vni, 3);
+ filter->tenant_id = rte_be_to_cpu_32(tenant_id_be);
if (!o_eth_spec && !o_eth_mask &&
i_eth_spec && i_eth_mask)
filter->filter_type =
diff --git a/src/dpdk/drivers/net/i40e/i40e_rxtx.c b/src/dpdk/drivers/net/i40e/i40e_rxtx.c
index 8aa55eef..947081db 100644
--- a/src/dpdk/drivers/net/i40e/i40e_rxtx.c
+++ b/src/dpdk/drivers/net/i40e/i40e_rxtx.c
@@ -75,6 +75,12 @@
#define I40E_TXD_CMD (I40E_TX_DESC_CMD_EOP | I40E_TX_DESC_CMD_RS)
+#ifdef RTE_LIBRTE_IEEE1588
+#define I40E_TX_IEEE1588_TMST PKT_TX_IEEE1588_TMST
+#else
+#define I40E_TX_IEEE1588_TMST 0
+#endif
+
#define I40E_TX_CKSUM_OFFLOAD_MASK ( \
PKT_TX_IP_CKSUM | \
PKT_TX_L4_MASK | \
@@ -87,7 +93,9 @@
PKT_TX_OUTER_IP_CKSUM | \
PKT_TX_TCP_SEG | \
PKT_TX_QINQ_PKT | \
- PKT_TX_VLAN_PKT)
+ PKT_TX_VLAN_PKT | \
+ PKT_TX_TUNNEL_MASK | \
+ I40E_TX_IEEE1588_TMST)
#define I40E_TX_OFFLOAD_NOTSUP_MASK \
(PKT_TX_OFFLOAD_MASK ^ I40E_TX_OFFLOAD_MASK)