Lines Matching refs:rxnfc
414 static int enetc_get_rsshash(struct ethtool_rxnfc *rxnfc) in enetc_get_rsshash() argument
430 if (rxnfc->flow_type >= ARRAY_SIZE(rsshash)) in enetc_get_rsshash()
433 rxnfc->data = rsshash[rxnfc->flow_type]; in enetc_get_rsshash()
521 static int enetc_get_rxnfc(struct net_device *ndev, struct ethtool_rxnfc *rxnfc, in enetc_get_rxnfc() argument
527 switch (rxnfc->cmd) { in enetc_get_rxnfc()
529 rxnfc->data = priv->num_rx_rings; in enetc_get_rxnfc()
533 return enetc_get_rsshash(rxnfc); in enetc_get_rxnfc()
536 rxnfc->data = priv->si->num_fs_entries; in enetc_get_rxnfc()
538 rxnfc->rule_cnt = 0; in enetc_get_rxnfc()
541 rxnfc->rule_cnt++; in enetc_get_rxnfc()
544 if (rxnfc->fs.location >= priv->si->num_fs_entries) in enetc_get_rxnfc()
548 rxnfc->fs = priv->cls_rules[rxnfc->fs.location].fs; in enetc_get_rxnfc()
552 rxnfc->data = priv->si->num_fs_entries; in enetc_get_rxnfc()
558 if (j == rxnfc->rule_cnt) in enetc_get_rxnfc()
563 rxnfc->rule_cnt = j; in enetc_get_rxnfc()
572 static int enetc_set_rxnfc(struct net_device *ndev, struct ethtool_rxnfc *rxnfc) in enetc_set_rxnfc() argument
577 switch (rxnfc->cmd) { in enetc_set_rxnfc()
579 if (rxnfc->fs.location >= priv->si->num_fs_entries) in enetc_set_rxnfc()
582 if (rxnfc->fs.ring_cookie >= priv->num_rx_rings && in enetc_set_rxnfc()
583 rxnfc->fs.ring_cookie != RX_CLS_FLOW_DISC) in enetc_set_rxnfc()
586 err = enetc_set_cls_entry(priv->si, &rxnfc->fs, true); in enetc_set_rxnfc()
589 priv->cls_rules[rxnfc->fs.location].fs = rxnfc->fs; in enetc_set_rxnfc()
590 priv->cls_rules[rxnfc->fs.location].used = 1; in enetc_set_rxnfc()
593 if (rxnfc->fs.location >= priv->si->num_fs_entries) in enetc_set_rxnfc()
596 err = enetc_set_cls_entry(priv->si, &rxnfc->fs, false); in enetc_set_rxnfc()
599 priv->cls_rules[rxnfc->fs.location].used = 0; in enetc_set_rxnfc()