> -----Original Message-----
> From: zhichaox.z...@intel.com <zhichaox.z...@intel.com>
> Sent: Wednesday, June 22, 2022 6:49 PM
> To: dev@dpdk.org
> Cc: sta...@dpdk.org; Yang, Qiming <qiming.y...@intel.com>; Zeng, ZhichaoX
> <zhichaox.z...@intel.com>; alvinx.zh...@intel.com; Guo, Junfeng
> <junfeng....@intel.com>; Su, Simei <simei...@intel.com>; Ferruh Yigit
> <ferruh.yi...@intel.com>
> Subject: [PATCH v2] net/igc: fix segmentation fault in secondary dpdk-
> symmetric_mp
>
> From: Zhichao Zeng <zhichaox.z...@intel.com>
>
> In the secondary dpdk-symmetric_mp process, the "smp_port_init" was
> skipped, which cause some function pointers not to be initialized, and a
> segmentation fault occurred when calling these function pointers.
>
> This patch assigns initial values to rx_pkt_burst, tx_pkt_burst and
> tx_pkt_prepare pointers to avoid calling null function pointer.
>
> Fixes: 66fde1b943eb ("net/igc: add skeleton")
> Cc: alvinx.zh...@intel.com
> Cc: sta...@dpdk.org
>
> Signed-off-by: Zhichao Zeng <zhichaox.z...@intel.com>
>
> ---
> v2:
> remove unnecessary parameters, move declaration to relevant header file
> ---
> drivers/net/igc/igc_ethdev.c | 3 +++
> drivers/net/igc/igc_txrx.c | 6 +++---
> drivers/net/igc/igc_txrx.h | 4 ++++
> 3 files changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/igc/igc_ethdev.c b/drivers/net/igc/igc_ethdev.c index
> b9933b395d..25fb91bfec 100644
> --- a/drivers/net/igc/igc_ethdev.c
> +++ b/drivers/net/igc/igc_ethdev.c
> @@ -1234,6 +1234,9 @@ eth_igc_dev_init(struct rte_eth_dev *dev)
> dev->rx_queue_count = eth_igc_rx_queue_count;
> dev->rx_descriptor_status = eth_igc_rx_descriptor_status;
> dev->tx_descriptor_status = eth_igc_tx_descriptor_status;
> + dev->rx_pkt_burst = igc_recv_pkts;
> + dev->tx_pkt_burst = igc_xmit_pkts;
> + dev->tx_pkt_prepare = eth_igc_prep_pkts;
If you already assign the function point in dev_init, you should remove the
following redundant code.