[v1] net/ice: fix DCF Rx segmentation fault

Message ID 20201028165545.20665-1-haiyue.wang@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series [v1] net/ice: fix DCF Rx segmentation fault |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK

Commit Message

Wang, Haiyue Oct. 28, 2020, 4:55 p.m. UTC
  The initialization for the handler of Rx FlexiMD fields extraction into
mbuf is missed, it will cause segmentation fault (core dumped).

Fixes: 7a340b0b4e03 ("net/ice: refactor Rx FlexiMD handling")

Reported-by: Alvin Zhang <alvinx.zhang@intel.com>
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
---
 drivers/net/ice/ice_dcf.c  | 1 +
 drivers/net/ice/ice_rxtx.c | 2 +-
 drivers/net/ice/ice_rxtx.h | 2 ++
 3 files changed, 4 insertions(+), 1 deletion(-)
  

Comments

Qi Zhang Oct. 29, 2020, 1:19 a.m. UTC | #1
> -----Original Message-----
> From: Wang, Haiyue <haiyue.wang@intel.com>
> Sent: Thursday, October 29, 2020 12:56 AM
> To: dev@dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Wang, Haiyue
> <haiyue.wang@intel.com>; Zhang, AlvinX <alvinx.zhang@intel.com>; Yang,
> Qiming <qiming.yang@intel.com>; Guo, Jia <jia.guo@intel.com>
> Subject: [PATCH v1] net/ice: fix DCF Rx segmentation fault
> 
> The initialization for the handler of Rx FlexiMD fields extraction into mbuf is
> missed, it will cause segmentation fault (core dumped).
> 
> Fixes: 7a340b0b4e03 ("net/ice: refactor Rx FlexiMD handling")

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
  

Patch

diff --git a/drivers/net/ice/ice_dcf.c b/drivers/net/ice/ice_dcf.c
index d20e2b3f48..44dbd3bb84 100644
--- a/drivers/net/ice/ice_dcf.c
+++ b/drivers/net/ice/ice_dcf.c
@@ -899,6 +899,7 @@  ice_dcf_configure_queues(struct ice_dcf_hw *hw)
 			return -EINVAL;
 		}
 #endif
+		ice_select_rxd_to_pkt_fields_handler(rxq[i], vc_qp->rxq.rxdid);
 	}
 
 	memset(&args, 0, sizeof(args));
diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index f6291894cd..860ffb7f67 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -148,7 +148,7 @@  ice_rxd_to_pkt_fields_by_comms_aux_v2(struct ice_rx_queue *rxq,
 #endif
 }
 
-static void
+void
 ice_select_rxd_to_pkt_fields_handler(struct ice_rx_queue *rxq, uint32_t rxdid)
 {
 	switch (rxdid) {
diff --git a/drivers/net/ice/ice_rxtx.h b/drivers/net/ice/ice_rxtx.h
index 23409d479a..6b16716063 100644
--- a/drivers/net/ice/ice_rxtx.h
+++ b/drivers/net/ice/ice_rxtx.h
@@ -234,6 +234,8 @@  int ice_rx_descriptor_status(void *rx_queue, uint16_t offset);
 int ice_tx_descriptor_status(void *tx_queue, uint16_t offset);
 void ice_set_default_ptype_table(struct rte_eth_dev *dev);
 const uint32_t *ice_dev_supported_ptypes_get(struct rte_eth_dev *dev);
+void ice_select_rxd_to_pkt_fields_handler(struct ice_rx_queue *rxq,
+					  uint32_t rxdid);
 
 int ice_rx_vec_dev_check(struct rte_eth_dev *dev);
 int ice_tx_vec_dev_check(struct rte_eth_dev *dev);