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 541DAA054B; Thu, 16 Jul 2020 15:57:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1AED01D59F; Thu, 16 Jul 2020 15:57:12 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id BBDAD1D59E for ; Thu, 16 Jul 2020 15:57:10 +0200 (CEST) IronPort-SDR: i+12i1aI9GmKQNIpeBE0sFYZ1ESVtop1v3eTJGrNwrwJeTRsLhdl7agwHuSOMOOfCqFq44W7Uv vpSyATDrgIGQ== X-IronPort-AV: E=McAfee;i="6000,8403,9683"; a="234236457" X-IronPort-AV: E=Sophos;i="5.75,359,1589266800"; d="scan'208";a="234236457" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jul 2020 06:57:09 -0700 IronPort-SDR: hcg0d69IChgunwXJ3VwhFi78qvtMhL8XJ4/LviYA5jyzX5P/UvB00vL7DV/NcUZWVfLkiwTf+X GwYJknxBDl7A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,359,1589266800"; d="scan'208";a="391100802" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga001.fm.intel.com with ESMTP; 16 Jul 2020 06:57:09 -0700 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 16 Jul 2020 06:57:09 -0700 Received: from FMSEDG001.ED.cps.intel.com (10.1.192.133) by fmsmsx116.amr.corp.intel.com (10.18.116.20) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 16 Jul 2020 06:57:08 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.174) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 16 Jul 2020 06:57:08 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RBl9vQ0a318QC1Z43wCqtz7VqzwC4P/3Gh5oGol97h5GsOGViiO6ZgEoTajRRr4a0o4TW9lJfL9KucewlMR+GCVHd5MoFRnoncNQ6Vt6wy3xPogeh6aRsz1Y8nQu02HQKAxAO4lWEeVFPl3y0bZOZwp/6Bm/AFLACCZG7O6vmJv73vwd5q9szI8MPUw3wlrY3zLcNM5irLXavY9IR77StRxQTnouxqPZtvu7xJgySLHCojKk0ts74UIE0qOJYUuBQhEFZNohQuiIagXwgKPreWyr7r2y4CMwqmKt3rUIl8/t1dhCAcxDHw2EKtO0POmbR/f5XM0jE7D7tQm1NeRTlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=j7UKi8o5hbQVdFA1YJIxRFj5o9wt/SU9g3HynGDdb7k=; b=WoetIRRVUN9rVp/ACdgkMN8nuextRpxSgOwThS/ZRXr/quD0/mvFTjrz+82uPqNzKec2az2OADaxEc+Rc0BdXSBPqQFDRL5C77nfarGSgetWf9BrVUtZMTiOJcBiFazFXgkjAzGZ1EOU5Gs4FN0QVQVBuRlZFlcEESPvDOgrzFpYH04VfOxcUG9om5fung8B2sHzwu234jc0feg80VWT8YByvJzAng7Rt0ueNbAiVxJctzqi6L29ZMEDKL/KarQ2+xyVuJe35HumivZ4271qECvO2lsF6YVCKf77oZR6KAaB4P9QfFTR5g/nRA6IHUelujencNfYKHXMSlkglGJvVA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=j7UKi8o5hbQVdFA1YJIxRFj5o9wt/SU9g3HynGDdb7k=; b=W6j668zc6yTYfCak3UffR+0jwvfLTy5wawB+twfd5A6W1QT3iu7wjYC9LFq8E7OyIuxNR98SIDER5zdxOZvLqi3mtUnQKxA52VB3ZaU7otbbt3NgOISXIO4r+WcrdHDSHgHGDSCX2LkG6+fm1QYEDsipL/RNxNeODvRP8bvLPNo= Received: from BN6PR11MB4052.namprd11.prod.outlook.com (2603:10b6:405:7a::37) by BN6PR11MB4050.namprd11.prod.outlook.com (2603:10b6:405:7e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.20; Thu, 16 Jul 2020 13:57:07 +0000 Received: from BN6PR11MB4052.namprd11.prod.outlook.com ([fe80::c8cb:b0d5:692d:46bb]) by BN6PR11MB4052.namprd11.prod.outlook.com ([fe80::c8cb:b0d5:692d:46bb%6]) with mapi id 15.20.3174.025; Thu, 16 Jul 2020 13:57:07 +0000 From: "Wu, Jingjing" To: "Sun, Chenmin" , "Zhang, Qi Z" , "Xing, Beilei" , "Wang, Haiyue" CC: "dev@dpdk.org" Thread-Topic: [PATCH V4 4/4] net/i40e: FDIR update rate optimization Thread-Index: AQHWWpaiKqIsHHO0/0eCrNyPI3qM2qkKMX7w Date: Thu, 16 Jul 2020 13:57:06 +0000 Message-ID: References: <20200713222321.2118-1-chenmin.sun@intel.com> <20200715195329.34699-1-chenmin.sun@intel.com> <20200715195329.34699-5-chenmin.sun@intel.com> In-Reply-To: <20200715195329.34699-5-chenmin.sun@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.2.0.6 authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.147.218] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6a219d23-ffb1-4d6d-d538-08d829902085 x-ms-traffictypediagnostic: BN6PR11MB4050: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 6KbBoKOEf9W/HuqwuF9PUYfFc9gaoM1u0QEcaRsseTMvglkwOeRkCfefNB+ZCwwHqkK+6h2YoWRvuO0vIMDw2mwALR0W+HPmEiOSzRqbc90O4XVVigO1g4/xRTOW/L9FUE29ndyil74bWX++sfISFX20y/fvOl5zeiZ50BVyp299wTtOqjn6UoumWBmZvhlrCMbtRdDK/MFyUpoUzupZFSiUuOc22yn67if3ME40EQoZG9bzgE3H4l/1Q6hpPLQvXk7PWmP/Cfw6eQ6796tJNTKtcoT7JuMejysYzqG95dtDA8I/czAr5DDCUNtWeHUbY2AQyZGLbL5j0s9SfhSNDA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN6PR11MB4052.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(136003)(366004)(376002)(346002)(396003)(2906002)(478600001)(186003)(4326008)(15650500001)(76116006)(7696005)(6636002)(5660300002)(66946007)(86362001)(83380400001)(26005)(9686003)(110136005)(33656002)(66446008)(66476007)(52536014)(71200400001)(55016002)(8676002)(316002)(6506007)(66556008)(64756008)(8936002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: pZ+E9JLwR7BU3y/zpIDgSID/z3MbQtzItIj4DwIjJgnxzzqZLTP62CKZxIiba8OZaw/jvID2Yh+Y6c4Uu1yRGL6dAxR+1YYfv/FH2TXjlN0m8SwG5MZ7Wv9Ll6NcQ5N4HNCzL1mo2dp/j3W1uinXlqnffixFWZbjWCf6A2CrOSUxRiFOoOQEHedfcboxWp6NJi/C0IkJ77gMpEpV9r2DPxqsch+lrgey2tqR4PceOIhCX0Ieegz6zak+2wX6TiXWBf23AF2vtjuYuhMtYqG9mwkb9ud2PIKdZgRl6F+Oa93kDVNMgqlS+XNF2Nfu5+ty+13e82eSUhwRTlmVn16rSeKlzNGmas6Oq6e7txHncJU3ONv1pCebdO3mAAuu5vlz6x3fXcgtK4vlXUPE997Il/L7ra8pbCapQoRk5Eg/4Ll3ugSrdTQGJcEDlNnAxnlog5pLsWCuOgF+fMNQWo1d6JKtrrdAJ/Pnmnb8Ov8W/3YOFWvEjxM1Cw+96mlClE/C Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN6PR11MB4052.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6a219d23-ffb1-4d6d-d538-08d829902085 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Jul 2020 13:57:06.9477 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: bDoyI57sTGe/w4zH//pFJzYAkEQG3K5Ax0YU5BO1CnBoUEt+mywuExIAjusW4BpgPDeRrL3gExzdQuMpW2NTsQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB4050 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH V4 4/4] net/i40e: FDIR update rate optimization 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" [...] > +static inline unsigned char * > +i40e_find_available_buffer(struct rte_eth_dev *dev) > +{ > + struct i40e_pf *pf =3D I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private); > + struct i40e_fdir_info *fdir_info =3D &pf->fdir; > + struct i40e_tx_queue *txq =3D pf->fdir.txq; > + volatile struct i40e_tx_desc *txdp =3D &txq->tx_ring[txq->tx_tail + 1]; > + uint32_t i; > + > + /* no available buffer > + * search for more available buffers from the current > + * descriptor, until an unavailable one > + */ > + if (fdir_info->txq_available_buf_count <=3D 0) { > + uint16_t tmp_tail; > + volatile struct i40e_tx_desc *tmp_txdp; > + > + tmp_tail =3D txq->tx_tail; > + tmp_txdp =3D &txq->tx_ring[tmp_tail + 1]; > + > + do { > + if ((tmp_txdp->cmd_type_offset_bsz & > + > rte_cpu_to_le_64(I40E_TXD_QW1_DTYPE_MASK)) =3D=3D > + > rte_cpu_to_le_64(I40E_TX_DESC_DTYPE_DESC_DONE)) > + fdir_info->txq_available_buf_count++; > + else > + break; > + > + tmp_tail +=3D 2; > + if (tmp_tail >=3D txq->nb_tx_desc) > + tmp_tail =3D 0; > + } while (tmp_tail !=3D txq->tx_tail); > + } > + > + /* > + * if txq_available_buf_count > 0, just use the next one is ok, > + * else wait for the next DD until it's set to make sure the data > + * had been fetched by hardware > + */ > + if (fdir_info->txq_available_buf_count > 0) { > + fdir_info->txq_available_buf_count--; > + } else { > + /* wait until the tx descriptor is ready */ > + for (i =3D 0; i < I40E_FDIR_MAX_WAIT_US; i++) { > + if ((txdp->cmd_type_offset_bsz & > + > rte_cpu_to_le_64(I40E_TXD_QW1_DTYPE_MASK)) =3D=3D > + > rte_cpu_to_le_64(I40E_TX_DESC_DTYPE_DESC_DONE)) > + break; > + rte_delay_us(1); > + } > + if (i >=3D I40E_FDIR_MAX_WAIT_US) { > + PMD_DRV_LOG(ERR, > + "Failed to program FDIR filter: time out to get DD on tx > queue."); > + return NULL; > + } > + } Why wait for I40E_FDIR_MAX_WAIT_US but not return NULL immediately? [...] > i40e_flow_fdir_filter_programming(struct i40e_pf *pf, > enum i40e_filter_pctype pctype, > const struct i40e_fdir_filter_conf *filter, > - bool add) > + bool add, bool wait_status) > { > struct i40e_tx_queue *txq =3D pf->fdir.txq; > struct i40e_rx_queue *rxq =3D pf->fdir.rxq; > @@ -2011,8 +2092,10 @@ i40e_flow_fdir_filter_programming(struct i40e_pf *= pf, > volatile struct i40e_tx_desc *txdp; > volatile struct i40e_filter_program_desc *fdirdp; > uint32_t td_cmd; > - uint16_t vsi_id, i; > + uint16_t vsi_id; > uint8_t dest; > + uint32_t i; > + uint8_t retry_count =3D 0; >=20 > PMD_DRV_LOG(INFO, "filling filter programming descriptor."); > fdirdp =3D (volatile struct i40e_filter_program_desc *) > @@ -2087,7 +2170,8 @@ i40e_flow_fdir_filter_programming(struct i40e_pf *p= f, >=20 > PMD_DRV_LOG(INFO, "filling transmit descriptor."); > txdp =3D &txq->tx_ring[txq->tx_tail + 1]; > - txdp->buffer_addr =3D rte_cpu_to_le_64(pf->fdir.dma_addr); > + txdp->buffer_addr =3D rte_cpu_to_le_64(pf->fdir.dma_addr[txq->tx_tail /= 2]); > + [txq->tx_tail / 2] is not readable, how about use the avail pkt you get dir= ectly? Or another index to identify it? =20 > td_cmd =3D I40E_TX_DESC_CMD_EOP | > I40E_TX_DESC_CMD_RS | > I40E_TX_DESC_CMD_DUMMY; > @@ -2100,25 +2184,34 @@ i40e_flow_fdir_filter_programming(struct i40e_pf = *pf, > txq->tx_tail =3D 0; > /* Update the tx tail register */ > rte_wmb(); > + > + /* capture the previous error report(if any) from rx ring */ > + while ((i40e_check_fdir_programming_status(rxq) < 0) && > + (++retry_count < 100)) > + PMD_DRV_LOG(INFO, "previous error report captured."); > + Why check FDIR ring for 100 times? And "&&" is used here, the log is only p= rint if the 100th check fails?=20 >=20 > -- > 2.17.1