title: BUG: unable to handle kernel paging request, DPDK
body: <p>I was trying to run <code>DPDK</code> <code>KNI</code> application with dpdk version 16.07.2,</p>
  
  <p>For that I first unbinded the ports from <code>ixgbe</code> and binded them to <code>igb_uio</code> module with following command</p>
  
  <pre><code>echo 0000:05:00.1 &gt; /sys/bus/pci/drivers/ixgbe/unbind  
  echo 0000:05:00.0 &gt; /sys/bus/pci/drivers/ixgbe/unbind  
  echo 0x8086 0x1528 &gt; /sys/bus/pci/drivers/igb_uio/new_id
  </code></pre>
  
  <p>I compiled the kni application for target machine with Linux version 4.4.20 (sushila@dev03) (gcc version 4.9.2 (crosstool-NG 1.20.0) ) #1 SMP Fri Feb 24 14:32:28 CST 2017</p>
  
  <p>and when I ran the application it hung with the following message</p>
  
  <pre><code>Feb 28 10:09:37 (none) user.alert kernel: [   87.029554] BUG: unable to handle kernel paging request at 0000077e1d012900
  Feb 28 10:09:37 (none) user.alert kernel: [   87.029695] IP: [&lt;ffffffffa0033722&gt;] kni_net_rx_normal+0x2e2/0x440 [rte_kni]
  Feb 28 10:09:37 (none) user.warn kernel: [   87.029801] PGD 0
  Feb 28 10:09:37 (none) user.warn kernel: [   87.029889] Oops: 0000 [#1] SMP
  Feb 28 10:09:37 (none) user.warn kernel: [   87.030010] Modules linked in: rte_kni(O) igb_uio(O)
  Feb 28 10:09:37 (none) user.warn kernel: [   87.030167] CPU: 7 PID: 709 Comm: kni_single Tainted: G          IO    4.4.20 #1
  Feb 28 10:09:37 (none) user.warn kernel: [   87.030242] Hardware name:                  /DX58SO2, BIOS SOX5820J.86A.0603.2010.1117.1506 11/17/2010
  Feb 28 10:09:37 (none) user.warn kernel: [   87.030320] task: ffff8805a8ad8000 ti: ffff8805a7ae0000 task.ti: ffff8805a7ae0000
  Feb 28 10:09:37 (none) user.warn kernel: [   87.030395] RIP: 0010:[&lt;ffffffffa0033722&gt;]  [&lt;ffffffffa0033722&gt;] kni_net_rx_normal+0x2e2/0x440 [rte_kni]
  Feb 28 10:09:37 (none) user.warn kernel: [   87.030517] RSP: 0018:ffff8805a7ae3d30  EFLAGS: 00010286
  Feb 28 10:09:37 (none) user.warn kernel: [   87.030576] RAX: 0000077e1d012900 RBX: 0000000000000020 RCX: 0000000000000010
  Feb 28 10:09:37 (none) user.warn kernel: [   87.030639] RDX: 0000000000000001 RSI: 0000000000000246 RDI: ffffffffa00388a3
  Feb 28 10:09:37 (none) user.warn kernel: [   87.030701] RBP: ffff8805a7ae3e80 R08: 000000000000000a R09: 00000000fffffffe
  Feb 28 10:09:37 (none) user.warn kernel: [   87.030766] R10: 00000000ffff2fea R11: 0000000000000006 R12: ffff8805a8a75000
  Feb 28 10:09:37 (none) user.warn kernel: [   87.030829] R13: ffff8800b8c12800 R14: 0000000000000000 R15: ffff8805a8a75800
  Feb 28 10:09:37 (none) user.warn kernel: [   87.030893] FS:  0000000000000000(0000) GS:ffff88062fce0000(0000) knlGS:0000000000000000
  Feb 28 10:09:37 (none) user.warn kernel: [   87.030971] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
  Feb 28 10:09:37 (none) user.warn kernel: [   87.031031] CR2: 0000077e1d012900 CR3: 0000000001e0a000 CR4: 00000000000006e0
  Feb 28 10:09:37 (none) user.warn kernel: [   87.031094] Stack:
  Feb 28 10:09:37 (none) user.warn kernel: [   87.031148]  ffff88062fcf5940 ffff8805a8ad8560 0000000000000000 ffff88060000054e
  Feb 28 10:09:37 (none) user.warn kernel: [   87.031367]  0000077e1d012900 00000000b8c12800 00000000b8c11ec0 00000000b8c11580
  Feb 28 10:09:37 (none) user.warn kernel: [   87.031587]  00000000b8c10c40 00000000b8c10300 00000000b8c0f9c0 00000000b8c0f080
  Feb 28 10:09:37 (none) user.warn kernel: [   87.031811] Call Trace:
  Feb 28 10:09:37 (none) user.warn kernel: [   87.031871]  [&lt;ffffffffa00343af&gt;] kni_net_rx+0xf/0x20 [rte_kni]
  Feb 28 10:09:37 (none) user.warn kernel: [   87.031937]  [&lt;ffffffffa0032f05&gt;] kni_thread_single+0x45/0xb0 [rte_kni]
  Feb 28 10:09:37 (none) user.warn kernel: [   87.032004]  [&lt;ffffffffa0032ec0&gt;] ? kni_init_net+0x50/0x50 [rte_kni]
  Feb 28 10:09:37 (none) user.warn kernel: [   87.032067]  [&lt;ffffffff8107b7cb&gt;] kthread+0xdb/0x100
  Feb 28 10:09:37 (none) user.warn kernel: [   87.032125]  [&lt;ffffffff8107b6f0&gt;] ? kthread_park+0x60/0x60
  Feb 28 10:09:37 (none) user.warn kernel: [   87.032186]  [&lt;ffffffff81834c2f&gt;] ret_from_fork+0x3f/0x70
  Feb 28 10:09:37 (none) user.warn kernel: [   87.032246]  [&lt;ffffffff8107b6f0&gt;] ? kthread_park+0x60/0x60
  Feb 28 10:09:37 (none) user.warn kernel: [   87.032306] Code: 48 89 85 d0 fe ff ff eb 80 41 f6 c6 0f 75 0e 48 c7 c7 9f 88 03 a0 31 c0 e8 02 e9 11 e1 48 8b 85 d0 fe ff ff 48 c7 c7 a3 88 03 a0 &lt;42&gt; 0f b6 34 30 31 c0 49 83 c6 01 e8 e4 e8 11 e1 e9 5e fe ff ff
  Feb 28 10:09:37 (none) user.alert kernel: [   87.034742] RIP  [&lt;ffffffffa0033722&gt;] kni_net_rx_normal+0x2e2/0x440 [rte_kni]
  Feb 28 10:09:37 (none) user.warn kernel: [   87.034844]  RSP &lt;ffff8805a7ae3d30&gt;
  Feb 28 10:09:37 (none) user.warn kernel: [   87.034900] CR2: 0000077e1d012900
  Feb 28 10:09:37 (none) user.warn kernel: [   87.034956] ---[ end trace 5b31765eb0372d51 ]---
  </code></pre>
  
  <p>In there I saw it was failing somewhere in <code>kni_net_rx_normal()</code> function of <code>kni_net.c</code> file.</p>
  
  <p>So I narrowed down the line of code where it was failing and it came to line 169 where the memcpy happens
  Next I tried to print some addresses in that function and it gave me</p>
  
  <pre><code>kva data addresses: data_kva 0000077e1d012900 kva-&gt;buff_add 00007f7e1d012880 kva-&gt;data_off 128 kni-&gt;mbuf_va  (null) and kni-&gt;mbuf_kva ffff880000000000  
  </code></pre>
  
  <p>Next I tried to see if I can print the data in data_kva address and it failed there, so it looks like it fails when I try to access data_kva @ 0000077e1d012900, I guess address is wrong, I dont know why, Can you give me some idea on this or some things to try out to debug the problem.</p>