Lines Matching full:eth

17 	struct ethhdr eth;  member
57 mtk_flow_set_ipv4_addr(struct mtk_eth *eth, struct mtk_foe_entry *foe, in mtk_flow_set_ipv4_addr() argument
60 return mtk_foe_entry_set_ipv4_tuple(eth, foe, egress, in mtk_flow_set_ipv4_addr()
66 mtk_flow_set_ipv6_addr(struct mtk_eth *eth, struct mtk_foe_entry *foe, in mtk_flow_set_ipv6_addr() argument
69 return mtk_foe_entry_set_ipv6_tuple(eth, foe, in mtk_flow_set_ipv6_addr()
75 mtk_flow_offload_mangle_eth(const struct flow_action_entry *act, void *eth) in mtk_flow_offload_mangle_eth() argument
77 void *dest = eth + act->mangle.offset; in mtk_flow_offload_mangle_eth()
191 mtk_flow_set_output_device(struct mtk_eth *eth, struct mtk_foe_entry *foe, in mtk_flow_set_output_device() argument
199 mtk_foe_entry_set_wdma(eth, foe, info.wdma_idx, info.queue, in mtk_flow_set_output_device()
201 if (mtk_is_netsys_v2_or_greater(eth)) { in mtk_flow_set_output_device()
224 if (dev == eth->netdev[0]) in mtk_flow_set_output_device()
226 else if (dev == eth->netdev[1]) in mtk_flow_set_output_device()
228 else if (dev == eth->netdev[2]) in mtk_flow_set_output_device()
234 mtk_foe_entry_set_dsa(eth, foe, dsa_port); in mtk_flow_set_output_device()
239 mtk_foe_entry_set_queue(eth, foe, queue); in mtk_flow_set_output_device()
242 mtk_foe_entry_set_pse_port(eth, foe, pse_port); in mtk_flow_set_output_device()
248 mtk_flow_offload_replace(struct mtk_eth *eth, struct flow_cls_offload *f, in mtk_flow_offload_replace() argument
264 if (rhashtable_lookup(&eth->flow_table, &f->cookie, mtk_flow_ht_params)) in mtk_flow_offload_replace()
271 if (mtk_is_netsys_v2_or_greater(eth)) { in mtk_flow_offload_replace()
273 if (idev && idev->netdev_ops == eth->netdev[0]->netdev_ops) { in mtk_flow_offload_replace()
276 if (WARN_ON(mac->ppe_idx >= eth->soc->ppe_num)) in mtk_flow_offload_replace()
315 memcpy(data.eth.h_dest, match.key->dst, ETH_ALEN); in mtk_flow_offload_replace()
316 memcpy(data.eth.h_source, match.key->src, ETH_ALEN); in mtk_flow_offload_replace()
348 mtk_flow_offload_mangle_eth(act, &data.eth); in mtk_flow_offload_replace()
379 if (!is_valid_ether_addr(data.eth.h_source) || in mtk_flow_offload_replace()
380 !is_valid_ether_addr(data.eth.h_dest)) in mtk_flow_offload_replace()
383 err = mtk_foe_entry_prepare(eth, &foe, offload_type, l4proto, 0, in mtk_flow_offload_replace()
384 data.eth.h_source, data.eth.h_dest); in mtk_flow_offload_replace()
409 mtk_flow_set_ipv4_addr(eth, &foe, &data, false); in mtk_flow_offload_replace()
420 mtk_flow_set_ipv6_addr(eth, &foe, &data); in mtk_flow_offload_replace()
450 err = mtk_flow_set_ipv4_addr(eth, &foe, &data, true); in mtk_flow_offload_replace()
459 mtk_foe_entry_set_vlan(eth, &foe, data.vlan.vlans[i].id); in mtk_flow_offload_replace()
462 mtk_foe_entry_set_pppoe(eth, &foe, data.pppoe.sid); in mtk_flow_offload_replace()
464 err = mtk_flow_set_output_device(eth, &foe, odev, data.eth.h_dest, in mtk_flow_offload_replace()
481 err = mtk_foe_entry_commit(eth->ppe[entry->ppe_index], entry); in mtk_flow_offload_replace()
485 err = rhashtable_insert_fast(&eth->flow_table, &entry->node, in mtk_flow_offload_replace()
493 mtk_foe_entry_clear(eth->ppe[entry->ppe_index], entry); in mtk_flow_offload_replace()
502 mtk_flow_offload_destroy(struct mtk_eth *eth, struct flow_cls_offload *f) in mtk_flow_offload_destroy() argument
506 entry = rhashtable_lookup(&eth->flow_table, &f->cookie, in mtk_flow_offload_destroy()
511 mtk_foe_entry_clear(eth->ppe[entry->ppe_index], entry); in mtk_flow_offload_destroy()
512 rhashtable_remove_fast(&eth->flow_table, &entry->node, in mtk_flow_offload_destroy()
522 mtk_flow_offload_stats(struct mtk_eth *eth, struct flow_cls_offload *f) in mtk_flow_offload_stats() argument
528 entry = rhashtable_lookup(&eth->flow_table, &f->cookie, in mtk_flow_offload_stats()
533 idle = mtk_foe_entry_idle_time(eth->ppe[entry->ppe_index], entry); in mtk_flow_offload_stats()
537 mtk_foe_entry_get_mib(eth->ppe[entry->ppe_index], entry->hash, in mtk_flow_offload_stats()
548 int mtk_flow_offload_cmd(struct mtk_eth *eth, struct flow_cls_offload *cls, in mtk_flow_offload_cmd() argument
556 err = mtk_flow_offload_replace(eth, cls, ppe_index); in mtk_flow_offload_cmd()
559 err = mtk_flow_offload_destroy(eth, cls); in mtk_flow_offload_cmd()
562 err = mtk_flow_offload_stats(eth, cls); in mtk_flow_offload_cmd()
579 struct mtk_eth *eth; in mtk_eth_setup_tc_block_cb() local
582 eth = mac->hw; in mtk_eth_setup_tc_block_cb()
590 return mtk_flow_offload_cmd(eth, cls, 0); in mtk_eth_setup_tc_block_cb()
597 struct mtk_eth *eth = mac->hw; in mtk_eth_setup_tc_block() local
602 if (!eth->soc->offload_version) in mtk_eth_setup_tc_block()
653 int mtk_eth_offload_init(struct mtk_eth *eth, u8 id) in mtk_eth_offload_init() argument
655 if (!eth->ppe[id] || !eth->ppe[id]->foe_table) in mtk_eth_offload_init()
657 return rhashtable_init(&eth->flow_table, &mtk_flow_ht_params); in mtk_eth_offload_init()