summaryrefslogtreecommitdiffstats
path: root/src/main_dpdk.cpp
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-02-24 06:28:10 -0500
committerimarom <imarom@cisco.com>2016-02-24 06:29:06 -0500
commit252b8ab3f41a18af8561cece71cf07bc9872f39f (patch)
tree60ca5bedb147d54198ca806b5ce6dfe37d5f0f41 /src/main_dpdk.cpp
parent146525ddd44618bc5664cd632a86ff14be1c3ba9 (diff)
virtual NICs does not add 4 bytes of CRC
Diffstat (limited to 'src/main_dpdk.cpp')
-rwxr-xr-xsrc/main_dpdk.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/main_dpdk.cpp b/src/main_dpdk.cpp
index 701ae13e..608a05b3 100755
--- a/src/main_dpdk.cpp
+++ b/src/main_dpdk.cpp
@@ -127,6 +127,11 @@ public:
virtual TrexPlatformApi::driver_speed_e get_driver_speed(uint8_t port_id) = 0;
+ /* by default NIC driver adds CRC */
+ virtual bool has_crc_added() {
+ return true;
+ }
+
virtual int get_min_sample_rate(void)=0;
virtual void update_configuration(port_cfg_t * cfg)=0;
virtual void update_global_config_fdir(port_cfg_t * cfg)=0;
@@ -201,6 +206,10 @@ public:
return TrexPlatformApi::SPEED_1G;
}
+ virtual bool has_crc_added() {
+ return false;
+ }
+
static CTRexExtendedDriverBase * create(){
return ( new CTRexExtendedDriverBase1GVm() );
}
@@ -4927,10 +4936,12 @@ TrexDpdkPlatformApi::port_id_to_cores(uint8_t port_id, std::vector<std::pair<uin
void
TrexDpdkPlatformApi::get_interface_info(uint8_t port_id,
std::string &driver_name,
- driver_speed_e &speed) const {
+ driver_speed_e &speed,
+ bool &has_crc) const {
driver_name = CTRexExtendedDriverDb::Ins()->get_driver_name();
- speed = CTRexExtendedDriverDb::Ins()->get_drv()->get_driver_speed(port_id);
+ speed = CTRexExtendedDriverDb::Ins()->get_drv()->get_driver_speed(port_id);
+ has_crc = CTRexExtendedDriverDb::Ins()->get_drv()->has_crc_added();
}
void