From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 4060EA00E6 for ; Mon, 15 Apr 2019 14:50:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4A7A11B205; Mon, 15 Apr 2019 14:50:52 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 50FEF1B19A; Mon, 15 Apr 2019 14:50:49 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Apr 2019 05:50:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,353,1549958400"; d="scan'208";a="337618539" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga006.fm.intel.com with ESMTP; 15 Apr 2019 05:50:48 -0700 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 15 Apr 2019 05:50:47 -0700 Received: from shsmsx105.ccr.corp.intel.com (10.239.4.158) by fmsmsx109.amr.corp.intel.com (10.18.116.9) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 15 Apr 2019 05:50:47 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.93]) by SHSMSX105.ccr.corp.intel.com ([169.254.11.25]) with mapi id 14.03.0415.000; Mon, 15 Apr 2019 20:50:45 +0800 From: "Zhang, Qi Z" To: "Ananyev, Konstantin" , wangyunjian , "dev@dpdk.org" CC: "xudingke@huawei.com" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] net/i40e: fix crash when calling i40e_vsi_delete_mac Thread-Index: AQHU84XELEjJ7mozyEqo2B31/UrMyKY9LDyA Date: Mon, 15 Apr 2019 12:50:45 +0000 Message-ID: <039ED4275CED7440929022BC67E7061153368A95@SHSMSX103.ccr.corp.intel.com> References: <1555149291-12432-1-git-send-email-wangyunjian@huawei.com> <2601191342CEEE43887BDE71AB9772580148A97E3D@irsmsx105.ger.corp.intel.com> In-Reply-To: <2601191342CEEE43887BDE71AB9772580148A97E3D@irsmsx105.ger.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZTg3MjU4ZjEtNGU1Yy00ZjZiLWIxYmEtNjczZTFkNzYyOWZkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiMXliU0JUeWZ1bXpHdWczRWoyWnc2ZHhsTVg2YjNDYXpYYWlveXRDbjBMUnV0YTZuQ0J4V3ppXC9MWFFDbkxZaE4ifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix crash when calling i40e_vsi_delete_mac X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190415125045.9eVtTD46acRP-KOmfef2eMj1bKkbySQ4EXEHmgYSUdU@z> > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Ananyev, Konstantin > Sent: Monday, April 15, 2019 8:21 PM > To: wangyunjian ; dev@dpdk.org > Cc: xudingke@huawei.com; stable@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix crash when calling > i40e_vsi_delete_mac >=20 > Hi, >=20 > > 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=3Dvsi@entry=3D > > 0x400052804b40, addr=3Daddr@entry=3D0x7ffb47672244) at /usr/src/ > > debug/dpdk-18.11/drivers/net/i40e/i40e_ethdev.c:7266 > > #2 0x00007ffb4cbe342b in i40e_set_default_mac_addr (dev=3D out>, > > mac_addr=3D0x400052a6618d) 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= =3D > > , addr=3Daddr@entry=3D0x400052a6618d) at > /usr/src/debug/ > > dpdk-18.11/lib/librte_ethdev/rte_ethdev.c:3366 > > #4 0x00007ffb4d0bb403 in mac_address_slaves_update > (bonded_eth_dev=3D > > bonded_eth_dev@entry=3D0xacf8c0 ) 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=3D > > , type=3D, param=3D, > > ret_param=3D ) at /usr/src/debug/dpdk-18.11/driver= s/ > > net/bonding/rte_eth_bond_pmd.c:3076 > > #6 0x00007ffb4f56aa09 in _rte_eth_dev_callback_process > (dev=3Ddev@entry=3D > > 0xad3940 , event=3Devent@entry=3D > > RTE_ETH_EVENT_INTR_LSC, ret_param=3Dret_param@entry=3D0x0) > > at /usr/src/debug/dpdk-18.11/lib/librte_ethdev/rte_ethdev.c:3699 > > #7 0x00007ffb4cbb99f1 in i40e_dev_handle_aq_msg > (dev=3Ddev@entry=3D0xad3940 > > ) at > /usr/src/debug/dpdk-18.11/drivers/net/ > > i40e/i40e_ethdev.c:6573 > > #8 0x00007ffb4cbdfbed in i40e_dev_alarm_handler (param=3D0xad3940 > > ) at > /usr/src/debug/dpdk-18.11/drivers/net/ > > i40e/i40e_ethdev.c:6681 > > #9 0x00007ffb4fb9766f in eal_alarm_callback (arg=3D) = at > > > /usr/src/debug/dpdk-18.11/lib/librte_eal/linuxapp/eal/eal_alarm.c:90 > > #10 0x00007ffb4fb95dd2 in eal_intr_process_interrupts (nfds=3D > out>, events=3D) at /usr/src/debug/dpdk-18.11/lib/ > > librte_eal/linuxapp/eal/eal_interrupts.c:886 > > #11 eal_intr_handle_interrupts (totalfds=3D, pfd=3D20)= at > > /usr/src/debug/dpdk-18.11/lib/librte_eal/linuxapp/eal/ > > eal_interrupts.c:946 > > #12 eal_intr_thread_main (arg=3D) 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 >=20 > 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 synchroniz= ation, > leaving it up to the upper layer to choose the most appropriate one. > Konstantin +1