Lines Matching refs:rxfh_dev
1140 struct ethtool_rxfh_param rxfh_dev = {}; in ethtool_set_rxfh_indir() local
1151 rxfh_dev.indir_size = ops->get_rxfh_indir_size(dev); in ethtool_set_rxfh_indir()
1152 if (rxfh_dev.indir_size == 0) in ethtool_set_rxfh_indir()
1160 if (user_size != 0 && user_size != rxfh_dev.indir_size) in ethtool_set_rxfh_indir()
1163 rxfh_dev.indir = kcalloc(rxfh_dev.indir_size, in ethtool_set_rxfh_indir()
1164 sizeof(rxfh_dev.indir[0]), GFP_USER); in ethtool_set_rxfh_indir()
1165 if (!rxfh_dev.indir) in ethtool_set_rxfh_indir()
1174 u32 *indir = rxfh_dev.indir; in ethtool_set_rxfh_indir()
1176 for (i = 0; i < rxfh_dev.indir_size; i++) in ethtool_set_rxfh_indir()
1179 ret = ethtool_copy_validate_indir(rxfh_dev.indir, in ethtool_set_rxfh_indir()
1182 rxfh_dev.indir_size); in ethtool_set_rxfh_indir()
1187 rxfh_dev.hfunc = ETH_RSS_HASH_NO_CHANGE; in ethtool_set_rxfh_indir()
1188 ret = ops->set_rxfh(dev, &rxfh_dev, extack); in ethtool_set_rxfh_indir()
1199 kfree(rxfh_dev.indir); in ethtool_set_rxfh_indir()
1207 struct ethtool_rxfh_param rxfh_dev = {}; in ethtool_get_rxfh() local
1220 rxfh_dev.indir_size = ops->get_rxfh_indir_size(dev); in ethtool_get_rxfh()
1222 rxfh_dev.key_size = ops->get_rxfh_key_size(dev); in ethtool_get_rxfh()
1237 rxfh.indir_size = rxfh_dev.indir_size; in ethtool_get_rxfh()
1238 rxfh.key_size = rxfh_dev.key_size; in ethtool_get_rxfh()
1242 if ((user_indir_size && user_indir_size != rxfh_dev.indir_size) || in ethtool_get_rxfh()
1243 (user_key_size && user_key_size != rxfh_dev.key_size)) in ethtool_get_rxfh()
1246 indir_bytes = user_indir_size * sizeof(rxfh_dev.indir[0]); in ethtool_get_rxfh()
1253 rxfh_dev.indir = (u32 *)rss_config; in ethtool_get_rxfh()
1256 rxfh_dev.key = rss_config + indir_bytes; in ethtool_get_rxfh()
1264 if (rxfh_dev.indir) in ethtool_get_rxfh()
1265 memcpy(rxfh_dev.indir, ethtool_rxfh_context_indir(ctx), in ethtool_get_rxfh()
1268 rxfh_dev.key_size = 0; in ethtool_get_rxfh()
1270 if (rxfh_dev.key) in ethtool_get_rxfh()
1271 memcpy(rxfh_dev.key, in ethtool_get_rxfh()
1274 rxfh_dev.hfunc = ctx->hfunc; in ethtool_get_rxfh()
1276 rxfh_dev.input_xfrm = ctx->input_xfrm; in ethtool_get_rxfh()
1279 ret = dev->ethtool_ops->get_rxfh(dev, &rxfh_dev); in ethtool_get_rxfh()
1285 &rxfh_dev.hfunc, sizeof(rxfh.hfunc))) { in ethtool_get_rxfh()
1289 &rxfh_dev.input_xfrm, in ethtool_get_rxfh()
1294 &rxfh_dev.key_size, in ethtool_get_rxfh()
1349 struct ethtool_rxfh_param rxfh_dev = {}; in ethtool_set_rxfh() local
1403 indir_bytes = dev_indir_size * sizeof(rxfh_dev.indir[0]); in ethtool_set_rxfh()
1428 rxfh_dev.indir = (u32 *)rss_config; in ethtool_set_rxfh()
1429 rxfh_dev.indir_size = dev_indir_size; in ethtool_set_rxfh()
1430 ret = ethtool_copy_validate_indir(rxfh_dev.indir, in ethtool_set_rxfh()
1440 rxfh_dev.indir = (u32 *)rss_config; in ethtool_set_rxfh()
1441 rxfh_dev.indir_size = dev_indir_size; in ethtool_set_rxfh()
1442 indir = rxfh_dev.indir; in ethtool_set_rxfh()
1446 rxfh_dev.rss_delete = true; in ethtool_set_rxfh()
1451 rxfh_dev.key_size = dev_key_size; in ethtool_set_rxfh()
1452 rxfh_dev.key = rss_config + indir_bytes; in ethtool_set_rxfh()
1453 if (copy_from_user(rxfh_dev.key, in ethtool_set_rxfh()
1466 if (rxfh_dev.rss_delete) { in ethtool_set_rxfh()
1498 rxfh_dev.hfunc = rxfh.hfunc; in ethtool_set_rxfh()
1499 rxfh_dev.rss_context = rxfh.rss_context; in ethtool_set_rxfh()
1500 rxfh_dev.input_xfrm = rxfh.input_xfrm; in ethtool_set_rxfh()
1504 ret = ops->create_rxfh_context(dev, ctx, &rxfh_dev, in ethtool_set_rxfh()
1507 WARN_ON_ONCE(!ret && !rxfh_dev.key && in ethtool_set_rxfh()
1510 } else if (rxfh_dev.rss_delete) { in ethtool_set_rxfh()
1515 ret = ops->modify_rxfh_context(dev, ctx, &rxfh_dev, in ethtool_set_rxfh()
1519 ret = ops->set_rxfh(dev, &rxfh_dev, extack); in ethtool_set_rxfh()
1532 &rxfh_dev.rss_context, sizeof(rxfh_dev.rss_context))) in ethtool_set_rxfh()
1535 if (!rxfh_dev.rss_context) { in ethtool_set_rxfh()
1545 if (WARN_ON(xa_load(&dev->ethtool->rss_ctx, rxfh_dev.rss_context))) { in ethtool_set_rxfh()
1551 if (xa_is_err(xa_store(&dev->ethtool->rss_ctx, rxfh_dev.rss_context, in ethtool_set_rxfh()
1560 rxfh_dev.indir = (u32 *)rss_config; in ethtool_set_rxfh()
1561 rxfh_dev.indir_size = dev_indir_size; in ethtool_set_rxfh()
1563 rxfh_dev.key = rss_config + indir_bytes; in ethtool_set_rxfh()
1564 rxfh_dev.key_size = dev_key_size; in ethtool_set_rxfh()
1566 ret = ops->get_rxfh(dev, &rxfh_dev); in ethtool_set_rxfh()
1573 if (rxfh_dev.rss_delete) { in ethtool_set_rxfh()
1577 if (rxfh_dev.indir) { in ethtool_set_rxfh()
1579 ethtool_rxfh_context_indir(ctx)[i] = rxfh_dev.indir[i]; in ethtool_set_rxfh()
1584 if (rxfh_dev.key) { in ethtool_set_rxfh()
1585 memcpy(ethtool_rxfh_context_key(ctx), rxfh_dev.key, in ethtool_set_rxfh()
1589 if (rxfh_dev.hfunc != ETH_RSS_HASH_NO_CHANGE) in ethtool_set_rxfh()
1590 ctx->hfunc = rxfh_dev.hfunc; in ethtool_set_rxfh()
1591 if (rxfh_dev.input_xfrm != RXH_XFRM_NO_CHANGE) in ethtool_set_rxfh()
1592 ctx->input_xfrm = rxfh_dev.input_xfrm; in ethtool_set_rxfh()