[qca-nss-sfe] add fast xmit features
call hard start xmit in some case that no vlan tag exist,
won't go to xfrm nor qdisc exist.
Change-Id: I94104b0ce8d0e86ee6e63dc401ec042351ef63c7
Signed-off-by: Ken Zhu <quic_guigenz@quicinc.com>
diff --git a/sfe_ipv6_udp.c b/sfe_ipv6_udp.c
index 9e32513..5ffefdd 100644
--- a/sfe_ipv6_udp.c
+++ b/sfe_ipv6_udp.c
@@ -137,6 +137,8 @@
int ret;
bool hw_csum;
bool bridge_flow;
+ bool fast_xmit;
+ netdev_features_t features;
DEBUG_TRACE("%px: sfe: sfe_ipv6_recv_udp called.\n", skb);
@@ -527,6 +529,21 @@
skb->mark = cm->mark;
}
+ /*
+ * For the first packets, check if it could got fast xmit.
+ */
+ if (unlikely(!(cm->flags & SFE_IPV6_CONNECTION_MATCH_FLAG_FAST_XMIT_FLOW_CHECKED)
+ && (cm->flags & SFE_IPV6_CONNECTION_MATCH_FLAG_FAST_XMIT_DEV_ADMISSION))){
+ cm->features = netif_skb_features(skb);
+ if (likely(sfe_fast_xmit_check(skb, cm->features))) {
+ cm->flags |= SFE_IPV6_CONNECTION_MATCH_FLAG_FAST_XMIT;
+ }
+ cm->flags |= SFE_IPV6_CONNECTION_MATCH_FLAG_FAST_XMIT_FLOW_CHECKED;
+ }
+ features = cm->features;
+
+ fast_xmit = !!(cm->flags & SFE_IPV6_CONNECTION_MATCH_FLAG_FAST_XMIT);
+
rcu_read_unlock();
this_cpu_inc(si->stats_pcpu->packets_forwarded64);
@@ -538,6 +555,15 @@
prefetch(skb_shinfo(skb));
/*
+ * We do per packet condition check before we could fast xmit the
+ * packet.
+ */
+ if (likely(fast_xmit && dev_fast_xmit(skb, xmit_dev, features))) {
+ this_cpu_inc(si->stats_pcpu->packets_fast_xmited64);
+ return 1;
+ }
+
+ /*
* Mark that this packet has been fast forwarded.
*/
skb->fast_forwarded = 1;