X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fi40e%2Fi40e_fdir.c;h=af075fda2a2486f9a14b779687ea968b5be40568;hb=8089aa75c513e76a0afc029389a52e545786a9d1;hp=20658816ee0a24f4e204c6290d8800258a2685bd;hpb=4b5b8ce8ffe57c611ccee438dea67b612021cfba;p=dpdk.git diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c index 20658816ee..af075fda2a 100644 --- a/drivers/net/i40e/i40e_fdir.c +++ b/drivers/net/i40e/i40e_fdir.c @@ -160,7 +160,7 @@ i40e_fdir_setup(struct i40e_pf *pf) int err = I40E_SUCCESS; char z_name[RTE_MEMZONE_NAMESIZE]; const struct rte_memzone *mz = NULL; - struct rte_eth_dev *eth_dev = pf->adapter->eth_dev; + struct rte_eth_dev *eth_dev = &rte_eth_devices[pf->dev_data->port_id]; uint16_t i; if ((pf->flags & I40E_FLAG_FDIR) == 0) { @@ -284,7 +284,7 @@ i40e_fdir_teardown(struct i40e_pf *pf) { struct i40e_hw *hw = I40E_PF_TO_HW(pf); struct i40e_vsi *vsi; - struct rte_eth_dev *dev = pf->adapter->eth_dev; + struct rte_eth_dev *dev = &rte_eth_devices[pf->dev_data->port_id]; vsi = pf->fdir.fdir_vsi; if (!vsi) @@ -1607,13 +1607,13 @@ i40e_flow_set_fdir_inset(struct i40e_pf *pf, } /* Check if the configuration is conflicted */ - if (pf->fdir.inset_flag[pctype] && + if (pf->fdir.flow_count[pctype] && memcmp(&pf->fdir.input_set[pctype], &input_set, sizeof(uint64_t))) { PMD_DRV_LOG(ERR, "Conflict with the first rule's input set."); return -EINVAL; } - if (pf->fdir.inset_flag[pctype] && + if (pf->fdir.flow_count[pctype] && !memcmp(&pf->fdir.input_set[pctype], &input_set, sizeof(uint64_t))) return 0; @@ -1666,7 +1666,6 @@ i40e_flow_set_fdir_inset(struct i40e_pf *pf, I40E_WRITE_FLUSH(hw); pf->fdir.input_set[pctype] = input_set; - pf->fdir.inset_flag[pctype] = 1; return 0; } @@ -1890,11 +1889,13 @@ i40e_flow_add_del_fdir_filter(struct rte_eth_dev *dev, } if (add) { + fdir_info->flow_count[pctype]++; fdir_info->fdir_actual_cnt++; if (fdir_info->fdir_invalprio == 1 && fdir_info->fdir_guarantee_free_space > 0) fdir_info->fdir_guarantee_free_space--; } else { + fdir_info->flow_count[pctype]--; fdir_info->fdir_actual_cnt--; if (fdir_info->fdir_invalprio == 1 && fdir_info->fdir_guarantee_free_space <