[dpdk-stable] [dpdk-dev] [PATCH] net/i40e: fix crash when calling i40e_vsi_delete_mac

Zhang, Qi Z qi.z.zhang at intel.com
Mon Apr 15 14:50:45 CEST 2019



> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Ananyev, Konstantin
> Sent: Monday, April 15, 2019 8:21 PM
> To: wangyunjian <wangyunjian at huawei.com>; dev at dpdk.org
> Cc: xudingke at huawei.com; stable at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix crash when calling
> i40e_vsi_delete_mac
> 
> Hi,
> 
> > Now the macvlan filter list may be accessed in the same time by two
> > different threads and may cause a lot of optional errors. This patch
> > protects the macvlan filter access with a spinlock.
> >
> > Call Trace:
> >   #1  0x00007ffb4cbe2e3c in i40e_vsi_delete_mac (vsi=vsi at entry=
> >       0x400052804b40, addr=addr at entry=0x7ffb47672244) at /usr/src/
> >       debug/dpdk-18.11/drivers/net/i40e/i40e_ethdev.c:7266
> >   #2  0x00007ffb4cbe342b in i40e_set_default_mac_addr (dev=<optimized
> out>,
> >       mac_addr=0x400052a6618d) at
> /usr/src/debug/dpdk-18.11/drivers/net/
> > 	  i40e/i40e_ethdev.c:11893
> >   #3  0x00007ffb4f569d4a in rte_eth_dev_default_mac_addr_set (port_id=
> >       <optimized out>, addr=addr at entry=0x400052a6618d) at
> /usr/src/debug/
> > 	  dpdk-18.11/lib/librte_ethdev/rte_ethdev.c:3366
> >   #4  0x00007ffb4d0bb403 in mac_address_slaves_update
> (bonded_eth_dev=
> >       bonded_eth_dev at entry=0xacf8c0 <rte_eth_devices>) at
> /usr/src/debug/
> > 	  dpdk-18.11/drivers/net/bonding/rte_eth_bond_pmd.c:1854
> >   #5  0x00007ffb4d0bd221 in bond_ethdev_lsc_event_callback (port_id=
> >       <optimized out>, type=<optimized out>, param=<optimized out>,
> >       ret_param= <optimized out>) at /usr/src/debug/dpdk-18.11/drivers/
> >       net/bonding/rte_eth_bond_pmd.c:3076
> >   #6  0x00007ffb4f56aa09 in _rte_eth_dev_callback_process
> (dev=dev at entry=
> >       0xad3940 <rte_eth_devices+16512>, event=event at entry=
> >       RTE_ETH_EVENT_INTR_LSC, ret_param=ret_param at entry=0x0)
> >       at /usr/src/debug/dpdk-18.11/lib/librte_ethdev/rte_ethdev.c:3699
> >   #7  0x00007ffb4cbb99f1 in i40e_dev_handle_aq_msg
> (dev=dev at entry=0xad3940
> >       <rte_eth_devices+16512>) at
> /usr/src/debug/dpdk-18.11/drivers/net/
> >       i40e/i40e_ethdev.c:6573
> >   #8  0x00007ffb4cbdfbed in i40e_dev_alarm_handler (param=0xad3940
> >       <rte_eth_devices+16512>) at
> /usr/src/debug/dpdk-18.11/drivers/net/
> >       i40e/i40e_ethdev.c:6681
> >   #9  0x00007ffb4fb9766f in eal_alarm_callback (arg=<optimized out>) at
> >
> /usr/src/debug/dpdk-18.11/lib/librte_eal/linuxapp/eal/eal_alarm.c:90
> >   #10 0x00007ffb4fb95dd2 in eal_intr_process_interrupts (nfds=<optimized
> >       out>, events=<optimized out>) at /usr/src/debug/dpdk-18.11/lib/
> >       librte_eal/linuxapp/eal/eal_interrupts.c:886
> >   #11 eal_intr_handle_interrupts (totalfds=<optimized out>, pfd=20) at
> >       /usr/src/debug/dpdk-18.11/lib/librte_eal/linuxapp/eal/
> >       eal_interrupts.c:946
> >   #12 eal_intr_thread_main (arg=<optimized out>) at /usr/src/debug/
> >       dpdk-18.11/lib/librte_eal/linuxapp/eal/eal_interrupts.c:1035
> >   #13 0x00007ffb4b208dd5 in start_thread () from
> /usr/lib64/libpthread.so.0
> >   #14 0x00007ffb4981659d in clone () from /usr/lib64/libc.so.6
> 
> That is not specific to i40e or macvlan filter.
> If inside your app several threads concurrently access/modify NIC config, then
> you need to provide some synchronization mechanism for them.
> DPDK ethdev API (as most others) on itself doesn't provide any synchronization,
> leaving it up to the upper layer to choose the most appropriate one.
> Konstantin

+1



More information about the stable mailing list