+ ret = rte_eth_dev_filter_supported(port_id, RTE_ETH_FILTER_FDIR);
+ if (ret < 0) {
+ /* use the old fdir APIs to get info */
+ struct rte_eth_fdir fdir;
+ memset(&fdir, 0, sizeof(fdir));
+ ret = rte_eth_dev_fdir_get_infos(port_id, &fdir);
+ if (ret < 0) {
+ printf("\n getting fdir info fails on port %-2d\n",
+ port_id);
+ return;
+ }
+ printf("\n %s FDIR infos for port %-2d %s\n",
+ fdir_stats_border, port_id, fdir_stats_border);
+ printf(" collision: %-10"PRIu64" free: %"PRIu64"\n"
+ " maxhash: %-10"PRIu64" maxlen: %"PRIu64"\n"
+ " add: %-10"PRIu64" remove: %"PRIu64"\n"
+ " f_add: %-10"PRIu64" f_remove: %"PRIu64"\n",
+ (uint64_t)(fdir.collision), (uint64_t)(fdir.free),
+ (uint64_t)(fdir.maxhash), (uint64_t)(fdir.maxlen),
+ fdir.add, fdir.remove, fdir.f_add, fdir.f_remove);
+ printf(" %s############################%s\n",
+ fdir_stats_border, fdir_stats_border);
+ return;
+ }
+
+ memset(&fdir_info, 0, sizeof(fdir_info));
+ rte_eth_dev_filter_ctrl(port_id, RTE_ETH_FILTER_FDIR,
+ RTE_ETH_FILTER_INFO, &fdir_info);
+ memset(&fdir_stat, 0, sizeof(fdir_stat));
+ rte_eth_dev_filter_ctrl(port_id, RTE_ETH_FILTER_FDIR,
+ RTE_ETH_FILTER_STATS, &fdir_stat);