--- a/drivers/platform/msm/ipa/ipa_v2/rmnet_ipa.c +++ b/drivers/platform/msm/ipa/ipa_v2/rmnet_ipa.c @@ -28,6 +28,7 @@ #include #include #include +#include /* __subsys_notif_shim__ */ #include @@ -1206,6 +1207,36 @@ } qmap_check = RMNET_MAP_GET_CD_BIT(skb); +#if IS_ENABLED(CONFIG_IPV6) + /* + * QMAP data frames (CD=0) carrying IPv6 multicast (ff00::/8) are + * link-local control traffic -- MLDv1/v2 reports, NDP, router + * solicitation. None of it is routable over the LTE bearer and the + * IPA v2.6L HW has no routing entry for it: the CD0 path runs + * ipa2_tx_dp(IPA_CLIENT_APPS_LAN_WAN_PROD,...) which is the HW + * datapath WITHOUT an IP_PACKET_INIT command, i.e. the IPA HW must + * route purely by IP header. With the TX pipe not yet connected + * (ipa2_setup_sys_pipe for APPS_LAN_WAN_PROD runs only in + * vendor_auto_ipacm_init_fn(), ~3s after the Q6 QMI handshake) the + * first MLD report after bearer start dereferenced the invalid sys + * pipe and faulted inside dev_hard_start_xmit (the reported panic); + * once routed, HW exceptions loop back into the AP (IPA_RECEIVE in + * apps_ipa_tx_complete_notify). Drop IPv6 multicast QMAP frames + * here, before they reach the IPA. skb is linear up to the IP + * header: rmnet_map_egress_handler() ran skb_cow_head() before + * pushing the 4-byte MAP header. + */ + if (!qmap_check && skb_headlen(skb) >= 4 + sizeof(struct ipv6hdr)) { + struct ipv6hdr *ip6 = (struct ipv6hdr *)(skb->data + 4); + + if (ip6->version == 6 && ipv6_addr_is_multicast(&ip6->daddr)) { + IPAWANDBG_LOW("SW filtering out IPv6 mcast QMAP pkt\n"); + dev_kfree_skb_any(skb); + dev->stats.tx_dropped++; + return NETDEV_TX_OK; + } + } +#endif if (netif_queue_stopped(dev)) { if (qmap_check && atomic_read(&wwan_ptr->outstanding_pkts) < @@ -1260,7 +1291,23 @@ } if (ret) { - ret = NETDEV_TX_BUSY; + /* + * ipa2_tx_dp() returns -EFAULT when the destination TX + * pipe is not connected/valid or the SPS transfer could + * not be submitted. That is a persistent state (it only + * clears when vendor_auto_ipacm_init_fn() runs), NOT + * transient qdisc backpressure. Returning NETDEV_TX_BUSY + * made sch_direct_xmit requeue and re-xmit the same skb + * (and before the NULL-guard, re-enter the panic path on + * every ping). Drop and count instead. + */ + if (ret == -EFAULT) { + dev_kfree_skb_any(skb); + dev->stats.tx_dropped++; + ret = NETDEV_TX_OK; + } else { + ret = NETDEV_TX_BUSY; + } goto out; }