From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 22870A0487 for ; Mon, 29 Jul 2019 02:45:15 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 482781BF35; Mon, 29 Jul 2019 02:45:14 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 0EC451BEB2; Mon, 29 Jul 2019 02:45:11 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jul 2019 17:45:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,320,1559545200"; d="scan'208";a="172993988" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga007.fm.intel.com with ESMTP; 28 Jul 2019 17:45:10 -0700 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 28 Jul 2019 17:45:10 -0700 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 28 Jul 2019 17:45:09 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.80]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.249]) with mapi id 14.03.0439.000; Mon, 29 Jul 2019 08:45:07 +0800 From: "Wang, Ying A" To: "Ye, Xiaolong" CC: "Zhang, Qi Z" , "dev@dpdk.org" , "Yang, Qiming" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2] net/ice: fix LLDP forward Thread-Index: AQHVQ4ei3E81L9uezUKwOW4HGSfVDKbdSjCAgAN8WAA= Date: Mon, 29 Jul 2019 00:45:07 +0000 Message-ID: <44DE8E8A53B4014CA1985CEE86C07F2A0B96ECD2@SHSMSX101.ccr.corp.intel.com> References: <1564088408-99709-1-git-send-email-ying.a.wang@intel.com> <1564097763-276974-1-git-send-email-ying.a.wang@intel.com> <20190727033047.GA81704@intel.com> In-Reply-To: <20190727033047.GA81704@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNGQ0NWQyNjctY2FmZS00YWZmLWJhODItNjI2MjYwODk3ZDM5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoidUt2NUdDWmk3WUlWMkR4TlphNUY2RG1aTXNiMHNOT0hRdXIzSzZDOGhDd1wvaUtMN1wvajIxMWpRVWFoQldWUXpOIn0= x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] net/ice: fix LLDP forward 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" > -----Original Message----- > From: Ye, Xiaolong > Sent: Saturday, July 27, 2019 11:31 AM > To: Wang, Ying A > Cc: Zhang, Qi Z ; dev@dpdk.org; Yang, Qiming > ; stable@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v2] net/ice: fix LLDP forward >=20 > On 07/26, Wang Ying A wrote: > >The patch fix the issue that lldp packet can't be forwarded to host. > > > >Fixes: 59d151de6673 ("net/ice: stop LLDP by default") > >Cc: stable@dpdk.org > > > >Signed-off-by: Wang Ying A > >--- > >--- > >V2: Remove redundant macro definiton and function argument; > > Modify the function name, variables and comments to avoid > > similarities with kernel code. > >--- > > > > drivers/net/ice/ice_ethdev.c | 42 > > +++++++++++++++++++++++++++++++++++++++++- > > 1 file changed, 41 insertions(+), 1 deletion(-) > > > >diff --git a/drivers/net/ice/ice_ethdev.c > >b/drivers/net/ice/ice_ethdev.c index 08fc9ec..9550aed 100644 > >--- a/drivers/net/ice/ice_ethdev.c > >+++ b/drivers/net/ice/ice_ethdev.c > >@@ -1385,6 +1385,40 @@ static int ice_parse_devargs(struct rte_eth_dev > *dev) > > return ret; > > } > > > >+/* Forward LLDP packets to default VSI by set switch rules*/ static > >+int ice_vsi_config_sw_lldp(struct ice_vsi *vsi, bool on) { > >+ struct ice_hw *hw =3D ICE_VSI_TO_HW(vsi); > >+ struct ice_fltr_list_entry *s_list_itr =3D NULL; > >+ struct LIST_HEAD_TYPE list_head; > >+ int ret =3D 0; > >+ > >+ INIT_LIST_HEAD(&list_head); > >+ > >+ s_list_itr =3D (struct ice_fltr_list_entry *) > >+ ice_malloc(hw, sizeof(*s_list_itr)); > >+ if (!s_list_itr) { > >+ ret =3D -ENOMEM; > >+ goto DONE; >=20 > Here ice_malloc has failed, so you don't need to goto DONE to free it, yo= u can > just return -ENOMEM here. >=20 > Thanks, > Xiaolong >=20 OK, will fix it in V3. Thanks Ying > >+ } > >+ s_list_itr->fltr_info.lkup_type =3D ICE_SW_LKUP_ETHERTYPE; > >+ s_list_itr->fltr_info.vsi_handle =3D vsi->idx; > >+ s_list_itr->fltr_info.l_data.ethertype_mac.ethertype =3D > >+ RTE_ETHER_TYPE_LLDP; > >+ s_list_itr->fltr_info.fltr_act =3D ICE_FWD_TO_VSI; > >+ s_list_itr->fltr_info.flag =3D ICE_FLTR_RX; > >+ s_list_itr->fltr_info.src_id =3D ICE_SRC_ID_LPORT; > >+ LIST_ADD(&s_list_itr->list_entry, &list_head); > >+ if (on) > >+ ret =3D ice_add_eth_mac(hw, &list_head); > >+ else > >+ ret =3D ice_remove_eth_mac(hw, &list_head); > >+DONE: > >+ rte_free(s_list_itr); > >+ return ret; > >+} > >+ > > static int > > ice_dev_init(struct rte_eth_dev *dev) > > { > >@@ -1492,7 +1526,13 @@ static int ice_parse_devargs(struct rte_eth_dev > *dev) > > ret =3D ice_aq_stop_lldp(hw, TRUE, FALSE, NULL); > > if (ret !=3D ICE_SUCCESS) > > PMD_INIT_LOG(DEBUG, "lldp has already stopped\n"); > >- > >+ ret =3D ice_init_dcb(hw, TRUE); > >+ if (ret !=3D ICE_SUCCESS) > >+ PMD_INIT_LOG(DEBUG, "Failed to init DCB\n"); > >+ /* Forward LLDP packets to default VSI */ > >+ ret =3D ice_vsi_config_sw_lldp(vsi, TRUE); > >+ if (ret !=3D ICE_SUCCESS) > >+ PMD_INIT_LOG(DEBUG, "Failed to cfg lldp\n"); > > /* register callback func to eal lib */ > > rte_intr_callback_register(intr_handle, > > ice_interrupt_handler, dev); > >-- > >1.8.3.1 > >