All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>,
	jerin.jacob@caviumnetworks.com,
	santosh.shukla@caviumnetworks.com,
	rkudurumalla@caviumnetworks.com
Cc: dev@dpdk.org, "Kudurumalla,
	Rakesh" <rakesh.kudurumalla@cavium.com>,
	Shahaf Shuler <shahafs@mellanox.com>,
	Andrew Rybchenko <arybchenko@solarflare.com>,
	Olivier MATZ <olivier.matz@6wind.com>
Subject: Re: [PATCH] net/thunderx: add support for Rx VLAN offload
Date: Wed, 4 Jul 2018 18:36:29 +0100	[thread overview]
Message-ID: <63fa281f-e777-dc35-fa39-33e5dbcb0d42@intel.com> (raw)
In-Reply-To: <20180701164637.978-1-pbhagavatula@caviumnetworks.com>

On 7/1/2018 5:46 PM, Pavan Nikhilesh wrote:
> From: "Kudurumalla, Rakesh" <rakesh.kudurumalla@cavium.com>
> 
> This feature is used to offload stripping of vlan header from recevied
> packets and update vlan_tci field in mbuf when
> DEV_RX_OFFLOAD_VLAN_STRIP & ETH_VLAN_STRIP_MASK flag is set.
> 
> Signed-off-by: Rakesh Kudurumalla <rkudurumalla@caviumnetworks.com>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> ---
>  drivers/net/thunderx/base/nicvf_hw.c |  1 +
>  drivers/net/thunderx/nicvf_ethdev.c  | 59 +++++++++++++++++------
>  drivers/net/thunderx/nicvf_rxtx.c    | 70 ++++++++++++++++++++++++----
>  drivers/net/thunderx/nicvf_rxtx.h    | 15 ++++--
>  drivers/net/thunderx/nicvf_struct.h  |  1 +

In thunderx.ini, "VLAN offload" already marked as P(Partially) is it still
partially? Why?


<...>

> @@ -1590,9 +1595,9 @@ nicvf_vf_start(struct rte_eth_dev *dev, struct nicvf *nic, uint32_t rbdrsz)
>  		     nic->rbdr->tail, nb_rbdr_desc, nic->vf_id);
>  
>  	/* Configure VLAN Strip */
> -	vlan_strip = !!(dev->data->dev_conf.rxmode.offloads &
> -			DEV_RX_OFFLOAD_VLAN_STRIP);
> -	nicvf_vlan_hw_strip(nic, vlan_strip);
> +	mask = ETH_VLAN_STRIP_MASK | ETH_VLAN_FILTER_MASK |
> +		ETH_VLAN_EXTEND_MASK;

You don't need anything more than ETH_VLAN_STRIP_MASK but agreed no issue add
more if you prefer.

> +	ret = nicvf_vlan_offload_config(dev, mask);
>  
>  	/* Based on the packet type(IPv4 or IPv6), the nicvf HW aligns L3 data
>  	 * to the 64bit memory address.
> @@ -1983,6 +1988,7 @@ static const struct eth_dev_ops nicvf_eth_dev_ops = {
>  	.dev_infos_get            = nicvf_dev_info_get,
>  	.dev_supported_ptypes_get = nicvf_dev_supported_ptypes_get,
>  	.mtu_set                  = nicvf_dev_set_mtu,
> +	.vlan_offload_set         = nicvf_vlan_offload_set,

Not related to this patch but I believe this name 'vlan_offload_set' is
confusing, it enable/disable VLAN related config:
- vlan strip offload
- vlan filtering package (drop/accept specific vlans)
- double vlan feature (not offload if I am not missing anything)
We can think about a more proper name later...

Also rte_eth_dev_set_vlan_offload() API may have a defect, it seems not taking
capability flags into account, cc'ed Shahaf and Andrew for information.

And I have a question about DEV_TX_OFFLOAD_VLAN_INSERT, perhaps goes to Olivier,
if DEV_TX_OFFLOAD_VLAN_INSERT enabled what is the correct way to provide
vlan_tci to insert?
And do we need something like PKT_RX_VLAN_INSERT and use mbuf->vlan_tci value to
have the ability to insert VLAN to some packets?

<...>

> +static int
> +nicvf_vlan_offload_set(struct rte_eth_dev *dev, int mask)
> +{
> +	nicvf_vlan_offload_config(dev, mask);

Don't you need to change rx_pkt_burst function according request here.

Like if driver was using nicvf_recv_pkts_vlan_strip() and application disabled
vlan_strip, what will happen?

<...>

> +uint16_t __hot
> +nicvf_recv_pkts_vlan_strip(void *rx_queue, struct rte_mbuf **rx_pkts,
> +		uint16_t nb_pkts)
> +{
> +	return nicvf_recv_pkts(rx_queue, rx_pkts, nb_pkts,
> +			NICVF_RX_OFFLOAD_NONE | NICVF_RX_OFFLOAD_VLAN_STRIP);

Why do you OR NICVF_RX_OFFLOAD_NONE, this cause zeroing the pkt->ol_flags which
will be overriten because of NICVF_RX_OFFLOAD_VLAN_STRIP already?

  reply	other threads:[~2018-07-04 17:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-01 16:46 [PATCH] net/thunderx: add support for Rx VLAN offload Pavan Nikhilesh
2018-07-04 17:36 ` Ferruh Yigit [this message]
2018-07-13 14:16   ` rkudurumalla
2018-07-14  8:02     ` Andrew Rybchenko
2018-07-16  9:26 ` [PATCH v2 1/2] net/thunderx: enable Rx checksum offload Pavan Nikhilesh
2018-07-16  9:26   ` [PATCH v2 2/2] net/thunderx: add support for Rx VLAN offload Pavan Nikhilesh
2018-07-18 13:48   ` [PATCH v2 1/2] net/thunderx: enable Rx checksum offload Ferruh Yigit
2018-07-18 15:05 ` [PATCH v3 " Pavan Nikhilesh
2018-07-18 15:05   ` [PATCH v3 2/2] net/thunderx: add support for Rx VLAN offload Pavan Nikhilesh
2018-07-18 17:30     ` Jerin Jacob
2018-07-18 17:27   ` [PATCH v3 1/2] net/thunderx: enable Rx checksum offload Jerin Jacob
2018-07-19 13:15     ` Ferruh Yigit

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=63fa281f-e777-dc35-fa39-33e5dbcb0d42@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=arybchenko@solarflare.com \
    --cc=dev@dpdk.org \
    --cc=jerin.jacob@caviumnetworks.com \
    --cc=olivier.matz@6wind.com \
    --cc=pbhagavatula@caviumnetworks.com \
    --cc=rakesh.kudurumalla@cavium.com \
    --cc=rkudurumalla@caviumnetworks.com \
    --cc=santosh.shukla@caviumnetworks.com \
    --cc=shahafs@mellanox.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.