1 --- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
2 +++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
4 #include <linux/if_ether.h>
5 #include <linux/rhashtable.h>
7 +#include <linux/ipv6.h>
8 #include <net/flow_offload.h>
9 #include <net/pkt_cls.h>
11 @@ -19,6 +20,11 @@ struct mtk_flow_data {
17 + struct in6_addr src_addr;
18 + struct in6_addr dst_addr;
23 @@ -63,6 +69,14 @@ mtk_flow_set_ipv4_addr(struct mtk_foe_en
24 data->v4.dst_addr, data->dst_port);
28 +mtk_flow_set_ipv6_addr(struct mtk_foe_entry *foe, struct mtk_flow_data *data)
30 + return mtk_foe_entry_set_ipv6_tuple(foe,
31 + data->v6.src_addr.s6_addr32, data->src_port,
32 + data->v6.dst_addr.s6_addr32, data->dst_port);
36 mtk_flow_offload_mangle_eth(const struct flow_action_entry *act, void *eth)
38 @@ -256,6 +270,9 @@ mtk_flow_offload_replace(struct mtk_eth
39 case FLOW_DISSECTOR_KEY_IPV4_ADDRS:
40 offload_type = MTK_PPE_PKT_TYPE_IPV4_HNAPT;
42 + case FLOW_DISSECTOR_KEY_IPV6_ADDRS:
43 + offload_type = MTK_PPE_PKT_TYPE_IPV6_ROUTE_5T;
48 @@ -291,6 +308,17 @@ mtk_flow_offload_replace(struct mtk_eth
49 mtk_flow_set_ipv4_addr(&foe, &data, false);
52 + if (addr_type == FLOW_DISSECTOR_KEY_IPV6_ADDRS) {
53 + struct flow_match_ipv6_addrs addrs;
55 + flow_rule_match_ipv6_addrs(rule, &addrs);
57 + data.v6.src_addr = addrs.key->src;
58 + data.v6.dst_addr = addrs.key->dst;
60 + mtk_flow_set_ipv6_addr(&foe, &data);
63 flow_action_for_each(i, act, &rule->action) {
64 if (act->id != FLOW_ACTION_MANGLE)