Lines Matching refs:flow_tlvs
1062 static int of_dpa_cmd_add_ig_port(OfDpaFlow *flow, RockerTlv **flow_tlvs) in of_dpa_cmd_add_ig_port() argument
1069 if (!flow_tlvs[ROCKER_TLV_OF_DPA_IN_PPORT] || in of_dpa_cmd_add_ig_port()
1070 !flow_tlvs[ROCKER_TLV_OF_DPA_GOTO_TABLE_ID]) { in of_dpa_cmd_add_ig_port()
1077 key->in_pport = rocker_tlv_get_le32(flow_tlvs[ROCKER_TLV_OF_DPA_IN_PPORT]); in of_dpa_cmd_add_ig_port()
1078 if (flow_tlvs[ROCKER_TLV_OF_DPA_IN_PPORT_MASK]) { in of_dpa_cmd_add_ig_port()
1080 rocker_tlv_get_le32(flow_tlvs[ROCKER_TLV_OF_DPA_IN_PPORT_MASK]); in of_dpa_cmd_add_ig_port()
1086 rocker_tlv_get_le16(flow_tlvs[ROCKER_TLV_OF_DPA_GOTO_TABLE_ID]); in of_dpa_cmd_add_ig_port()
1099 static int of_dpa_cmd_add_vlan(OfDpaFlow *flow, RockerTlv **flow_tlvs) in of_dpa_cmd_add_vlan() argument
1107 if (!flow_tlvs[ROCKER_TLV_OF_DPA_IN_PPORT] || in of_dpa_cmd_add_vlan()
1108 !flow_tlvs[ROCKER_TLV_OF_DPA_VLAN_ID]) { in of_dpa_cmd_add_vlan()
1116 key->in_pport = rocker_tlv_get_le32(flow_tlvs[ROCKER_TLV_OF_DPA_IN_PPORT]); in of_dpa_cmd_add_vlan()
1123 key->eth.vlan_id = rocker_tlv_get_u16(flow_tlvs[ROCKER_TLV_OF_DPA_VLAN_ID]); in of_dpa_cmd_add_vlan()
1125 if (flow_tlvs[ROCKER_TLV_OF_DPA_VLAN_ID_MASK]) { in of_dpa_cmd_add_vlan()
1127 rocker_tlv_get_u16(flow_tlvs[ROCKER_TLV_OF_DPA_VLAN_ID_MASK]); in of_dpa_cmd_add_vlan()
1136 if (flow_tlvs[ROCKER_TLV_OF_DPA_GOTO_TABLE_ID]) { in of_dpa_cmd_add_vlan()
1138 rocker_tlv_get_le16(flow_tlvs[ROCKER_TLV_OF_DPA_GOTO_TABLE_ID]); in of_dpa_cmd_add_vlan()
1146 if (!flow_tlvs[ROCKER_TLV_OF_DPA_NEW_VLAN_ID]) { in of_dpa_cmd_add_vlan()
1151 rocker_tlv_get_u16(flow_tlvs[ROCKER_TLV_OF_DPA_NEW_VLAN_ID]); in of_dpa_cmd_add_vlan()
1163 static int of_dpa_cmd_add_term_mac(OfDpaFlow *flow, RockerTlv **flow_tlvs) in of_dpa_cmd_add_term_mac() argument
1176 if (!flow_tlvs[ROCKER_TLV_OF_DPA_IN_PPORT] || in of_dpa_cmd_add_term_mac()
1177 !flow_tlvs[ROCKER_TLV_OF_DPA_IN_PPORT_MASK] || in of_dpa_cmd_add_term_mac()
1178 !flow_tlvs[ROCKER_TLV_OF_DPA_ETHERTYPE] || in of_dpa_cmd_add_term_mac()
1179 !flow_tlvs[ROCKER_TLV_OF_DPA_DST_MAC] || in of_dpa_cmd_add_term_mac()
1180 !flow_tlvs[ROCKER_TLV_OF_DPA_DST_MAC_MASK] || in of_dpa_cmd_add_term_mac()
1181 !flow_tlvs[ROCKER_TLV_OF_DPA_VLAN_ID] || in of_dpa_cmd_add_term_mac()
1182 !flow_tlvs[ROCKER_TLV_OF_DPA_VLAN_ID_MASK]) { in of_dpa_cmd_add_term_mac()
1189 key->in_pport = rocker_tlv_get_le32(flow_tlvs[ROCKER_TLV_OF_DPA_IN_PPORT]); in of_dpa_cmd_add_term_mac()
1194 rocker_tlv_get_le32(flow_tlvs[ROCKER_TLV_OF_DPA_IN_PPORT_MASK]); in of_dpa_cmd_add_term_mac()
1196 key->eth.type = rocker_tlv_get_u16(flow_tlvs[ROCKER_TLV_OF_DPA_ETHERTYPE]); in of_dpa_cmd_add_term_mac()
1203 rocker_tlv_data(flow_tlvs[ROCKER_TLV_OF_DPA_DST_MAC]), in of_dpa_cmd_add_term_mac()
1206 rocker_tlv_data(flow_tlvs[ROCKER_TLV_OF_DPA_DST_MAC_MASK]), in of_dpa_cmd_add_term_mac()
1227 key->eth.vlan_id = rocker_tlv_get_u16(flow_tlvs[ROCKER_TLV_OF_DPA_VLAN_ID]); in of_dpa_cmd_add_term_mac()
1229 rocker_tlv_get_u16(flow_tlvs[ROCKER_TLV_OF_DPA_VLAN_ID_MASK]); in of_dpa_cmd_add_term_mac()
1231 if (flow_tlvs[ROCKER_TLV_OF_DPA_GOTO_TABLE_ID]) { in of_dpa_cmd_add_term_mac()
1233 rocker_tlv_get_le16(flow_tlvs[ROCKER_TLV_OF_DPA_GOTO_TABLE_ID]); in of_dpa_cmd_add_term_mac()
1251 if (flow_tlvs[ROCKER_TLV_OF_DPA_COPY_CPU_ACTION]) { in of_dpa_cmd_add_term_mac()
1253 rocker_tlv_get_u8(flow_tlvs[ROCKER_TLV_OF_DPA_COPY_CPU_ACTION]); in of_dpa_cmd_add_term_mac()
1259 static int of_dpa_cmd_add_bridging(OfDpaFlow *flow, RockerTlv **flow_tlvs) in of_dpa_cmd_add_bridging() argument
1279 if (flow_tlvs[ROCKER_TLV_OF_DPA_VLAN_ID]) { in of_dpa_cmd_add_bridging()
1281 rocker_tlv_get_u16(flow_tlvs[ROCKER_TLV_OF_DPA_VLAN_ID]); in of_dpa_cmd_add_bridging()
1286 if (flow_tlvs[ROCKER_TLV_OF_DPA_TUNNEL_ID]) { in of_dpa_cmd_add_bridging()
1288 rocker_tlv_get_le32(flow_tlvs[ROCKER_TLV_OF_DPA_TUNNEL_ID]); in of_dpa_cmd_add_bridging()
1299 if (flow_tlvs[ROCKER_TLV_OF_DPA_DST_MAC]) { in of_dpa_cmd_add_bridging()
1301 rocker_tlv_data(flow_tlvs[ROCKER_TLV_OF_DPA_DST_MAC]), in of_dpa_cmd_add_bridging()
1308 if (flow_tlvs[ROCKER_TLV_OF_DPA_DST_MAC_MASK]) { in of_dpa_cmd_add_bridging()
1310 rocker_tlv_data(flow_tlvs[ROCKER_TLV_OF_DPA_DST_MAC_MASK]), in of_dpa_cmd_add_bridging()
1314 } else if (flow_tlvs[ROCKER_TLV_OF_DPA_DST_MAC]) { in of_dpa_cmd_add_bridging()
1339 if (flow_tlvs[ROCKER_TLV_OF_DPA_GOTO_TABLE_ID]) { in of_dpa_cmd_add_bridging()
1341 rocker_tlv_get_le16(flow_tlvs[ROCKER_TLV_OF_DPA_GOTO_TABLE_ID]); in of_dpa_cmd_add_bridging()
1348 if (flow_tlvs[ROCKER_TLV_OF_DPA_GROUP_ID]) { in of_dpa_cmd_add_bridging()
1350 rocker_tlv_get_le32(flow_tlvs[ROCKER_TLV_OF_DPA_GROUP_ID]); in of_dpa_cmd_add_bridging()
1402 if (flow_tlvs[ROCKER_TLV_OF_DPA_TUNNEL_LPORT]) { in of_dpa_cmd_add_bridging()
1404 rocker_tlv_get_le32(flow_tlvs[ROCKER_TLV_OF_DPA_TUNNEL_LPORT]); in of_dpa_cmd_add_bridging()
1412 if (flow_tlvs[ROCKER_TLV_OF_DPA_COPY_CPU_ACTION]) { in of_dpa_cmd_add_bridging()
1414 rocker_tlv_get_u8(flow_tlvs[ROCKER_TLV_OF_DPA_COPY_CPU_ACTION]); in of_dpa_cmd_add_bridging()
1421 RockerTlv **flow_tlvs) in of_dpa_cmd_add_unicast_routing() argument
1433 if (!flow_tlvs[ROCKER_TLV_OF_DPA_ETHERTYPE]) { in of_dpa_cmd_add_unicast_routing()
1440 key->eth.type = rocker_tlv_get_u16(flow_tlvs[ROCKER_TLV_OF_DPA_ETHERTYPE]); in of_dpa_cmd_add_unicast_routing()
1455 if (!flow_tlvs[ROCKER_TLV_OF_DPA_DST_IP]) { in of_dpa_cmd_add_unicast_routing()
1459 rocker_tlv_get_u32(flow_tlvs[ROCKER_TLV_OF_DPA_DST_IP]); in of_dpa_cmd_add_unicast_routing()
1464 if (flow_tlvs[ROCKER_TLV_OF_DPA_DST_IP_MASK]) { in of_dpa_cmd_add_unicast_routing()
1466 rocker_tlv_get_u32(flow_tlvs[ROCKER_TLV_OF_DPA_DST_IP_MASK]); in of_dpa_cmd_add_unicast_routing()
1471 if (!flow_tlvs[ROCKER_TLV_OF_DPA_DST_IPV6]) { in of_dpa_cmd_add_unicast_routing()
1475 rocker_tlv_data(flow_tlvs[ROCKER_TLV_OF_DPA_DST_IPV6]), in of_dpa_cmd_add_unicast_routing()
1480 if (flow_tlvs[ROCKER_TLV_OF_DPA_DST_IPV6_MASK]) { in of_dpa_cmd_add_unicast_routing()
1482 rocker_tlv_data(flow_tlvs[ROCKER_TLV_OF_DPA_DST_IPV6_MASK]), in of_dpa_cmd_add_unicast_routing()
1490 if (flow_tlvs[ROCKER_TLV_OF_DPA_GOTO_TABLE_ID]) { in of_dpa_cmd_add_unicast_routing()
1492 rocker_tlv_get_le16(flow_tlvs[ROCKER_TLV_OF_DPA_GOTO_TABLE_ID]); in of_dpa_cmd_add_unicast_routing()
1498 if (flow_tlvs[ROCKER_TLV_OF_DPA_GROUP_ID]) { in of_dpa_cmd_add_unicast_routing()
1500 rocker_tlv_get_le32(flow_tlvs[ROCKER_TLV_OF_DPA_GROUP_ID]); in of_dpa_cmd_add_unicast_routing()
1513 RockerTlv **flow_tlvs) in of_dpa_cmd_add_multicast_routing() argument
1524 if (!flow_tlvs[ROCKER_TLV_OF_DPA_ETHERTYPE] || in of_dpa_cmd_add_multicast_routing()
1525 !flow_tlvs[ROCKER_TLV_OF_DPA_VLAN_ID]) { in of_dpa_cmd_add_multicast_routing()
1532 key->eth.type = rocker_tlv_get_u16(flow_tlvs[ROCKER_TLV_OF_DPA_ETHERTYPE]); in of_dpa_cmd_add_multicast_routing()
1544 key->eth.vlan_id = rocker_tlv_get_u16(flow_tlvs[ROCKER_TLV_OF_DPA_VLAN_ID]); in of_dpa_cmd_add_multicast_routing()
1549 if (flow_tlvs[ROCKER_TLV_OF_DPA_SRC_IP]) { in of_dpa_cmd_add_multicast_routing()
1551 rocker_tlv_get_u32(flow_tlvs[ROCKER_TLV_OF_DPA_SRC_IP]); in of_dpa_cmd_add_multicast_routing()
1554 if (flow_tlvs[ROCKER_TLV_OF_DPA_SRC_IP_MASK]) { in of_dpa_cmd_add_multicast_routing()
1556 rocker_tlv_get_u32(flow_tlvs[ROCKER_TLV_OF_DPA_SRC_IP_MASK]); in of_dpa_cmd_add_multicast_routing()
1559 if (!flow_tlvs[ROCKER_TLV_OF_DPA_SRC_IP]) { in of_dpa_cmd_add_multicast_routing()
1565 if (!flow_tlvs[ROCKER_TLV_OF_DPA_DST_IP]) { in of_dpa_cmd_add_multicast_routing()
1570 rocker_tlv_get_u32(flow_tlvs[ROCKER_TLV_OF_DPA_DST_IP]); in of_dpa_cmd_add_multicast_routing()
1579 if (flow_tlvs[ROCKER_TLV_OF_DPA_SRC_IPV6]) { in of_dpa_cmd_add_multicast_routing()
1581 rocker_tlv_data(flow_tlvs[ROCKER_TLV_OF_DPA_SRC_IPV6]), in of_dpa_cmd_add_multicast_routing()
1585 if (flow_tlvs[ROCKER_TLV_OF_DPA_SRC_IPV6_MASK]) { in of_dpa_cmd_add_multicast_routing()
1587 rocker_tlv_data(flow_tlvs[ROCKER_TLV_OF_DPA_SRC_IPV6_MASK]), in of_dpa_cmd_add_multicast_routing()
1591 if (!flow_tlvs[ROCKER_TLV_OF_DPA_SRC_IPV6]) { in of_dpa_cmd_add_multicast_routing()
1600 if (!flow_tlvs[ROCKER_TLV_OF_DPA_DST_IPV6]) { in of_dpa_cmd_add_multicast_routing()
1605 rocker_tlv_data(flow_tlvs[ROCKER_TLV_OF_DPA_DST_IPV6]), in of_dpa_cmd_add_multicast_routing()
1617 if (flow_tlvs[ROCKER_TLV_OF_DPA_GOTO_TABLE_ID]) { in of_dpa_cmd_add_multicast_routing()
1619 rocker_tlv_get_le16(flow_tlvs[ROCKER_TLV_OF_DPA_GOTO_TABLE_ID]); in of_dpa_cmd_add_multicast_routing()
1625 if (flow_tlvs[ROCKER_TLV_OF_DPA_GROUP_ID]) { in of_dpa_cmd_add_multicast_routing()
1627 rocker_tlv_get_le32(flow_tlvs[ROCKER_TLV_OF_DPA_GROUP_ID]); in of_dpa_cmd_add_multicast_routing()
1639 RockerTlv **flow_tlvs) in of_dpa_cmd_add_acl_ip() argument
1648 if (flow_tlvs[ROCKER_TLV_OF_DPA_IP_PROTO]) { in of_dpa_cmd_add_acl_ip()
1650 rocker_tlv_get_u8(flow_tlvs[ROCKER_TLV_OF_DPA_IP_PROTO]); in of_dpa_cmd_add_acl_ip()
1652 if (flow_tlvs[ROCKER_TLV_OF_DPA_IP_PROTO_MASK]) { in of_dpa_cmd_add_acl_ip()
1654 rocker_tlv_get_u8(flow_tlvs[ROCKER_TLV_OF_DPA_IP_PROTO_MASK]); in of_dpa_cmd_add_acl_ip()
1656 if (flow_tlvs[ROCKER_TLV_OF_DPA_IP_DSCP]) { in of_dpa_cmd_add_acl_ip()
1658 rocker_tlv_get_u8(flow_tlvs[ROCKER_TLV_OF_DPA_IP_DSCP]); in of_dpa_cmd_add_acl_ip()
1660 if (flow_tlvs[ROCKER_TLV_OF_DPA_IP_DSCP_MASK]) { in of_dpa_cmd_add_acl_ip()
1662 rocker_tlv_get_u8(flow_tlvs[ROCKER_TLV_OF_DPA_IP_DSCP_MASK]); in of_dpa_cmd_add_acl_ip()
1664 if (flow_tlvs[ROCKER_TLV_OF_DPA_IP_ECN]) { in of_dpa_cmd_add_acl_ip()
1666 rocker_tlv_get_u8(flow_tlvs[ROCKER_TLV_OF_DPA_IP_ECN]) << 6; in of_dpa_cmd_add_acl_ip()
1668 if (flow_tlvs[ROCKER_TLV_OF_DPA_IP_ECN_MASK]) { in of_dpa_cmd_add_acl_ip()
1670 rocker_tlv_get_u8(flow_tlvs[ROCKER_TLV_OF_DPA_IP_ECN_MASK]) << 6; in of_dpa_cmd_add_acl_ip()
1674 static int of_dpa_cmd_add_acl(OfDpaFlow *flow, RockerTlv **flow_tlvs) in of_dpa_cmd_add_acl() argument
1691 if (!flow_tlvs[ROCKER_TLV_OF_DPA_IN_PPORT] || in of_dpa_cmd_add_acl()
1692 !flow_tlvs[ROCKER_TLV_OF_DPA_ETHERTYPE]) { in of_dpa_cmd_add_acl()
1696 if (flow_tlvs[ROCKER_TLV_OF_DPA_VLAN_ID] && in of_dpa_cmd_add_acl()
1697 flow_tlvs[ROCKER_TLV_OF_DPA_TUNNEL_ID]) { in of_dpa_cmd_add_acl()
1704 key->in_pport = rocker_tlv_get_le32(flow_tlvs[ROCKER_TLV_OF_DPA_IN_PPORT]); in of_dpa_cmd_add_acl()
1705 if (flow_tlvs[ROCKER_TLV_OF_DPA_IN_PPORT_MASK]) { in of_dpa_cmd_add_acl()
1707 rocker_tlv_get_le32(flow_tlvs[ROCKER_TLV_OF_DPA_IN_PPORT_MASK]); in of_dpa_cmd_add_acl()
1710 if (flow_tlvs[ROCKER_TLV_OF_DPA_SRC_MAC]) { in of_dpa_cmd_add_acl()
1712 rocker_tlv_data(flow_tlvs[ROCKER_TLV_OF_DPA_SRC_MAC]), in of_dpa_cmd_add_acl()
1716 if (flow_tlvs[ROCKER_TLV_OF_DPA_SRC_MAC_MASK]) { in of_dpa_cmd_add_acl()
1718 rocker_tlv_data(flow_tlvs[ROCKER_TLV_OF_DPA_SRC_MAC_MASK]), in of_dpa_cmd_add_acl()
1722 if (flow_tlvs[ROCKER_TLV_OF_DPA_DST_MAC]) { in of_dpa_cmd_add_acl()
1724 rocker_tlv_data(flow_tlvs[ROCKER_TLV_OF_DPA_DST_MAC]), in of_dpa_cmd_add_acl()
1728 if (flow_tlvs[ROCKER_TLV_OF_DPA_DST_MAC_MASK]) { in of_dpa_cmd_add_acl()
1730 rocker_tlv_data(flow_tlvs[ROCKER_TLV_OF_DPA_DST_MAC_MASK]), in of_dpa_cmd_add_acl()
1734 key->eth.type = rocker_tlv_get_u16(flow_tlvs[ROCKER_TLV_OF_DPA_ETHERTYPE]); in of_dpa_cmd_add_acl()
1739 if (flow_tlvs[ROCKER_TLV_OF_DPA_VLAN_ID]) { in of_dpa_cmd_add_acl()
1741 rocker_tlv_get_u16(flow_tlvs[ROCKER_TLV_OF_DPA_VLAN_ID]); in of_dpa_cmd_add_acl()
1744 if (flow_tlvs[ROCKER_TLV_OF_DPA_VLAN_ID_MASK]) { in of_dpa_cmd_add_acl()
1746 rocker_tlv_get_u16(flow_tlvs[ROCKER_TLV_OF_DPA_VLAN_ID_MASK]); in of_dpa_cmd_add_acl()
1776 of_dpa_cmd_add_acl_ip(key, mask, flow_tlvs); in of_dpa_cmd_add_acl()
1780 if (flow_tlvs[ROCKER_TLV_OF_DPA_GROUP_ID]) { in of_dpa_cmd_add_acl()
1782 rocker_tlv_get_le32(flow_tlvs[ROCKER_TLV_OF_DPA_GROUP_ID]); in of_dpa_cmd_add_acl()
1785 if (flow_tlvs[ROCKER_TLV_OF_DPA_COPY_CPU_ACTION]) { in of_dpa_cmd_add_acl()
1787 rocker_tlv_get_u8(flow_tlvs[ROCKER_TLV_OF_DPA_COPY_CPU_ACTION]); in of_dpa_cmd_add_acl()
1794 RockerTlv **flow_tlvs) in of_dpa_cmd_flow_add_mod() argument
1799 if (!flow_tlvs[ROCKER_TLV_OF_DPA_TABLE_ID] || in of_dpa_cmd_flow_add_mod()
1800 !flow_tlvs[ROCKER_TLV_OF_DPA_PRIORITY] || in of_dpa_cmd_flow_add_mod()
1801 !flow_tlvs[ROCKER_TLV_OF_DPA_HARDTIME]) { in of_dpa_cmd_flow_add_mod()
1805 tbl = rocker_tlv_get_le16(flow_tlvs[ROCKER_TLV_OF_DPA_TABLE_ID]); in of_dpa_cmd_flow_add_mod()
1806 flow->priority = rocker_tlv_get_le32(flow_tlvs[ROCKER_TLV_OF_DPA_PRIORITY]); in of_dpa_cmd_flow_add_mod()
1807 flow->hardtime = rocker_tlv_get_le32(flow_tlvs[ROCKER_TLV_OF_DPA_HARDTIME]); in of_dpa_cmd_flow_add_mod()
1809 if (flow_tlvs[ROCKER_TLV_OF_DPA_IDLETIME]) { in of_dpa_cmd_flow_add_mod()
1816 rocker_tlv_get_le32(flow_tlvs[ROCKER_TLV_OF_DPA_IDLETIME]); in of_dpa_cmd_flow_add_mod()
1821 err = of_dpa_cmd_add_ig_port(flow, flow_tlvs); in of_dpa_cmd_flow_add_mod()
1824 err = of_dpa_cmd_add_vlan(flow, flow_tlvs); in of_dpa_cmd_flow_add_mod()
1827 err = of_dpa_cmd_add_term_mac(flow, flow_tlvs); in of_dpa_cmd_flow_add_mod()
1830 err = of_dpa_cmd_add_bridging(flow, flow_tlvs); in of_dpa_cmd_flow_add_mod()
1833 err = of_dpa_cmd_add_unicast_routing(flow, flow_tlvs); in of_dpa_cmd_flow_add_mod()
1836 err = of_dpa_cmd_add_multicast_routing(flow, flow_tlvs); in of_dpa_cmd_flow_add_mod()
1839 err = of_dpa_cmd_add_acl(flow, flow_tlvs); in of_dpa_cmd_flow_add_mod()
1847 RockerTlv **flow_tlvs) in of_dpa_cmd_flow_add() argument
1858 err = of_dpa_cmd_flow_add_mod(of_dpa, flow, flow_tlvs); in of_dpa_cmd_flow_add()
1868 RockerTlv **flow_tlvs) in of_dpa_cmd_flow_mod() argument
1876 return of_dpa_cmd_flow_add_mod(of_dpa, flow, flow_tlvs); in of_dpa_cmd_flow_mod()
1925 RockerTlv **flow_tlvs) in of_dpa_flow_cmd() argument
1929 if (!flow_tlvs[ROCKER_TLV_OF_DPA_COOKIE]) { in of_dpa_flow_cmd()
1933 cookie = rocker_tlv_get_le64(flow_tlvs[ROCKER_TLV_OF_DPA_COOKIE]); in of_dpa_flow_cmd()
1937 return of_dpa_cmd_flow_add(of_dpa, cookie, flow_tlvs); in of_dpa_flow_cmd()
1939 return of_dpa_cmd_flow_mod(of_dpa, cookie, flow_tlvs); in of_dpa_flow_cmd()