Lines Matching refs:rxnfc
288 static int enetc_get_rsshash(struct ethtool_rxnfc *rxnfc) in enetc_get_rsshash() argument
304 if (rxnfc->flow_type >= ARRAY_SIZE(rsshash)) in enetc_get_rsshash()
307 rxnfc->data = rsshash[rxnfc->flow_type]; in enetc_get_rsshash()
395 static int enetc_get_rxnfc(struct net_device *ndev, struct ethtool_rxnfc *rxnfc, in enetc_get_rxnfc() argument
401 switch (rxnfc->cmd) { in enetc_get_rxnfc()
403 rxnfc->data = priv->num_rx_rings; in enetc_get_rxnfc()
407 return enetc_get_rsshash(rxnfc); in enetc_get_rxnfc()
410 rxnfc->data = priv->si->num_fs_entries; in enetc_get_rxnfc()
412 rxnfc->rule_cnt = 0; in enetc_get_rxnfc()
415 rxnfc->rule_cnt++; in enetc_get_rxnfc()
418 if (rxnfc->fs.location >= priv->si->num_fs_entries) in enetc_get_rxnfc()
422 rxnfc->fs = priv->cls_rules[rxnfc->fs.location].fs; in enetc_get_rxnfc()
426 rxnfc->data = priv->si->num_fs_entries; in enetc_get_rxnfc()
432 if (j == rxnfc->rule_cnt) in enetc_get_rxnfc()
437 rxnfc->rule_cnt = j; in enetc_get_rxnfc()
446 static int enetc_set_rxnfc(struct net_device *ndev, struct ethtool_rxnfc *rxnfc) in enetc_set_rxnfc() argument
451 switch (rxnfc->cmd) { in enetc_set_rxnfc()
453 if (rxnfc->fs.location >= priv->si->num_fs_entries) in enetc_set_rxnfc()
456 if (rxnfc->fs.ring_cookie >= priv->num_rx_rings && in enetc_set_rxnfc()
457 rxnfc->fs.ring_cookie != RX_CLS_FLOW_DISC) in enetc_set_rxnfc()
460 err = enetc_set_cls_entry(priv->si, &rxnfc->fs, true); in enetc_set_rxnfc()
463 priv->cls_rules[rxnfc->fs.location].fs = rxnfc->fs; in enetc_set_rxnfc()
464 priv->cls_rules[rxnfc->fs.location].used = 1; in enetc_set_rxnfc()
467 if (rxnfc->fs.location >= priv->si->num_fs_entries) in enetc_set_rxnfc()
470 err = enetc_set_cls_entry(priv->si, &rxnfc->fs, false); in enetc_set_rxnfc()
473 priv->cls_rules[rxnfc->fs.location].used = 0; in enetc_set_rxnfc()