Skip to content

Commit

Permalink
net/i40e: fix global register recovery
Browse files Browse the repository at this point in the history
[ upstream commit ac241c7 ]

PMD configures the global register I40E_GLINT_CTL during
device initialization to work around the Rx write back
issue. But when a device is bound from DPDK to kernel,
the global register is not recovered to the original
state, it will cause kernel driver performance drop issue.
This patch fixes this issue.

Fixes: be6c228 ("i40e: support Rx interrupt")
Fixes: 4ab8314 ("net/i40e: fix interrupt conflict with multi-driver")

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
  • Loading branch information
beileix authored and bluca committed Feb 2, 2021
1 parent 54aa2da commit de803d7
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions drivers/net/i40e/i40e_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,21 @@ static inline void i40e_config_automask(struct i40e_pf *pf)
I40E_WRITE_REG(hw, I40E_GLINT_CTL, val);
}

static inline void i40e_clear_automask(struct i40e_pf *pf)
{
struct i40e_hw *hw = I40E_PF_TO_HW(pf);
uint32_t val;

val = I40E_READ_REG(hw, I40E_GLINT_CTL);
val &= ~(I40E_GLINT_CTL_DIS_AUTOMASK_PF0_MASK |
I40E_GLINT_CTL_DIS_AUTOMASK_VF0_MASK);

if (!pf->support_multi_driver)
val &= ~I40E_GLINT_CTL_DIS_AUTOMASK_N_MASK;

I40E_WRITE_REG(hw, I40E_GLINT_CTL, val);
}

#define I40E_FLOW_CONTROL_ETHERTYPE 0x8808

/*
Expand Down Expand Up @@ -2741,6 +2756,8 @@ i40e_dev_close(struct rte_eth_dev *dev)
/* Remove all Traffic Manager configuration */
i40e_tm_conf_uninit(dev);

i40e_clear_automask(pf);

hw->adapter_closed = 1;
return ret;
}
Expand Down

0 comments on commit de803d7

Please sign in to comment.