summaryrefslogtreecommitdiffstats
path: root/src/dpdk/drivers/net/i40e/i40e_ethdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dpdk/drivers/net/i40e/i40e_ethdev.c')
-rw-r--r--src/dpdk/drivers/net/i40e/i40e_ethdev.c102
1 files changed, 93 insertions, 9 deletions
diff --git a/src/dpdk/drivers/net/i40e/i40e_ethdev.c b/src/dpdk/drivers/net/i40e/i40e_ethdev.c
index 4492bcc1..f8ee5a60 100644
--- a/src/dpdk/drivers/net/i40e/i40e_ethdev.c
+++ b/src/dpdk/drivers/net/i40e/i40e_ethdev.c
@@ -704,6 +704,9 @@ static inline void i40e_GLQF_reg_init(struct i40e_hw *hw)
#define I40E_FLOW_CONTROL_ETHERTYPE 0x8808
+#define TREX_PATCH
+#define TREX_PATCH_LOW_LATENCY
+
/*
* Add a ethertype filter to drop all flow control frames transmitted
* from VSIs.
@@ -2515,9 +2518,11 @@ i40e_read_stats_registers(struct i40e_pf *pf, struct i40e_hw *hw)
I40E_GLPRT_PTC9522L(hw->port),
pf->offset_loaded, &os->tx_size_big,
&ns->tx_size_big);
+#ifndef TREX_PATCH
i40e_stat_update_32(hw, I40E_GLQF_PCNT(pf->fdir.match_counter_index),
pf->offset_loaded,
&os->fd_sb_match, &ns->fd_sb_match);
+#endif
/* GLPRT_MSPDC not supported */
/* GLPRT_XEC not supported */
@@ -2543,10 +2548,17 @@ i40e_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
pf->main_vsi->eth_stats.rx_multicast +
pf->main_vsi->eth_stats.rx_broadcast -
pf->main_vsi->eth_stats.rx_discards;
+#ifndef TREX_PATCH
stats->opackets = pf->main_vsi->eth_stats.tx_unicast +
pf->main_vsi->eth_stats.tx_multicast +
pf->main_vsi->eth_stats.tx_broadcast;
stats->ibytes = ns->eth.rx_bytes;
+#else
+ /* Hanoch: move to global transmit and not pf->vsi and we have two high and low priorty */
+ stats->opackets = ns->eth.tx_unicast +ns->eth.tx_multicast +ns->eth.tx_broadcast;
+ stats->ibytes = pf->main_vsi->eth_stats.rx_bytes;
+#endif
+
stats->obytes = ns->eth.tx_bytes;
stats->oerrors = ns->eth.tx_errors +
pf->main_vsi->eth_stats.tx_errors;
@@ -4327,10 +4339,18 @@ i40e_veb_setup(struct i40e_pf *pf, struct i40e_vsi *vsi)
/* create floating veb if vsi is NULL */
if (vsi != NULL) {
ret = i40e_aq_add_veb(hw, veb->uplink_seid, vsi->seid,
- I40E_DEFAULT_TCMAP, false,
+#ifdef TREX_PATCH_LOW_LATENCY
+ vsi->enabled_tc, false,
+#else
+ I40E_DEFAULT_TCMAP, false,
+#endif
&veb->seid, false, NULL);
} else {
+#ifdef TREX_PATCH_LOW_LATENCY
+ ret = i40e_aq_add_veb(hw, 0, 0, vsi->enabled_tc,
+#else
ret = i40e_aq_add_veb(hw, 0, 0, I40E_DEFAULT_TCMAP,
+#endif
true, &veb->seid, false, NULL);
}
@@ -4489,6 +4509,57 @@ i40e_update_default_filter_setting(struct i40e_vsi *vsi)
return i40e_vsi_add_mac(vsi, &filter);
}
+#ifdef TREX_PATCH_LOW_LATENCY
+static int
+i40e_vsi_update_tc_max_bw(struct i40e_vsi *vsi, u16 credit){
+ struct i40e_hw *hw = I40E_VSI_TO_HW(vsi);
+ int ret;
+
+ if (!vsi->seid) {
+ PMD_DRV_LOG(ERR, "seid not valid");
+ return -EINVAL;
+ }
+
+ ret = i40e_aq_config_vsi_bw_limit(hw, vsi->seid, credit,0, NULL);
+ if (ret != I40E_SUCCESS) {
+ PMD_DRV_LOG(ERR, "Failed to configure TC BW");
+ return ret;
+ }
+ return (0);
+}
+
+static int
+i40e_vsi_update_tc_bandwidth_ex(struct i40e_vsi *vsi)
+{
+ struct i40e_hw *hw = I40E_VSI_TO_HW(vsi);
+ int i, ret;
+ struct i40e_aqc_configure_vsi_ets_sla_bw_data tc_bw_data;
+ struct i40e_aqc_configure_vsi_tc_bw_data * res_buffer;
+
+ if (!vsi->seid) {
+ PMD_DRV_LOG(ERR, "seid not valid");
+ return -EINVAL;
+ }
+
+ memset(&tc_bw_data, 0, sizeof(tc_bw_data));
+ tc_bw_data.tc_valid_bits = 3;
+
+ /* enable TC 0,1 */
+ ret = i40e_aq_config_vsi_ets_sla_bw_limit(hw, vsi->seid, &tc_bw_data, NULL);
+ if (ret != I40E_SUCCESS) {
+ PMD_DRV_LOG(ERR, "Failed to configure TC BW");
+ return ret;
+ }
+
+ vsi->enabled_tc=3;
+ res_buffer = ( struct i40e_aqc_configure_vsi_tc_bw_data *)&tc_bw_data;
+ (void)rte_memcpy(vsi->info.qs_handle, res_buffer->qs_handles,
+ sizeof(vsi->info.qs_handle));
+
+ return I40E_SUCCESS;
+}
+#endif
+
/*
* i40e_vsi_get_bw_config - Query VSI BW Information
* @vsi: the VSI to be queried
@@ -4565,7 +4636,8 @@ i40e_enable_pf_lb(struct i40e_pf *pf)
/* Use the FW API if FW >= v5.0 */
if (hw->aq.fw_maj_ver < 5) {
- PMD_INIT_LOG(ERR, "FW < v5.0, cannot enable loopback");
+ //TREX_PATCH - changed from ERR to INFO. Most of our customers do not have latest FW
+ PMD_INIT_LOG(INFO, "FW < v5.0, cannot enable loopback");
return;
}
@@ -9831,6 +9903,7 @@ i40e_dcb_hw_configure(struct i40e_pf *pf,
*
* Returns 0 on success, negative value on failure
*/
+//TREX_PATCH - changed all ERR to INFO in below func
static int
i40e_dcb_init_configure(struct rte_eth_dev *dev, bool sw_dcb)
{
@@ -9839,7 +9912,7 @@ i40e_dcb_init_configure(struct rte_eth_dev *dev, bool sw_dcb)
int ret = 0;
if ((pf->flags & I40E_FLAG_DCB) == 0) {
- PMD_INIT_LOG(ERR, "HW doesn't support DCB");
+ PMD_INIT_LOG(INFO, "HW doesn't support DCB");
return -ENOTSUP;
}
@@ -9861,8 +9934,12 @@ i40e_dcb_init_configure(struct rte_eth_dev *dev, bool sw_dcb)
hw->local_dcbx_config.etscfg.willing = 0;
hw->local_dcbx_config.etscfg.maxtcs = 0;
hw->local_dcbx_config.etscfg.tcbwtable[0] = 100;
- hw->local_dcbx_config.etscfg.tsatable[0] =
- I40E_IEEE_TSA_ETS;
+ hw->local_dcbx_config.etscfg.tsatable[0] = I40E_IEEE_TSA_ETS;
+#ifdef TREX_PATCH_LOW_LATENCY
+ hw->local_dcbx_config.etscfg.tcbwtable[1] = 0;
+ hw->local_dcbx_config.etscfg.tsatable[1] = I40E_IEEE_TSA_STRICT;
+ hw->local_dcbx_config.etscfg.prioritytable[1] = 1;
+#endif
hw->local_dcbx_config.etsrec =
hw->local_dcbx_config.etscfg;
hw->local_dcbx_config.pfc.willing = 0;
@@ -9877,13 +9954,20 @@ i40e_dcb_init_configure(struct rte_eth_dev *dev, bool sw_dcb)
I40E_APP_PROTOID_FCOE;
ret = i40e_set_dcb_config(hw);
if (ret) {
- PMD_INIT_LOG(ERR,
+ PMD_INIT_LOG(INFO,
"default dcb config fails. err = %d, aq_err = %d.",
ret, hw->aq.asq_last_status);
return -ENOSYS;
}
+#ifdef TREX_PATCH_LOW_LATENCY
+ if (i40e_vsi_update_tc_bandwidth_ex(pf->main_vsi) !=
+ I40E_SUCCESS) {
+ PMD_DRV_LOG(ERR, "Failed to update TC bandwidth");
+ return -ENOSYS;
+ }
+#endif
} else {
- PMD_INIT_LOG(ERR,
+ PMD_INIT_LOG(INFO,
"DCB initialization in FW fails, err = %d, aq_err = %d.",
ret, hw->aq.asq_last_status);
return -ENOTSUP;
@@ -9896,12 +9980,12 @@ i40e_dcb_init_configure(struct rte_eth_dev *dev, bool sw_dcb)
ret = i40e_init_dcb(hw);
if (!ret) {
if (hw->dcbx_status == I40E_DCBX_STATUS_DISABLED) {
- PMD_INIT_LOG(ERR,
+ PMD_INIT_LOG(INFO,
"HW doesn't support DCBX offload.");
return -ENOTSUP;
}
} else {
- PMD_INIT_LOG(ERR,
+ PMD_INIT_LOG(INFO,
"DCBX configuration failed, err = %d, aq_err = %d.",
ret, hw->aq.asq_last_status);
return -ENOTSUP;