Commit 082def10 authored by Anjali Singhai Jain's avatar Anjali Singhai Jain Committed by Jeff Kirsher

i40e: Report cmd->data in ETHTOOL_GRXCLSRLCNT instead of ETHTOOL_GRXCLSRULE

Based on review feedback from upstream cmd->data is not
defined in ETHTOOL_GRXCLSRULE but needs to be reported in
ETHTOOL_GRXCLSRLCNT. Also use a helper function to calculate the total
filter count.

Change-ID: Iaacbf729527b73290c4fdad837b379b44fd7dd20
Signed-off-by: default avatarAnjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: default avatarJim Young <jamesx.m.young@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent b2d36c03
...@@ -534,6 +534,15 @@ static inline bool i40e_rx_is_programming_status(u64 qw) ...@@ -534,6 +534,15 @@ static inline bool i40e_rx_is_programming_status(u64 qw)
(qw >> I40E_RX_PROG_STATUS_DESC_LENGTH_SHIFT); (qw >> I40E_RX_PROG_STATUS_DESC_LENGTH_SHIFT);
} }
/**
* i40e_get_fd_cnt_all - get the total FD filter space available
* @pf: pointer to the pf struct
**/
static inline int i40e_get_fd_cnt_all(struct i40e_pf *pf)
{
return pf->hw.fdir_shared_filter_count + pf->fdir_pf_filter_count;
}
/* needed by i40e_ethtool.c */ /* needed by i40e_ethtool.c */
int i40e_up(struct i40e_vsi *vsi); int i40e_up(struct i40e_vsi *vsi);
void i40e_down(struct i40e_vsi *vsi); void i40e_down(struct i40e_vsi *vsi);
......
...@@ -1131,8 +1131,7 @@ static int i40e_get_ethtool_fdir_all(struct i40e_pf *pf, ...@@ -1131,8 +1131,7 @@ static int i40e_get_ethtool_fdir_all(struct i40e_pf *pf,
int cnt = 0; int cnt = 0;
/* report total rule count */ /* report total rule count */
cmd->data = pf->hw.fdir_shared_filter_count + cmd->data = i40e_get_fd_cnt_all(pf);
pf->fdir_pf_filter_count;
hlist_for_each_entry_safe(rule, node2, hlist_for_each_entry_safe(rule, node2,
&pf->fdir_filter_list, fdir_node) { &pf->fdir_filter_list, fdir_node) {
...@@ -1166,10 +1165,6 @@ static int i40e_get_ethtool_fdir_entry(struct i40e_pf *pf, ...@@ -1166,10 +1165,6 @@ static int i40e_get_ethtool_fdir_entry(struct i40e_pf *pf,
struct i40e_fdir_filter *rule = NULL; struct i40e_fdir_filter *rule = NULL;
struct hlist_node *node2; struct hlist_node *node2;
/* report total rule count */
cmd->data = pf->hw.fdir_shared_filter_count +
pf->fdir_pf_filter_count;
hlist_for_each_entry_safe(rule, node2, hlist_for_each_entry_safe(rule, node2,
&pf->fdir_filter_list, fdir_node) { &pf->fdir_filter_list, fdir_node) {
if (fsp->location <= rule->fd_id) if (fsp->location <= rule->fd_id)
...@@ -1220,6 +1215,8 @@ static int i40e_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd, ...@@ -1220,6 +1215,8 @@ static int i40e_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd,
break; break;
case ETHTOOL_GRXCLSRLCNT: case ETHTOOL_GRXCLSRLCNT:
cmd->rule_cnt = pf->fdir_pf_active_filters; cmd->rule_cnt = pf->fdir_pf_active_filters;
/* report total rule count */
cmd->data = i40e_get_fd_cnt_all(pf);
ret = 0; ret = 0;
break; break;
case ETHTOOL_GRXCLSRULE: case ETHTOOL_GRXCLSRULE:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment