system automatically reboot due to MC7430

dailijin dailijin126 at 126.com
Fri Sep 2 10:01:06 UTC 2016


Hi all,


I add debug info in usbnet and qmi_wwan driver, detail as below.


usbnet.c:
static inline void rx_process (struct usbnet *dev, struct sk_buff *skb)
{
   ...
    if (skb->len) {
        /* all data was already cloned from skb inside the driver */
        if (dev->driver_info->flags & FLAG_MULTI_PACKET)
            dev_kfree_skb_any(skb);
        else
            printk (KERN_INFO "danner debug =>rx_process, skb len:%zu, dev:%s\n", skb->len, skb->dev ? skb->dev->name : "<NULL>");
            usbnet_skb_return(dev, skb);
        return;
    }


    netif_dbg(dev, rx_err, dev->net, "drop\n");
    dev->net->stats.rx_errors++;
done:
    skb_queue_tail(&dev->done, skb);
}
void usbnet_skb_return (struct usbnet *dev, struct sk_buff *skb)
{
    int status;


    if (test_bit(EVENT_RX_PAUSED, &dev->flags)) {
        skb_queue_tail(&dev->rxq_pause, skb);
        return;
    }
    printk (KERN_INFO "danner debug => skb->protocol=%d, net:%s\n", skb->protocol,skb->dev ? skb->dev->name : "<NULL>");
    if (skb->protocol == 8) {
        if (strcmp (dev->driver_name, "qmi_wwan") != 0) {
            skb->protocol = eth_type_trans (skb, dev->net);
        }
    } else if (skb->protocol == 0 || !skb->dev){
        WARN_ONCE(skb->protocol != 0, "skb->dev unset, but skb->protocol=0x%04x\n", ntohs(skb->protocol));
        skb->protocol = eth_type_trans (skb, dev->net);
    }
.....
}


qmi_wwan.c:


static int qmi_wwan_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
{
    struct qmi_wwan_state *info = (void *)&dev->data;
    bool rawip = info->flags & QMI_WWAN_FLAG_RAWIP;
    __be16 proto;


    /* This check is no longer done by usbnet */
    if (skb->len < dev->net->hard_header_len) {
        return 0;
    }    


    switch (skb->data[0] & 0xf0) {
    case 0x40:
        proto = htons(ETH_P_IP);
        printk(KERN_INFO "danner debug => proto:ETH_P_IP, dev:%s\n", skb->dev ? skb->dev->name: "<NULL>");
        break;
    case 0x60:
        printk(KERN_INFO "danner debug => proto:ETH_P_IPV6, dev:%s\n", skb->dev ? skb->dev->name: "<NULL>");
        proto = htons(ETH_P_IPV6);
        break;
    case 0x00:
        printk(KERN_INFO "danner debug => proto:00,dev:%s\n", skb->dev ? skb->dev->name: "<NULL>");
        if (rawip) {
            printk(KERN_INFO "danner debug => raw ip, return, dev:%s\n", skb->dev ? skb->dev->name: "<NULL>");
            return 0;
        }    
        if (is_multicast_ether_addr(skb->data)) {
            printk(KERN_INFO "danner debug => is_multicast_ether_addr, return, dev:%s\n", skb->dev ? skb->dev->name: "<NULL>");
            return 1;
        }
        /* possibly bogus destination - rewrite just in case */
        skb_reset_mac_header(skb);
        goto fix_dest;
    default:
        if (rawip) {
            printk(KERN_INFO "danner debug => raw ip 2, return, dev:%s\n", skb->dev ? skb->dev->name: "<NULL>");
            return 0;
        }


        /* pass along other packets without modifications */
        printk(KERN_INFO "danner debug => default, return, dev:%s\n", skb->dev ? skb->dev->name: "<NULL>");
        return 1;
    }


    if (rawip) {
        skb->dev = dev->net; /* normally set by eth_type_trans */
        skb->protocol = proto;
        printk(KERN_INFO "danner debug => raw ip 3, return, dev:%s\n", skb->dev ? skb->dev->name: "<NULL>");
        return 1;
    }


    printk(KERN_INFO "danner debug => %s: len:%d head:%p data:%p tail:%#lx end:%#lx dev:%s\n",
         __func__,skb->len, skb->head, skb->data,
         (unsigned long)skb->tail, (unsigned long)skb->end,
         skb->dev ? skb->dev->name : "<NULL>");


    if (skb_headroom(skb) < ETH_HLEN) {
        printk(KERN_INFO "danner debug => skb_headroom, dev:%s\n", skb->dev ? skb->dev->name : "<NULL>");
        return 0;
    }


    printk(KERN_INFO "danner debug => skb_push, dev:%s\n", skb->dev ? skb->dev->name : "<NULL>");
    skb_push(skb, ETH_HLEN);
    skb_reset_mac_header(skb);
    eth_hdr(skb)->h_proto = proto;
    eth_zero_addr(eth_hdr(skb)->h_source);
fix_dest:
    memcpy(eth_hdr(skb)->h_dest, dev->net->dev_addr, ETH_ALEN);
    printk(KERN_INFO "danner debug => fix dest, return, dev:%s\n", skb->dev ? skb->dev->name: "<NULL>");
    return 1;
}


then I test again, plugin 6 MC7430 with 3 SIM card, plugin one MC7304, connect Ethernet cable. after transfer data about 0.5 ~ 2 hour via them, the system still will automatically reboot. and captured the log as below:
259264 Sep 02 09:22:46 tvupack kernel: danner debug =>rx_process, skb len:119, dev:wwan0
259265 Sep 02 09:22:46 tvupack kernel: danner debug => skb->protocol=0, net:wwan0
259266 Sep 02 09:22:46 tvupack kernel: danner debug => proto:ETH_P_IP, dev:wwan6
259267 Sep 02 09:22:46 tvupack kernel: danner debug => raw ip 3, return, dev:wwan6
259268 Sep 02 09:22:46 tvupack kernel: danner debug =>rx_process, skb len:105, dev:wwan6
259269 Sep 02 09:22:46 tvupack kernel: danner debug => skb->protocol=8, net:wwan6
259270 Sep 02 09:22:46 tvupack kernel: danner debug => proto:ETH_P_IP, dev:wwan4
259271 Sep 02 09:22:46 tvupack kernel: danner debug => raw ip 3, return, dev:wwan4
259272 Sep 02 09:22:46 tvupack kernel: danner debug =>rx_process, skb len:105, dev:wwan4
259273 Sep 02 09:22:46 tvupack kernel: danner debug => skb->protocol=8, net:wwan4
259274 Sep 02 09:22:46 tvupack kernel: danner debug => default, return, dev:wwan0
259275 Sep 02 09:22:46 tvupack kernel: danner debug =>rx_process, skb len:119, dev:wwan0
259276 Sep 02 09:22:46 tvupack kernel: danner debug => skb->protocol=0, net:wwan0
259277 Sep 02 09:22:46 tvupack kernel: danner debug => default, return, dev:wwan0
259278 Sep 02 09:22:46 tvupack kernel: danner debug =>rx_process, skb len:58, dev:wwan0
259279 Sep 02 09:22:46 tvupack kernel: danner debug => skb->protocol=0, net:wwan0
259280 Sep 02 09:22:46 tvupack kernel: danner debug => proto:ETH_P_IP, dev:wwan2
259281 Sep 02 09:22:46 tvupack kernel: danner debug => raw ip 3, return, dev:wwan2
259282 Sep 02 09:22:46 tvupack kernel: danner debug =>rx_process, skb len:120, dev:wwan2
259283 Sep 02 09:22:46 tvupack kernel: danner debug => skb->protocol=8, net:wwan2
259284 Sep 02 09:22:46 tvupack kernel: danner debug => proto:ETH_P_IP, dev:wwan4
259285 Sep 02 09:22:46 tvupack kernel: danner debug => raw ip 3, return, dev:wwan4
259286 Sep 02 09:22:46 tvupack kernel: danner debug =>rx_process, skb len:84, dev:wwan4
259287 Sep 02 09:22:46 tvupack kernel: danner debug => skb->protocol=8, net:wwan4
259288 Sep 02 09:22:46 tvupack kernel: danner debug => proto:ETH_P_IP, dev:wwan4
259289 Sep 02 09:22:46 tvupack kernel: danner debug => raw ip 3, return, dev:wwan4
259290 Sep 02 09:22:46 tvupack kernel: danner debug =>rx_process, skb len:120, dev:wwan4
259291 Sep 02 09:22:46 tvupack kernel: danner debug => skb->protocol=8, net:wwan4
259292 Sep 02 09:22:46 tvupack kernel: danner debug => default, return, dev:wwan0
259293 Sep 02 09:22:46 tvupack kernel: danner debug =>rx_process, skb len:134, dev:wwan0
259294 Sep 02 09:22:46 tvupack kernel: danner debug => skb->protocol=0, net:wwan0
259295 Sep 02 09:22:46 tvupack kernel: danner debug => proto:ETH_P_IP, dev:wwan6
259296 Sep 02 09:22:46 tvupack kernel: danner debug => raw ip 3, return, dev:wwan6
259297 Sep 02 09:22:46 tvupack kernel: danner debug =>rx_process, skb len:120, dev:wwan6


From log, three MC7430(wwan2, wwan4, wwan6) use ETH_P_IP, the skb protocol is 8, and use raw ip mode. it should not execute skb_push().
the MC7304 enter the default logic in qmi_wwan_rx_fixup(see log:tvupack kernel: danner debug => default, return, dev:wwan0), I don't know whether this is right, it don't use ETH_P_IP or ETH_P_IPV6.
it seems that MC7304 and MC7430 all not execute skb_push(). so this is strange that system display skb_under_panic when system reboot.


Does anyone can find some clue?



--

Best Regards,
Dai,Lijin

在 2016-09-02 11:02:32,"dailijin" <dailijin126 at 126.com> 写道:

Hi All,


when I reproduce it again, the log as below:
Sep 01 23:12:59 tvupack kernel: usb 1-1.6.5: New USB device found, idVendor=1199, idProduct=9071
Sep 01 23:12:59 tvupack kernel: usb 1-1.6.5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Sep 01 23:12:59 tvupack kernel: usb 1-1.6.5: Product: Sierra Wireless MC7455 Qualcomm® Snapdragon™ X7 LTE-A
Sep 01 23:12:59 tvupack kernel: usb 1-1.6.5: Manufacturer: Sierra Wireless, Incorporated
Sep 01 23:12:59 tvupack kernel: usb 1-1.6.5: SerialNumber: LU55030071041009
Sep 01 23:12:59 tvupack kernel: GobiSerial 1-1.6.5:1.2: GobiSerial converter detected
Sep 01 23:12:59 tvupack kernel: usb 1-1.6.5: GobiSerial converter now attached to ttyUSB11
Sep 01 23:12:59 tvupack kernel: GobiSerial 1-1.6.5:1.3: GobiSerial converter detected
Sep 01 23:12:59 tvupack kernel: usb 1-1.6.5: GobiSerial converter now attached to ttyUSB12
Sep 01 23:12:59 tvupack kernel: qmi_wwan 1-1.6.5:1.8: cdc-wdm11: USB WDM device
Sep 01 23:12:59 tvupack kernel: qmi_wwan 1-1.6.5:1.8 wwan10: register 'qmi_wwan' at usb-0000:00:1d.0-1.6.5, WWAN/QMI device, c2:1d:5c:87:2a:56
Sep 01 23:12:59 tvupack kernel: qmi_wwan 1-1.6.5:1.10: cdc-wdm12: USB WDM device
Sep 01 23:12:59 tvupack kernel: qmi_wwan 1-1.6.5:1.10 wwan11: register 'qmi_wwan' at usb-0000:00:1d.0-1.6.5, WWAN/QMI device, c2:1d:5c:87:2a:56
Sep 01 23:12:59 tvupack systemd-sysctl[26114]: Overwriting earlier assignment of kernel/sysrq in file '/usr/lib64/sysctl.d/60-gentoo.conf'.
Sep 01 23:12:59 tvupack NetworkManager[755]: SCPlugin-Ifupdown: devices added (path: /sys/devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1.6/1-1.6.5/1-1.6.5:1.8/net/wwan10, iface: wwan10)
Sep 01 23:12:59 tvupack NetworkManager[755]: SCPluginIfupdown: locking wired connection setting
Sep 01 23:12:59 tvupack NetworkManager[755]: Ifupdown: get unmanaged devices count: 13
Sep 01 23:12:59 tvupack systemd-sysctl[26116]: Overwriting earlier assignment of kernel/sysrq in file '/usr/lib64/sysctl.d/60-gentoo.conf'.
Sep 01 23:12:59 tvupack NetworkManager[755]: SCPlugin-Ifupdown: devices added (path: /sys/devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1.6/1-1.6.5/1-1.6.5:1.10/net/wwan11, iface: wwan11)
Sep 01 23:12:59 tvupack NetworkManager[755]: SCPluginIfupdown: locking wired connection setting
Sep 01 23:12:59 tvupack NetworkManager[755]: Ifupdown: get unmanaged devices count: 14
Sep 01 23:13:15 tvupack perl[13323]: tvudial  : slotid: 5, using dev 0 -> cdc-wdm3 to dial MC7430
Sep 01 23:13:15 tvupack perl[13323]: tvudial  : slotid: 5, using dev 0 -> wwan2 to dial MC7430, diaing net name: wwan2
Sep 01 23:13:15 tvupack kernel: usb 1-1.6.2: USB disconnect, device number 48
Sep 01 23:13:15 tvupack kernel: GobiSerial driver ttyUSB5: GobiSerial converter now disconnected from ttyUSB5
Sep 01 23:13:15 tvupack kernel: GobiSerial 1-1.6.2:1.2: device disconnected
Sep 01 23:13:15 tvupack kernel: GobiSerial driver ttyUSB6: GobiSerial converter now disconnected from ttyUSB6
Sep 01 23:13:15 tvupack kernel: GobiSerial 1-1.6.2:1.3: device disconnected
Sep 01 23:13:15 tvupack kernel: qmi_wwan 1-1.6.2:1.8 wwan4: unregister 'qmi_wwan' usb-0000:00:1d.0-1.6.2, WWAN/QMI device
Sep 01 23:13:15 tvupack kernel: qmi_wwan 1-1.6.2:1.10 wwan5: unregister 'qmi_wwan' usb-0000:00:1d.0-1.6.2, WWAN/QMI device
Sep 01 23:13:15 tvupack kernel: skbuff: skb_under_panic: text:ffffffff816a609d len:167 put:65 head:ffff8800682ddc40 data:ffff8800682ddc3f tail:0xa6 end:0x640 dev:wwan8







--

Best Regards,
Dai,Lijin

在 2016-09-02 10:00:24,"dailijin" <dailijin126 at 126.com> 写道:

Hi Bjorn,


I am not sure whether the modem send IPV6 packet, how do I check this?


I also reproduce this issue again. plugin 6 MC7430 with 3 SIM card, connect WIFI,  the device do live about 12 hour with 400k/2s, this issue happen.


I also attach qmi_wwan driver source code, could you check it and whether can find any clue about this issue? the uncompress command is "tar zxvf my_qmi_wwan.tar.gz"


I am very appreciate all your notice on this issue.




--

Best Regards,
Dai,Lijin



在 2016-09-02 02:53:12,"Bjørn Mork" <bjorn at mork.no> 写道:
>dailijin  <dailijin126 at 126.com> writes:
>
>> void usbnet_skb_return (struct usbnet *dev, struct sk_buff *skb)
>> {
>>     int status;
>>
>>
>>     if (test_bit(EVENT_RX_PAUSED, &dev->flags)) {
>>         skb_queue_tail(&dev->rxq_pause, skb);
>>         return;
>>     }    
>>     if (skb->protocol != 8)
>>         skb->protocol = eth_type_trans (skb, dev->net);
>>    .......
>> }
>
>And if the modem ever sends qmi_wwan a raw IPv6 packet, then that will
>obviously blow up...
>
>
>Bjørn
>_______________________________________________
>libqmi-devel mailing list
>libqmi-devel at lists.freedesktop.org
>https://lists.freedesktop.org/mailman/listinfo/libqmi-devel





 




【网易自营|30天无忧退货】Moleskine制造商直供经典商务皮面记事本,限时仅39元>    
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libqmi-devel/attachments/20160902/410c67ce/attachment-0001.html>


More information about the libqmi-devel mailing list