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 63E17A00C3; Mon, 8 Jun 2020 09:35:49 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B1FAB1BE3D; Mon, 8 Jun 2020 09:35:48 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 63042199BC for ; Mon, 8 Jun 2020 09:35:47 +0200 (CEST) IronPort-SDR: frL1SWDQaHJg7MKbqhdAs/ZBdoS8i97Squv9eaRL/kizLBlueENo/n7ZIbTJVh5eAgETPt/84F G1+mimnhJXUw== 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/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2020 00:35:46 -0700 IronPort-SDR: ppYjClAVXnJZFa+xdXiFjUC8Jlx3UjwMTUobZrgy6gRFhlEVBvoUaEispooIL0TvfN17c3v0mm BCyS8qydxTXw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,487,1583222400"; d="scan'208";a="258619155" Received: from orsmsx107.amr.corp.intel.com ([10.22.240.5]) by fmsmga007.fm.intel.com with ESMTP; 08 Jun 2020 00:35:46 -0700 Received: from orsmsx163.amr.corp.intel.com (10.22.240.88) by ORSMSX107.amr.corp.intel.com (10.22.240.5) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 8 Jun 2020 00:35:45 -0700 Received: from ORSEDG002.ED.cps.intel.com (10.7.248.5) by ORSMSX163.amr.corp.intel.com (10.22.240.88) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 8 Jun 2020 00:35:45 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.102) by edgegateway.intel.com (134.134.137.101) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 8 Jun 2020 00:35:45 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gNJlT03NJKH4/l+cV7uRFvIq1ellE+iHAPW9XdU3OzVZ4K5vbXCxxZySH23Uu9EYPK0RCd7r5Hcx+p7siEhqOYb4Rt8PGJ/pJbISFrt0UzYvsOUNhB8c0vISpYYalkisEbYGt5kFxv6agQqcamETR8dWUU2nPNTAChJsg68RQ/F4YPrNAAM4NZ49w3GPM4bDf9SZ9IC/Qno8lHq5Dtndxp0wVNg9kvSXkU2bWYjCu1Wk6ojYj1ta9VMGm/hqWJ4ZMJT7HJhPss104ok65ZgZg2RumRm5qo6FRFet5pxRKSn3ddMOq9wW6yTn+3oxiUbyh6uMBJQNzZAWGK8eZf81Ow== 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=OO5nGuOw67BQX6RYZQ5GNsJ20k93dSqElYtR9FvdoKI=; b=EvEWleKLl5l+fXVUEsIkIILOyc/OlxnV8Lnzyam3zTiUQgBwbNKqSBzD5hlZWooXQU3mEKH1v1zkl5nJaeEGFy2mkaIlvlpTJeykJqHctlZVqx2xZy9kGRj15MkHGpC0Ws+mPybtsAU9+BKOciLzt2HxbAQ+m6V6pXJ6S1A4lzowSSwN5f3U75UV2sRq1gepbAZmS1Tax67m16osCUYLoBbsFL2iBeWlf6s8Oo6iLJAFfZZAjFdCUO+YPHTJWSgGDO56PstdE0kP52j5zFGpszdELvqdtSRhVMOhLpaNwZZu3DWkievKrr4I+CH84d1aAowFK5/nboviSrt4czqlZQ== 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=OO5nGuOw67BQX6RYZQ5GNsJ20k93dSqElYtR9FvdoKI=; b=wFHoQoe3LwYCFm+s+f6rCO46B3grDyO1/zkQcwDl/IIELgdW+BGxJ7wu15CR388gKoy8myk5m/oTD/QE0hwex7Al31lcq2cS61Z60pkciUzlsk+UnSV2lhiWubyQKLOq+NInhyTPEbfEueDrxUOmXIGh5lOUuAqZQ9kyhL23dOE= Received: from BN6PR11MB0017.namprd11.prod.outlook.com (2603:10b6:405:6c::34) by BN6PR11MB0068.namprd11.prod.outlook.com (2603:10b6:405:69::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.23; Mon, 8 Jun 2020 07:35:43 +0000 Received: from BN6PR11MB0017.namprd11.prod.outlook.com ([fe80::c8eb:f4c9:5b58:3120]) by BN6PR11MB0017.namprd11.prod.outlook.com ([fe80::c8eb:f4c9:5b58:3120%6]) with mapi id 15.20.3066.023; Mon, 8 Jun 2020 07:35:43 +0000 From: "Yang, Qiming" To: "Xu, Ting" , "dev@dpdk.org" CC: "Zhang, Qi Z" , "Mcnamara, John" , "Kovacevic, Marko" Thread-Topic: [PATCH v1 09/12] net/ice: add queue start and stop for DCF Thread-Index: AQHWOzOG80+n10gdLke3UMwoINsvdqjOVzPw Date: Mon, 8 Jun 2020 07:35:43 +0000 Message-ID: References: <20200605201737.33766-1-ting.xu@intel.com> <20200605201737.33766-10-ting.xu@intel.com> In-Reply-To: <20200605201737.33766-10-ting.xu@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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.55.46.36] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 369a7eba-c30a-4c4d-c97c-08d80b7e8d4c x-ms-traffictypediagnostic: BN6PR11MB0068: 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:6; x-forefront-prvs: 042857DBB5 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: VsOalgpMBtUjmqWVHLYMc/zzz1jyhBypEnel5d+4YbyImJJtSFkCtVNJDUvCkGTuLgY4jPiVI2lQmaYNy3f8ZGMGMTgB3evba/uNoRZK20WPGQ6zVTEsDMVOCZsZuw8dibUEK3drea56btJ4/IiKpYx+c2OEP1M9+OVHD09NY00D9e2iup4QKrx333/UTY+1Sir/FyGTsiPOvv9X6Gef/u+gD32m/nwja4eJE52TG4OT59rnDdrqd04sH+VAgOWdu45xOsKeJVZGBo5TmW20QgHMgQTm3Om9wJfEaun4IVbMOkB0tekw3hvcZy17skkgQn4jNV08goXNNkfDP2U8wA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN6PR11MB0017.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(346002)(366004)(376002)(136003)(39860400002)(396003)(66556008)(66446008)(64756008)(107886003)(8676002)(66476007)(9686003)(66946007)(4326008)(55016002)(186003)(54906003)(316002)(26005)(53546011)(7696005)(6506007)(33656002)(478600001)(8936002)(110136005)(83380400001)(71200400001)(86362001)(52536014)(76116006)(5660300002)(2906002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: H0LzNYb/JUbd2fqYpb+D7ZDovgG2eMzWwwMunDyGISxWJBt1WRktsaruvY24vQm44LYVh1NTla6bwD41Ie9/4QyRxUcHG0inkKYnCGeVNyJbN87Y01dTBmdTz9g2X3zBulSbADiKOfOnA8TGcvLYrVMj+p+NB9Dz0jeyhtkP0lZdEsYR1l/4j+MoOxVJGQ677pGUla03YLoRipiALjt5+1vp/yY/Fgi6aGlRNy1z6kS5oSB4auxyEaYCxoewqKnG7CGs2MfhE4VZ0pYbkPvhtV+/t5aHN0jT2tw8gGzttmG1eu+ztPNrAFiFK9CafmjcFXGZQ+aWyjhkJAUq4wCWHpg25tazdxWiLrP1m6BiU0YONX6xAnLnYO65JAVENw8UV9bdVBwZRYTICSsk83PY5XCM3lj2NbEdfOKIbKss0s7evU8WOOMKKbjIAkPwXnfdsx1nJ4eW4sL1Fk8uc+BbE+P8St5r6ptT6MjN6P65h9o= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 369a7eba-c30a-4c4d-c97c-08d80b7e8d4c X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jun 2020 07:35:43.5520 (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: k3m+t/VJjVXjd+FkFyDzqhZFy9gUg+oJiV7DhF8Jsv3DsmuAc+m/wO56I4moDfYRA1fMLf/4hr2OtDPSPAlJOA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB0068 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v1 09/12] net/ice: add queue start and stop for DCF 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: Xu, Ting > Sent: Saturday, June 6, 2020 04:18 > To: dev@dpdk.org > Cc: Zhang, Qi Z ; Yang, Qiming > ; Mcnamara, John ; > Kovacevic, Marko > Subject: [PATCH v1 09/12] net/ice: add queue start and stop for DCF >=20 > From: Qi Zhang >=20 > Add queue start and stop in DCF. Support queue enable and disable through > virtual channel. Add support for Rx queue mbufs allocation and queue rese= t. >=20 > Signed-off-by: Qi Zhang > --- > drivers/net/ice/ice_dcf.c | 57 ++++++ > drivers/net/ice/ice_dcf.h | 3 +- > drivers/net/ice/ice_dcf_ethdev.c | 309 > +++++++++++++++++++++++++++++++ > 3 files changed, 368 insertions(+), 1 deletion(-) >=20 Snip... > +} > diff --git a/drivers/net/ice/ice_dcf.h b/drivers/net/ice/ice_dcf.h index > 9470d1df7..68e1661c0 100644 > --- a/drivers/net/ice/ice_dcf.h > +++ b/drivers/net/ice/ice_dcf.h > @@ -70,5 +70,6 @@ void ice_dcf_uninit_hw(struct rte_eth_dev *eth_dev, > struct ice_dcf_hw *hw); int ice_dcf_init_rss(struct ice_dcf_hw *hw); in= t > ice_dcf_configure_queues(struct ice_dcf_hw *hw); int > ice_dcf_config_irq_map(struct ice_dcf_hw *hw); > - > +int ice_dcf_switch_queue(struct ice_dcf_hw *hw, uint16_t qid, bool rx, > +bool on); int ice_dcf_disable_queues(struct ice_dcf_hw *hw); > #endif /* _ICE_DCF_H_ */ > diff --git a/drivers/net/ice/ice_dcf_ethdev.c > b/drivers/net/ice/ice_dcf_ethdev.c > index 9605fb8ed..59113fc4b 100644 > --- a/drivers/net/ice/ice_dcf_ethdev.c > +++ b/drivers/net/ice/ice_dcf_ethdev.c > @@ -226,6 +226,259 @@ static int ice_dcf_config_rx_queues_irqs(struct > rte_eth_dev *dev, > return 0; > } >=20 . > +static int > +ice_dcf_start_queues(struct rte_eth_dev *dev) { > + struct ice_rx_queue *rxq; > + struct ice_tx_queue *txq; > + int i; > + > + for (i =3D 0; i < dev->data->nb_tx_queues; i++) { > + txq =3D dev->data->tx_queues[i]; > + if (txq->tx_deferred_start) > + continue; > + if (ice_dcf_tx_queue_start(dev, i) !=3D 0) { > + PMD_DRV_LOG(ERR, "Fail to start queue %u", i); > + return -1; If queue start fail, should stop the queue already started > + } > + } > + > + for (i =3D 0; i < dev->data->nb_rx_queues; i++) { > + rxq =3D dev->data->rx_queues[i]; > + if (rxq->rx_deferred_start) > + continue; > + if (ice_dcf_rx_queue_start(dev, i) !=3D 0) { > + PMD_DRV_LOG(ERR, "Fail to start queue %u", i); > + return -1; > + } > + } > + > + return 0; > +} > + > static int > ice_dcf_dev_start(struct rte_eth_dev *dev) { @@ -266,20 +519,72 @@ > ice_dcf_dev_start(struct rte_eth_dev *dev) > return ret; > } >=20 > + if (dev->data->dev_conf.intr_conf.rxq !=3D 0) { > + rte_intr_disable(intr_handle); > + rte_intr_enable(intr_handle); > + } > + > + ret =3D ice_dcf_start_queues(dev); > + if (ret) { > + PMD_DRV_LOG(ERR, "Failed to enable queues"); > + return ret; > + } > + > dev->data->dev_link.link_status =3D ETH_LINK_UP; >=20 > return 0; > } >=20 > +static void > +ice_dcf_stop_queues(struct rte_eth_dev *dev) { > + struct ice_dcf_adapter *ad =3D dev->data->dev_private; > + struct ice_dcf_hw *hw =3D &ad->real_hw; > + struct ice_rx_queue *rxq; > + struct ice_tx_queue *txq; > + int ret, i; > + > + /* Stop All queues */ > + ret =3D ice_dcf_disable_queues(hw); > + if (ret) > + PMD_DRV_LOG(WARNING, "Fail to stop queues"); > + > + for (i =3D 0; i < dev->data->nb_tx_queues; i++) { > + txq =3D dev->data->tx_queues[i]; > + if (!txq) > + continue; > + txq->tx_rel_mbufs(txq); > + reset_tx_queue(txq); > + dev->data->tx_queue_state[i] =3D > RTE_ETH_QUEUE_STATE_STOPPED; > + } > + for (i =3D 0; i < dev->data->nb_rx_queues; i++) { > + rxq =3D dev->data->rx_queues[i]; > + if (!rxq) > + continue; > + rxq->rx_rel_mbufs(rxq); > + reset_rx_queue(rxq); > + dev->data->rx_queue_state[i] =3D > RTE_ETH_QUEUE_STATE_STOPPED; > + } > +} > + > static void > ice_dcf_dev_stop(struct rte_eth_dev *dev) { > struct ice_dcf_adapter *dcf_ad =3D dev->data->dev_private; > + struct rte_intr_handle *intr_handle =3D dev->intr_handle; > struct ice_adapter *ad =3D &dcf_ad->parent; >=20 > if (ad->pf.adapter_stopped =3D=3D 1) > return; >=20 > + ice_dcf_stop_queues(dev); > + > + rte_intr_efd_disable(intr_handle); > + if (intr_handle->intr_vec) { > + rte_free(intr_handle->intr_vec); > + intr_handle->intr_vec =3D NULL; > + } > + > dev->data->dev_link.link_status =3D ETH_LINK_DOWN; > ad->pf.adapter_stopped =3D 1; > } > @@ -476,6 +781,10 @@ static const struct eth_dev_ops > ice_dcf_eth_dev_ops =3D { > .tx_queue_setup =3D ice_tx_queue_setup, > .rx_queue_release =3D ice_rx_queue_release, > .tx_queue_release =3D ice_tx_queue_release, > + .rx_queue_start =3D ice_dcf_rx_queue_start, > + .tx_queue_start =3D ice_dcf_tx_queue_start, > + .rx_queue_stop =3D ice_dcf_rx_queue_stop, > + .tx_queue_stop =3D ice_dcf_tx_queue_stop, > .link_update =3D ice_dcf_link_update, > .stats_get =3D ice_dcf_stats_get, > .stats_reset =3D ice_dcf_stats_reset, > -- > 2.17.1