Lines Matching refs:rxnfc
483 static int enetc_get_rsshash(struct ethtool_rxnfc *rxnfc) in enetc_get_rsshash() argument
499 if (rxnfc->flow_type >= ARRAY_SIZE(rsshash)) in enetc_get_rsshash()
502 rxnfc->data = rsshash[rxnfc->flow_type]; in enetc_get_rsshash()
590 static int enetc_get_rxnfc(struct net_device *ndev, struct ethtool_rxnfc *rxnfc, in enetc_get_rxnfc() argument
596 switch (rxnfc->cmd) { in enetc_get_rxnfc()
598 rxnfc->data = priv->num_rx_rings; in enetc_get_rxnfc()
602 return enetc_get_rsshash(rxnfc); in enetc_get_rxnfc()
605 rxnfc->data = priv->si->num_fs_entries; in enetc_get_rxnfc()
607 rxnfc->rule_cnt = 0; in enetc_get_rxnfc()
610 rxnfc->rule_cnt++; in enetc_get_rxnfc()
613 if (rxnfc->fs.location >= priv->si->num_fs_entries) in enetc_get_rxnfc()
617 rxnfc->fs = priv->cls_rules[rxnfc->fs.location].fs; in enetc_get_rxnfc()
621 rxnfc->data = priv->si->num_fs_entries; in enetc_get_rxnfc()
627 if (j == rxnfc->rule_cnt) in enetc_get_rxnfc()
632 rxnfc->rule_cnt = j; in enetc_get_rxnfc()
641 static int enetc_set_rxnfc(struct net_device *ndev, struct ethtool_rxnfc *rxnfc) in enetc_set_rxnfc() argument
646 switch (rxnfc->cmd) { in enetc_set_rxnfc()
648 if (rxnfc->fs.location >= priv->si->num_fs_entries) in enetc_set_rxnfc()
651 if (rxnfc->fs.ring_cookie >= priv->num_rx_rings && in enetc_set_rxnfc()
652 rxnfc->fs.ring_cookie != RX_CLS_FLOW_DISC) in enetc_set_rxnfc()
655 err = enetc_set_cls_entry(priv->si, &rxnfc->fs, true); in enetc_set_rxnfc()
658 priv->cls_rules[rxnfc->fs.location].fs = rxnfc->fs; in enetc_set_rxnfc()
659 priv->cls_rules[rxnfc->fs.location].used = 1; in enetc_set_rxnfc()
662 if (rxnfc->fs.location >= priv->si->num_fs_entries) in enetc_set_rxnfc()
665 err = enetc_set_cls_entry(priv->si, &rxnfc->fs, false); in enetc_set_rxnfc()
668 priv->cls_rules[rxnfc->fs.location].used = 0; in enetc_set_rxnfc()