Lines Matching refs:fs
1331 struct ethtool_rx_flow_spec *fs = &cmd->fs; in nfp_net_fs_to_ethtool() local
1338 fs->h_u.tcp_ip4_spec.ip4src = entry->key.sip4; in nfp_net_fs_to_ethtool()
1339 fs->h_u.tcp_ip4_spec.ip4dst = entry->key.dip4; in nfp_net_fs_to_ethtool()
1340 fs->h_u.tcp_ip4_spec.psrc = entry->key.sport; in nfp_net_fs_to_ethtool()
1341 fs->h_u.tcp_ip4_spec.pdst = entry->key.dport; in nfp_net_fs_to_ethtool()
1342 fs->m_u.tcp_ip4_spec.ip4src = entry->msk.sip4; in nfp_net_fs_to_ethtool()
1343 fs->m_u.tcp_ip4_spec.ip4dst = entry->msk.dip4; in nfp_net_fs_to_ethtool()
1344 fs->m_u.tcp_ip4_spec.psrc = entry->msk.sport; in nfp_net_fs_to_ethtool()
1345 fs->m_u.tcp_ip4_spec.pdst = entry->msk.dport; in nfp_net_fs_to_ethtool()
1351 fs->h_u.tcp_ip6_spec.ip6src[i] = entry->key.sip6[i]; in nfp_net_fs_to_ethtool()
1352 fs->h_u.tcp_ip6_spec.ip6dst[i] = entry->key.dip6[i]; in nfp_net_fs_to_ethtool()
1353 fs->m_u.tcp_ip6_spec.ip6src[i] = entry->msk.sip6[i]; in nfp_net_fs_to_ethtool()
1354 fs->m_u.tcp_ip6_spec.ip6dst[i] = entry->msk.dip6[i]; in nfp_net_fs_to_ethtool()
1356 fs->h_u.tcp_ip6_spec.psrc = entry->key.sport; in nfp_net_fs_to_ethtool()
1357 fs->h_u.tcp_ip6_spec.pdst = entry->key.dport; in nfp_net_fs_to_ethtool()
1358 fs->m_u.tcp_ip6_spec.psrc = entry->msk.sport; in nfp_net_fs_to_ethtool()
1359 fs->m_u.tcp_ip6_spec.pdst = entry->msk.dport; in nfp_net_fs_to_ethtool()
1362 fs->h_u.usr_ip4_spec.ip_ver = ETH_RX_NFC_IP4; in nfp_net_fs_to_ethtool()
1363 fs->h_u.usr_ip4_spec.ip4src = entry->key.sip4; in nfp_net_fs_to_ethtool()
1364 fs->h_u.usr_ip4_spec.ip4dst = entry->key.dip4; in nfp_net_fs_to_ethtool()
1365 fs->h_u.usr_ip4_spec.proto = entry->key.l4_proto; in nfp_net_fs_to_ethtool()
1366 fs->m_u.usr_ip4_spec.ip4src = entry->msk.sip4; in nfp_net_fs_to_ethtool()
1367 fs->m_u.usr_ip4_spec.ip4dst = entry->msk.dip4; in nfp_net_fs_to_ethtool()
1368 fs->m_u.usr_ip4_spec.proto = entry->msk.l4_proto; in nfp_net_fs_to_ethtool()
1372 fs->h_u.usr_ip6_spec.ip6src[i] = entry->key.sip6[i]; in nfp_net_fs_to_ethtool()
1373 fs->h_u.usr_ip6_spec.ip6dst[i] = entry->key.dip6[i]; in nfp_net_fs_to_ethtool()
1374 fs->m_u.usr_ip6_spec.ip6src[i] = entry->msk.sip6[i]; in nfp_net_fs_to_ethtool()
1375 fs->m_u.usr_ip6_spec.ip6dst[i] = entry->msk.dip6[i]; in nfp_net_fs_to_ethtool()
1377 fs->h_u.usr_ip6_spec.l4_proto = entry->key.l4_proto; in nfp_net_fs_to_ethtool()
1378 fs->m_u.usr_ip6_spec.l4_proto = entry->msk.l4_proto; in nfp_net_fs_to_ethtool()
1381 fs->h_u.ether_spec.h_proto = entry->key.l3_proto; in nfp_net_fs_to_ethtool()
1382 fs->m_u.ether_spec.h_proto = entry->msk.l3_proto; in nfp_net_fs_to_ethtool()
1388 fs->flow_type = entry->flow_type; in nfp_net_fs_to_ethtool()
1389 fs->ring_cookie = entry->action; in nfp_net_fs_to_ethtool()
1391 if (fs->flow_type & FLOW_RSS) { in nfp_net_fs_to_ethtool()
1395 fs->ring_cookie |= ETHTOOL_RX_FLOW_SPEC_RING; in nfp_net_fs_to_ethtool()
1408 if (cmd->fs.location >= NFP_FS_MAX_ENTRY) in nfp_net_get_fs_rule()
1411 list_for_each_entry(entry, &nn->fs.list, node) { in nfp_net_get_fs_rule()
1412 if (entry->loc == cmd->fs.location) in nfp_net_get_fs_rule()
1415 if (entry->loc > cmd->fs.location) in nfp_net_get_fs_rule()
1431 list_for_each_entry(entry, &nn->fs.list, node) in nfp_net_get_fs_loc()
1447 cmd->rule_cnt = nn->fs.count; in nfp_net_get_rxnfc()
1513 static int nfp_net_fs_from_ethtool(struct nfp_fs_entry *entry, struct ethtool_rx_flow_spec *fs) in nfp_net_fs_from_ethtool() argument
1518 switch (fs->flow_type & ~FLOW_RSS) { in nfp_net_fs_from_ethtool()
1522 entry->msk.sip4 = fs->m_u.tcp_ip4_spec.ip4src; in nfp_net_fs_from_ethtool()
1523 entry->msk.dip4 = fs->m_u.tcp_ip4_spec.ip4dst; in nfp_net_fs_from_ethtool()
1524 entry->msk.sport = fs->m_u.tcp_ip4_spec.psrc; in nfp_net_fs_from_ethtool()
1525 entry->msk.dport = fs->m_u.tcp_ip4_spec.pdst; in nfp_net_fs_from_ethtool()
1526 entry->key.sip4 = fs->h_u.tcp_ip4_spec.ip4src & entry->msk.sip4; in nfp_net_fs_from_ethtool()
1527 entry->key.dip4 = fs->h_u.tcp_ip4_spec.ip4dst & entry->msk.dip4; in nfp_net_fs_from_ethtool()
1528 entry->key.sport = fs->h_u.tcp_ip4_spec.psrc & entry->msk.sport; in nfp_net_fs_from_ethtool()
1529 entry->key.dport = fs->h_u.tcp_ip4_spec.pdst & entry->msk.dport; in nfp_net_fs_from_ethtool()
1535 entry->msk.sip6[i] = fs->m_u.tcp_ip6_spec.ip6src[i]; in nfp_net_fs_from_ethtool()
1536 entry->msk.dip6[i] = fs->m_u.tcp_ip6_spec.ip6dst[i]; in nfp_net_fs_from_ethtool()
1537 entry->key.sip6[i] = fs->h_u.tcp_ip6_spec.ip6src[i] & entry->msk.sip6[i]; in nfp_net_fs_from_ethtool()
1538 entry->key.dip6[i] = fs->h_u.tcp_ip6_spec.ip6dst[i] & entry->msk.dip6[i]; in nfp_net_fs_from_ethtool()
1540 entry->msk.sport = fs->m_u.tcp_ip6_spec.psrc; in nfp_net_fs_from_ethtool()
1541 entry->msk.dport = fs->m_u.tcp_ip6_spec.pdst; in nfp_net_fs_from_ethtool()
1542 entry->key.sport = fs->h_u.tcp_ip6_spec.psrc & entry->msk.sport; in nfp_net_fs_from_ethtool()
1543 entry->key.dport = fs->h_u.tcp_ip6_spec.pdst & entry->msk.dport; in nfp_net_fs_from_ethtool()
1546 entry->msk.sip4 = fs->m_u.usr_ip4_spec.ip4src; in nfp_net_fs_from_ethtool()
1547 entry->msk.dip4 = fs->m_u.usr_ip4_spec.ip4dst; in nfp_net_fs_from_ethtool()
1548 entry->msk.l4_proto = fs->m_u.usr_ip4_spec.proto; in nfp_net_fs_from_ethtool()
1549 entry->key.sip4 = fs->h_u.usr_ip4_spec.ip4src & entry->msk.sip4; in nfp_net_fs_from_ethtool()
1550 entry->key.dip4 = fs->h_u.usr_ip4_spec.ip4dst & entry->msk.dip4; in nfp_net_fs_from_ethtool()
1551 entry->key.l4_proto = fs->h_u.usr_ip4_spec.proto & entry->msk.l4_proto; in nfp_net_fs_from_ethtool()
1555 entry->msk.sip6[i] = fs->m_u.usr_ip6_spec.ip6src[i]; in nfp_net_fs_from_ethtool()
1556 entry->msk.dip6[i] = fs->m_u.usr_ip6_spec.ip6dst[i]; in nfp_net_fs_from_ethtool()
1557 entry->key.sip6[i] = fs->h_u.usr_ip6_spec.ip6src[i] & entry->msk.sip6[i]; in nfp_net_fs_from_ethtool()
1558 entry->key.dip6[i] = fs->h_u.usr_ip6_spec.ip6dst[i] & entry->msk.dip6[i]; in nfp_net_fs_from_ethtool()
1560 entry->msk.l4_proto = fs->m_u.usr_ip6_spec.l4_proto; in nfp_net_fs_from_ethtool()
1561 entry->key.l4_proto = fs->h_u.usr_ip6_spec.l4_proto & entry->msk.l4_proto; in nfp_net_fs_from_ethtool()
1564 entry->msk.l3_proto = fs->m_u.ether_spec.h_proto; in nfp_net_fs_from_ethtool()
1565 entry->key.l3_proto = fs->h_u.ether_spec.h_proto & entry->msk.l3_proto; in nfp_net_fs_from_ethtool()
1571 switch (fs->flow_type & ~FLOW_RSS) { in nfp_net_fs_from_ethtool()
1589 entry->flow_type = fs->flow_type; in nfp_net_fs_from_ethtool()
1590 entry->action = fs->ring_cookie; in nfp_net_fs_from_ethtool()
1591 entry->loc = fs->location; in nfp_net_fs_from_ethtool()
1600 list_for_each_entry(entry, &nn->fs.list, node) { in nfp_net_fs_check_existing()
1614 struct ethtool_rx_flow_spec *fs = &cmd->fs; in nfp_net_fs_add() local
1623 if ((fs->flow_type & FLOW_RSS) && cmd->rss_context) in nfp_net_fs_add()
1626 if (fs->location >= NFP_FS_MAX_ENTRY) in nfp_net_fs_add()
1629 if (fs->ring_cookie != RX_CLS_FLOW_DISC && in nfp_net_fs_add()
1630 fs->ring_cookie >= nn->dp.num_rx_rings) in nfp_net_fs_add()
1634 switch (fs->flow_type & ~FLOW_RSS) { in nfp_net_fs_add()
1638 unsupp_mask = !!fs->m_u.tcp_ip4_spec.tos; in nfp_net_fs_add()
1643 unsupp_mask = !!fs->m_u.tcp_ip6_spec.tclass; in nfp_net_fs_add()
1646 unsupp_mask = !!fs->m_u.usr_ip4_spec.l4_4_bytes || in nfp_net_fs_add()
1647 !!fs->m_u.usr_ip4_spec.tos || in nfp_net_fs_add()
1648 !!fs->m_u.usr_ip4_spec.ip_ver; in nfp_net_fs_add()
1650 unsupp_mask |= fs->h_u.usr_ip4_spec.ip_ver != ETH_RX_NFC_IP4; in nfp_net_fs_add()
1653 unsupp_mask = !!fs->m_u.usr_ip6_spec.l4_4_bytes || in nfp_net_fs_add()
1654 !!fs->m_u.usr_ip6_spec.tclass; in nfp_net_fs_add()
1657 if (fs->h_u.ether_spec.h_proto == htons(ETH_P_IP) || in nfp_net_fs_add()
1658 fs->h_u.ether_spec.h_proto == htons(ETH_P_IPV6)) { in nfp_net_fs_add()
1663 unsupp_mask = !is_zero_ether_addr(fs->m_u.ether_spec.h_dest) || in nfp_net_fs_add()
1664 !is_zero_ether_addr(fs->m_u.ether_spec.h_source) || in nfp_net_fs_add()
1665 (fs->m_u.ether_spec.h_proto != htons(0xffff)); in nfp_net_fs_add()
1678 nfp_net_fs_from_ethtool(new, fs); in nfp_net_fs_add()
1688 list_for_each_entry(entry, &nn->fs.list, node) { in nfp_net_fs_add()
1689 if (entry->loc == fs->location) { in nfp_net_fs_add()
1694 nn->fs.count--; in nfp_net_fs_add()
1699 nn->fs.count++; in nfp_net_fs_add()
1706 if (entry->loc > fs->location) in nfp_net_fs_add()
1710 if (nn->fs.count == NFP_FS_MAX_ENTRY) { in nfp_net_fs_add()
1720 nn->fs.count++; in nfp_net_fs_add()
1737 if (!nn->fs.count || cmd->fs.location >= NFP_FS_MAX_ENTRY) in nfp_net_fs_del()
1740 list_for_each_entry(entry, &nn->fs.list, node) { in nfp_net_fs_del()
1741 if (entry->loc == cmd->fs.location) { in nfp_net_fs_del()
1748 nn->fs.count--; in nfp_net_fs_del()
1751 } else if (entry->loc > cmd->fs.location) { in nfp_net_fs_del()