Skip to content

Commit

Permalink
net/e1000: fix crash with link status in secondary process
Browse files Browse the repository at this point in the history
The code to update link status is not safe in secondary process.
If called from secondary it will crash, example from dumpcap:

    /dpdk/app/dpdk-dumpcap -i 0000:00:04.0
    File: /tmp/dpdk-dumpcap_0_0000:00:04.0_20240723020203.pcapng
    Segmentation fault (core dumped)

Fixes: 8058034 ("e1000: support EM devices (also known as e1000/e1000e)")
Cc: stable@dpdk.org

Signed-off-by: Jun Wang <junwang01@cestc.cn>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  • Loading branch information
wangjun0728 authored and bruce-richardson committed Aug 22, 2024
1 parent cb9187b commit 02b8f20
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/e1000/em_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1136,6 +1136,9 @@ eth_em_link_update(struct rte_eth_dev *dev, int wait_to_complete)
struct rte_eth_link link;
int link_up, count;

if (rte_eal_process_type() != RTE_PROC_PRIMARY)
return -1;

link_up = 0;
hw->mac.get_link_status = 1;

Expand Down

0 comments on commit 02b8f20

Please sign in to comment.