From: "Zhang, Helin" <helin.zhang@intel.com>
To: Thomas Monjalon <thomas.monjalon@6wind.com>,
Daniel Kaminsky <daniel.kaminsky@infinitelocality.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] Loop back mode of the KNI
Date: Fri, 17 Jan 2014 14:28:14 +0000 [thread overview]
Message-ID: <F35DEAC7BCE34641BA9FAC6BCA4A12E70A6989BE@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <201401171219.41797.thomas.monjalon@6wind.com>
Hi Thomas
The final fix for that could be like below.
diff --git a/lib/librte_eal/linuxapp/kni/kni_net.c b/lib/librte_eal/linuxapp/kni/kni_net.c
index 9a49111..12dbcc0 100644
--- a/lib/librte_eal/linuxapp/kni/kni_net.c
+++ b/lib/librte_eal/linuxapp/kni/kni_net.c
@@ -311,7 +311,6 @@ kni_net_rx_lo_fifo_skb(struct kni_dev *kni)
skb_reserve(skb, 2);
memcpy(skb_put(skb, len), data_kva, len);
skb->dev = dev;
- skb->protocol = eth_type_trans(skb, dev);
skb->ip_summed = CHECKSUM_UNNECESSARY;
dev_kfree_skb(skb);
}
@@ -327,7 +326,6 @@ kni_net_rx_lo_fifo_skb(struct kni_dev *kni)
skb_reserve(skb, 2);
memcpy(skb_put(skb, len), data_kva, len);
skb->dev = dev;
- skb->protocol = eth_type_trans(skb, dev);
skb->ip_summed = CHECKSUM_UNNECESSARY;
kni->stats.rx_bytes += len;
Regards,
Helin
-----Original Message-----
From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
Sent: Friday, January 17, 2014 7:20 PM
To: Daniel Kaminsky; Zhang, Helin
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] Loop back mode of the KNI
> > From: Daniel Kaminsky
[...]
> > > 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.
> On Wed, Dec 25, 2013 at 2:50 AM, Zhang, Helin <helin.zhang@intel.com> wrote:
[...]
> > Yes. That's a bug, and it will be fixed in later DPDK releases.
25/12/2013 07:57, Daniel Kaminsky:
[...]
> The "fix" below works for me but I don't think it's complete and
> correct for all kernels.
>
> --- 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);
> }
Thanks Daniel.
Please Helin, could you share the complete patch in case Daniel's one is not sufficient ?
--
Thomas
next prev parent reply other threads:[~2014-01-17 14:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-19 16:36 Daniel Kaminsky
2013-12-25 0:50 ` Zhang, Helin
2013-12-25 6:57 ` Daniel Kaminsky
2014-01-17 11:19 ` Thomas Monjalon
2014-01-17 14:28 ` Zhang, Helin [this message]
2014-01-17 15:35 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=F35DEAC7BCE34641BA9FAC6BCA4A12E70A6989BE@SHSMSX104.ccr.corp.intel.com \
--to=helin.zhang@intel.com \
--cc=daniel.kaminsky@infinitelocality.com \
--cc=dev@dpdk.org \
--cc=thomas.monjalon@6wind.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).