* [dpdk-stable] [PATCH 01/18] net/dpaa: fix coverity reported issues [not found] <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> @ 2017-12-13 12:05 ` Hemant Agrawal 2018-01-09 10:46 ` Ferruh Yigit 2017-12-13 12:05 ` [dpdk-stable] [PATCH 02/18] net/dpaa: fix the mbuf packet type if zero Hemant Agrawal ` (2 subsequent siblings) 3 siblings, 1 reply; 10+ messages in thread From: Hemant Agrawal @ 2017-12-13 12:05 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, stable Fixes: 05ba55bc2b1a ("net/dpaa: add packet dump for debugging") Fixes: 37f9b54bd3cf ("net/dpaa: support Tx and Rx queue setup") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> --- drivers/net/dpaa/dpaa_ethdev.c | 6 +++--- drivers/net/dpaa/dpaa_rxtx.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index cf5a2ec..3023302 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -723,7 +723,7 @@ static int dpaa_fc_set_default(struct dpaa_if *dpaa_intf) static int dpaa_rx_queue_init(struct qman_fq *fq, uint32_t fqid) { - struct qm_mcc_initfq opts; + struct qm_mcc_initfq opts = {0}; int ret; PMD_INIT_FUNC_TRACE(); @@ -769,7 +769,7 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, static int dpaa_tx_queue_init(struct qman_fq *fq, struct fman_if *fman_intf) { - struct qm_mcc_initfq opts; + struct qm_mcc_initfq opts = {0}; int ret; PMD_INIT_FUNC_TRACE(); @@ -800,7 +800,7 @@ static int dpaa_tx_queue_init(struct qman_fq *fq, /* Initialise a DEBUG FQ ([rt]x_error, rx_default). */ static int dpaa_debug_queue_init(struct qman_fq *fq, uint32_t fqid) { - struct qm_mcc_initfq opts; + struct qm_mcc_initfq opts = {0}; int ret; PMD_INIT_FUNC_TRACE(); diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 41e57f2..771e141 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -665,7 +665,7 @@ tx_on_external_pool(struct qman_fq *txq, struct rte_mbuf *mbuf, return 1; } - DPAA_MBUF_TO_CONTIG_FD(mbuf, fd_arr, dpaa_intf->bp_info->bpid); + DPAA_MBUF_TO_CONTIG_FD(dmable_mbuf, fd_arr, dpaa_intf->bp_info->bpid); return 0; } -- 2.7.4 ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-stable] [PATCH 01/18] net/dpaa: fix coverity reported issues 2017-12-13 12:05 ` [dpdk-stable] [PATCH 01/18] net/dpaa: fix coverity reported issues Hemant Agrawal @ 2018-01-09 10:46 ` Ferruh Yigit 2018-01-09 13:29 ` Hemant Agrawal 0 siblings, 1 reply; 10+ messages in thread From: Ferruh Yigit @ 2018-01-09 10:46 UTC (permalink / raw) To: Hemant Agrawal, dev; +Cc: stable, Kovacevic, Marko On 12/13/2017 12:05 PM, Hemant Agrawal wrote: > Fixes: 05ba55bc2b1a ("net/dpaa: add packet dump for debugging") > Fixes: 37f9b54bd3cf ("net/dpaa: support Tx and Rx queue setup") > Cc: stable@dpdk.org> > Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> Hi Hemant, fix coverity issues is not very helpful as commit title, can you please document what really fixed. And there is a special format for coverity fixes: " Coverity issue: ...... Fixes: ............ ("...") Cc: stable@dpdk.org [if required] Signed-off-by: .... " There are samples in git history. It seems this format is not documented and Marko will help to document it. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-stable] [PATCH 01/18] net/dpaa: fix coverity reported issues 2018-01-09 10:46 ` Ferruh Yigit @ 2018-01-09 13:29 ` Hemant Agrawal 0 siblings, 0 replies; 10+ messages in thread From: Hemant Agrawal @ 2018-01-09 13:29 UTC (permalink / raw) To: Ferruh Yigit, dev; +Cc: stable, Kovacevic, Marko On 1/9/2018 4:16 PM, Ferruh Yigit wrote: > On 12/13/2017 12:05 PM, Hemant Agrawal wrote: >> Fixes: 05ba55bc2b1a ("net/dpaa: add packet dump for debugging") >> Fixes: 37f9b54bd3cf ("net/dpaa: support Tx and Rx queue setup") >> Cc: stable@dpdk.org> >> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> > > Hi Hemant, > > fix coverity issues is not very helpful as commit title, can you please document > what really fixed. > > And there is a special format for coverity fixes: > > " > > Coverity issue: ...... > Fixes: ............ ("...") > Cc: stable@dpdk.org [if required] > > Signed-off-by: .... > " > > There are samples in git history. It seems this format is not documented and > Marko will help to document it. > Hi Ferruh, thanks for the review. Please ignore v2, I will fix it in v3. Regards, Hemant ^ permalink raw reply [flat|nested] 10+ messages in thread
* [dpdk-stable] [PATCH 02/18] net/dpaa: fix the mbuf packet type if zero [not found] <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> 2017-12-13 12:05 ` [dpdk-stable] [PATCH 01/18] net/dpaa: fix coverity reported issues Hemant Agrawal @ 2017-12-13 12:05 ` Hemant Agrawal 2017-12-13 12:05 ` [dpdk-stable] [PATCH 03/18] net/dpaa: fix FW version code Hemant Agrawal [not found] ` <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> 3 siblings, 0 replies; 10+ messages in thread From: Hemant Agrawal @ 2017-12-13 12:05 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, Ashish Jain, stable From: Ashish Jain <ashish.jain@nxp.com> Populate the mbuf field packet_type which is required for calculating checksum while transmitting frames Fixes: 8cffdcbe85aa ("net/dpaa: support scattered Rx") Cc: stable@dpdk.org Signed-off-by: Ashish Jain <ashish.jain@nxp.com> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> --- drivers/net/dpaa/dpaa_rxtx.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 771e141..c0cfec9 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -58,6 +58,7 @@ #include <rte_ip.h> #include <rte_tcp.h> #include <rte_udp.h> +#include <rte_net.h> #include "dpaa_ethdev.h" #include "dpaa_rxtx.h" @@ -504,6 +505,15 @@ dpaa_eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf, fd->opaque_addr = 0; if (mbuf->ol_flags & DPAA_TX_CKSUM_OFFLOAD_MASK) { + if (!mbuf->packet_type) { + struct rte_net_hdr_lens hdr_lens; + + mbuf->packet_type = rte_net_get_ptype(mbuf, &hdr_lens, + RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK + | RTE_PTYPE_L4_MASK); + mbuf->l2_len = hdr_lens.l2_len; + mbuf->l3_len = hdr_lens.l3_len; + } if (temp->data_off < DEFAULT_TX_ICEOF + sizeof(struct dpaa_eth_parse_results_t)) temp->data_off = DEFAULT_TX_ICEOF @@ -611,6 +621,15 @@ tx_on_dpaa_pool_unsegmented(struct rte_mbuf *mbuf, } if (mbuf->ol_flags & DPAA_TX_CKSUM_OFFLOAD_MASK) { + if (!mbuf->packet_type) { + struct rte_net_hdr_lens hdr_lens; + + mbuf->packet_type = rte_net_get_ptype(mbuf, &hdr_lens, + RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK + | RTE_PTYPE_L4_MASK); + mbuf->l2_len = hdr_lens.l2_len; + mbuf->l3_len = hdr_lens.l3_len; + } if (mbuf->data_off < (DEFAULT_TX_ICEOF + sizeof(struct dpaa_eth_parse_results_t))) { DPAA_DP_LOG(DEBUG, "Checksum offload Err: " -- 2.7.4 ^ permalink raw reply [flat|nested] 10+ messages in thread
* [dpdk-stable] [PATCH 03/18] net/dpaa: fix FW version code [not found] <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> 2017-12-13 12:05 ` [dpdk-stable] [PATCH 01/18] net/dpaa: fix coverity reported issues Hemant Agrawal 2017-12-13 12:05 ` [dpdk-stable] [PATCH 02/18] net/dpaa: fix the mbuf packet type if zero Hemant Agrawal @ 2017-12-13 12:05 ` Hemant Agrawal [not found] ` <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> 3 siblings, 0 replies; 10+ messages in thread From: Hemant Agrawal @ 2017-12-13 12:05 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, stable fix the soc id path and missing fclose Fixes: cf0fab1d2ca5 ("net/dpaa: support firmware version get API") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> --- drivers/net/dpaa/dpaa_ethdev.c | 14 +++++--------- drivers/net/dpaa/dpaa_ethdev.h | 2 +- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 3023302..29678c5 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -212,19 +212,15 @@ dpaa_fw_version_get(struct rte_eth_dev *dev __rte_unused, DPAA_PMD_ERR("Unable to open SoC device"); return -ENOTSUP; /* Not supported on this infra */ } - - ret = fscanf(svr_file, "svr:%x", &svr_ver); - if (ret <= 0) { + if (fscanf(svr_file, "svr:%x", &svr_ver) <= 0) DPAA_PMD_ERR("Unable to read SoC device"); - return -ENOTSUP; /* Not supported on this infra */ - } - ret = snprintf(fw_version, fw_size, - "svr:%x-fman-v%x", - svr_ver, - fman_ip_rev); + fclose(svr_file); + ret = snprintf(fw_version, fw_size, "SVR:%x-fman-v%x", + svr_ver, fman_ip_rev); ret += 1; /* add the size of '\0' */ + if (fw_size < (uint32_t)ret) return ret; else diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index 5457d61..ec5ae13 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -46,7 +46,7 @@ /* DPAA SoC identifier; If this is not available, it can be concluded * that board is non-DPAA. Single slot is currently supported. */ -#define DPAA_SOC_ID_FILE "sys/devices/soc0/soc_id" +#define DPAA_SOC_ID_FILE "/sys/devices/soc0/soc_id" #define DPAA_MBUF_HW_ANNOTATION 64 #define DPAA_FD_PTA_SIZE 64 -- 2.7.4 ^ permalink raw reply [flat|nested] 10+ messages in thread
[parent not found: <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com>]
* [dpdk-stable] [PATCH v2 01/18] net/dpaa: fix the mbuf packet type if zero [not found] ` <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> @ 2018-01-09 13:22 ` Hemant Agrawal 2018-01-09 13:22 ` [dpdk-stable] [PATCH v2 02/18] net/dpaa: fix FW version code Hemant Agrawal [not found] ` <1515581201-29784-1-git-send-email-hemant.agrawal@nxp.com> 2 siblings, 0 replies; 10+ messages in thread From: Hemant Agrawal @ 2018-01-09 13:22 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, shreyansh.jain, Ashish Jain, stable From: Ashish Jain <ashish.jain@nxp.com> Populate the mbuf field packet_type which is required for calculating checksum while transmitting frames Fixes: 8cffdcbe85aa ("net/dpaa: support scattered Rx") Cc: stable@dpdk.org Signed-off-by: Ashish Jain <ashish.jain@nxp.com> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> --- drivers/net/dpaa/dpaa_rxtx.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index c3a0920..630d7a5 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -32,6 +32,7 @@ #include <rte_ip.h> #include <rte_tcp.h> #include <rte_udp.h> +#include <rte_net.h> #include "dpaa_ethdev.h" #include "dpaa_rxtx.h" @@ -478,6 +479,15 @@ dpaa_eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf, fd->opaque_addr = 0; if (mbuf->ol_flags & DPAA_TX_CKSUM_OFFLOAD_MASK) { + if (!mbuf->packet_type) { + struct rte_net_hdr_lens hdr_lens; + + mbuf->packet_type = rte_net_get_ptype(mbuf, &hdr_lens, + RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK + | RTE_PTYPE_L4_MASK); + mbuf->l2_len = hdr_lens.l2_len; + mbuf->l3_len = hdr_lens.l3_len; + } if (temp->data_off < DEFAULT_TX_ICEOF + sizeof(struct dpaa_eth_parse_results_t)) temp->data_off = DEFAULT_TX_ICEOF @@ -585,6 +595,15 @@ tx_on_dpaa_pool_unsegmented(struct rte_mbuf *mbuf, } if (mbuf->ol_flags & DPAA_TX_CKSUM_OFFLOAD_MASK) { + if (!mbuf->packet_type) { + struct rte_net_hdr_lens hdr_lens; + + mbuf->packet_type = rte_net_get_ptype(mbuf, &hdr_lens, + RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK + | RTE_PTYPE_L4_MASK); + mbuf->l2_len = hdr_lens.l2_len; + mbuf->l3_len = hdr_lens.l3_len; + } if (mbuf->data_off < (DEFAULT_TX_ICEOF + sizeof(struct dpaa_eth_parse_results_t))) { DPAA_DP_LOG(DEBUG, "Checksum offload Err: " -- 2.7.4 ^ permalink raw reply [flat|nested] 10+ messages in thread
* [dpdk-stable] [PATCH v2 02/18] net/dpaa: fix FW version code [not found] ` <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> 2018-01-09 13:22 ` [dpdk-stable] [PATCH v2 01/18] net/dpaa: fix the mbuf packet type if zero Hemant Agrawal @ 2018-01-09 13:22 ` Hemant Agrawal [not found] ` <1515581201-29784-1-git-send-email-hemant.agrawal@nxp.com> 2 siblings, 0 replies; 10+ messages in thread From: Hemant Agrawal @ 2018-01-09 13:22 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, shreyansh.jain, stable fix the soc id path and missing fclose Fixes: cf0fab1d2ca5 ("net/dpaa: support firmware version get API") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> --- drivers/net/dpaa/dpaa_ethdev.c | 14 +++++--------- drivers/net/dpaa/dpaa_ethdev.h | 2 +- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 7b4a6f1..db6574f 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -186,19 +186,15 @@ dpaa_fw_version_get(struct rte_eth_dev *dev __rte_unused, DPAA_PMD_ERR("Unable to open SoC device"); return -ENOTSUP; /* Not supported on this infra */ } - - ret = fscanf(svr_file, "svr:%x", &svr_ver); - if (ret <= 0) { + if (fscanf(svr_file, "svr:%x", &svr_ver) <= 0) DPAA_PMD_ERR("Unable to read SoC device"); - return -ENOTSUP; /* Not supported on this infra */ - } - ret = snprintf(fw_version, fw_size, - "svr:%x-fman-v%x", - svr_ver, - fman_ip_rev); + fclose(svr_file); + ret = snprintf(fw_version, fw_size, "SVR:%x-fman-v%x", + svr_ver, fman_ip_rev); ret += 1; /* add the size of '\0' */ + if (fw_size < (uint32_t)ret) return ret; else diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index bd63ee0..254fca2 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -20,7 +20,7 @@ /* DPAA SoC identifier; If this is not available, it can be concluded * that board is non-DPAA. Single slot is currently supported. */ -#define DPAA_SOC_ID_FILE "sys/devices/soc0/soc_id" +#define DPAA_SOC_ID_FILE "/sys/devices/soc0/soc_id" #define DPAA_MBUF_HW_ANNOTATION 64 #define DPAA_FD_PTA_SIZE 64 -- 2.7.4 ^ permalink raw reply [flat|nested] 10+ messages in thread
[parent not found: <1515581201-29784-1-git-send-email-hemant.agrawal@nxp.com>]
* [dpdk-stable] [PATCH v3 01/19] net/dpaa: fix uninitialized and unused variables [not found] ` <1515581201-29784-1-git-send-email-hemant.agrawal@nxp.com> @ 2018-01-10 10:46 ` Hemant Agrawal 2018-01-10 10:46 ` [dpdk-stable] [PATCH v3 02/19] net/dpaa: fix the mbuf packet type if zero Hemant Agrawal 2018-01-10 10:46 ` [dpdk-stable] [PATCH v3 03/19] net/dpaa: fix FW version code Hemant Agrawal 2 siblings, 0 replies; 10+ messages in thread From: Hemant Agrawal @ 2018-01-10 10:46 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, shreyansh.jain, stable This patch fixes the issues reported by NXP's internal coverity build. Fixes: 05ba55bc2b1a ("net/dpaa: add packet dump for debugging") Fixes: 37f9b54bd3cf ("net/dpaa: support Tx and Rx queue setup") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> --- drivers/net/dpaa/dpaa_ethdev.c | 6 +++--- drivers/net/dpaa/dpaa_rxtx.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 2eb00b5..7b4a6f1 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -697,7 +697,7 @@ static int dpaa_fc_set_default(struct dpaa_if *dpaa_intf) static int dpaa_rx_queue_init(struct qman_fq *fq, uint32_t fqid) { - struct qm_mcc_initfq opts; + struct qm_mcc_initfq opts = {0}; int ret; PMD_INIT_FUNC_TRACE(); @@ -743,7 +743,7 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, static int dpaa_tx_queue_init(struct qman_fq *fq, struct fman_if *fman_intf) { - struct qm_mcc_initfq opts; + struct qm_mcc_initfq opts = {0}; int ret; PMD_INIT_FUNC_TRACE(); @@ -774,7 +774,7 @@ static int dpaa_tx_queue_init(struct qman_fq *fq, /* Initialise a DEBUG FQ ([rt]x_error, rx_default). */ static int dpaa_debug_queue_init(struct qman_fq *fq, uint32_t fqid) { - struct qm_mcc_initfq opts; + struct qm_mcc_initfq opts = {0}; int ret; PMD_INIT_FUNC_TRACE(); diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 905ecc0..c3a0920 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -639,7 +639,7 @@ tx_on_external_pool(struct qman_fq *txq, struct rte_mbuf *mbuf, return 1; } - DPAA_MBUF_TO_CONTIG_FD(mbuf, fd_arr, dpaa_intf->bp_info->bpid); + DPAA_MBUF_TO_CONTIG_FD(dmable_mbuf, fd_arr, dpaa_intf->bp_info->bpid); return 0; } -- 2.7.4 ^ permalink raw reply [flat|nested] 10+ messages in thread
* [dpdk-stable] [PATCH v3 02/19] net/dpaa: fix the mbuf packet type if zero [not found] ` <1515581201-29784-1-git-send-email-hemant.agrawal@nxp.com> 2018-01-10 10:46 ` [dpdk-stable] [PATCH v3 01/19] net/dpaa: fix uninitialized and unused variables Hemant Agrawal @ 2018-01-10 10:46 ` Hemant Agrawal 2018-01-10 10:46 ` [dpdk-stable] [PATCH v3 03/19] net/dpaa: fix FW version code Hemant Agrawal 2 siblings, 0 replies; 10+ messages in thread From: Hemant Agrawal @ 2018-01-10 10:46 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, shreyansh.jain, Ashish Jain, stable From: Ashish Jain <ashish.jain@nxp.com> Populate the mbuf field packet_type which is required for calculating checksum while transmitting frames Fixes: 8cffdcbe85aa ("net/dpaa: support scattered Rx") Cc: stable@dpdk.org Signed-off-by: Ashish Jain <ashish.jain@nxp.com> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> --- drivers/net/dpaa/dpaa_rxtx.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index c3a0920..630d7a5 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -32,6 +32,7 @@ #include <rte_ip.h> #include <rte_tcp.h> #include <rte_udp.h> +#include <rte_net.h> #include "dpaa_ethdev.h" #include "dpaa_rxtx.h" @@ -478,6 +479,15 @@ dpaa_eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf, fd->opaque_addr = 0; if (mbuf->ol_flags & DPAA_TX_CKSUM_OFFLOAD_MASK) { + if (!mbuf->packet_type) { + struct rte_net_hdr_lens hdr_lens; + + mbuf->packet_type = rte_net_get_ptype(mbuf, &hdr_lens, + RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK + | RTE_PTYPE_L4_MASK); + mbuf->l2_len = hdr_lens.l2_len; + mbuf->l3_len = hdr_lens.l3_len; + } if (temp->data_off < DEFAULT_TX_ICEOF + sizeof(struct dpaa_eth_parse_results_t)) temp->data_off = DEFAULT_TX_ICEOF @@ -585,6 +595,15 @@ tx_on_dpaa_pool_unsegmented(struct rte_mbuf *mbuf, } if (mbuf->ol_flags & DPAA_TX_CKSUM_OFFLOAD_MASK) { + if (!mbuf->packet_type) { + struct rte_net_hdr_lens hdr_lens; + + mbuf->packet_type = rte_net_get_ptype(mbuf, &hdr_lens, + RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK + | RTE_PTYPE_L4_MASK); + mbuf->l2_len = hdr_lens.l2_len; + mbuf->l3_len = hdr_lens.l3_len; + } if (mbuf->data_off < (DEFAULT_TX_ICEOF + sizeof(struct dpaa_eth_parse_results_t))) { DPAA_DP_LOG(DEBUG, "Checksum offload Err: " -- 2.7.4 ^ permalink raw reply [flat|nested] 10+ messages in thread
* [dpdk-stable] [PATCH v3 03/19] net/dpaa: fix FW version code [not found] ` <1515581201-29784-1-git-send-email-hemant.agrawal@nxp.com> 2018-01-10 10:46 ` [dpdk-stable] [PATCH v3 01/19] net/dpaa: fix uninitialized and unused variables Hemant Agrawal 2018-01-10 10:46 ` [dpdk-stable] [PATCH v3 02/19] net/dpaa: fix the mbuf packet type if zero Hemant Agrawal @ 2018-01-10 10:46 ` Hemant Agrawal 2 siblings, 0 replies; 10+ messages in thread From: Hemant Agrawal @ 2018-01-10 10:46 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, shreyansh.jain, stable fix the soc id path and missing fclose Fixes: cf0fab1d2ca5 ("net/dpaa: support firmware version get API") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> --- drivers/net/dpaa/dpaa_ethdev.c | 14 +++++--------- drivers/net/dpaa/dpaa_ethdev.h | 2 +- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 7b4a6f1..db6574f 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -186,19 +186,15 @@ dpaa_fw_version_get(struct rte_eth_dev *dev __rte_unused, DPAA_PMD_ERR("Unable to open SoC device"); return -ENOTSUP; /* Not supported on this infra */ } - - ret = fscanf(svr_file, "svr:%x", &svr_ver); - if (ret <= 0) { + if (fscanf(svr_file, "svr:%x", &svr_ver) <= 0) DPAA_PMD_ERR("Unable to read SoC device"); - return -ENOTSUP; /* Not supported on this infra */ - } - ret = snprintf(fw_version, fw_size, - "svr:%x-fman-v%x", - svr_ver, - fman_ip_rev); + fclose(svr_file); + ret = snprintf(fw_version, fw_size, "SVR:%x-fman-v%x", + svr_ver, fman_ip_rev); ret += 1; /* add the size of '\0' */ + if (fw_size < (uint32_t)ret) return ret; else diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index bd63ee0..254fca2 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -20,7 +20,7 @@ /* DPAA SoC identifier; If this is not available, it can be concluded * that board is non-DPAA. Single slot is currently supported. */ -#define DPAA_SOC_ID_FILE "sys/devices/soc0/soc_id" +#define DPAA_SOC_ID_FILE "/sys/devices/soc0/soc_id" #define DPAA_MBUF_HW_ANNOTATION 64 #define DPAA_FD_PTA_SIZE 64 -- 2.7.4 ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2018-01-10 10:47 UTC | newest] Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> 2017-12-13 12:05 ` [dpdk-stable] [PATCH 01/18] net/dpaa: fix coverity reported issues Hemant Agrawal 2018-01-09 10:46 ` Ferruh Yigit 2018-01-09 13:29 ` Hemant Agrawal 2017-12-13 12:05 ` [dpdk-stable] [PATCH 02/18] net/dpaa: fix the mbuf packet type if zero Hemant Agrawal 2017-12-13 12:05 ` [dpdk-stable] [PATCH 03/18] net/dpaa: fix FW version code Hemant Agrawal [not found] ` <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> 2018-01-09 13:22 ` [dpdk-stable] [PATCH v2 01/18] net/dpaa: fix the mbuf packet type if zero Hemant Agrawal 2018-01-09 13:22 ` [dpdk-stable] [PATCH v2 02/18] net/dpaa: fix FW version code Hemant Agrawal [not found] ` <1515581201-29784-1-git-send-email-hemant.agrawal@nxp.com> 2018-01-10 10:46 ` [dpdk-stable] [PATCH v3 01/19] net/dpaa: fix uninitialized and unused variables Hemant Agrawal 2018-01-10 10:46 ` [dpdk-stable] [PATCH v3 02/19] net/dpaa: fix the mbuf packet type if zero Hemant Agrawal 2018-01-10 10:46 ` [dpdk-stable] [PATCH v3 03/19] net/dpaa: fix FW version code Hemant Agrawal
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).