From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 87BBDA04AF;
	Thu, 17 Sep 2020 14:50:12 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id B20201C10B;
	Thu, 17 Sep 2020 14:50:11 +0200 (CEST)
Received: from mga02.intel.com (mga02.intel.com [134.134.136.20])
 by dpdk.org (Postfix) with ESMTP id EB4611BEA1
 for <dev@dpdk.org>; Thu, 17 Sep 2020 14:50:09 +0200 (CEST)
IronPort-SDR: 4KuIEhg+07I5hq0dvIKv0AoLrc5Tc6yxxBfV1Sg0t6x7p3gElQp9C8FcB/z2IZjMGlcSJdPA8V
 AI38R/nFxKow==
X-IronPort-AV: E=McAfee;i="6000,8403,9746"; a="147373836"
X-IronPort-AV: E=Sophos;i="5.76,437,1592895600"; d="scan'208";a="147373836"
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from orsmga005.jf.intel.com ([10.7.209.41])
 by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 17 Sep 2020 05:50:02 -0700
IronPort-SDR: s5JZ+opvNgZ+WFD1k+2Ty5N+gbCMY+zZdB1BqDHc31Iv9fK+h1/6dqcHJdaz+D7Mw4Iday/AxT
 ks/8egKuuXmg==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.76,436,1592895600"; d="scan'208";a="483731752"
Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15])
 by orsmga005.jf.intel.com with ESMTP; 17 Sep 2020 05:50:01 -0700
Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by
 ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.1713.5; Thu, 17 Sep 2020 05:50:01 -0700
Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by
 orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5
 via Frontend Transport; Thu, 17 Sep 2020 05:50:01 -0700
Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.170)
 by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.1.1713.5; Thu, 17 Sep 2020 05:49:59 -0700
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=bcNBznktSQUMn3FaMWsdIYU9YP9MB8Xz/0gZ01zFMyngI+kamrrkrgKhlB0fG/oI8khwxhjrXCTgt4yByQjlkFEclKhq8gNlOfeuJ1Fq3mKbKZl9wp+GLi+gfDJN9TyWTqf9BGyYvVkxuLg3AYhl1WfKUkcc1iTU1cZvKaf11cfHJqOB+X6SWK0NyBVshDZwTkT64OsLq3BUhMotx/0rWWa5UVeM0pIzkNYNrU8JVdHMWHcI1FvZC+zD4n32tLJIjd8O7WbCHbGT4uda6L5fL4ur+msI1lJljV+EJ+WF5sHtYuBSjO59kgYF9V27ecYdYfJEzTl3jeWlU1ZCc4Rg6A==
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=fG+TUMSrul5veBei344Tmf3pDJVDFWYKmorRPv2NqM4=;
 b=MDiZLgif1U6c094Mcfko7GazX3xe2FBeB//14p+5Ka/HkDO+erF2HR/lVHos5fWUPajiLcpaveOvX62WDo/Eo564Tb/vZBNi8x+cVtv4+K1mgwfi1rQyIUIUIgfdyM3jm9YTTe8HdEVsBjIA0SglQBKmeKCJ40EXLpU0CI6YGJrpIiHoh4tH49kaDl60mwHtXLSOqzFWQiYdf2Adjcu6bPdqJz19vXF5i6K9Y7OUa39KbcOogCkKt4NE4QG5OraTnioNjl5O38Dao8Lm3Q5VRhW8bLddyKInaNpj2IYGaQwbsWcfVeKN0NdMtNUdZSmJUmUmxz9JhWqvmWP72/JQiw==
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=fG+TUMSrul5veBei344Tmf3pDJVDFWYKmorRPv2NqM4=;
 b=YEQ+taVC1xiFkrma+xt5nbEcIqntH1C+mMs1MXEXAclta13u5TJdS8gI8CH0XiIxGbHLyxwmz9jrQtWunySz+EAwr5/9QvxwFCS4UFuiqbqomSrdqd2Z33arhMCDP5mNLLc7JTdQTEC3H3NMVvKOAkKjB45xr7QGNcKrUmpIOz8=
Received: from BYAPR11MB3301.namprd11.prod.outlook.com (2603:10b6:a03:7f::26)
 by BYAPR11MB3621.namprd11.prod.outlook.com (2603:10b6:a03:fc::32)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.16; Thu, 17 Sep
 2020 12:49:58 +0000
Received: from BYAPR11MB3301.namprd11.prod.outlook.com
 ([fe80::f43b:a137:dab8:8b0b]) by BYAPR11MB3301.namprd11.prod.outlook.com
 ([fe80::f43b:a137:dab8:8b0b%6]) with mapi id 15.20.3391.011; Thu, 17 Sep 2020
 12:49:57 +0000
From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
To: "Min Hu (Connor)" <humin29@huawei.com>, "dev@dpdk.org" <dev@dpdk.org>
CC: "thomas@monjalon.net" <thomas@monjalon.net>, "arybchenko@solarflare.com"
 <arybchenko@solarflare.com>, "Yigit, Ferruh" <ferruh.yigit@intel.com>,
 "linuxarm@huawei.com" <linuxarm@huawei.com>
Thread-Topic: [V5 1/3] ethdev: introduce FEC API
Thread-Index: AQHWjNA5qzveYw6BFUKlVHaXueoa1Klsx9BQ
Date: Thu, 17 Sep 2020 12:49:56 +0000
Message-ID: <BYAPR11MB3301F303CE9B397329B92C659A3E0@BYAPR11MB3301.namprd11.prod.outlook.com>
References: <1599534347-20430-1-git-send-email-humin29@huawei.com>
 <1600332730-44952-1-git-send-email-humin29@huawei.com>
 <1600332730-44952-2-git-send-email-humin29@huawei.com>
In-Reply-To: <1600332730-44952-2-git-send-email-humin29@huawei.com>
Accept-Language: en-GB, 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.5.1.3
authentication-results: huawei.com; dkim=none (message not signed)
 header.d=none;huawei.com; dmarc=none action=none header.from=intel.com;
x-originating-ip: [46.7.39.127]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 893790f5-14ae-4cf3-68c7-08d85b082f06
x-ms-traffictypediagnostic: BYAPR11MB3621:
x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr
x-ms-exchange-transport-forked: True
x-microsoft-antispam-prvs: <BYAPR11MB362125B231893F7145EF34EE9A3E0@BYAPR11MB3621.namprd11.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:7691;
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: TbTKnmHXRlUN7mcn/7MS/9UBDaOGQTjlBr9tj083mhE9wU/gRwtxR/pdK9yaWQHVJlLHRPSf4qd8d8ec0Lbf+wxSUx5ye1hp94L2l1DsA5hTfDX+/r2jO0ieoVS/WG1rQVZ0gLYa2Frnkkrgxwo2+wF13wuB7w8A4cCC8jBQ1GRFoU2Xt3Igfh12wu0eZDPI3isJfZeiIFjqGl28NpI1xbAWKdQBo/aIg3T5dQI0hYSWCq7RsRmIWVeATniCxjR+4/MvyNzmHXUmTmsKzKx1J3Id3Nt593GIT1/JO3eh7Qq/H8tHPN0QnzCsJ0XBpqHY
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
 IPV:NLI; SFV:NSPM; H:BYAPR11MB3301.namprd11.prod.outlook.com; PTR:; CAT:NONE;
 SFS:(4636009)(136003)(396003)(346002)(39860400002)(376002)(366004)(6506007)(4326008)(83380400001)(478600001)(66476007)(316002)(7696005)(66446008)(54906003)(66556008)(64756008)(8676002)(66946007)(5660300002)(8936002)(2906002)(71200400001)(52536014)(55016002)(86362001)(186003)(33656002)(110136005)(30864003)(76116006)(26005)(9686003);
 DIR:OUT; SFP:1102; 
x-ms-exchange-antispam-messagedata: TyEoiSyeIkr+M0/JOfxdAaBPWRQwDYCiMs2bQGIjzenUt05UoSpt85c9CofcYhO4F4QOsAX2AfE8BYHmURpZ0mOsWS6Z6KOvYT2La+FK3nNtTL5K6HQRu7vwX6m40NB9tmed44ZGoNwtJXMYpWn66pJDdX7NZZ+dXNx0+jxMG78kKtCILVuzfamrMun7/0z2rXZ9IxK5eqMx9rvMjO4VAMZaLxrpmG6Is8EQx8Zadvl1K5tlPtzKCXDJ5DBU2UHjYkzFEtk2S8OoxvF960SMF+zjSnVUiV9rxoYpUlYjec+d88vUdbZVTZRB8eQ9Q61dRYX9KyawjAEsJOUsgBf4VYmAVLWTX2z7F/G3rVKgu1/ZOaXbPqEt2B2wRY35aH2RdDSKNfA2YgW/hYuP1PvgF+NJ4OR8r5m9MpL9AjY5Gx8E8915PEoNo1uIBtU3gaqM4AswfhwMess2LoPvY5Bhrxg0+GXgO0uyoBweM0tq/CKCMe9bSL/Q/lkvTOlebDUGvxTJEhjCQvCH4SDvdaZcJ8LYYtnPQW3j0Xr/AC2CP88qNc5/PLKYKZvuOoNfwgIFnoVgEPRqcdNrgEFdZMTiOE43veOc/Tgv3GtrNFC3seDaLK+ukisl++c2G6rYoc2f8JxqCTPbQGZ/OmWZG/5TkQ==
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: BYAPR11MB3301.namprd11.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 893790f5-14ae-4cf3-68c7-08d85b082f06
X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Sep 2020 12:49:57.3663 (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: mtHXmR4dYHPsbEHayseugZKL2k0eNf9F0s3MLCIbxijHHVy/OnFb/3wC7um6rBIzGj4vSJ9UJub/6yhNGdTtOEjzEFEvryDV0aRn2bQTBsU=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3621
X-OriginatorOrg: intel.com
Subject: Re: [dpdk-dev] [V5 1/3] ethdev: introduce FEC API
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>


>=20
> This patch adds Forward error correction(FEC) support for ethdev.
> Introduce APIs which support query and config FEC information in
> hardware.
>=20
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> Reviewed-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
> Reviewed-by: Chengwen Feng <fengchengwen@huawei.com>
> Reviewed-by: Chengchang Tang <tangchengchang@huawei.com>
> ---
> v4->v5:
> Modifies FEC capa definitions using macros.
> Add RTE_ prefix for public FEC mode enum.
> add release notes about FEC for dpdk20_11.
>=20
> ---
> v2->v3:
> add function return value "-ENOTSUP" for API
>=20
> ---
>  doc/guides/rel_notes/release_20_11.rst   | 13 +++++
>  lib/librte_ethdev/rte_ethdev.c           | 50 +++++++++++++++++++
>  lib/librte_ethdev/rte_ethdev.h           | 83 ++++++++++++++++++++++++++=
++++++
>  lib/librte_ethdev/rte_ethdev_core.h      | 77 ++++++++++++++++++++++++++=
+++
>  lib/librte_ethdev/rte_ethdev_version.map |  5 ++
>  5 files changed, 228 insertions(+)
>=20
> diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_note=
s/release_20_11.rst
> index cc72609..e4f0587 100644
> --- a/doc/guides/rel_notes/release_20_11.rst
> +++ b/doc/guides/rel_notes/release_20_11.rst
> @@ -55,6 +55,19 @@ New Features
>       Also, make sure to start the actual text at the margin.
>       =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D
>=20
> +* **Added the FEC Library, a generic FEC query and config library.**
> +
> +  Added the FEC library which provides an API for query FEC capabilities=
 and
> +  FEC mode from device. Also, API for configuring FEC mode is also provi=
ded.
> +
> +  Added hns3 FEC PMD, for supporting query and config FEC mode.
> +
> +* **Updated testpmd with a command for FEC.**
> +
> +  Added a FEC command to testpmd app,
> +  ``show port <port_id> fec capabilities`` which queries FEC capabilitie=
s device supports.
> +  ``show port <port_id> fec_mode`` which queries FEC mode from device.
> +  ``set port <port_id> fec_mode <auto|off|rs|baser>`` which configures F=
EC mode to device.
>=20
>  Removed Items
>  -------------
> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethde=
v.c
> index 7858ad5..fde77c1 100644
> --- a/lib/librte_ethdev/rte_ethdev.c
> +++ b/lib/librte_ethdev/rte_ethdev.c
> @@ -3642,6 +3642,56 @@ rte_eth_led_off(uint16_t port_id)
>  	return eth_err(port_id, (*dev->dev_ops->dev_led_off)(dev));
>  }
>=20
> +int
> +rte_eth_fec_get_capability(uint16_t port_id, uint32_t *fec_cap)
> +{
> +	struct rte_eth_dev *dev;
> +
> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> +	dev =3D &rte_eth_devices[port_id];
> +	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->fec_get_capability, -ENOTSUP);
> +	return eth_err(port_id, (*dev->dev_ops->fec_get_capability)(dev,
> +								fec_cap));
> +}
> +
> +int
> +rte_eth_fec_get(uint16_t port_id, enum rte_fec_mode *mode)
> +{
> +	struct rte_eth_dev *dev;
> +
> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> +	dev =3D &rte_eth_devices[port_id];
> +	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->fec_get, -ENOTSUP);
> +	return eth_err(port_id, (*dev->dev_ops->fec_get)(dev, mode));
> +}
> +
> +int
> +rte_eth_fec_set(uint16_t port_id, enum rte_fec_mode mode)
> +{
> +	struct rte_eth_dev *dev;
> +	uint32_t fec_mode_mask;
> +	int ret;
> +
> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> +
> +	ret =3D rte_eth_fec_get_capability(port_id, &fec_mode_mask);
> +	if (ret)
> +		return ret;
> +
> +	/*
> +	 * Check whether the configured mode is within the FEC capability.
> +	 * If not, the configured mode will not be supported.
> +	 */
> +	if (!(fec_mode_mask & (1U << (uint32_t)mode))) {
> +		RTE_ETHDEV_LOG(ERR, "unsupported fec mode=3D%d\n", mode);
> +		return -EINVAL;
> +	}
> +
> +	dev =3D &rte_eth_devices[port_id];
> +	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->fec_set, -ENOTSUP);
> +	return eth_err(port_id, (*dev->dev_ops->fec_set)(dev, mode));
> +}
> +
>  /*
>   * Returns index into MAC address array of addr. Use 00:00:00:00:00:00 t=
o find
>   * an empty spot.
> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethde=
v.h
> index 70295d7..aa79326 100644
> --- a/lib/librte_ethdev/rte_ethdev.h
> +++ b/lib/librte_ethdev/rte_ethdev.h
> @@ -1511,6 +1511,25 @@ struct rte_eth_dcb_info {
>  	struct rte_eth_dcb_tc_queue_mapping tc_queue;
>  };
>=20
> +/**
> + * This enum indicates the possible (forward error correction)FEC modes
> + * of an ethdev port.
> + */
> +enum rte_fec_mode {
> +	RTE_ETH_FEC_NOFEC =3D 0,      /**< FEC is off */
> +	RTE_ETH_FEC_BASER,          /**< FEC using common algorithm */
> +	RTE_ETH_FEC_RS,             /**< FEC using RS algorithm */
> +	RTE_ETH_FEC_AUTO,           /**< FEC autonegotiation modes */
> +	RTE_ETH_FEC_NUM

It is better not to have RTE_ETH_FEC_NUM here:
Any future additions to that enum would overwrite _NUM values and would
considered as ABI breakage.
Aprart from that:
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

> +};
> +
> +/* This indicates FEC capabilities */
> +#define RTE_ETH_FEC_CAPA_NOFEC  (1U << RTE_ETH_FEC_NOFEC)
> +#define RTE_ETH_FEC_CAPA_BASER  (1U << RTE_ETH_FEC_BASER)
> +#define RTE_ETH_FEC_CAPA_RS     (1U << RTE_ETH_FEC_RS)
> +#define RTE_ETH_FEC_CAPA_AUTO   (1U << RTE_ETH_FEC_AUTO)
> +
> +
>  #define RTE_ETH_ALL RTE_MAX_ETHPORTS
>=20
>  /* Macros to check for valid port */
> @@ -3328,6 +3347,70 @@ int  rte_eth_led_on(uint16_t port_id);
>  int  rte_eth_led_off(uint16_t port_id);
>=20
>  /**
> + * @warning
> + * @b EXPERIMENTAL: this API may change, or be removed, without prior no=
tice
> + *
> + * Get Forward Error Correction(FEC) capability.
> + *
> + * @param port_id
> + *   The port identifier of the Ethernet device.
> + * @param fec_cap
> + *   returns the FEC capability from the device, as follows:
> + *   RTE_ETH_FEC_CAPA_NOFEC
> + *   RTE_ETH_FEC_CAPA_BASER
> + *   RTE_ETH_FEC_CAPA_RS
> + *   RTE_ETH_FEC_CAPA_AUTO
> + * @return
> + *   - (0) if successful.
> + *   - (-ENOTSUP) if underlying hardware OR driver doesn't support.
> + *     that operation.
> + *   - (-EIO) if device is removed.
> + *   - (-ENODEV)  if *port_id* invalid.
> + */
> +__rte_experimental
> +int rte_eth_fec_get_capability(uint16_t port_id, uint32_t *fec_cap);
> +
> +/**
> + * @warning
> + * @b EXPERIMENTAL: this API may change, or be removed, without prior no=
tice
> + *
> + * Get current Forward Error Correction(FEC) mode.
> + *
> + * @param port_id
> + *   The port identifier of the Ethernet device.
> + * @param mode
> + *   returns the FEC mode from the device.
> + * @return
> + *   - (0) if successful.
> + *   - (-ENOTSUP) if underlying hardware OR driver doesn't support.
> + *     that operation.
> + *   - (-EIO) if device is removed.
> + *   - (-ENODEV)  if *port_id* invalid.
> + */
> +__rte_experimental
> +int rte_eth_fec_get(uint16_t port_id, enum rte_fec_mode *mode);
> +
> +/**
> + * @warning
> + * @b EXPERIMENTAL: this API may change, or be removed, without prior no=
tice
> + *
> + * Set Forward Error Correction(FEC) mode.
> + *
> + * @param port_id
> + *   The port identifier of the Ethernet device.
> + * @param mode
> + *   the FEC mode.
> + * @return
> + *   - (0) if successful.
> + *   - (-EINVAL) if the FEC mode is not valid.
> + *   - (-ENOTSUP) if underlying hardware OR driver doesn't support.
> + *   - (-EIO) if device is removed.
> + *   - (-ENODEV)  if *port_id* invalid.
> + */
> +__rte_experimental
> +int rte_eth_fec_set(uint16_t port_id, enum rte_fec_mode mode);
> +
> +/**
>   * Get current status of the Ethernet link flow control for Ethernet dev=
ice
>   *
>   * @param port_id
> diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_=
ethdev_core.h
> index 32407dd..cd1acf1 100644
> --- a/lib/librte_ethdev/rte_ethdev_core.h
> +++ b/lib/librte_ethdev/rte_ethdev_core.h
> @@ -604,6 +604,76 @@ typedef int (*eth_tx_hairpin_queue_setup_t)
>  	 const struct rte_eth_hairpin_conf *hairpin_conf);
>=20
>  /**
> + * @internal
> + * Get Forward Error Correction(FEC) capability.
> + *
> + * @param dev
> + *   ethdev handle of port.
> + * @param fec_cap
> + *   returns the FEC capability from the device.
> + *
> + * @return
> + *   Negative errno value on error, 0 on success.
> + *
> + * @retval 0
> + *   Success, get FEC success.
> + * @retval -ENOTSUP
> + *   operation is not supported.
> + * @retval -EIO
> + *   device is removed.
> + * @retval -ENODEV
> + *   Device is gone.
> + */
> +typedef int (*eth_fec_get_capability_t)(struct rte_eth_dev *dev,
> +					uint32_t *fec_cap);
> +
> +/**
> + * @internal
> + * Get Forward Error Correction(FEC) mode.
> + *
> + * @param dev
> + *   ethdev handle of port.
> + * @param mode
> + *   returns the FEC mode from the device.
> + *
> + * @return
> + *   Negative errno value on error, 0 on success.
> + *
> + * @retval 0
> + *   Success, get FEC success.
> + * @retval -ENOTSUP
> + *   operation is not supported.
> + * @retval -EIO
> + *   device is removed.
> + * @retval -ENODEV
> + *   Device is gone.
> + */
> +typedef int (*eth_fec_get_t)(struct rte_eth_dev *dev, enum rte_fec_mode =
*mode);
> +
> +/**
> + * @internal
> + *   Set Forward Error Correction(FEC) mode.
> + *
> + * @param dev
> + *   ethdev handle of port.
> + * @param mode
> + *   the FEC mode.
> + *
> + * @return
> + *   Negative errno value on error, 0 on success.
> + *
> + * @retval 0
> + *   Success, set FEC success.
> + * @retval -ENOTSUP
> + *   operation is not supported.
> + * @retval -EIO
> + *   device is removed.
> + * @retval -ENODEV
> + *   Device is gone.
> + */
> +typedef int (*eth_fec_set_t)(struct rte_eth_dev *dev, enum rte_fec_mode =
mode);
> +
> +/**
>   * @internal A structure containing the functions exported by an Etherne=
t driver.
>   */
>  struct eth_dev_ops {
> @@ -752,6 +822,13 @@ struct eth_dev_ops {
>  	/**< Set up device RX hairpin queue. */
>  	eth_tx_hairpin_queue_setup_t tx_hairpin_queue_setup;
>  	/**< Set up device TX hairpin queue. */
> +
> +	eth_fec_get_capability_t fec_get_capability;
> +	/**< Get Forward Error Correction(FEC) capability; */
> +	eth_fec_get_t fec_get;
> +	/**< Get Forward Error Correction(FEC) mode; */
> +	eth_fec_set_t fec_set;
> +	/**< Set Forward Error Correction(FEC) mode; */
>  };
>=20
>  /**
> diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev=
/rte_ethdev_version.map
> index 02081d9..9f3fb8f 100644
> --- a/lib/librte_ethdev/rte_ethdev_version.map
> +++ b/lib/librte_ethdev/rte_ethdev_version.map
> @@ -239,6 +239,11 @@ EXPERIMENTAL {
>  	__rte_ethdev_trace_rx_burst;
>  	__rte_ethdev_trace_tx_burst;
>  	rte_flow_get_aged_flows;
> +
> +	# added in 20.11
> +	rte_eth_fec_get_capability;
> +	rte_eth_fec_get;
> +	rte_eth_fec_set;
>  };
>=20
>  INTERNAL {
> --
> 2.7.4