DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Lu, Wenzhuo" <wenzhuo.lu@intel.com>
To: Roger B Melton <rmelton@cisco.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] net/e1000: i350 VLAN tags in loopback packets are big endian
Date: Wed, 11 Oct 2017 01:32:02 +0000	[thread overview]
Message-ID: <6A0DE07E22DDAD4C9103DF62FEBC09093B6C2328@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <20171006233355.9378-1-rmelton@cisco.com>

Hi Roger,

> -----Original Message-----
> From: Roger B Melton [mailto:rmelton@cisco.com]
> Sent: Saturday, October 7, 2017 7:34 AM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>
> Cc: dev@dpdk.org; Roger B Melton <rmelton@cisco.com>
> Subject: [PATCH] net/e1000: i350 VLAN tags in loopback packets are big
> endian
> 
> When copying VLAN tags from the RX descriptor to the vlan_tci field in the
> mbuf header,  igb_rxtx.c:eth_igb_recv_pkts() and
> eth_igb_recv_scattered_pkts() both assume that the VLAN tag is always little
> endian.  While i350 VLAN non-loopback packets are stored little endian,
> VLAN tags for i350 VLAN loopback packets are big endian.
> 
> For i350 VLAN loopback packets, swap the tag when copying from the RX
> descriptor to the mbuf header.  This will ensure that the mbuf vlan_tci is
> always little endian.
> 
> Signed-off-by: Roger B Melton <rmelton@cisco.com>
> ---
>  drivers/net/e1000/igb_rxtx.c | 56
> ++++++++++++++++++++++++++++++++++++++++----
>  1 file changed, 51 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c index
> 1c80a2a..8432d8b 100644
> --- a/drivers/net/e1000/igb_rxtx.c
> +++ b/drivers/net/e1000/igb_rxtx.c


> @@ -2278,6 +2300,18 @@ eth_igb_rx_init(struct rte_eth_dev *dev)
> 
>  		rxq = dev->data->rx_queues[i];
> 
> +		rxq->flags = 0;
> +		/*
> +		 * The i210, i211, i350, i354 and i350VF LB vlan packets
> +		 * have vlan tags byte swapped.
> +		 */
> +		if (hw->mac.type >= e1000_i350) {
Many thanks for the patch.
I think we need to check i350 and i354 here as LB bit is only meaningful on these NICs.

> +			rxq->flags |= IGB_RXQ_FLAG_LB_BSWAP_VLAN;
> +			PMD_INIT_LOG(DEBUG, "IGB rx vlan bswap
> required");
> +		} else {
> +			PMD_INIT_LOG(DEBUG, "IGB rx vlan bswap not
> required");
> +		}
> +
>  		/* Allocate buffers for descriptor rings and set up queue */
>  		ret = igb_alloc_rx_queue_mbufs(rxq);
>  		if (ret)
> @@ -2557,6 +2591,18 @@ eth_igbvf_rx_init(struct rte_eth_dev *dev)
> 
>  		rxq = dev->data->rx_queues[i];
> 
> +		rxq->flags = 0;
> +		/*
> +		 * The i210, i211, i350, i354 and i350VF LB vlan packets
> +		 * have vlan tags byte swapped.
> +		 */
> +		if (hw->mac.type >= e1000_i350) {
We need to check e1000_vfadapt_i350 here to exclude e1000_vfadapt.

> +			rxq->flags |= IGB_RXQ_FLAG_LB_BSWAP_VLAN;
> +			PMD_INIT_LOG(DEBUG, "IGB rx vlan bswap
> required");
> +		} else {
> +			PMD_INIT_LOG(DEBUG, "IGB rx vlan bswap not
> required");
> +		}
> +
>  		/* Allocate buffers for descriptor rings and set up queue */
>  		ret = igb_alloc_rx_queue_mbufs(rxq);
>  		if (ret)
> --
> 2.10.3.dirty

  reply	other threads:[~2017-10-11  1:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-06 23:33 Roger B Melton
2017-10-11  1:32 ` Lu, Wenzhuo [this message]
2017-10-11 14:34   ` Roger B. Melton

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=6A0DE07E22DDAD4C9103DF62FEBC09093B6C2328@shsmsx102.ccr.corp.intel.com \
    --to=wenzhuo.lu@intel.com \
    --cc=dev@dpdk.org \
    --cc=rmelton@cisco.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).