Merge "[qca-nss-sfe] Fix the interface type check for MAP-T flow."
diff --git a/sfe.c b/sfe.c
index 8f45907..b8c8040 100644
--- a/sfe.c
+++ b/sfe.c
@@ -25,6 +25,7 @@
#include <net/addrconf.h>
#include <linux/inetdevice.h>
#include <net/pkt_sched.h>
+#include <net/vxlan.h>
#include "sfe_debug.h"
#include "sfe_api.h"
@@ -552,7 +553,7 @@
* Does our input device support IP processing?
*/
src_dev = dev_get_by_index(&init_net, msg->msg.rule_create.conn_rule.flow_top_interface_num);
- if (!src_dev || (is_routed && !sfe_dev_is_layer_3_interface(src_dev, true))) {
+ if (!src_dev || (is_routed && !sfe_dev_is_layer_3_interface(src_dev, true) && !netif_is_vxlan(src_dev))) {
ret = SFE_CMN_RESPONSE_EINTERFACE;
sfe_incr_exceptions(SFE_EXCEPTION_SRC_DEV_NOT_L3);
goto failed_ret;
@@ -572,7 +573,7 @@
* Does our output device support IP processing?
*/
dest_dev = dev_get_by_index(&init_net, msg->msg.rule_create.conn_rule.return_top_interface_num);
- if (!dest_dev || (is_routed && !sfe_dev_is_layer_3_interface(dest_dev, true))) {
+ if (!dest_dev || (is_routed && !sfe_dev_is_layer_3_interface(dest_dev, true) && !netif_is_vxlan(dest_dev))) {
ret = SFE_CMN_RESPONSE_EINTERFACE;
sfe_incr_exceptions(SFE_EXCEPTION_DEST_DEV_NOT_L3);
goto failed_ret;
@@ -901,7 +902,7 @@
* Does our input device support IP processing?
*/
src_dev = dev_get_by_index(&init_net, msg->msg.rule_create.conn_rule.flow_top_interface_num);
- if (!src_dev || (is_routed && !sfe_dev_is_layer_3_interface(src_dev, false))) {
+ if (!src_dev || (is_routed && !sfe_dev_is_layer_3_interface(src_dev, false) && !netif_is_vxlan(src_dev))) {
ret = SFE_CMN_RESPONSE_EINTERFACE;
sfe_incr_exceptions(SFE_EXCEPTION_SRC_DEV_NOT_L3);
goto failed_ret;
@@ -921,7 +922,7 @@
* Does our output device support IP processing?
*/
dest_dev = dev_get_by_index(&init_net, msg->msg.rule_create.conn_rule.return_top_interface_num);
- if (!dest_dev || (is_routed && !sfe_dev_is_layer_3_interface(dest_dev, false))) {
+ if (!dest_dev || (is_routed && !sfe_dev_is_layer_3_interface(dest_dev, false) && !netif_is_vxlan(dest_dev))) {
ret = SFE_CMN_RESPONSE_EINTERFACE;
sfe_incr_exceptions(SFE_EXCEPTION_DEST_DEV_NOT_L3);
goto failed_ret;
diff --git a/sfe_ipv4.c b/sfe_ipv4.c
index 815f494..a93ed7e 100644
--- a/sfe_ipv4.c
+++ b/sfe_ipv4.c
@@ -1084,7 +1084,7 @@
original_cm->match_dev = src_dev;
original_cm->match_protocol = tuple->protocol;
original_cm->match_src_ip = tuple->flow_ip;
- original_cm->match_src_port = tuple->flow_ident;
+ original_cm->match_src_port = netif_is_vxlan(src_dev) ? 0 : tuple->flow_ident;
original_cm->match_dest_ip = tuple->return_ip;
original_cm->match_dest_port = tuple->return_ident;
diff --git a/sfe_ipv4_udp.c b/sfe_ipv4_udp.c
index f38cc29..6266244 100644
--- a/sfe_ipv4_udp.c
+++ b/sfe_ipv4_udp.c
@@ -442,7 +442,6 @@
skb->ip_summed = CHECKSUM_PARTIAL;
} else {
iph->check = sfe_ipv4_gen_ip_csum(iph);
- skb->ip_summed = CHECKSUM_UNNECESSARY;
}
/*
diff --git a/sfe_ipv6.c b/sfe_ipv6.c
index bc3f4bf..eab2717 100644
--- a/sfe_ipv6.c
+++ b/sfe_ipv6.c
@@ -1064,7 +1064,7 @@
original_cm->match_dev = src_dev;
original_cm->match_protocol = tuple->protocol;
original_cm->match_src_ip[0] = *(struct sfe_ipv6_addr *)tuple->flow_ip;
- original_cm->match_src_port = tuple->flow_ident;
+ original_cm->match_src_port = netif_is_vxlan(src_dev) ? 0 : tuple->flow_ident;
original_cm->match_dest_ip[0] = *(struct sfe_ipv6_addr *)tuple->return_ip;
original_cm->match_dest_port = tuple->return_ident;
diff --git a/sfe_ipv6_udp.c b/sfe_ipv6_udp.c
index 02eb034..e5eeb9e 100644
--- a/sfe_ipv6_udp.c
+++ b/sfe_ipv6_udp.c
@@ -435,8 +435,6 @@
*/
if (likely(hw_csum)) {
skb->ip_summed = CHECKSUM_PARTIAL;
- } else {
- skb->ip_summed = CHECKSUM_UNNECESSARY;
}
/*