DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Kirill Rybalchenko <kirill.rybalchenko@intel.com>, dev@dpdk.org
Cc: andrey.chilikin@intel.com, beilei.xing@intel.com, jingjing.wu@intel.com
Subject: Re: [dpdk-dev] [PATCH v2 2/4] net/i40e: add new functions to manipulate with pctype mapping table
Date: Fri, 8 Sep 2017 18:01:20 +0100	[thread overview]
Message-ID: <c836f98f-9e29-ef5f-d6c5-629b098b1dd8@intel.com> (raw)
In-Reply-To: <1504278166-32769-3-git-send-email-kirill.rybalchenko@intel.com>

On 9/1/2017 4:02 PM, Kirill Rybalchenko wrote:
> Add new functions which allow modify, return or reset to default
> the contents of flow type to pctype dynamic mapping table.
> 
> Signed-off-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
> ---
>  drivers/net/i40e/rte_pmd_i40e.c | 98 +++++++++++++++++++++++++++++++++++++++++
>  drivers/net/i40e/rte_pmd_i40e.h | 61 +++++++++++++++++++++++++

.map file needs to be updated for shared build.

<...>

> +int rte_pmd_i40e_flow_type_mapping_get(
> +			uint8_t port,
> +			struct rte_pmd_i40e_flow_type_mapping *mapping_items,
> +			uint16_t size,
> +			uint16_t *count,
> +			uint8_t valid_only)> +{
> +	struct rte_eth_dev *dev;
> +	struct i40e_adapter *ad;
> +	int n = 0;
> +	uint16_t i;
> +
> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
> +
> +	dev = &rte_eth_devices[port];
> +
> +	if (!is_i40e_supported(dev))
> +		return -ENOTSUP;
> +
> +	ad = I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
> +
> +	for (i = 0; i < I40E_FLOW_TYPE_MAX; i++) {
> +		if (n >= size)
> +			break;

This returns partial table and success, how caller can know if it get
full table or not?

Is returning partial table required, specially when custom offset is not
supported..

> +		if (valid_only && ad->pcypes_tbl[i] == 0ULL)
> +			continue;
> +		mapping_items[n].flow_type = i;
> +		mapping_items[n].pctype = ad->pcypes_tbl[i];
> +		n++;
> +	}
> +
> +	*count = n;
> +	return 0;
> +}
<...>

> @@ -657,4 +657,65 @@ int rte_pmd_i40e_ptype_mapping_replace(uint8_t port,
>  int rte_pmd_i40e_add_vf_mac_addr(uint8_t port, uint16_t vf_id,
>  				 struct ether_addr *mac_addr);
>  
> +
> +struct rte_pmd_i40e_flow_type_mapping {
> +	uint8_t flow_type; /**< software defined flow type*/

flow_type are RTE_ETH_FLOW_* values defined in rte_eth_ctrl.h which is
public header.

> +	uint64_t pctype; /**< hardware defined pctype */

But how user can get pctype values, since this is part of public API,
and if application would like to use these values, is there any public
header list them?

> +};
> +
> +/**
> + * Update hardware defined pctype to software defined flow type
> + * mapping table.
> + *
> + * @param port
> + *    pointer to port identifier of the device.
> + * @param mapping_items
> + *    the base address of the mapping items array.
> + * @param count
> + *    number of mapping items.
> + * @param exclusive
> + *    the flag indicate different ptype mapping update method.
> + *    -(0) only overwrite referred PTYPE mapping,
> + *	keep other PTYPEs mapping unchanged.
> + *    -(!0) overwrite referred PTYPE mapping,
> + *	set other PTYPEs maps to PTYPE_UNKNOWN.
> + */
> +int rte_pmd_i40e_flow_type_mapping_update(
> +			uint8_t port,
> +			struct rte_pmd_i40e_flow_type_mapping *mapping_items,
> +			uint16_t count,
> +			uint8_t exclusive);

May prefer boolean here.

> +
> +/**
> + * Get software defined flow type to hardware defined pctype
> + * mapping items.
> + *
> + * @param port
> + *    pointer to port identifier of the device.
> + * @param mapping_items
> + *    the base address of the array to store returned items.
> + * @param size
> + *    the size of the input array.
> + * @param count
> + *    the place to store the number of returned items.
> + * @param valid_only
> + *    -(0) return full mapping table.
> + *    -(!0) only return mapping items which flow_type != RTE_ETH_FLOW_UNKNOWN.
> + */
> +int rte_pmd_i40e_flow_type_mapping_get(
> +			uint8_t port,
> +			struct rte_pmd_i40e_flow_type_mapping *mapping_items,
> +			uint16_t size,
> +			uint16_t *count,
> +			uint8_t valid_only);

May prefer boolean here.

<...>

  parent reply	other threads:[~2017-09-08 17:02 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1503569908-104074-1-git-send-email-kirill.rybalchenko@intel.com>
2017-09-01 15:02 ` [dpdk-dev] [PATCH v2 0/4] net/i40e: implement dynamic mapping of flow types to pctypes Kirill Rybalchenko
2017-09-01 15:02   ` [dpdk-dev] [PATCH v2 1/4] net/i40e: implement dynamic mapping of sw flow types to hw pctypes Kirill Rybalchenko
2017-09-04 16:49     ` Ananyev, Konstantin
2017-09-08 16:58     ` Ferruh Yigit
2017-09-01 15:02   ` [dpdk-dev] [PATCH v2 2/4] net/i40e: add new functions to manipulate with pctype mapping table Kirill Rybalchenko
2017-09-04 17:24     ` Iremonger, Bernard
2017-09-08 17:01     ` Ferruh Yigit [this message]
2017-09-01 15:02   ` [dpdk-dev] [PATCH v2 3/4] app/testpmd: add new commands to manipulate with pctype mapping Kirill Rybalchenko
2017-09-04 17:29     ` Iremonger, Bernard
2017-09-08 17:02     ` Ferruh Yigit
2017-09-01 15:02   ` [dpdk-dev] [PATCH v2 4/4] ethdev: remove unnecessary check for new flow type Kirill Rybalchenko
2017-09-08 17:01     ` Ferruh Yigit
2017-09-04 17:16   ` [dpdk-dev] [PATCH v2 0/4] net/i40e: implement dynamic mapping of flow types to pctypes Iremonger, Bernard
2017-09-20 14:32   ` [dpdk-dev] [PATCH v3 0/6] " Kirill Rybalchenko
2017-09-20 14:32     ` [dpdk-dev] [PATCH v3 1/6] net/i40e: remove unnecessary bit operations Kirill Rybalchenko
2017-09-20 14:32     ` [dpdk-dev] [PATCH v3 2/6] net/i40e: add definition for invalid pctype Kirill Rybalchenko
2017-09-22  7:29       ` Xing, Beilei
2017-09-20 14:33     ` [dpdk-dev] [PATCH v3 3/6] net/i40e: implement dynamic mapping of sw flow types to hw pctypes Kirill Rybalchenko
2017-09-25  9:44       ` Xing, Beilei
2017-09-20 14:33     ` [dpdk-dev] [PATCH v3 4/6] net/i40e: add new functions to manipulate with pctype mapping table Kirill Rybalchenko
2017-09-22  7:27       ` Xing, Beilei
2017-09-20 14:33     ` [dpdk-dev] [PATCH v3 5/6] app/testpmd: add new commands to manipulate with pctype mapping Kirill Rybalchenko
2017-09-25 11:54       ` Xing, Beilei
2017-09-20 14:33     ` [dpdk-dev] [PATCH v3 6/6] ethdev: remove unnecessary check for new flow type Kirill Rybalchenko
2017-10-02 15:08     ` [dpdk-dev] [PATCH v4 0/5] net/i40e: implement dynamic mapping of flow types to pctypes Kirill Rybalchenko
2017-10-02 15:08       ` [dpdk-dev] [PATCH v4 1/5] net/i40e: remove unnecessary bit operations Kirill Rybalchenko
2017-10-02 15:08       ` [dpdk-dev] [PATCH v4 2/5] net/i40e: implement dynamic mapping of sw flow types to hw pctypes Kirill Rybalchenko
2017-10-02 15:09       ` [dpdk-dev] [PATCH v4 3/5] net/i40e: add new functions to manipulate with pctype mapping table Kirill Rybalchenko
2017-10-02 15:09       ` [dpdk-dev] [PATCH v4 4/5] app/testpmd: add new commands to manipulate with pctype mapping Kirill Rybalchenko
2017-10-03 21:42         ` Ferruh Yigit
2017-10-02 15:09       ` [dpdk-dev] [PATCH v4 5/5] ethdev: remove unnecessary check for new flow type Kirill Rybalchenko
2017-10-03 21:44       ` [dpdk-dev] [PATCH v4 0/5] net/i40e: implement dynamic mapping of flow types to pctypes Ferruh Yigit
2017-10-04 12:52       ` [dpdk-dev] [PATCH v5 " Kirill Rybalchenko
2017-10-04 12:52         ` [dpdk-dev] [PATCH v5 1/5] net/i40e: remove unnecessary bit operations Kirill Rybalchenko
2017-10-04 12:52         ` [dpdk-dev] [PATCH v5 2/5] net/i40e: implement dynamic mapping of sw flow types to hw pctypes Kirill Rybalchenko
2017-10-04 12:52         ` [dpdk-dev] [PATCH v5 3/5] net/i40e: add new functions to manipulate with pctype mapping table Kirill Rybalchenko
2017-10-04 12:52         ` [dpdk-dev] [PATCH v5 4/5] app/testpmd: add new commands to manipulate with pctype mapping Kirill Rybalchenko
2017-10-04 12:52         ` [dpdk-dev] [PATCH v5 5/5] ethdev: remove unnecessary check for new flow type Kirill Rybalchenko
2017-10-04 21:48         ` [dpdk-dev] [PATCH v5 0/5] net/i40e: implement dynamic mapping of flow types to pctypes Ferruh Yigit
2017-10-05  1:28           ` 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=c836f98f-9e29-ef5f-d6c5-629b098b1dd8@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=andrey.chilikin@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=kirill.rybalchenko@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).