Thanks Helin,

The "fix" below works for me but I don't think it's complete and correct
for all kernels.

Daniel

Index: src/kernel/fast_kni/kni_net.c
===================================================================
--- src/kernel/fast_kni/kni_net.c
+++ src/kernel/fast_kni/kni_net.c
@@ -353,6 +353,12 @@
  kni->stats.rx_bytes += len;
  kni->stats.rx_packets++;

+                        /* adjust the skb */
+                        if (likely(skb_mac_header_was_set(skb))) {
+                            skb->len += ETH_HLEN;
+                            skb->data -= ETH_HLEN;
+                        }
+
  /* call tx interface */
  kni_net_tx(skb, dev);
  }



On Wed, Dec 25, 2013 at 2:50 AM, Zhang, Helin <helin.zhang at intel.com> wrote:

> Hi Daniel
>
> Thanks for your good catch!
> Yes. That's a bug, and it will be fixed in later DPDK releases.
>
> Regards,
> Helin
>
> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Daniel Kaminsky
> Sent: Friday, December 20, 2013 12:36 AM
> To: dev at dpdk.org
> Subject: [dpdk-dev] Loop back mode of the KNI
>
> Hi all,
>
> We're working on the KNI and we see a strange behavior which seems like a
> bug in the the kernel module.
>
> When running with *lo_mode=lo_mode_fifo *everything works as expected, the
> packets looks similar on the ingress and egress.
> But when running with *lo_mode=lo_mode_fifo_skb *the packets on the egress
> doesn't include the first 14 bytes (the ethernet header) although the
> packets size doesn't change.
>
> Thanks,
> Daniel
>

Reply via email to