X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fi40e%2Fi40e_flow.c;h=61021037c857d09786251f566334f1d25a6cc26f;hb=4b701523742e3753d58949846ac4eeebc6d5a78f;hp=3c0af70c0ca48e9f851a9eff8ed962fb9d1fb6e4;hpb=3106ca84dc2de241382461d93d49d5a643145c70;p=dpdk.git diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index 3c0af70c0c..61021037c8 100644 --- a/drivers/net/i40e/i40e_flow.c +++ b/drivers/net/i40e/i40e_flow.c @@ -2349,6 +2349,37 @@ i40e_flow_set_fdir_inset(struct i40e_pf *pf, if (num < 0) return -EINVAL; + if (pf->support_multi_driver) { + for (i = 0; i < num; i++) + if (i40e_read_rx_ctl(hw, + I40E_GLQF_FD_MSK(i, pctype)) != + mask_reg[i]) { + PMD_DRV_LOG(ERR, "Input set setting is not" + " supported with" + " `support-multi-driver`" + " enabled!"); + return -EPERM; + } + for (i = num; i < I40E_INSET_MASK_NUM_REG; i++) + if (i40e_read_rx_ctl(hw, + I40E_GLQF_FD_MSK(i, pctype)) != 0) { + PMD_DRV_LOG(ERR, "Input set setting is not" + " supported with" + " `support-multi-driver`" + " enabled!"); + return -EPERM; + } + + } else { + for (i = 0; i < num; i++) + i40e_check_write_reg(hw, I40E_GLQF_FD_MSK(i, pctype), + mask_reg[i]); + /*clear unused mask registers of the pctype */ + for (i = num; i < I40E_INSET_MASK_NUM_REG; i++) + i40e_check_write_reg(hw, + I40E_GLQF_FD_MSK(i, pctype), 0); + } + inset_reg |= i40e_translate_input_set_reg(hw->mac.type, input_set); i40e_check_write_reg(hw, I40E_PRTQF_FD_INSET(pctype, 0), @@ -2357,13 +2388,6 @@ i40e_flow_set_fdir_inset(struct i40e_pf *pf, (uint32_t)((inset_reg >> I40E_32_BIT_WIDTH) & UINT32_MAX)); - for (i = 0; i < num; i++) - i40e_check_write_reg(hw, I40E_GLQF_FD_MSK(i, pctype), - mask_reg[i]); - - /*clear unused mask registers of the pctype */ - for (i = num; i < I40E_INSET_MASK_NUM_REG; i++) - i40e_check_write_reg(hw, I40E_GLQF_FD_MSK(i, pctype), 0); I40E_WRITE_FLUSH(hw); pf->fdir.input_set[pctype] = input_set; @@ -3105,7 +3129,7 @@ i40e_flow_parse_fdir_action(struct rte_eth_dev *dev, NEXT_ITEM_OF_ACTION(act, actions, index); switch (act->type) { case RTE_FLOW_ACTION_TYPE_MARK: - if (!mark_spec) { + if (mark_spec) { /* Double MARK actions requested */ rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, act, @@ -3117,7 +3141,7 @@ i40e_flow_parse_fdir_action(struct rte_eth_dev *dev, filter->soft_id = mark_spec->id; break; case RTE_FLOW_ACTION_TYPE_FLAG: - if (!mark_spec) { + if (mark_spec) { /* MARK + FLAG not supported */ rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, act, @@ -4771,10 +4795,11 @@ i40e_flow_destroy(struct rte_eth_dev *dev, &((struct i40e_fdir_filter *)flow->rule)->fdir, 0); /* If the last flow is destroyed, disable fdir. */ - if (!ret && !TAILQ_EMPTY(&pf->fdir.fdir_list)) { + if (!ret && TAILQ_EMPTY(&pf->fdir.fdir_list)) { i40e_fdir_teardown(pf); dev->data->dev_conf.fdir_conf.mode = RTE_FDIR_MODE_NONE; + i40e_fdir_rx_proc_enable(dev, 0); } break; case RTE_ETH_FILTER_HASH: @@ -4931,6 +4956,9 @@ i40e_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *error) return -rte_errno; } + /* Disable FDIR processing as all FDIR rules are now flushed */ + i40e_fdir_rx_proc_enable(dev, 0); + return ret; }