From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) by dpdk.org (Postfix) with ESMTP id AE1721DB9 for ; Mon, 30 Apr 2018 16:43:32 +0200 (CEST) Received: by mail-wr0-f196.google.com with SMTP id v60-v6so8281850wrc.7 for ; Mon, 30 Apr 2018 07:43:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lU4dOOKyioJtoFW06Jp3Kvik1AzKTjSE8UKh6R4ZoOk=; b=WFDfuqpzB7x9AcNBZJURbCEg/VKZ/bDZiTlwA9wTUnSrUz8I9mRHjWlaXk24y4jBMp X9IEK5HITJFHy+RP94iuv+LgkIrfYlO5QqS0EfOu/+OB1v6fykq7NT55hFz0VygCqz8/ AwolTveQItWdnF5m/5FNV8QfWoqUBIsfttrDhcKM7krVWv0WVHsVqoxGq/Zggeptiu1i +iIuUyba1Y7bJKs9Nd51fspHuRMtd5d4GBXhwjRn1KL3yuAcYnAV7dfHj01HKGznIGLV 6agjaJJ+E3vzVM/8NuAZ6FNoWeyXvzx0NO+sz8MeMHi9mpTyN85sSGF6D9lZnXQ9VxQH VqjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=lU4dOOKyioJtoFW06Jp3Kvik1AzKTjSE8UKh6R4ZoOk=; b=h6RWs303S8p5eL0gvto2fLEHWQAzFHpexWPxjxp87MMPBkdJTvPS5ajOIvILX1y/Jp ufnFQjGof3Rd82gM+Mq9aRROWIkfkn0Eoo1/b4iX+wz8UdnrS57bHymqtNWThdlZov2S +VSq/57LbS4/VUdFgaQrSXcYRz+O3oBOfTIgxU5DWyXslSrvtjjLOjgBKPFALhvNAUVx DEC+8pCcqHaJw82mhjdrKVbCqTe2e5SvyHqyitXzDmB1Znmo7PwR9KB5HHy/ZlaAHPEs 7cZJa5khCeaAQZrBzkEtoDsye/Ofw4RYfFHPsN5svABqgTpq2tbCjQ1Dc3VvU/crYljg O4iw== X-Gm-Message-State: ALQs6tB8VqDbfiFc/74WuyaR40slJXoldtK6lLRWaKd2ouhRRghv7RPD ZkDzCgT51piiAuUeWGqjojk= X-Google-Smtp-Source: AB8JxZp1BKjvyefmAUIypSb0HYjp5UU5Z9Z8ZT1gpnA5+VWxkuKrIQo38aXhGw5kvMdFqFWidrwxqQ== X-Received: by 2002:adf:e447:: with SMTP id t7-v6mr9012897wrm.143.1525099412408; Mon, 30 Apr 2018 07:43:32 -0700 (PDT) Received: from localhost ([2a00:23c5:be9a:5200:ce4c:82c0:d567:ecbb]) by smtp.gmail.com with ESMTPSA id n143sm11564348wmd.29.2018.04.30.07.43.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Apr 2018 07:43:31 -0700 (PDT) From: luca.boccassi@gmail.com To: Beilei Xing Cc: Jingjing Wu , dpdk stable Date: Mon, 30 Apr 2018 15:40:57 +0100 Message-Id: <20180430144223.18657-42-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180430144223.18657-1-luca.boccassi@gmail.com> References: <20180430140606.4615-80-luca.boccassi@gmail.com> <20180430144223.18657-1-luca.boccassi@gmail.com> Subject: [dpdk-stable] patch 'net/i40e: fix DDP profile DEL operation' has been queued to stable release 18.02.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Apr 2018 14:43:32 -0000 Hi, FYI, your patch has been queued to stable release 18.02.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/02/18. So please shout if anyone has objections. Thanks. Luca Boccassi --- >>From c534c86507c440566a930818b2b8c2155a4a9cb2 Mon Sep 17 00:00:00 2001 From: Beilei Xing Date: Wed, 7 Feb 2018 16:40:59 +0800 Subject: [PATCH] net/i40e: fix DDP profile DEL operation [ upstream commit 0585f5c3d2643e49c0d2629e4937fb0bf010afbd ] Customized info will be updated when processing DDP package, including PCYPE/PTYPE/protocol. Previously, the customized info is updated without any check for package operation - ADD or DEL, but only covers ADD operation. In this situation, even if a package is being removed, new PCTYPE/PTYPE/protocol will still be created, it will cause wrong parsing for SW. This patch cleans new PCTYPE/PTYPE/protocol created when a package is being removed. Fixes: e163c18a15b0 ("net/i40e: update ptype and pctype info") Signed-off-by: Beilei Xing Acked-by: Jingjing Wu --- drivers/net/i40e/i40e_ethdev.c | 51 +++++++++++++++++++++++++++++++++-------- 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, 50 insertions(+), 13 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 5671b64bf..2322d6043 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -11530,7 +11530,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; @@ -11543,6 +11544,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); @@ -11605,8 +11612,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; + } } } @@ -11616,8 +11628,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; @@ -11630,6 +11643,17 @@ 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; + } + + if (op == RTE_PMD_I40E_PKG_OP_WR_DEL) { + rte_pmd_i40e_ptype_mapping_reset(port_id); + return 0; + } + /* get information about new ptype num */ ret = rte_pmd_i40e_get_ddp_info(pkg, pkg_size, (uint8_t *)&ptype_num, sizeof(ptype_num), @@ -11802,7 +11826,7 @@ i40e_update_customized_ptype(struct rte_eth_dev *dev, uint8_t *pkg, void i40e_update_customized_info(struct rte_eth_dev *dev, uint8_t *pkg, - uint32_t pkg_size) + uint32_t pkg_size, enum rte_pmd_i40e_package_op op) { struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private); uint32_t proto_num; @@ -11811,6 +11835,12 @@ i40e_update_customized_info(struct rte_eth_dev *dev, uint8_t *pkg, uint32_t i; 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; + } + /* get information about protocol number */ ret = rte_pmd_i40e_get_ddp_info(pkg, pkg_size, (uint8_t *)&proto_num, sizeof(proto_num), @@ -11844,20 +11874,23 @@ i40e_update_customized_info(struct rte_eth_dev *dev, uint8_t *pkg, /* Check if GTP is supported. */ for (i = 0; i < proto_num; i++) { if (!strncmp(proto[i].name, "GTP", 3)) { - pf->gtp_support = true; + if (op == RTE_PMD_I40E_PKG_OP_WR_ADD) + pf->gtp_support = true; + else + pf->gtp_support = false; break; } } /* Update customized pctype info */ ret = i40e_update_customized_pctype(dev, pkg, pkg_size, - proto_num, proto); + proto_num, proto, op); if (ret) PMD_DRV_LOG(INFO, "No pctype is updated."); /* Update customized ptype info */ ret = i40e_update_customized_ptype(dev, pkg, pkg_size, - proto_num, proto); + proto_num, proto, op); if (ret) PMD_DRV_LOG(INFO, "No ptype is updated."); diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h index 99efb6707..a51bd4b07 100644 --- a/drivers/net/i40e/i40e_ethdev.h +++ b/drivers/net/i40e/i40e_ethdev.h @@ -11,6 +11,7 @@ #include #include #include +#include "rte_pmd_i40e.h" #define I40E_VLAN_TAG_SIZE 4 @@ -1206,7 +1207,8 @@ void i40e_tm_conf_uninit(struct rte_eth_dev *dev); struct i40e_customized_pctype* i40e_find_customized_pctype(struct i40e_pf *pf, uint8_t index); void i40e_update_customized_info(struct rte_eth_dev *dev, uint8_t *pkg, - uint32_t pkg_size); + uint32_t pkg_size, + enum rte_pmd_i40e_package_op op); int i40e_dcb_init_configure(struct rte_eth_dev *dev, bool sw_dcb); int i40e_flush_queue_region_all_conf(struct rte_eth_dev *dev, struct i40e_hw *hw, struct i40e_pf *pf, uint16_t on); diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index 312c7eed0..31d7b8857 100644 --- a/drivers/net/i40e/i40e_flow.c +++ b/drivers/net/i40e/i40e_flow.c @@ -2400,7 +2400,7 @@ i40e_flow_fdir_get_pctype_value(struct i40e_pf *pf, break; } - if (cus_pctype) + if (cus_pctype && cus_pctype->valid) return cus_pctype->pctype; return I40E_FILTER_PCTYPE_INVALID; diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c index ada3eff27..169d635e2 100644 --- a/drivers/net/i40e/rte_pmd_i40e.c +++ b/drivers/net/i40e/rte_pmd_i40e.c @@ -1610,8 +1610,6 @@ rte_pmd_i40e_process_ddp_package(uint16_t port, uint8_t *buff, return -EINVAL; } - i40e_update_customized_info(dev, buff, size); - /* Find metadata segment */ metadata_seg_hdr = i40e_find_segment_in_package(SEGMENT_TYPE_METADATA, pkg_hdr); @@ -1715,6 +1713,10 @@ rte_pmd_i40e_process_ddp_package(uint16_t port, uint8_t *buff, } } + if (op == RTE_PMD_I40E_PKG_OP_WR_ADD || + op == RTE_PMD_I40E_PKG_OP_WR_DEL) + i40e_update_customized_info(dev, buff, size, op); + rte_free(profile_info_sec); return status; } -- 2.14.2