Lines Matching full:eth

17 	struct ethhdr eth;  member
55 mtk_flow_set_ipv4_addr(struct mtk_eth *eth, struct mtk_foe_entry *foe, in mtk_flow_set_ipv4_addr() argument
58 return mtk_foe_entry_set_ipv4_tuple(eth, foe, egress, in mtk_flow_set_ipv4_addr()
64 mtk_flow_set_ipv6_addr(struct mtk_eth *eth, struct mtk_foe_entry *foe, in mtk_flow_set_ipv6_addr() argument
67 return mtk_foe_entry_set_ipv6_tuple(eth, foe, in mtk_flow_set_ipv6_addr()
73 mtk_flow_offload_mangle_eth(const struct flow_action_entry *act, void *eth) in mtk_flow_offload_mangle_eth() argument
75 void *dest = eth + act->mangle.offset; in mtk_flow_offload_mangle_eth()
187 mtk_flow_set_output_device(struct mtk_eth *eth, struct mtk_foe_entry *foe, in mtk_flow_set_output_device() argument
195 mtk_foe_entry_set_wdma(eth, foe, info.wdma_idx, info.queue, in mtk_flow_set_output_device()
197 if (mtk_is_netsys_v2_or_greater(eth)) { in mtk_flow_set_output_device()
220 if (dev == eth->netdev[0]) in mtk_flow_set_output_device()
222 else if (dev == eth->netdev[1]) in mtk_flow_set_output_device()
224 else if (dev == eth->netdev[2]) in mtk_flow_set_output_device()
230 mtk_foe_entry_set_dsa(eth, foe, dsa_port); in mtk_flow_set_output_device()
235 mtk_foe_entry_set_queue(eth, foe, queue); in mtk_flow_set_output_device()
238 mtk_foe_entry_set_pse_port(eth, foe, pse_port); in mtk_flow_set_output_device()
244 mtk_flow_offload_replace(struct mtk_eth *eth, struct flow_cls_offload *f, in mtk_flow_offload_replace() argument
260 if (rhashtable_lookup(&eth->flow_table, &f->cookie, mtk_flow_ht_params)) in mtk_flow_offload_replace()
267 if (mtk_is_netsys_v2_or_greater(eth)) { in mtk_flow_offload_replace()
269 if (idev && idev->netdev_ops == eth->netdev[0]->netdev_ops) { in mtk_flow_offload_replace()
272 if (WARN_ON(mac->ppe_idx >= eth->soc->ppe_num)) in mtk_flow_offload_replace()
311 memcpy(data.eth.h_dest, match.key->dst, ETH_ALEN); in mtk_flow_offload_replace()
312 memcpy(data.eth.h_source, match.key->src, ETH_ALEN); in mtk_flow_offload_replace()
344 mtk_flow_offload_mangle_eth(act, &data.eth); in mtk_flow_offload_replace()
374 if (!is_valid_ether_addr(data.eth.h_source) || in mtk_flow_offload_replace()
375 !is_valid_ether_addr(data.eth.h_dest)) in mtk_flow_offload_replace()
378 err = mtk_foe_entry_prepare(eth, &foe, offload_type, l4proto, 0, in mtk_flow_offload_replace()
379 data.eth.h_source, data.eth.h_dest); in mtk_flow_offload_replace()
404 mtk_flow_set_ipv4_addr(eth, &foe, &data, false); in mtk_flow_offload_replace()
415 mtk_flow_set_ipv6_addr(eth, &foe, &data); in mtk_flow_offload_replace()
445 err = mtk_flow_set_ipv4_addr(eth, &foe, &data, true); in mtk_flow_offload_replace()
457 mtk_foe_entry_set_vlan(eth, &foe, data.vlan.id); in mtk_flow_offload_replace()
460 mtk_foe_entry_set_pppoe(eth, &foe, data.pppoe.sid); in mtk_flow_offload_replace()
462 err = mtk_flow_set_output_device(eth, &foe, odev, data.eth.h_dest, in mtk_flow_offload_replace()
479 err = mtk_foe_entry_commit(eth->ppe[entry->ppe_index], entry); in mtk_flow_offload_replace()
483 err = rhashtable_insert_fast(&eth->flow_table, &entry->node, in mtk_flow_offload_replace()
491 mtk_foe_entry_clear(eth->ppe[entry->ppe_index], entry); in mtk_flow_offload_replace()
500 mtk_flow_offload_destroy(struct mtk_eth *eth, struct flow_cls_offload *f) in mtk_flow_offload_destroy() argument
504 entry = rhashtable_lookup(&eth->flow_table, &f->cookie, in mtk_flow_offload_destroy()
509 mtk_foe_entry_clear(eth->ppe[entry->ppe_index], entry); in mtk_flow_offload_destroy()
510 rhashtable_remove_fast(&eth->flow_table, &entry->node, in mtk_flow_offload_destroy()
520 mtk_flow_offload_stats(struct mtk_eth *eth, struct flow_cls_offload *f) in mtk_flow_offload_stats() argument
526 entry = rhashtable_lookup(&eth->flow_table, &f->cookie, in mtk_flow_offload_stats()
531 idle = mtk_foe_entry_idle_time(eth->ppe[entry->ppe_index], entry); in mtk_flow_offload_stats()
535 mtk_foe_entry_get_mib(eth->ppe[entry->ppe_index], entry->hash, in mtk_flow_offload_stats()
546 int mtk_flow_offload_cmd(struct mtk_eth *eth, struct flow_cls_offload *cls, in mtk_flow_offload_cmd() argument
554 err = mtk_flow_offload_replace(eth, cls, ppe_index); in mtk_flow_offload_cmd()
557 err = mtk_flow_offload_destroy(eth, cls); in mtk_flow_offload_cmd()
560 err = mtk_flow_offload_stats(eth, cls); in mtk_flow_offload_cmd()
577 struct mtk_eth *eth; in mtk_eth_setup_tc_block_cb() local
580 eth = mac->hw; in mtk_eth_setup_tc_block_cb()
588 return mtk_flow_offload_cmd(eth, cls, 0); in mtk_eth_setup_tc_block_cb()
595 struct mtk_eth *eth = mac->hw; in mtk_eth_setup_tc_block() local
600 if (!eth->soc->offload_version) in mtk_eth_setup_tc_block()
651 int mtk_eth_offload_init(struct mtk_eth *eth, u8 id) in mtk_eth_offload_init() argument
653 if (!eth->ppe[id] || !eth->ppe[id]->foe_table) in mtk_eth_offload_init()
655 return rhashtable_init(&eth->flow_table, &mtk_flow_ht_params); in mtk_eth_offload_init()