From: "Wu, Jingjing" <jingjing.wu@intel.com>
To: "Xing, Beilei" <beilei.xing@intel.com>,
"Zhang, Qi Z" <qi.z.zhang@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
"Chilikin, Andrey" <andrey.chilikin@intel.com>,
"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] net/i40e: fix issue during customized info update
Date: Wed, 7 Feb 2018 07:56:46 +0000 [thread overview]
Message-ID: <9BB6961774997848B5B42BEC655768F810F6EFF2@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <1517298807-8148-1-git-send-email-beilei.xing@intel.com>
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Beilei Xing
> Sent: Tuesday, January 30, 2018 3:53 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org; Chilikin, Andrey <andrey.chilikin@intel.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/i40e: fix issue during customized info update
>
> Customized info is updated without checking package
> operation - ADD or DEL, it only covers ADD operation
> currently. This patch adds process for DEL operation.
>
> Fixes: e163c18a15b0 ("net/i40e: update ptype and pctype info")
> Cc: stable@dpdk.org
>
> Signed-off-by: Beilei Xing <beilei.xing@intel.com>
> ---
> drivers/net/i40e/i40e_ethdev.c | 48 +++++++++++++++++++++++++++++++++--------
> drivers/net/i40e/i40e_ethdev.h | 4 +++-
> drivers/net/i40e/i40e_flow.c | 2 +-
> drivers/net/i40e/rte_pmd_i40e.c | 6 ++++--
> 4 files changed, 47 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
> index 1ba18f2..f228a03 100644
> --- a/drivers/net/i40e/i40e_ethdev.c
> +++ b/drivers/net/i40e/i40e_ethdev.c
> @@ -11206,7 +11206,8 @@ i40e_find_customized_pctype(struct i40e_pf *pf, uint8_t
> index)
> static int
> i40e_update_customized_pctype(struct rte_eth_dev *dev, uint8_t *pkg,
> uint32_t pkg_size, uint32_t proto_num,
> - struct rte_pmd_i40e_proto_info *proto)
> + struct rte_pmd_i40e_proto_info *proto,
> + enum rte_pmd_i40e_package_op op)
> {
> struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
> uint32_t pctype_num;
> @@ -11219,6 +11220,12 @@ i40e_update_customized_pctype(struct rte_eth_dev *dev,
> uint8_t *pkg,
> uint32_t i, j, n;
> int ret;
>
> + if (op != RTE_PMD_I40E_PKG_OP_WR_ADD &&
> + op != RTE_PMD_I40E_PKG_OP_WR_DEL) {
> + PMD_DRV_LOG(ERR, "Unsupported operation.");
> + return -1;
> + }
> +
> ret = rte_pmd_i40e_get_ddp_info(pkg, pkg_size,
> (uint8_t *)&pctype_num, sizeof(pctype_num),
> RTE_PMD_I40E_PKG_INFO_PCTYPE_NUM);
> @@ -11281,8 +11288,13 @@ i40e_update_customized_pctype(struct rte_eth_dev *dev,
> uint8_t *pkg,
> i40e_find_customized_pctype(pf,
> I40E_CUSTOMIZED_GTPU);
> if (new_pctype) {
> - new_pctype->pctype = pctype_value;
> - new_pctype->valid = true;
> + if (op == RTE_PMD_I40E_PKG_OP_WR_ADD) {
> + new_pctype->pctype = pctype_value;
> + new_pctype->valid = true;
> + } else {
> + new_pctype->pctype = I40E_FILTER_PCTYPE_INVALID;
> + new_pctype->valid = false;
> + }
> }
> }
>
> @@ -11292,8 +11304,9 @@ i40e_update_customized_pctype(struct rte_eth_dev *dev,
> uint8_t *pkg,
>
> static int
> i40e_update_customized_ptype(struct rte_eth_dev *dev, uint8_t *pkg,
> - uint32_t pkg_size, uint32_t proto_num,
> - struct rte_pmd_i40e_proto_info *proto)
> + uint32_t pkg_size, uint32_t proto_num,
> + struct rte_pmd_i40e_proto_info *proto,
> + enum rte_pmd_i40e_package_op op)
> {
> struct rte_pmd_i40e_ptype_mapping *ptype_mapping;
> uint16_t port_id = dev->data->port_id;
> @@ -11306,6 +11319,12 @@ i40e_update_customized_ptype(struct rte_eth_dev *dev,
> uint8_t *pkg,
> bool in_tunnel;
> int ret;
>
> + if (op != RTE_PMD_I40E_PKG_OP_WR_ADD &&
> + op != RTE_PMD_I40E_PKG_OP_WR_DEL) {
> + PMD_DRV_LOG(ERR, "Unsupported operation.");
> + return -1;
> + }
> +
> /* get information about new ptype num */
> ret = rte_pmd_i40e_get_ddp_info(pkg, pkg_size,
> (uint8_t *)&ptype_num, sizeof(ptype_num),
> @@ -11348,6 +11367,8 @@ i40e_update_customized_ptype(struct rte_eth_dev *dev,
> uint8_t *pkg,
> for (i = 0; i < ptype_num; i++) {
> ptype_mapping[i].hw_ptype = ptype[i].ptype_id;
> ptype_mapping[i].sw_ptype = 0;
> + if (op == RTE_PMD_I40E_PKG_OP_WR_DEL)
> + continue;
Think about if the original ptype is replaced. How about
Just use rte_pmd_i40e_ptype_mapping_reset?
Thanks
Jingjing
next prev parent reply other threads:[~2018-02-07 7:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-30 7:53 [dpdk-stable] " Beilei Xing
2018-02-07 7:56 ` Wu, Jingjing [this message]
2018-02-07 8:40 ` [dpdk-stable] [PATCH v2] " Beilei Xing
2018-02-07 9:49 ` Wu, Jingjing
2018-03-25 6:22 ` [dpdk-stable] [dpdk-dev] " Zhang, Helin
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=9BB6961774997848B5B42BEC655768F810F6EFF2@SHSMSX103.ccr.corp.intel.com \
--to=jingjing.wu@intel.com \
--cc=andrey.chilikin@intel.com \
--cc=beilei.xing@intel.com \
--cc=dev@dpdk.org \
--cc=qi.z.zhang@intel.com \
--cc=stable@dpdk.org \
/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).