summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/prox_port_cfg.c
diff options
context:
space:
mode:
authorXavier Simonart <xavier.simonart@intel.com>2019-03-04 14:50:04 +0100
committerXavier Simonart <xavier.simonart@intel.com>2019-03-06 17:17:16 +0100
commit22d1e458389ae6c6eb98d9c14c4f1cd8e2009f3d (patch)
treea324bbaaa772d8e45d61476ce92b2d9ebaeb448a /VNFs/DPPD-PROX/prox_port_cfg.c
parent40c34eda9e2be84b9dcc98326d0609f1fa89007f (diff)
PROX generator: performance optimization (2/4)
Improve PROX generator performance by pre-calculating bytes_to_tsc. This improvement is only implemented for non-pcap generator, where only few different packet sizes are usually generated. This change might have a negative performance impact in some cases, if many different packet sizes are generated, resulting in higher memory usage. This is the case for instance if random is applied to packet size. In addition, simplified the rx path, receiving now only MAX_PKT_BURST packets per handle loop. Before we were trying to empty the NIC looping on RX packets, ending up with many rx packets per handle loop. This was used to determine an lower bound for the time the packet was received. We now set the lower bound when less than MAX_PKT_BURST has been received. Change-Id: I1ce813d7e4ac1577ea412c590add5d6f94b36ec7 Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
Diffstat (limited to 'VNFs/DPPD-PROX/prox_port_cfg.c')
-rw-r--r--VNFs/DPPD-PROX/prox_port_cfg.c42
1 files changed, 20 insertions, 22 deletions
diff --git a/VNFs/DPPD-PROX/prox_port_cfg.c b/VNFs/DPPD-PROX/prox_port_cfg.c
index 6dc023dc..a538be4f 100644
--- a/VNFs/DPPD-PROX/prox_port_cfg.c
+++ b/VNFs/DPPD-PROX/prox_port_cfg.c
@@ -320,10 +320,10 @@ static void print_port_capa(struct prox_port_cfg *port_cfg)
plog_info("\t\tPort driver is %s\n", port_cfg->driver_name);
#if RTE_VERSION >= RTE_VERSION_NUM(16,4,0,0)
plog_info("\t\tSupported speed mask = 0x%x\n", port_cfg->dev_info.speed_capa);
- if (port_cfg->link_speed != UINT32_MAX) {
- plog_info("\t\tHighest link speed capa = %d Mbps\n", port_cfg->link_speed);
- }
#endif
+ if (port_cfg->max_link_speed != UINT32_MAX) {
+ plog_info("\t\tHighest link speed capa = %d Mbps\n", port_cfg->max_link_speed);
+ }
#if RTE_VERSION >= RTE_VERSION_NUM(18,8,0,1)
plog_info("\t\tRX offload capa = 0x%lx = ", port_cfg->dev_info.rx_offload_capa);
@@ -410,12 +410,12 @@ static void print_port_capa(struct prox_port_cfg *port_cfg)
#endif
}
-static void get_link_speed(struct prox_port_cfg *port_cfg)
+static void get_max_link_speed(struct prox_port_cfg *port_cfg)
{
-#if RTE_VERSION >= RTE_VERSION_NUM(16,4,0,0)
- port_cfg->link_speed = UINT32_MAX;
+ port_cfg->max_link_speed = UINT32_MAX;
- // virtio and vmxnet3 reports fake link_speed
+#if RTE_VERSION >= RTE_VERSION_NUM(16,4,0,0)
+ // virtio and vmxnet3 reports fake max_link_speed
if (strcmp(port_cfg->short_name, "vmxnet3") && strcmp(port_cfg->short_name, "virtio")) {
// Get link_speed from highest capability from the port
// This will be used by gen and lat for extrapolation purposes
@@ -424,29 +424,29 @@ static void get_link_speed(struct prox_port_cfg *port_cfg)
// and might result in wrong exrapolation, and hence should not be used
// for extrapolation purposes
if (port_cfg->dev_info.speed_capa & ETH_LINK_SPEED_100G)
- port_cfg->link_speed = ETH_SPEED_NUM_100G;
+ port_cfg->max_link_speed = ETH_SPEED_NUM_100G;
else if (port_cfg->dev_info.speed_capa & ETH_LINK_SPEED_56G)
- port_cfg->link_speed = ETH_SPEED_NUM_56G;
+ port_cfg->max_link_speed = ETH_SPEED_NUM_56G;
else if (port_cfg->dev_info.speed_capa & ETH_LINK_SPEED_50G)
- port_cfg->link_speed = ETH_SPEED_NUM_50G;
+ port_cfg->max_link_speed = ETH_SPEED_NUM_50G;
else if (port_cfg->dev_info.speed_capa & ETH_LINK_SPEED_40G)
- port_cfg->link_speed = ETH_SPEED_NUM_40G;
+ port_cfg->max_link_speed = ETH_SPEED_NUM_40G;
else if (port_cfg->dev_info.speed_capa & ETH_LINK_SPEED_25G)
- port_cfg->link_speed = ETH_SPEED_NUM_25G;
+ port_cfg->max_link_speed = ETH_SPEED_NUM_25G;
else if (port_cfg->dev_info.speed_capa & ETH_LINK_SPEED_20G)
- port_cfg->link_speed = ETH_SPEED_NUM_20G;
+ port_cfg->max_link_speed = ETH_SPEED_NUM_20G;
else if (port_cfg->dev_info.speed_capa & ETH_LINK_SPEED_10G)
- port_cfg->link_speed = ETH_SPEED_NUM_10G;
+ port_cfg->max_link_speed = ETH_SPEED_NUM_10G;
else if (port_cfg->dev_info.speed_capa & ETH_LINK_SPEED_5G)
- port_cfg->link_speed = ETH_SPEED_NUM_5G;
+ port_cfg->max_link_speed = ETH_SPEED_NUM_5G;
else if (port_cfg->dev_info.speed_capa & ETH_LINK_SPEED_2_5G)
- port_cfg->link_speed = ETH_SPEED_NUM_2_5G;
+ port_cfg->max_link_speed = ETH_SPEED_NUM_2_5G;
else if (port_cfg->dev_info.speed_capa & ETH_LINK_SPEED_1G)
- port_cfg->link_speed = ETH_SPEED_NUM_1G;
+ port_cfg->max_link_speed = ETH_SPEED_NUM_1G;
else if (port_cfg->dev_info.speed_capa & (ETH_LINK_SPEED_100M_HD | ETH_LINK_SPEED_100M))
- port_cfg->link_speed = ETH_SPEED_NUM_100M;
+ port_cfg->max_link_speed = ETH_SPEED_NUM_100M;
else if (port_cfg->dev_info.speed_capa & (ETH_LINK_SPEED_10M_HD | ETH_LINK_SPEED_10M))
- port_cfg->link_speed = ETH_SPEED_NUM_10M;
+ port_cfg->max_link_speed = ETH_SPEED_NUM_10M;
}
#endif
@@ -459,7 +459,7 @@ static void init_port(struct prox_port_cfg *port_cfg)
uint8_t port_id;
int ret;
- get_link_speed(port_cfg);
+ get_max_link_speed(port_cfg);
print_port_capa(port_cfg);
port_id = port_cfg - prox_port_cfg;
PROX_PANIC(port_cfg->n_rxq == 0 && port_cfg->n_txq == 0,
@@ -652,9 +652,7 @@ static void init_port(struct prox_port_cfg *port_cfg)
rte_eth_link_get(port_id, &link);
port_cfg->link_up = link.link_status;
-#if RTE_VERSION < RTE_VERSION_NUM(16,4,0,0)
port_cfg->link_speed = link.link_speed;
-#endif
if (link.link_status) {
plog_info("Link Up - speed %'u Mbps - %s\n",