Lines Matching refs:rxnfc
276 static int enetc_get_rsshash(struct ethtool_rxnfc *rxnfc) in enetc_get_rsshash() argument
292 if (rxnfc->flow_type >= ARRAY_SIZE(rsshash)) in enetc_get_rsshash()
295 rxnfc->data = rsshash[rxnfc->flow_type]; in enetc_get_rsshash()
383 static int enetc_get_rxnfc(struct net_device *ndev, struct ethtool_rxnfc *rxnfc, in enetc_get_rxnfc() argument
389 switch (rxnfc->cmd) { in enetc_get_rxnfc()
391 rxnfc->data = priv->num_rx_rings; in enetc_get_rxnfc()
395 return enetc_get_rsshash(rxnfc); in enetc_get_rxnfc()
398 rxnfc->data = priv->si->num_fs_entries; in enetc_get_rxnfc()
400 rxnfc->rule_cnt = 0; in enetc_get_rxnfc()
403 rxnfc->rule_cnt++; in enetc_get_rxnfc()
406 if (rxnfc->fs.location >= priv->si->num_fs_entries) in enetc_get_rxnfc()
410 rxnfc->fs = priv->cls_rules[rxnfc->fs.location].fs; in enetc_get_rxnfc()
414 rxnfc->data = priv->si->num_fs_entries; in enetc_get_rxnfc()
420 if (j == rxnfc->rule_cnt) in enetc_get_rxnfc()
425 rxnfc->rule_cnt = j; in enetc_get_rxnfc()
434 static int enetc_set_rxnfc(struct net_device *ndev, struct ethtool_rxnfc *rxnfc) in enetc_set_rxnfc() argument
439 switch (rxnfc->cmd) { in enetc_set_rxnfc()
441 if (rxnfc->fs.location >= priv->si->num_fs_entries) in enetc_set_rxnfc()
444 if (rxnfc->fs.ring_cookie >= priv->num_rx_rings && in enetc_set_rxnfc()
445 rxnfc->fs.ring_cookie != RX_CLS_FLOW_DISC) in enetc_set_rxnfc()
448 err = enetc_set_cls_entry(priv->si, &rxnfc->fs, true); in enetc_set_rxnfc()
451 priv->cls_rules[rxnfc->fs.location].fs = rxnfc->fs; in enetc_set_rxnfc()
452 priv->cls_rules[rxnfc->fs.location].used = 1; in enetc_set_rxnfc()
455 if (rxnfc->fs.location >= priv->si->num_fs_entries) in enetc_set_rxnfc()
458 err = enetc_set_cls_entry(priv->si, &rxnfc->fs, false); in enetc_set_rxnfc()
461 priv->cls_rules[rxnfc->fs.location].used = 0; in enetc_set_rxnfc()