Changeset e47ab4d
- Timestamp:
- 12/16/16 18:40:53 (4 years ago)
- Branches:
- 4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, master, ndag_format, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
- Children:
- d31b952
- Parents:
- 47c4490
- git-author:
- EaseTheWorld <easetheworld@…> (12/16/16 18:40:53)
- git-committer:
- GitHub <noreply@…> (12/16/16 18:40:53)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/format_dpdk.c
r5e3f16c re47ab4d 364 364 #endif 365 365 char mempool_name[MEMPOOL_NAME_LEN]; /* The name of the mempool that we are using */ 366 uint8_t rss_key[40]; // This is the RSS KEY366 enum hasher_types hasher_type; 367 367 /* To improve single-threaded performance we always batch reading 368 368 * packets, in a burst, otherwise the parallel library does this for us */ … … 856 856 FORMAT(libtrace)->burst_size = 0; 857 857 FORMAT(libtrace)->burst_offset = 0; 858 FORMAT(libtrace)->hasher_type = HASHER_BALANCE; 858 859 859 860 /* Make our first stream */ … … 929 930 return 0; 930 931 case TRACE_OPTION_HASHER: 931 switch (*((enum hasher_types *) data)) 932 { 933 case HASHER_BALANCE: 934 case HASHER_UNIDIRECTIONAL: 935 toeplitz_create_unikey(FORMAT(libtrace)->rss_key); 936 return 0; 937 case HASHER_BIDIRECTIONAL: 938 toeplitz_create_bikey(FORMAT(libtrace)->rss_key); 939 return 0; 940 case HASHER_CUSTOM: 941 // We don't support these 942 return -1; 943 } 944 break; 932 FORMAT(libtrace)->hasher_type=*(enum hasher_types*)data; 933 return 0; 945 934 case TRACE_OPTION_FILTER: 946 935 /* TODO filtering */ … … 992 981 .rx_adv_conf = { 993 982 .rss_conf = { 994 // .rss_key = &rss_key, // We set this per format995 983 .rss_hf = RX_RSS_FLAGS, 996 984 }, … … 1350 1338 return -1; 1351 1339 } 1340 } 1341 1342 // for symmetric rss, repeat 2 bytes 1343 // otherwise, use default rss key in drivers 1344 uint8_t rss_key[52]; // 52 for i40e, 40 for others 1345 if (format_data->hasher_type == HASHER_BIDIRECTIONAL) { 1346 #if RTE_VERSION >= RTE_VERSION_NUM(2, 1, 0, 0) 1347 struct rte_eth_dev_info dev_info; 1348 rte_eth_dev_info_get(format_data->port, &dev_info); 1349 port_conf.rx_adv_conf.rss_conf.rss_key_len = dev_info.hash_key_size; 1350 #else 1351 port_conf.rx_adv_conf.rss_conf.rss_key_len = sizeof(rss_key); 1352 #endif 1353 // first 2 bytes of rss_intel_key from drivers/net/e1000/igb_rxtx.c 1354 static uint8_t rss_key_2bytes[] = {0x6D, 0x5A}; 1355 int i; 1356 for (i=0; i<port_conf.rx_adv_conf.rss_conf.rss_key_len; i += sizeof(rss_key_2bytes)) 1357 memcpy(rss_key + i, rss_key_2bytes, sizeof(rss_key_2bytes)); 1358 port_conf.rx_adv_conf.rss_conf.rss_key = rss_key; 1352 1359 } 1353 1360
Note: See TracChangeset
for help on using the changeset viewer.