DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Zhang, Qi Z" <qi.z.zhang@intel.com>
To: "Wu, Jingjing" <jingjing.wu@intel.com>,
	"Zhang, Helin" <helin.zhang@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v3 2/3] net/i40e: configurable PTYPE mapping
Date: Mon, 27 Mar 2017 01:55:46 +0000	[thread overview]
Message-ID: <039ED4275CED7440929022BC67E70611530758E4@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <9BB6961774997848B5B42BEC655768F810D13446@SHSMSX103.ccr.corp.intel.com>

Hi Jingjing

> -----Original Message-----
> From: Wu, Jingjing
> Sent: Friday, March 24, 2017 5:55 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Zhang, Helin
> <helin.zhang@intel.com>
> Cc: dev@dpdk.org
> Subject: RE: [PATCH v3 2/3] net/i40e: configurable PTYPE mapping
> 
> > diff --git a/drivers/net/i40e/rte_pmd_i40e.h
> > b/drivers/net/i40e/rte_pmd_i40e.h index a0ad88c..1e25270 100644
> > --- a/drivers/net/i40e/rte_pmd_i40e.h
> > +++ b/drivers/net/i40e/rte_pmd_i40e.h
> > @@ -65,6 +65,13 @@ struct rte_pmd_i40e_mb_event_param {
> >  	uint16_t msglen;   /**< length of the message */
> >  };
> >
> > +#define RTE_PMD_I40E_PTYPE_USER_DEFINE_MASK 0x80000000
> > +
> 
> Could you add more comments to describe the MASK's meaning?
> And what is user defined packet type, and what is the user defined packet
> type?

The purpose of this mask is to let application define their own software PTYPE while not break existing ones.
I will add more comments to explain this.
> 
> 
> And what is the difference between update and replace map?

Both APIs is used to update the ptype mapping table

The difference is 

rte_pmd_i40e_ptype_mapping_replace will searched the specific software ptype (or group) in ptype mapping table and replace it with the new one.
One of the situation to use this API is, application try to simplify the ptype table by representing a group of more specific sw ptype with a generic one like below
rte_pmd_i40e_ptype_mapping_replace(port_id, RTE_PTYPE_L2_MASK, 1, RTE_PTYPE_L2_ETHER);

rte_pmd_i40e_ptype_mapping_update is a little bit low level, because the application need to know about the hardware ptype encode, 
Application can define its own ptype mapping table according to datasheet from scratch or just by modifying the return content from rte_pmd_i40e_ptype_mapping_get 
then use this API to override the whole old table (exclusive set), or part of the old one (exclusive not set)

Thanks
Qi

  reply	other threads:[~2017-03-27  1:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-17 10:45 [dpdk-dev] [PATCH v2 0/3] " Qi Zhang
2017-03-17 10:45 ` [dpdk-dev] [PATCH v3 1/3] net/i40e: enable per dev PTYPE mapping table Qi Zhang
2017-03-17 10:45 ` [dpdk-dev] [PATCH v3 2/3] net/i40e: configurable PTYPE mapping Qi Zhang
2017-03-24  9:55   ` Wu, Jingjing
2017-03-27  1:55     ` Zhang, Qi Z [this message]
2017-03-17 10:45 ` [dpdk-dev] [PATCH v3 3/3] app/testpmd: add CL for ptype mapping configure Qi Zhang
2017-03-21 15:53   ` Ferruh Yigit
2017-03-22  1:24     ` Zhang, Qi Z

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=039ED4275CED7440929022BC67E70611530758E4@SHSMSX103.ccr.corp.intel.com \
    --to=qi.z.zhang@intel.com \
    --cc=dev@dpdk.org \
    --cc=helin.zhang@intel.com \
    --cc=jingjing.wu@intel.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).