Lines Matching refs:rxnfc
305 static int enetc_get_rsshash(struct ethtool_rxnfc *rxnfc) in enetc_get_rsshash() argument
321 if (rxnfc->flow_type >= ARRAY_SIZE(rsshash)) in enetc_get_rsshash()
324 rxnfc->data = rsshash[rxnfc->flow_type]; in enetc_get_rsshash()
412 static int enetc_get_rxnfc(struct net_device *ndev, struct ethtool_rxnfc *rxnfc, in enetc_get_rxnfc() argument
418 switch (rxnfc->cmd) { in enetc_get_rxnfc()
420 rxnfc->data = priv->num_rx_rings; in enetc_get_rxnfc()
424 return enetc_get_rsshash(rxnfc); in enetc_get_rxnfc()
427 rxnfc->data = priv->si->num_fs_entries; in enetc_get_rxnfc()
429 rxnfc->rule_cnt = 0; in enetc_get_rxnfc()
432 rxnfc->rule_cnt++; in enetc_get_rxnfc()
435 if (rxnfc->fs.location >= priv->si->num_fs_entries) in enetc_get_rxnfc()
439 rxnfc->fs = priv->cls_rules[rxnfc->fs.location].fs; in enetc_get_rxnfc()
443 rxnfc->data = priv->si->num_fs_entries; in enetc_get_rxnfc()
449 if (j == rxnfc->rule_cnt) in enetc_get_rxnfc()
454 rxnfc->rule_cnt = j; in enetc_get_rxnfc()
463 static int enetc_set_rxnfc(struct net_device *ndev, struct ethtool_rxnfc *rxnfc) in enetc_set_rxnfc() argument
468 switch (rxnfc->cmd) { in enetc_set_rxnfc()
470 if (rxnfc->fs.location >= priv->si->num_fs_entries) in enetc_set_rxnfc()
473 if (rxnfc->fs.ring_cookie >= priv->num_rx_rings && in enetc_set_rxnfc()
474 rxnfc->fs.ring_cookie != RX_CLS_FLOW_DISC) in enetc_set_rxnfc()
477 err = enetc_set_cls_entry(priv->si, &rxnfc->fs, true); in enetc_set_rxnfc()
480 priv->cls_rules[rxnfc->fs.location].fs = rxnfc->fs; in enetc_set_rxnfc()
481 priv->cls_rules[rxnfc->fs.location].used = 1; in enetc_set_rxnfc()
484 if (rxnfc->fs.location >= priv->si->num_fs_entries) in enetc_set_rxnfc()
487 err = enetc_set_cls_entry(priv->si, &rxnfc->fs, false); in enetc_set_rxnfc()
490 priv->cls_rules[rxnfc->fs.location].used = 0; in enetc_set_rxnfc()