[qca-nss-sfe] Add src iface check with no flush flag
This is required to re-inject the packets to the stack,
if L2 acceleration is not enabled for the flows. By doing
this check, first pass of the flow with the L2 interface will be
skipped and the flow will come to SFE with the L3 interface in the
second pass.
Change-Id: I83585c3cf937451545e7854f51a0389c2ca557c5
Signed-off-by: Murat Sezgin <quic_msezgin@quicinc.com>
diff --git a/sfe_ipv6_gre.c b/sfe_ipv6_gre.c
index 1db0f6f..eae7d56 100644
--- a/sfe_ipv6_gre.c
+++ b/sfe_ipv6_gre.c
@@ -100,18 +100,21 @@
* Source interface validate.
*/
if (unlikely((cm->flags & SFE_IPV6_CONNECTION_MATCH_FLAG_SRC_INTERFACE_CHECK) && (cm->match_dev != dev))) {
- struct sfe_ipv6_connection *c = cm->connection;
- int ret;
- spin_lock_bh(&si->lock);
- ret = sfe_ipv6_remove_connection(si, c);
- spin_unlock_bh(&si->lock);
+ if (!(cm->flags & SFE_IPV6_CONNECTION_MATCH_FLAG_SRC_INTERFACE_CHECK_NO_FLUSH)) {
+ struct sfe_ipv6_connection *c = cm->connection;
+ int ret;
+ DEBUG_TRACE("flush on source interface check failure\n");
+ spin_lock_bh(&si->lock);
+ ret = sfe_ipv6_remove_connection(si, c);
+ spin_unlock_bh(&si->lock);
- if (ret) {
- sfe_ipv6_flush_connection(si, c, SFE_SYNC_REASON_FLUSH);
+ if (ret) {
+ sfe_ipv6_flush_connection(si, c, SFE_SYNC_REASON_FLUSH);
+ }
}
rcu_read_unlock();
sfe_ipv6_exception_stats_inc(si, SFE_IPV6_EXCEPTION_EVENT_INVALID_SRC_IFACE);
- DEBUG_TRACE("flush on wrong source interface check failure\n");
+ DEBUG_TRACE("exception the packet on source interface check failure\n");
return 0;
}