check VIC FW support using FILTER_INFO, remove patch from enic driver
authorHanoh Haim <[email protected]>
Mon, 28 Nov 2016 13:20:19 +0000 (15:20 +0200)
committerHanoh Haim <[email protected]>
Mon, 28 Nov 2016 19:16:09 +0000 (21:16 +0200)
Signed-off-by: Hanoh Haim <[email protected]>
scripts/automation/trex_control_plane/stl/examples/stl_imix_bidir_update.py
src/dpdk/drivers/net/enic/enic_ethdev.c
src/main_dpdk.cpp

index 55d1bbf..22cceb8 100644 (file)
@@ -52,7 +52,7 @@ def imix_test (server):
         c.start(ports = (dir_0 + dir_1), mult = "100kpps", total = True)
 
         while True:
-            for rate in range(200,1000,10):
+            for rate in range(200,3100,10):
     
                 # choose rate and start traffic for 10 seconds on 5 mpps
                 #mult = "30%"
@@ -63,7 +63,7 @@ def imix_test (server):
         
                 c.update(ports = (dir_0 + dir_1), mult = my_mult)
 
-                time.sleep(2);
+                #time.sleep(1);
                 
                 # block until done
                 #c.wait_on_traffic(ports = (dir_0 + dir_1))
index c05476b..6a86e23 100644 (file)
@@ -436,22 +436,6 @@ static void enicpmd_dev_stats_reset(struct rte_eth_dev *eth_dev)
 }
 
 
-int enicpmd_dev_get_fw_support(int port_id, 
-                               uint32_t *ver){
-    struct rte_eth_dev *dev;
-
-    RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
-
-    dev = &rte_eth_devices[port_id];
-    *ver=0;
-
-    struct enic *enic = pmd_priv(dev);
-    enic->adv_filters;
-    if ( enic->adv_filters ==0 ) {
-        return (-1);
-    }
-    return (0);
-}
 
 
 static void enicpmd_dev_info_get(struct rte_eth_dev *eth_dev,
index 6f18b0b..f102acb 100644 (file)
@@ -6852,26 +6852,25 @@ int CTRexExtendedDriverBaseVIC::configure_rx_filter_rules_statefull(CPhyEthIF *
     return 0;
 }
 
-extern "C" int enicpmd_dev_get_fw_support(int port_id,
-                                          uint32_t *ver);
 
 
 int CTRexExtendedDriverBaseVIC::verify_fw_ver(int port_id) {
 
-    uint32_t ver;
-    int ret=enicpmd_dev_get_fw_support(port_id,&ver);
+    struct rte_eth_fdir_info fdir_info;
 
-    if (ret==0) {
-        if (CGlobalInfo::m_options.preview.getVMode() >= 1) {
-            printf("VIC port %d: FW support advanced filtering \n", port_id);
+    if ( rte_eth_dev_filter_ctrl(port_id,RTE_ETH_FILTER_FDIR, RTE_ETH_FILTER_INFO,(void *)&fdir_info) == 0 ){
+        if ( fdir_info.flow_types_mask[0] & (1<< RTE_ETH_FLOW_NONFRAG_IPV4_OTHER) ) {
+           /* support new features */
+            if (CGlobalInfo::m_options.preview.getVMode() >= 1) {
+                printf("VIC port %d: FW support advanced filtering \n", port_id);
+            }
+            return (0);
         }
-    }else{
-        printf("Error: VIC firmware should upgrade to support advanced filtering \n");
-        printf("  Please refer to %s for upgrade instructions\n",
-               "https://trex-tgn.cisco.com/trex/doc/trex_manual.html");
-        exit(1);
     }
-    return (0);
+    printf("Error: VIC firmware should upgrade to support advanced filtering \n");
+    printf("  Please refer to %s for upgrade instructions\n",
+           "https://trex-tgn.cisco.com/trex/doc/trex_manual.html");
+    exit(1);
 }