From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sesbmg23.ericsson.net (sesbmg23.ericsson.net [193.180.251.37]) by dpdk.org (Postfix) with ESMTP id A62C71B2F4 for ; Wed, 14 Feb 2018 11:53:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/simple; q=dns/txt; i=@ericsson.com; t=1518605589; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:CC:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=5dPPmzQNNN57Khu46hbagDRfQRsEg4ZYqXysUxKvVpc=; b=f+7+9n4Wl/yG7JJMeaBfGVIeWCJXXprfPyXVlMklbYFFtHLL2Iws8/c37BlrKRnk MJPBm1bSCZ8EivQPF3+VajlrOKBAOIO+BE8EvKUE2xeFVpZqnt6xxh/s+MwD+dPl OcwuUZrca2uSpOlD/9mVt7Jv8yi5L2e9rlr1I+rajEg=; X-AuditID: c1b4fb25-473ff7000000341b-9e-5a841514d074 Received: from ESESSHC020.ericsson.se (Unknown_Domain [153.88.183.78]) by sesbmg23.ericsson.net (Symantec Mail Security) with SMTP id 84.4A.13339.415148A5; Wed, 14 Feb 2018 11:53:09 +0100 (CET) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (153.88.183.145) by oa.msg.ericsson.com (153.88.183.78) with Microsoft SMTP Server (TLS) id 14.3.352.0; Wed, 14 Feb 2018 11:53:08 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=1cuwm6jWSISMGWrLVMaLDWRUSeL0Dg8398J6y3f2pOs=; b=aLCOL+Nj0y09Zup5Xbpg0Bh7BBQTr6loIWyA7TCc4wCDRic8XaxC3WPHRJSAiJQJhpiBQ4CmZjDcyhdMe65wR+TChFNkJJ6khgy3uWGugvAu2nG8nvScxRDi5T01fQWKFGCZMpGu6YH0OSXWZjEw4yN7Vzz4TWrLSvSSF50+Mnw= Received: from AM4PR07MB3300.eurprd07.prod.outlook.com (10.171.189.29) by AM4PR07MB1425.eurprd07.prod.outlook.com (10.165.248.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.527.6; Wed, 14 Feb 2018 10:53:05 +0000 Received: from AM4PR07MB3300.eurprd07.prod.outlook.com ([fe80::e902:c57f:f907:cfb0]) by AM4PR07MB3300.eurprd07.prod.outlook.com ([fe80::e902:c57f:f907:cfb0%4]) with mapi id 15.20.0506.013; Wed, 14 Feb 2018 10:53:04 +0000 From: Nitin Katiyar To: "Xing, Beilei" , "dev@dpdk.org" CC: Venkatesan Pradeep Thread-Topic: Multi-driver support for Fortville Thread-Index: AdOkfW85iSROZVqIT7S7aLSZsHwtmQArxVtAABVBzlA= Date: Wed, 14 Feb 2018 10:53:04 +0000 Message-ID: References: <94479800C636CB44BD422CB454846E01320D6386@SHSMSX101.ccr.corp.intel.com> In-Reply-To: <94479800C636CB44BD422CB454846E01320D6386@SHSMSX101.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [125.16.128.122] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM4PR07MB1425; 7:kk3dvgnuqTCIZL8Lc8v5YbPOyEQJCDgjQInHf0RtHaAIIpI2kMzz+roIYa0hYrns1W3k+6sAOpc+AeizSCEDwKzpkdHn1GMVOBUs0WiEe/p6S/VFbxr7cZxOiYCfyi5bVVN3QfgvZZMu2/5MCV0yr63w9Rpj+aIXNfZ7GjHS93QHQDMmUP6FcSZsw50winOXPyqrsQjIT0mtONYCkXLSOLkx5FxkX0lEkYgjzig8kw18QdHPE2ma7IJCsSft9hwS x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-forefront-antispam-report: SFV:SKI; SCL:-1; SFV:NSPM; SFS:(10009020)(396003)(346002)(366004)(39380400002)(39860400002)(376002)(199004)(189003)(13464003)(27574002)(3280700002)(53546011)(6506007)(59450400001)(102836004)(186003)(55236004)(26005)(305945005)(7736002)(74316002)(68736007)(3660700001)(105586002)(2906002)(97736004)(3846002)(6116002)(86362001)(575784001)(2950100002)(5250100002)(229853002)(2900100001)(4326008)(25786009)(966005)(106356001)(14454004)(2501003)(478600001)(66066001)(33656002)(53936002)(6246003)(107886003)(316002)(110136005)(6436002)(9686003)(6306002)(53946003)(5660300001)(7696005)(81156014)(8936002)(8676002)(3480700004)(16200700003)(99286004)(81166006)(55016002)(76176011)(559001)(579004)(569006); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR07MB1425; H:AM4PR07MB3300.eurprd07.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; x-ms-office365-filtering-correlation-id: bb9d3e51-cd49-4289-1c4d-08d573992001 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(2017052603307)(7153060)(7193020); SRVR:AM4PR07MB1425; x-ms-traffictypediagnostic: AM4PR07MB1425: authentication-results: spf=none (sender IP is ) smtp.mailfrom=nitin.katiyar@ericsson.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(37575265505322)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(10201501046)(3231101)(944501161)(3002001)(93006095)(93001095)(6041288)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(6072148)(201708071742011); SRVR:AM4PR07MB1425; BCL:0; PCL:0; RULEID:; SRVR:AM4PR07MB1425; x-forefront-prvs: 0583A86C08 received-spf: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 3LxxFu844xgRmGr6g8h5S1U6yhUczEn0GsZwvoJuFKxCzpE4INPVNOtzGObl8MqfPEu2FHVJwwIXi729eal2dg== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: bb9d3e51-cd49-4289-1c4d-08d573992001 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Feb 2018 10:53:04.6176 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 92e84ceb-fbfd-47ab-be52-080c6b87953f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR07MB1425 X-OriginatorOrg: ericsson.com X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpjleLIzCtJLcpLzFFi42KZGbHdT1dUtCXKYH0zq0X3hxYmi3eftjM5 MHn8WrCU1WPxnpdMAUxRXDYpqTmZZalF+nYJXBn35txmK3h7iKmi9fdL9gbGmc1MXYycHBIC JhLNje8Yuxi5OIQEDjNK/Du1jw3COcEocevufyYQh0XgE5NE7+r/LBCZiUwSq/e9ZoVwHjFK PLxykx1kGJuAgcT2i5PAbBEBT4nWi9OZuxg5OJgFLCSmn9EBCQsL6Eu829/FChIWASo/el0N otpKov3rCbCTWARUJb69+gY2hVcgRuLm/mZmiFXLGCU+v/rGCJLgFAiRmP9nPzOIzSggJvH9 1BqwZmYBcYlbT+ZD/SYgsWTPeWYIW1Ti5eN/rBC2ksTmmS+gamQlLs3vZoSwtzBJtF+ohrCN Jbom7AH7UULgOpvEjQM72CASvhIzN19lhEhcZJSYePkc2DcSAloSj2f7QxwUK/Hu8VOoZdkS 83e+hOr1lpjaNxdqWT+zxIx/ARMY9WchuRvC1pFYsPsTG4StLbFs4WvmWeDAEJQ4OfMJywJG llWMosWpxUm56UbGeqlFmcnFxfl5enmpJZsYganj4JbfqjsYL79xPMQowMGoxMP7nrUlSog1 say4MvcQowQHs5IIr/H55igh3pTEyqrUovz4otKc1OJDjNIcLErivCc9eaOEBNITS1KzU1ML UotgskwcnFINjJZvQvUKHixj+qXvbrWjWV5G5FICl0fk52uFcrNm7dmnve+6Tfk22/C7PpGL +XVyjxZ5258S9dP7q384QKfa8rSDUXD0yySbtiqds6zu4e/+1XGWLL+kky03fXGm7ROlvgrZ qxplUWLzPu7uKpS5Kq09//KDOfIzWOJaJLYtaVeM2jTH0VRdiaU4I9FQi7moOBEA5CDs9hkD AAA= Subject: Re: [dpdk-dev] Multi-driver support for Fortville 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: , X-List-Received-Date: Wed, 14 Feb 2018 10:53:09 -0000 Hi Beilei, Thanks for clarifying the queries. We have been referring to following patc= hes.=20 https://dpdk.org/dev/patchwork/patch/34945/ https://dpdk.org/dev/patchwork/patch/34946/ https://dpdk.org/dev/patchwork/patch/34947/ https://dpdk.org/dev/patchwork/patch/34948/ Are these final versions and merged in dpdk branch? If not, where can I fin= d latest patches? Regards, Nitin -----Original Message----- From: Xing, Beilei [mailto:beilei.xing@intel.com]=20 Sent: Wednesday, February 14, 2018 6:50 AM To: Nitin Katiyar ; dev@dpdk.org Cc: Venkatesan Pradeep Subject: RE: Multi-driver support for Fortville Hi Nitin, > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Nitin Katiyar > Sent: Tuesday, February 13, 2018 11:48 AM > To: dev@dpdk.org > Cc: Venkatesan Pradeep > Subject: [dpdk-dev] Multi-driver support for Fortville >=20 > Hi, > Resending the queries with change in subject line. > 1) With these patches, we have 2 different values for some of the=20 > global registers depending upon whether single driver or multi-driver=20 > is using all ports of the NIC. Does it impact any=20 > functionality/performance if we use DPDK drivers in single driver vs mult= i-driver support? Yes. If support multi-driver, for functionality, some configurations will not be supported. Including flo= w director flexible payload, RSS input set/RSS bit mask/hash function/symme= tric hash/FDIR input set/TPID/flow control watermark/GRE tunnel key length = configuration, QinQ parser and QinQ cloud filter support. For performance, PF will use INT0 instead of INTN when support multi-driver= , so there'll be many interrupts costing CPU cycles during receiving packet= s. > 2) Why can't we have same settings for both the cases? i.e=20 > Unconditionally programming the global registers in DPDK driver with=20 > the same values as in Kernel driver. That way we don't have to care for e= xtra parameter. The reason is same as above. > 3) Does this issue need any update for kernel driver also? As I know, there's no need to update kernel driver. >=20 > Regards, > Nitin >=20 > -----Original Message----- > From: Nitin Katiyar > Sent: Monday, February 12, 2018 11:32 AM > To: dev@dpdk.org > Cc: Venkatesan Pradeep > Subject: RE: dev Digest, Vol 180, Issue 152 >=20 > Hi Beilei, > I was looking at the patches and have few queries regarding=20 > support-multi-driver. > 1) With these patches, we have 2 different values for some of the=20 > global registers depending upon whether single driver or multi-driver=20 > is using all ports of the NIC. Does it impact any=20 > functionality/performance if we use DPDK drivers in single driver vs mult= i-driver support? > 2) Why can't we have same settings for both the cases? That way we=20 > don't have to care for extra parameter. > 3) Does this issue need any update for kernel driver also? >=20 >=20 > Regards, > Nitin >=20 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of=20 > dev-request@dpdk.org > Sent: Friday, February 02, 2018 5:55 PM > To: dev@dpdk.org > Subject: dev Digest, Vol 180, Issue 152 >=20 > Send dev mailing list submissions to > dev@dpdk.org >=20 > To subscribe or unsubscribe via the World Wide Web, visit > https://dpdk.org/ml/listinfo/dev > or, via email, send a message with subject or body 'help' to > dev-request@dpdk.org >=20 > You can reach the person managing the list at > dev-owner@dpdk.org >=20 > When replying, please edit your Subject line so it is more specific than = "Re: > Contents of dev digest..." >=20 >=20 > Today's Topics: >=20 > 1. [PATCH v3 2/4] net/i40e: add debug logs when writing global > registers (Beilei Xing) > 2. [PATCH v3 3/4] net/i40e: fix multiple driver support issue > (Beilei Xing) > 3. [PATCH v3 4/4] net/i40e: fix interrupt conflict when using > multi-driver (Beilei Xing) >=20 >=20 > ---------------------------------------------------------------------- >=20 > Message: 1 > Date: Fri, 2 Feb 2018 20:25:08 +0800 > From: Beilei Xing > To: dev@dpdk.org, jingjing.wu@intel.com > Cc: stable@dpdk.org > Subject: [dpdk-dev] [PATCH v3 2/4] net/i40e: add debug logs when > writing global registers > Message-ID: <1517574310-93096-3-git-send-email-beilei.xing@intel.com> >=20 > Add debug logs when writing global registers. >=20 > Signed-off-by: Beilei Xing > Cc: stable@dpdk.org > --- > drivers/net/i40e/i40e_ethdev.c | 127 > +++++++++++++++++++++++++---------------- > drivers/net/i40e/i40e_ethdev.h | 8 +++ > 2 files changed, 87 insertions(+), 48 deletions(-) >=20 > diff --git a/drivers/net/i40e/i40e_ethdev.c=20 > b/drivers/net/i40e/i40e_ethdev.c index 44821f2..ef23241 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -716,6 +716,15 @@ rte_i40e_dev_atomic_write_link_status(struct > rte_eth_dev *dev, > return 0; > } >=20 > +static inline void > +i40e_write_global_rx_ctl(struct i40e_hw *hw, u32 reg_addr, u32=20 > +reg_val) { > + i40e_write_rx_ctl(hw, reg_addr, reg_val); > + PMD_DRV_LOG(DEBUG, "Global register 0x%08x is modified " > + "with value 0x%08x", > + reg_addr, reg_val); > +} > + > RTE_PMD_REGISTER_PCI(net_i40e, rte_i40e_pmd.pci_drv);=20 > RTE_PMD_REGISTER_PCI_TABLE(net_i40e, pci_id_i40e_map); >=20 > @@ -735,9 +744,9 @@ static inline void i40e_GLQF_reg_init(struct=20 > i40e_hw > *hw) > * configuration API is added to avoid configuration conflicts > * between ports of the same device. > */ > - I40E_WRITE_REG(hw, I40E_GLQF_ORT(33), 0x000000E0); > - I40E_WRITE_REG(hw, I40E_GLQF_ORT(34), 0x000000E3); > - I40E_WRITE_REG(hw, I40E_GLQF_ORT(35), 0x000000E6); > + I40E_WRITE_GLB_REG(hw, I40E_GLQF_ORT(33), 0x000000E0); > + I40E_WRITE_GLB_REG(hw, I40E_GLQF_ORT(34), 0x000000E3); > + I40E_WRITE_GLB_REG(hw, I40E_GLQF_ORT(35), 0x000000E6); > i40e_global_cfg_warning(I40E_WARNING_ENA_FLX_PLD); >=20 > /* > @@ -746,8 +755,8 @@ static inline void i40e_GLQF_reg_init(struct=20 > i40e_hw > *hw) > * configuration API is added to avoid configuration conflicts > * between ports of the same device. > */ > - I40E_WRITE_REG(hw, I40E_GLQF_ORT(40), 0x00000029); > - I40E_WRITE_REG(hw, I40E_GLQF_PIT(9), 0x00009420); > + I40E_WRITE_GLB_REG(hw, I40E_GLQF_ORT(40), 0x00000029); > + I40E_WRITE_GLB_REG(hw, I40E_GLQF_PIT(9), 0x00009420); > i40e_global_cfg_warning(I40E_WARNING_QINQ_PARSER); > } >=20 > @@ -2799,8 +2808,9 @@ i40e_vlan_tpid_set(struct rte_eth_dev *dev, > "I40E_GL_SWT_L2TAGCTRL[%d]", reg_id); > return ret; > } > - PMD_DRV_LOG(DEBUG, "Debug write 0x%08"PRIx64" to " > - "I40E_GL_SWT_L2TAGCTRL[%d]", reg_w, reg_id); > + PMD_DRV_LOG(DEBUG, > + "Global register 0x%08x is changed with value 0x%08x", > + I40E_GL_SWT_L2TAGCTRL(reg_id), (uint32_t)reg_w); >=20 > i40e_global_cfg_warning(I40E_WARNING_TPID); >=20 > @@ -3030,16 +3040,16 @@ i40e_flow_ctrl_set(struct rte_eth_dev *dev,=20 > struct rte_eth_fc_conf *fc_conf) > } >=20 > /* config the water marker both based on the packets and bytes */ > - I40E_WRITE_REG(hw, I40E_GLRPB_PHW, > + I40E_WRITE_GLB_REG(hw, I40E_GLRPB_PHW, > (pf->fc_conf.high_water[I40E_MAX_TRAFFIC_CLASS] > << I40E_KILOSHIFT) / I40E_PACKET_AVERAGE_SIZE); > - I40E_WRITE_REG(hw, I40E_GLRPB_PLW, > + I40E_WRITE_GLB_REG(hw, I40E_GLRPB_PLW, > (pf->fc_conf.low_water[I40E_MAX_TRAFFIC_CLASS] > << I40E_KILOSHIFT) / I40E_PACKET_AVERAGE_SIZE); > - I40E_WRITE_REG(hw, I40E_GLRPB_GHW, > + I40E_WRITE_GLB_REG(hw, I40E_GLRPB_GHW, > pf->fc_conf.high_water[I40E_MAX_TRAFFIC_CLASS] > << I40E_KILOSHIFT); > - I40E_WRITE_REG(hw, I40E_GLRPB_GLW, > + I40E_WRITE_GLB_REG(hw, I40E_GLRPB_GLW, > pf->fc_conf.low_water[I40E_MAX_TRAFFIC_CLASS] > << I40E_KILOSHIFT); > i40e_global_cfg_warning(I40E_WARNING_FLOW_CTL); > @@ -6880,6 +6890,9 @@ i40e_dev_set_gre_key_len(struct i40e_hw *hw,=20 > uint8_t len) > reg, NULL); > if (ret !=3D 0) > return ret; > + PMD_DRV_LOG(DEBUG, "Global register 0x%08x is changed " > + "with value 0x%08x", > + I40E_GL_PRS_FVBM(2), reg); > i40e_global_cfg_warning(I40E_WARNING_GRE_KEY_LEN); > } else { > ret =3D 0; > @@ -7124,41 +7137,43 @@ i40e_set_hash_filter_global_config(struct > i40e_hw *hw, > I40E_GLQF_HSYM_SYMH_ENA_MASK : 0; > if (hw->mac.type =3D=3D I40E_MAC_X722) { > if (pctype =3D=3D I40E_FILTER_PCTYPE_NONF_IPV4_UDP) { > - i40e_write_rx_ctl(hw, I40E_GLQF_HSYM( > + i40e_write_global_rx_ctl(hw, I40E_GLQF_HSYM( > I40E_FILTER_PCTYPE_NONF_IPV4_UDP), reg); > - i40e_write_rx_ctl(hw, I40E_GLQF_HSYM( > + i40e_write_global_rx_ctl(hw, I40E_GLQF_HSYM( > I40E_FILTER_PCTYPE_NONF_UNICAST_IPV4_UDP), > reg); > - i40e_write_rx_ctl(hw, I40E_GLQF_HSYM( > + i40e_write_global_rx_ctl(hw, I40E_GLQF_HSYM( > I40E_FILTER_PCTYPE_NONF_MULTICAST_IPV4_UDP), > reg); > } else if (pctype =3D=3D I40E_FILTER_PCTYPE_NONF_IPV4_TCP) { > - i40e_write_rx_ctl(hw, I40E_GLQF_HSYM( > + i40e_write_global_rx_ctl(hw, I40E_GLQF_HSYM( > I40E_FILTER_PCTYPE_NONF_IPV4_TCP), reg); > - i40e_write_rx_ctl(hw, I40E_GLQF_HSYM( > + i40e_write_global_rx_ctl(hw, I40E_GLQF_HSYM( >=20 > I40E_FILTER_PCTYPE_NONF_IPV4_TCP_SYN_NO_ACK), > reg); > } else if (pctype =3D=3D I40E_FILTER_PCTYPE_NONF_IPV6_UDP) { > - i40e_write_rx_ctl(hw, I40E_GLQF_HSYM( > + i40e_write_global_rx_ctl(hw, I40E_GLQF_HSYM( > I40E_FILTER_PCTYPE_NONF_IPV6_UDP), reg); > - i40e_write_rx_ctl(hw, I40E_GLQF_HSYM( > + i40e_write_global_rx_ctl(hw, I40E_GLQF_HSYM( > I40E_FILTER_PCTYPE_NONF_UNICAST_IPV6_UDP), > reg); > - i40e_write_rx_ctl(hw, I40E_GLQF_HSYM( > + i40e_write_global_rx_ctl(hw, I40E_GLQF_HSYM( > I40E_FILTER_PCTYPE_NONF_MULTICAST_IPV6_UDP), > reg); > } else if (pctype =3D=3D I40E_FILTER_PCTYPE_NONF_IPV6_TCP) { > - i40e_write_rx_ctl(hw, I40E_GLQF_HSYM( > + i40e_write_global_rx_ctl(hw, I40E_GLQF_HSYM( > I40E_FILTER_PCTYPE_NONF_IPV6_TCP), reg); > - i40e_write_rx_ctl(hw, I40E_GLQF_HSYM( > + i40e_write_global_rx_ctl(hw, I40E_GLQF_HSYM( >=20 > I40E_FILTER_PCTYPE_NONF_IPV6_TCP_SYN_NO_ACK), > reg); > } else { > - i40e_write_rx_ctl(hw, I40E_GLQF_HSYM(pctype), > - reg); > + i40e_write_global_rx_ctl(hw, > + I40E_GLQF_HSYM(pctype), > + reg); > } > } else { > - i40e_write_rx_ctl(hw, I40E_GLQF_HSYM(pctype), reg); > + i40e_write_global_rx_ctl(hw, I40E_GLQF_HSYM(pctype), > + reg); > } > i40e_global_cfg_warning(I40E_WARNING_HSYM); > } > @@ -7184,7 +7199,7 @@ i40e_set_hash_filter_global_config(struct > i40e_hw *hw, > /* Use the default, and keep it as it is */ > goto out; >=20 > - i40e_write_rx_ctl(hw, I40E_GLQF_CTL, reg); > + i40e_write_global_rx_ctl(hw, I40E_GLQF_CTL, reg); > i40e_global_cfg_warning(I40E_WARNING_QF_CTL); >=20 > out: > @@ -7799,6 +7814,18 @@ i40e_check_write_reg(struct i40e_hw *hw,=20 > uint32_t addr, uint32_t val) } >=20 > static void > +i40e_check_write_global_reg(struct i40e_hw *hw, uint32_t addr,=20 > +uint32_t > +val) { > + uint32_t reg =3D i40e_read_rx_ctl(hw, addr); > + > + PMD_DRV_LOG(DEBUG, "[0x%08x] original: 0x%08x", addr, reg); > + if (reg !=3D val) > + i40e_write_global_rx_ctl(hw, addr, val); > + PMD_DRV_LOG(DEBUG, "[0x%08x] after: 0x%08x", addr, > + (uint32_t)i40e_read_rx_ctl(hw, addr)); } > + > +static void > i40e_filter_input_set_init(struct i40e_pf *pf) { > struct i40e_hw *hw =3D I40E_PF_TO_HW(pf); @@ -7831,24 +7858,28 @@=20 > i40e_filter_input_set_init(struct i40e_pf *pf) > i40e_check_write_reg(hw, I40E_PRTQF_FD_INSET(pctype, 1), > (uint32_t)((inset_reg >> > I40E_32_BIT_WIDTH) & UINT32_MAX)); > - i40e_check_write_reg(hw, I40E_GLQF_HASH_INSET(0, pctype), > + i40e_check_write_global_reg(hw, I40E_GLQF_HASH_INSET(0, > pctype), > (uint32_t)(inset_reg & UINT32_MAX)); > - i40e_check_write_reg(hw, I40E_GLQF_HASH_INSET(1, pctype), > + i40e_check_write_global_reg(hw, I40E_GLQF_HASH_INSET(1, > pctype), > (uint32_t)((inset_reg >> > I40E_32_BIT_WIDTH) & UINT32_MAX)); >=20 > for (i =3D 0; i < num; i++) { > - i40e_check_write_reg(hw, I40E_GLQF_FD_MSK(i, pctype), > - mask_reg[i]); > - i40e_check_write_reg(hw, I40E_GLQF_HASH_MSK(i, pctype), > - mask_reg[i]); > + i40e_check_write_global_reg(hw, > + I40E_GLQF_FD_MSK(i, pctype), > + mask_reg[i]); > + i40e_check_write_global_reg(hw, > + I40E_GLQF_HASH_MSK(i, pctype), > + mask_reg[i]); > } > /*clear unused mask registers of the pctype */ > for (i =3D num; i < I40E_INSET_MASK_NUM_REG; i++) { > - i40e_check_write_reg(hw, I40E_GLQF_FD_MSK(i, pctype), > - 0); > - i40e_check_write_reg(hw, I40E_GLQF_HASH_MSK(i, pctype), > - 0); > + i40e_check_write_global_reg(hw, > + I40E_GLQF_FD_MSK(i, pctype), > + 0); > + i40e_check_write_global_reg(hw, > + I40E_GLQF_HASH_MSK(i, pctype), > + 0); > } > I40E_WRITE_FLUSH(hw); >=20 > @@ -7920,20 +7951,20 @@ i40e_hash_filter_inset_select(struct i40e_hw=20 > *hw, >=20 > inset_reg |=3D i40e_translate_input_set_reg(hw->mac.type, input_set); >=20 > - i40e_check_write_reg(hw, I40E_GLQF_HASH_INSET(0, pctype), > - (uint32_t)(inset_reg & UINT32_MAX)); > - i40e_check_write_reg(hw, I40E_GLQF_HASH_INSET(1, pctype), > - (uint32_t)((inset_reg >> > - I40E_32_BIT_WIDTH) & UINT32_MAX)); > + i40e_check_write_global_reg(hw, I40E_GLQF_HASH_INSET(0, pctype), > + (uint32_t)(inset_reg & UINT32_MAX)); > + i40e_check_write_global_reg(hw, I40E_GLQF_HASH_INSET(1, pctype), > + (uint32_t)((inset_reg >> > + I40E_32_BIT_WIDTH) & UINT32_MAX)); > i40e_global_cfg_warning(I40E_WARNING_HASH_INSET); >=20 > for (i =3D 0; i < num; i++) > - i40e_check_write_reg(hw, I40E_GLQF_HASH_MSK(i, pctype), > - mask_reg[i]); > + i40e_check_write_global_reg(hw, I40E_GLQF_HASH_MSK(i, > pctype), > + mask_reg[i]); > /*clear unused mask registers of the pctype */ > for (i =3D num; i < I40E_INSET_MASK_NUM_REG; i++) > - i40e_check_write_reg(hw, I40E_GLQF_HASH_MSK(i, pctype), > - 0); > + i40e_check_write_global_reg(hw, I40E_GLQF_HASH_MSK(i, > pctype), > + 0); > i40e_global_cfg_warning(I40E_WARNING_HASH_MSK); > I40E_WRITE_FLUSH(hw); >=20 > @@ -8007,12 +8038,12 @@ i40e_fdir_filter_inset_select(struct i40e_pf *pf, > I40E_32_BIT_WIDTH) & UINT32_MAX)); >=20 > for (i =3D 0; i < num; i++) > - i40e_check_write_reg(hw, I40E_GLQF_FD_MSK(i, pctype), > - mask_reg[i]); > + i40e_check_write_global_reg(hw, I40E_GLQF_FD_MSK(i, pctype), > + mask_reg[i]); > /*clear unused mask registers of the pctype */ > for (i =3D num; i < I40E_INSET_MASK_NUM_REG; i++) > - i40e_check_write_reg(hw, I40E_GLQF_FD_MSK(i, pctype), > - 0); > + i40e_check_write_global_reg(hw, I40E_GLQF_FD_MSK(i, pctype), > + 0); > i40e_global_cfg_warning(I40E_WARNING_FD_MSK); > I40E_WRITE_FLUSH(hw); >=20 > diff --git a/drivers/net/i40e/i40e_ethdev.h=20 > b/drivers/net/i40e/i40e_ethdev.h index 1d813ef..12b6000 100644 > --- a/drivers/net/i40e/i40e_ethdev.h > +++ b/drivers/net/i40e/i40e_ethdev.h > @@ -103,6 +103,14 @@ > (((vf)->version_major =3D=3D I40E_VIRTCHNL_VERSION_MAJOR) && \ > ((vf)->version_minor =3D=3D 1)) >=20 > +static inline void > +I40E_WRITE_GLB_REG(struct i40e_hw *hw, uint32_t reg, uint32_t value) { > + I40E_WRITE_REG(hw, reg, value); > + PMD_DRV_LOG(DEBUG, "Global register 0x%08x is modified " > + "with value 0x%08x", > + reg, value); > +} > + > /* index flex payload per layer */ > enum i40e_flxpld_layer_idx { > I40E_FLXPLD_L2_IDX =3D 0, > -- > 2.5.5 >=20 >=20 >=20 > ------------------------------ >=20 > Message: 2 > Date: Fri, 2 Feb 2018 20:25:09 +0800 > From: Beilei Xing > To: dev@dpdk.org, jingjing.wu@intel.com > Cc: stable@dpdk.org > Subject: [dpdk-dev] [PATCH v3 3/4] net/i40e: fix multiple driver > support issue > Message-ID: <1517574310-93096-4-git-send-email-beilei.xing@intel.com> >=20 > This patch provides the option to disable writing some global=20 > registers in PMD, in order to avoid affecting other drivers, when=20 > multiple drivers run on the same NIC and control different physical=20 > ports. Because there are few global resources shared among different phys= ical ports. >=20 > Fixes: ec246eeb5da1 ("i40e: use default filter input set on init") > Fixes: 98f055707685 ("i40e: configure input fields for RSS or flow=20 > director") > Fixes: f05ec7d77e41 ("i40e: initialize flow director flexible payload=20 > setting") > Fixes: e536c2e32883 ("net/i40e: fix parsing QinQ packets type") > Fixes: 19b16e2f6442 ("ethdev: add vlan type when setting ether type") > Cc: stable@dpdk.org >=20 > Signed-off-by: Beilei Xing > --- > drivers/net/i40e/i40e_ethdev.c | 215 > ++++++++++++++++++++++++++++++++--------- > drivers/net/i40e/i40e_ethdev.h | 2 + > 2 files changed, 171 insertions(+), 46 deletions(-) >=20 > diff --git a/drivers/net/i40e/i40e_ethdev.c=20 > b/drivers/net/i40e/i40e_ethdev.c index ef23241..ae0f31a 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -944,6 +944,67 @@ config_floating_veb(struct rte_eth_dev *dev)=20 > #define I40E_L2_TAGS_S_TAG_SHIFT 1 #define I40E_L2_TAGS_S_TAG_MASK=20 > I40E_MASK(0x1, I40E_L2_TAGS_S_TAG_SHIFT) >=20 > +#define ETH_I40E_SUPPORT_MULTI_DRIVER "support-multi-driver" > +RTE_PMD_REGISTER_PARAM_STRING(net_i40e, > + ETH_I40E_SUPPORT_MULTI_DRIVER "=3D0|1"); > + > +static int > +i40e_parse_multi_drv_handler(__rte_unused const char *key, > + const char *value, > + void *opaque) > +{ > + struct i40e_pf *pf; > + unsigned long support_multi_driver; > + char *end; > + > + pf =3D (struct i40e_pf *)opaque; > + > + errno =3D 0; > + support_multi_driver =3D strtoul(value, &end, 10); > + if (errno !=3D 0 || end =3D=3D value || *end !=3D 0) { > + PMD_DRV_LOG(WARNING, "Wrong global configuration"); > + return -(EINVAL); > + } > + > + if (support_multi_driver =3D=3D 1 || support_multi_driver =3D=3D 0) > + pf->support_multi_driver =3D (bool)support_multi_driver; > + else > + PMD_DRV_LOG(WARNING, "%s must be 1 or 0,", > + "enable global configuration by default." > + ETH_I40E_SUPPORT_MULTI_DRIVER); > + return 0; > +} > + > +static int > +i40e_support_multi_driver(struct rte_eth_dev *dev) { > + struct i40e_pf *pf =3D > I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private); > + struct rte_pci_device *pci_dev =3D dev->pci_dev; > + static const char *valid_keys[] =3D { > + ETH_I40E_SUPPORT_MULTI_DRIVER, NULL}; > + struct rte_kvargs *kvlist; > + > + /* Enable global configuration by default */ > + pf->support_multi_driver =3D false; > + > + if (!pci_dev->device.devargs) > + return 0; > + > + kvlist =3D rte_kvargs_parse(pci_dev->device.devargs->args, valid_keys); > + if (!kvlist) > + return -EINVAL; > + > + if (rte_kvargs_count(kvlist, ETH_I40E_SUPPORT_MULTI_DRIVER) > 1) > + PMD_DRV_LOG(WARNING, "More than one argument \"%s\" and > only " > + "the first invalid or last valid one is used !", > + ETH_I40E_SUPPORT_MULTI_DRIVER); > + > + rte_kvargs_process(kvlist, ETH_I40E_SUPPORT_MULTI_DRIVER, > + i40e_parse_multi_drv_handler, pf); > + rte_kvargs_free(kvlist); > + return 0; > +} > + > static int > eth_i40e_dev_init(struct rte_eth_dev *dev) { @@ -993,6 +1054,9 @@=20 > eth_i40e_dev_init(struct rte_eth_dev *dev) > hw->bus.func =3D pci_dev->addr.function; > hw->adapter_stopped =3D 0; >=20 > + /* Check if need to support multi-driver */ > + i40e_support_multi_driver(dev); > + > /* Make sure all is clean before doing PF reset */ > i40e_clear_hw(hw); >=20 > @@ -1019,7 +1083,8 @@ eth_i40e_dev_init(struct rte_eth_dev *dev) > * software. It should be removed once issues are fixed > * in NVM. > */ > - i40e_GLQF_reg_init(hw); > + if (!pf->support_multi_driver) > + i40e_GLQF_reg_init(hw); >=20 > /* Initialize the input set for filters (hash and fd) to default value = */ > i40e_filter_input_set_init(pf); > @@ -1115,11 +1180,14 @@ eth_i40e_dev_init(struct rte_eth_dev *dev) > i40e_set_fc(hw, &aq_fail, TRUE); >=20 > /* Set the global registers with default ether type value */ > - ret =3D i40e_vlan_tpid_set(dev, ETH_VLAN_TYPE_OUTER, > ETHER_TYPE_VLAN); > - if (ret !=3D I40E_SUCCESS) { > - PMD_INIT_LOG(ERR, "Failed to set the default outer " > - "VLAN ether type"); > - goto err_setup_pf_switch; > + if (!pf->support_multi_driver) { > + ret =3D i40e_vlan_tpid_set(dev, ETH_VLAN_TYPE_OUTER, > + ETHER_TYPE_VLAN); > + if (ret !=3D I40E_SUCCESS) { > + PMD_INIT_LOG(ERR, "Failed to set the default outer " > + "VLAN ether type"); > + goto err_setup_pf_switch; > + } > } >=20 > /* PF setup, which includes VSI setup */ @@ -2754,11 +2822,17 @@=20 > i40e_vlan_tpid_set(struct rte_eth_dev *dev, > uint16_t tpid) > { > struct i40e_hw *hw =3D > I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); > + struct i40e_pf *pf =3D > I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private); > uint64_t reg_r =3D 0, reg_w =3D 0; > uint16_t reg_id =3D 0; > int ret =3D 0; > int qinq =3D dev->data->dev_conf.rxmode.hw_vlan_extend; >=20 > + if (pf->support_multi_driver) { > + PMD_DRV_LOG(ERR, "Setting TPID is not supported."); > + return -ENOTSUP; > + } > + > switch (vlan_type) { > case ETH_VLAN_TYPE_OUTER: > if (qinq) > @@ -3039,20 +3113,25 @@ i40e_flow_ctrl_set(struct rte_eth_dev *dev,=20 > struct rte_eth_fc_conf *fc_conf) > I40E_WRITE_REG(hw, I40E_PRTDCB_MFLCN, mflcn_reg); > } >=20 > - /* config the water marker both based on the packets and bytes */ > - I40E_WRITE_GLB_REG(hw, I40E_GLRPB_PHW, > - (pf->fc_conf.high_water[I40E_MAX_TRAFFIC_CLASS] > - << I40E_KILOSHIFT) / I40E_PACKET_AVERAGE_SIZE); > - I40E_WRITE_GLB_REG(hw, I40E_GLRPB_PLW, > - (pf->fc_conf.low_water[I40E_MAX_TRAFFIC_CLASS] > - << I40E_KILOSHIFT) / I40E_PACKET_AVERAGE_SIZE); > - I40E_WRITE_GLB_REG(hw, I40E_GLRPB_GHW, > - pf->fc_conf.high_water[I40E_MAX_TRAFFIC_CLASS] > - << I40E_KILOSHIFT); > - I40E_WRITE_GLB_REG(hw, I40E_GLRPB_GLW, > - pf->fc_conf.low_water[I40E_MAX_TRAFFIC_CLASS] > - << I40E_KILOSHIFT); > - i40e_global_cfg_warning(I40E_WARNING_FLOW_CTL); > + if (!pf->support_multi_driver) { > + /* config water marker both based on the packets and bytes */ > + I40E_WRITE_GLB_REG(hw, I40E_GLRPB_PHW, > + (pf->fc_conf.high_water[I40E_MAX_TRAFFIC_CLASS] > + << I40E_KILOSHIFT) / I40E_PACKET_AVERAGE_SIZE); > + I40E_WRITE_GLB_REG(hw, I40E_GLRPB_PLW, > + (pf->fc_conf.low_water[I40E_MAX_TRAFFIC_CLASS] > + << I40E_KILOSHIFT) / I40E_PACKET_AVERAGE_SIZE); > + I40E_WRITE_GLB_REG(hw, I40E_GLRPB_GHW, > + pf->fc_conf.high_water[I40E_MAX_TRAFFIC_CLASS] > + << I40E_KILOSHIFT); > + I40E_WRITE_GLB_REG(hw, I40E_GLRPB_GLW, > + pf->fc_conf.low_water[I40E_MAX_TRAFFIC_CLASS] > + << I40E_KILOSHIFT); > + i40e_global_cfg_warning(I40E_WARNING_FLOW_CTL); > + } else { > + PMD_DRV_LOG(ERR, > + "Water marker configuration is not supported."); > + } >=20 > I40E_WRITE_FLUSH(hw); >=20 > @@ -6870,9 +6949,15 @@ i40e_tunnel_filter_param_check(struct i40e_pf=20 > *pf, static int i40e_dev_set_gre_key_len(struct i40e_hw *hw, uint8_t=20 > len) { > + struct i40e_pf *pf =3D &((struct i40e_adapter *)hw->back)->pf; > uint32_t val, reg; > int ret =3D -EINVAL; >=20 > + if (pf->support_multi_driver) { > + PMD_DRV_LOG(ERR, "GRE key length configuration is > unsupported"); > + return -ENOTSUP; > + } > + > val =3D I40E_READ_REG(hw, I40E_GL_PRS_FVBM(2)); > PMD_DRV_LOG(DEBUG, "Read original GL_PRS_FVBM with 0x%08x\n", val); >=20 > @@ -7114,12 +7199,18 @@ static int > i40e_set_hash_filter_global_config(struct i40e_hw *hw, > struct rte_eth_hash_global_conf *g_cfg) { > + struct i40e_pf *pf =3D &((struct i40e_adapter *)hw->back)->pf; > int ret; > uint16_t i; > uint32_t reg; > uint32_t mask0 =3D g_cfg->valid_bit_mask[0]; > enum i40e_filter_pctype pctype; >=20 > + if (pf->support_multi_driver) { > + PMD_DRV_LOG(ERR, "Hash global configuration is not > supported."); > + return -ENOTSUP; > + } > + > /* Check the input parameters */ > ret =3D i40e_hash_global_config_check(g_cfg); > if (ret < 0) > @@ -7850,6 +7941,12 @@ i40e_filter_input_set_init(struct i40e_pf *pf) > I40E_INSET_MASK_NUM_REG); > if (num < 0) > return; > + > + if (pf->support_multi_driver && num > 0) { > + PMD_DRV_LOG(ERR, "Input set setting is not supported."); > + return; > + } > + > inset_reg =3D i40e_translate_input_set_reg(hw->mac.type, > input_set); >=20 > @@ -7858,39 +7955,49 @@ i40e_filter_input_set_init(struct i40e_pf *pf) > i40e_check_write_reg(hw, I40E_PRTQF_FD_INSET(pctype, 1), > (uint32_t)((inset_reg >> > I40E_32_BIT_WIDTH) & UINT32_MAX)); > - i40e_check_write_global_reg(hw, I40E_GLQF_HASH_INSET(0, > pctype), > - (uint32_t)(inset_reg & UINT32_MAX)); > - i40e_check_write_global_reg(hw, I40E_GLQF_HASH_INSET(1, > pctype), > - (uint32_t)((inset_reg >> > - I40E_32_BIT_WIDTH) & UINT32_MAX)); > - > - for (i =3D 0; i < num; i++) { > + if (!pf->support_multi_driver) { > + i40e_check_write_global_reg(hw, > + I40E_GLQF_HASH_INSET(0, pctype), > + (uint32_t)(inset_reg & UINT32_MAX)); > i40e_check_write_global_reg(hw, > + I40E_GLQF_HASH_INSET(1, pctype), > + (uint32_t)((inset_reg >> > + I40E_32_BIT_WIDTH) & UINT32_MAX)); > + > + for (i =3D 0; i < num; i++) { > + i40e_check_write_global_reg(hw, > I40E_GLQF_FD_MSK(i, pctype), > mask_reg[i]); > - i40e_check_write_global_reg(hw, > + i40e_check_write_global_reg(hw, > I40E_GLQF_HASH_MSK(i, pctype), > mask_reg[i]); > - } > - /*clear unused mask registers of the pctype */ > - for (i =3D num; i < I40E_INSET_MASK_NUM_REG; i++) { > - i40e_check_write_global_reg(hw, > + } > + /*clear unused mask registers of the pctype */ > + for (i =3D num; i < I40E_INSET_MASK_NUM_REG; i++) { > + i40e_check_write_global_reg(hw, > I40E_GLQF_FD_MSK(i, pctype), > 0); > - i40e_check_write_global_reg(hw, > + i40e_check_write_global_reg(hw, > I40E_GLQF_HASH_MSK(i, pctype), > - 0); > + 0); > + } > + } else { > + PMD_DRV_LOG(ERR, > + "Input set setting is not supported."); > } > I40E_WRITE_FLUSH(hw); >=20 > /* store the default input set */ > - pf->hash_input_set[pctype] =3D input_set; > + if (!pf->support_multi_driver) > + pf->hash_input_set[pctype] =3D input_set; > pf->fdir.input_set[pctype] =3D input_set; > } >=20 > - i40e_global_cfg_warning(I40E_WARNING_HASH_INSET); > - i40e_global_cfg_warning(I40E_WARNING_FD_MSK); > - i40e_global_cfg_warning(I40E_WARNING_HASH_MSK); > + if (!pf->support_multi_driver) { > + i40e_global_cfg_warning(I40E_WARNING_HASH_INSET); > + i40e_global_cfg_warning(I40E_WARNING_FD_MSK); > + i40e_global_cfg_warning(I40E_WARNING_HASH_MSK); > + } > } >=20 > int > @@ -7903,6 +8010,11 @@ i40e_hash_filter_inset_select(struct i40e_hw=20 > *hw, > uint32_t mask_reg[I40E_INSET_MASK_NUM_REG] =3D {0}; > int ret, i, num; >=20 > + if (pf->support_multi_driver) { > + PMD_DRV_LOG(ERR, "Hash input set setting is not supported."); > + return -ENOTSUP; > + } > + > if (!conf) { > PMD_DRV_LOG(ERR, "Invalid pointer"); > return -EFAULT; > @@ -8029,6 +8141,11 @@ i40e_fdir_filter_inset_select(struct i40e_pf *pf, > if (num < 0) > return -EINVAL; >=20 > + if (pf->support_multi_driver && num > 0) { > + PMD_DRV_LOG(ERR, "FDIR bit mask is not supported."); > + return -ENOTSUP; > + } > + > inset_reg |=3D i40e_translate_input_set_reg(hw->mac.type, input_set); >=20 > i40e_check_write_reg(hw, I40E_PRTQF_FD_INSET(pctype, 0), @@ > -8037,14 +8154,20 @@ i40e_fdir_filter_inset_select(struct i40e_pf *pf, > (uint32_t)((inset_reg >> > I40E_32_BIT_WIDTH) & UINT32_MAX)); >=20 > - for (i =3D 0; i < num; i++) > - i40e_check_write_global_reg(hw, I40E_GLQF_FD_MSK(i, pctype), > - mask_reg[i]); > - /*clear unused mask registers of the pctype */ > - for (i =3D num; i < I40E_INSET_MASK_NUM_REG; i++) > - i40e_check_write_global_reg(hw, I40E_GLQF_FD_MSK(i, pctype), > - 0); > - i40e_global_cfg_warning(I40E_WARNING_FD_MSK); > + if (!pf->support_multi_driver) { > + for (i =3D 0; i < num; i++) > + i40e_check_write_global_reg(hw, > + I40E_GLQF_FD_MSK(i, pctype), > + mask_reg[i]); > + /*clear unused mask registers of the pctype */ > + for (i =3D num; i < I40E_INSET_MASK_NUM_REG; i++) > + i40e_check_write_global_reg(hw, > + I40E_GLQF_FD_MSK(i, pctype), > + 0); > + i40e_global_cfg_warning(I40E_WARNING_FD_MSK); > + } else { > + PMD_DRV_LOG(ERR, "FDIR bit mask is not supported."); > + } > I40E_WRITE_FLUSH(hw); >=20 > pf->fdir.input_set[pctype] =3D input_set; diff --git=20 > a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h=20 > index > 12b6000..82d5501 100644 > --- a/drivers/net/i40e/i40e_ethdev.h > +++ b/drivers/net/i40e/i40e_ethdev.h > @@ -485,6 +485,8 @@ struct i40e_pf { > bool floating_veb; /* The flag to use the floating VEB */ > /* The floating enable flag for the specific VF */ > bool floating_veb_list[I40E_MAX_VF]; > + > + bool support_multi_driver; /* 1 - support multiple driver */ > }; >=20 > enum pending_msg { > -- > 2.5.5 >=20 >=20 >=20 > ------------------------------ >=20 > Message: 3 > Date: Fri, 2 Feb 2018 20:25:10 +0800 > From: Beilei Xing > To: dev@dpdk.org, jingjing.wu@intel.com > Cc: stable@dpdk.org > Subject: [dpdk-dev] [PATCH v3 4/4] net/i40e: fix interrupt conflict > when using multi-driver > Message-ID: <1517574310-93096-5-git-send-email-beilei.xing@intel.com> >=20 > There's interrupt conflict when using DPDK and Linux i40e on different=20 > ports of the same Ethernet controller, this patch fixes it by=20 > switching from IntN to > Int0 if multiple drivers are used. >=20 > Fixes: be6c228d4da3 ("i40e: support Rx interrupt") > Cc: stable@dpdk.org >=20 > Signed-off-by: Beilei Xing > --- > drivers/net/i40e/i40e_ethdev.c | 93 > +++++++++++++++++++++++++-------------- > drivers/net/i40e/i40e_ethdev.h | 10 +++-- > drivers/net/i40e/i40e_ethdev_vf.c | 4 +- > 3 files changed, 68 insertions(+), 39 deletions(-) >=20 > diff --git a/drivers/net/i40e/i40e_ethdev.c=20 > b/drivers/net/i40e/i40e_ethdev.c index ae0f31a..cae22e7 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -760,6 +760,23 @@ static inline void i40e_GLQF_reg_init(struct=20 > i40e_hw *hw) > i40e_global_cfg_warning(I40E_WARNING_QINQ_PARSER); > } >=20 > +static inline void i40e_config_automask(struct i40e_pf *pf) { > + struct i40e_hw *hw =3D I40E_PF_TO_HW(pf); > + uint32_t val; > + > + /* INTENA flag is not auto-cleared for interrupt */ > + val =3D I40E_READ_REG(hw, I40E_GLINT_CTL); > + val |=3D I40E_GLINT_CTL_DIS_AUTOMASK_PF0_MASK | > + I40E_GLINT_CTL_DIS_AUTOMASK_VF0_MASK; > + > + /* If support multi-driver, PF will use INT0. */ > + if (!pf->support_multi_driver) > + val |=3D I40E_GLINT_CTL_DIS_AUTOMASK_N_MASK; > + > + I40E_WRITE_REG(hw, I40E_GLINT_CTL, val); } > + > #define I40E_FLOW_CONTROL_ETHERTYPE 0x8808 >=20 > /* > @@ -1077,6 +1094,8 @@ eth_i40e_dev_init(struct rte_eth_dev *dev) > return ret; > } >=20 > + i40e_config_automask(pf); > + > /* > * To work around the NVM issue, initialize registers > * for flexible payload and packet type of QinQ by @@ -1463,6=20 > +1482,7 @@ __vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t msix_vec= t, > int i; > uint32_t val; > struct i40e_hw *hw =3D I40E_VSI_TO_HW(vsi); > + struct i40e_pf *pf =3D I40E_VSI_TO_PF(vsi); >=20 > /* Bind all RX queues to allocated MSIX interrupt */ > for (i =3D 0; i < nb_queue; i++) { > @@ -1481,7 +1501,8 @@ __vsi_queues_bind_intr(struct i40e_vsi *vsi,=20 > uint16_t msix_vect, > /* Write first RX queue to Link list register as the head element */ > if (vsi->type !=3D I40E_VSI_SRIOV) { > uint16_t interval =3D > - i40e_calc_itr_interval(RTE_LIBRTE_I40E_ITR_INTERVAL); > + i40e_calc_itr_interval(RTE_LIBRTE_I40E_ITR_INTERVAL, > + pf->support_multi_driver); >=20 > if (msix_vect =3D=3D I40E_MISC_VEC_ID) { > I40E_WRITE_REG(hw, I40E_PFINT_LNKLST0, @@ -1539,7 > +1560,6 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi) > uint16_t nb_msix =3D RTE_MIN(vsi->nb_msix, intr_handle->nb_efd); > uint16_t queue_idx =3D 0; > int record =3D 0; > - uint32_t val; > int i; >=20 > for (i =3D 0; i < vsi->nb_qps; i++) { > @@ -1547,13 +1567,6 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi) > I40E_WRITE_REG(hw, I40E_QINT_RQCTL(vsi->base_queue + i), 0); > } >=20 > - /* INTENA flag is not auto-cleared for interrupt */ > - val =3D I40E_READ_REG(hw, I40E_GLINT_CTL); > - val |=3D I40E_GLINT_CTL_DIS_AUTOMASK_PF0_MASK | > - I40E_GLINT_CTL_DIS_AUTOMASK_N_MASK | > - I40E_GLINT_CTL_DIS_AUTOMASK_VF0_MASK; > - I40E_WRITE_REG(hw, I40E_GLINT_CTL, val); > - > /* VF bind interrupt */ > if (vsi->type =3D=3D I40E_VSI_SRIOV) { > __vsi_queues_bind_intr(vsi, msix_vect, @@ -1606,27 +1619,22 @@=20 > i40e_vsi_enable_queues_intr(struct i40e_vsi *vsi) > struct rte_eth_dev *dev =3D vsi->adapter->eth_dev; > struct rte_intr_handle *intr_handle =3D &dev->pci_dev->intr_handle; > struct i40e_hw *hw =3D I40E_VSI_TO_HW(vsi); > - uint16_t interval =3D i40e_calc_itr_interval(\ > - RTE_LIBRTE_I40E_ITR_INTERVAL); > + struct i40e_pf *pf =3D I40E_VSI_TO_PF(vsi); > uint16_t msix_intr, i; >=20 > - if (rte_intr_allow_others(intr_handle)) > + if (rte_intr_allow_others(intr_handle) || !pf->support_multi_driver) > for (i =3D 0; i < vsi->nb_msix; i++) { > msix_intr =3D vsi->msix_intr + i; > I40E_WRITE_REG(hw, I40E_PFINT_DYN_CTLN(msix_intr - 1), > - I40E_PFINT_DYN_CTLN_INTENA_MASK | > - I40E_PFINT_DYN_CTLN_CLEARPBA_MASK | > - (0 << I40E_PFINT_DYN_CTLN_ITR_INDX_SHIFT) | > - (interval << > - I40E_PFINT_DYN_CTLN_INTERVAL_SHIFT)); > + I40E_PFINT_DYN_CTLN_INTENA_MASK | > + I40E_PFINT_DYN_CTLN_CLEARPBA_MASK | > + I40E_PFINT_DYN_CTLN_ITR_INDX_MASK); > } > else > I40E_WRITE_REG(hw, I40E_PFINT_DYN_CTL0, > I40E_PFINT_DYN_CTL0_INTENA_MASK | > I40E_PFINT_DYN_CTL0_CLEARPBA_MASK | > - (0 << I40E_PFINT_DYN_CTL0_ITR_INDX_SHIFT) | > - (interval << > - I40E_PFINT_DYN_CTL0_INTERVAL_SHIFT)); > + I40E_PFINT_DYN_CTL0_ITR_INDX_MASK); >=20 > I40E_WRITE_FLUSH(hw); > } > @@ -1637,16 +1645,18 @@ i40e_vsi_disable_queues_intr(struct i40e_vsi > *vsi) > struct rte_eth_dev *dev =3D vsi->adapter->eth_dev; > struct rte_intr_handle *intr_handle =3D &dev->pci_dev->intr_handle; > struct i40e_hw *hw =3D I40E_VSI_TO_HW(vsi); > + struct i40e_pf *pf =3D I40E_VSI_TO_PF(vsi); > uint16_t msix_intr, i; >=20 > - if (rte_intr_allow_others(intr_handle)) > + if (rte_intr_allow_others(intr_handle) || !pf->support_multi_driver) > for (i =3D 0; i < vsi->nb_msix; i++) { > msix_intr =3D vsi->msix_intr + i; > I40E_WRITE_REG(hw, I40E_PFINT_DYN_CTLN(msix_intr - 1), > - 0); > + I40E_PFINT_DYN_CTLN_ITR_INDX_MASK); > } > else > - I40E_WRITE_REG(hw, I40E_PFINT_DYN_CTL0, 0); > + I40E_WRITE_REG(hw, I40E_PFINT_DYN_CTL0, > + I40E_PFINT_DYN_CTL0_ITR_INDX_MASK); >=20 > I40E_WRITE_FLUSH(hw); > } > @@ -4618,16 +4628,28 @@ i40e_vsi_setup(struct i40e_pf *pf, >=20 > /* VF has MSIX interrupt in VF range, don't allocate here */ > if (type =3D=3D I40E_VSI_MAIN) { > - ret =3D i40e_res_pool_alloc(&pf->msix_pool, > - RTE_MIN(vsi->nb_qps, > - RTE_MAX_RXTX_INTR_VEC_ID)); > - if (ret < 0) { > - PMD_DRV_LOG(ERR, "VSI MAIN %d get heap failed %d", > - vsi->seid, ret); > - goto fail_queue_alloc; > + if (pf->support_multi_driver) { > + /* If support multi-driver, need to use INT0 instead of > + * allocating from msix pool. The Msix pool is init from > + * INT1, so it's OK just set msix_intr to 0 and nb_msix > + * to 1 without calling i40e_res_pool_alloc. > + */ > + vsi->msix_intr =3D 0; > + vsi->nb_msix =3D 1; > + } else { > + ret =3D i40e_res_pool_alloc(&pf->msix_pool, > + RTE_MIN(vsi->nb_qps, > + RTE_MAX_RXTX_INTR_VEC_ID)); > + if (ret < 0) { > + PMD_DRV_LOG(ERR, > + "VSI MAIN %d get heap failed %d", > + vsi->seid, ret); > + goto fail_queue_alloc; > + } > + vsi->msix_intr =3D ret; > + vsi->nb_msix =3D RTE_MIN(vsi->nb_qps, > + RTE_MAX_RXTX_INTR_VEC_ID); > } > - vsi->msix_intr =3D ret; > - vsi->nb_msix =3D RTE_MIN(vsi->nb_qps, > RTE_MAX_RXTX_INTR_VEC_ID); > } else if (type !=3D I40E_VSI_SRIOV) { > ret =3D i40e_res_pool_alloc(&pf->msix_pool, 1); > if (ret < 0) { > @@ -5540,7 +5562,8 @@ void > i40e_pf_disable_irq0(struct i40e_hw *hw) { > /* Disable all interrupt types */ > - I40E_WRITE_REG(hw, I40E_PFINT_DYN_CTL0, 0); > + I40E_WRITE_REG(hw, I40E_PFINT_DYN_CTL0, > + I40E_PFINT_DYN_CTL0_ITR_INDX_MASK); > I40E_WRITE_FLUSH(hw); > } >=20 > @@ -9861,10 +9884,12 @@ i40e_dev_get_dcb_info(struct rte_eth_dev *dev, =20 > static int i40e_dev_rx_queue_intr_enable(struct rte_eth_dev *dev,=20 > uint16_t queue_id) { > + struct i40e_pf *pf =3D > I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private); > struct rte_intr_handle *intr_handle =3D &dev->pci_dev->intr_handle; > struct i40e_hw *hw =3D > I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); > uint16_t interval =3D > - i40e_calc_itr_interval(RTE_LIBRTE_I40E_ITR_INTERVAL); > + i40e_calc_itr_interval(RTE_LIBRTE_I40E_ITR_INTERVAL, > + pf->support_multi_driver); > uint16_t msix_intr; >=20 > msix_intr =3D intr_handle->intr_vec[queue_id]; diff --git=20 > a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h=20 > index > 82d5501..77a4466 100644 > --- a/drivers/net/i40e/i40e_ethdev.h > +++ b/drivers/net/i40e/i40e_ethdev.h > @@ -720,10 +720,14 @@ i40e_align_floor(int n) } >=20 > static inline uint16_t > -i40e_calc_itr_interval(int16_t interval) > +i40e_calc_itr_interval(int16_t interval, bool is_multi_drv) > { > - if (interval < 0 || interval > I40E_QUEUE_ITR_INTERVAL_MAX) > - interval =3D I40E_QUEUE_ITR_INTERVAL_DEFAULT; > + if (interval < 0 || interval > I40E_QUEUE_ITR_INTERVAL_MAX) { > + if (is_multi_drv) > + interval =3D I40E_QUEUE_ITR_INTERVAL_MAX; > + else > + interval =3D I40E_QUEUE_ITR_INTERVAL_DEFAULT; > + } >=20 > /* Convert to hardware count, as writing each 1 represents 2 us */ > return interval / 2; > diff --git a/drivers/net/i40e/i40e_ethdev_vf.c > b/drivers/net/i40e/i40e_ethdev_vf.c > index 1686914..618c717 100644 > --- a/drivers/net/i40e/i40e_ethdev_vf.c > +++ b/drivers/net/i40e/i40e_ethdev_vf.c > @@ -1246,7 +1246,7 @@ i40evf_init_vf(struct rte_eth_dev *dev) > struct i40e_vf *vf =3D > I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private); > struct ether_addr *p_mac_addr; > uint16_t interval =3D > - i40e_calc_itr_interval(I40E_QUEUE_ITR_INTERVAL_MAX); > + i40e_calc_itr_interval(I40E_QUEUE_ITR_INTERVAL_MAX, 0); >=20 > vf->adapter =3D > I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); > vf->dev_data =3D dev->data; > @@ -1986,7 +1986,7 @@ i40evf_dev_rx_queue_intr_enable(struct > rte_eth_dev *dev, uint16_t queue_id) > struct rte_intr_handle *intr_handle =3D &dev->pci_dev->intr_handle; > struct i40e_hw *hw =3D > I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); > uint16_t interval =3D > - i40e_calc_itr_interval(RTE_LIBRTE_I40E_ITR_INTERVAL); > + i40e_calc_itr_interval(RTE_LIBRTE_I40E_ITR_INTERVAL, 0); > uint16_t msix_intr; >=20 > msix_intr =3D intr_handle->intr_vec[queue_id]; > -- > 2.5.5 >=20 >=20 >=20 > End of dev Digest, Vol 180, Issue 152 > *************************************