static int
 mtk_foe_entry_commit_l2(struct mtk_ppe *ppe, struct mtk_flow_entry *entry)
 {
+       struct mtk_flow_entry *prev;
+
        entry->type = MTK_FLOW_TYPE_L2;
 
-       return rhashtable_insert_fast(&ppe->l2_flows, &entry->l2_node,
-                                     mtk_flow_l2_ht_params);
+       prev = rhashtable_lookup_get_insert_fast(&ppe->l2_flows, &entry->l2_node,
+                                                mtk_flow_l2_ht_params);
+       if (likely(!prev))
+               return 0;
+
+       if (IS_ERR(prev))
+               return PTR_ERR(prev);
+
+       return rhashtable_replace_fast(&ppe->l2_flows, &prev->l2_node,
+                                      &entry->l2_node, mtk_flow_l2_ht_params);
 }
 
 int mtk_foe_entry_commit(struct mtk_ppe *ppe, struct mtk_flow_entry *entry)