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 6F161A04C9; Mon, 14 Sep 2020 13:01:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A4951FFA; Mon, 14 Sep 2020 13:01:20 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2066.outbound.protection.outlook.com [40.107.21.66]) by dpdk.org (Postfix) with ESMTP id 0793AE07 for ; Mon, 14 Sep 2020 13:01:19 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Lvlil9UeXPt9Q32AWi7FgErFGuQ73jGZKfuuBCrYHA7AgA1M+lRUd4uqbE5KYbz2Fi3tCN3FCkXNq3oYI7nI8/lZRDM3PRdLR4dOjuOCOSbpAgshkgiqXWKj5zKMLAe9vud2UUkNeeQNmQKRIGr0GOQpxpMtc1sXOG8K5YkK166JA/oBH3m2L587jEZOwmk9SbqekYG7nPPATImQxwQ0jSQYqyP/tRpy0Io934uAAaQCNpGQaRdinJw6fDbTQFYSCyLVWEjyj0na76rHeACWBpAoZnUVmRZjy+EMWgsqVCWat72oA8ttG/SGB4G5fM6kOqlavlDyj5wD11sjP5LPYA== 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=JzhUr27VRS/5r26Pv0jqIhF1QsvJk6HTNu3WKbn+Yjc=; b=IsCmm8TxidQX9El1wHfVkKiMcvDS7WcsDjCyABu9pD5v4EByxzTmGIB1tB8O/TGiO+PQCPyfs+Eq9LNCm9lLZem3FO8urW+Pahe7RPrIXWLaDZiy7h3+XdqDEuh+jr5FXXHQ8z1Jj8lc/ZhDNIanQiXzwxFO0kXim1QUISnM3UP5hgkjyPW3WT/xY0prysLBIyAzbktY9ZuV9Rwdutk5voA/3fciWb8ie79xYrBiFpSKjbjnGb7MMmFBNkoSu4teZ8VGhHLdhlnxQJLGhRXdJVD7ypy9fRkaHwUy+4jxyaRIBGFj649/tWTr/2SLGw/q6xx97mwmjLJpwCSnIYifcA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JzhUr27VRS/5r26Pv0jqIhF1QsvJk6HTNu3WKbn+Yjc=; b=QYQe5iDfXcxsx95sHqbMeiGdfveu0JV83BBUYgU9FQmVQlIvNrRznA21FWdTgv2BATvpsWwa02PmQ2RWATFrEQy6yK2MIYWPnOcn3hLLpS+ip8KSCm11RZ9+DhLGcRiYymvHqu01jbbKZidNyJ1q00/AF4p4fa2thKKbCCcURLw= Received: from AM6PR04MB4456.eurprd04.prod.outlook.com (2603:10a6:20b:22::25) by AM6PR04MB4278.eurprd04.prod.outlook.com (2603:10a6:209:4f::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.17; Mon, 14 Sep 2020 11:01:17 +0000 Received: from AM6PR04MB4456.eurprd04.prod.outlook.com ([fe80::e024:2be5:29c3:31b0]) by AM6PR04MB4456.eurprd04.prod.outlook.com ([fe80::e024:2be5:29c3:31b0%7]) with mapi id 15.20.3370.019; Mon, 14 Sep 2020 11:01:17 +0000 From: Hemant Agrawal To: "Sachin Saxena (OSS)" , "dev@dpdk.org" , "ferruh.yigit@intel.com" Thread-Topic: [PATCH v2 6/8] bus/dpaa: enhance link status support Thread-Index: AQHWiBaLRCI0ija1skmNGgkZm9gsRaln++Rw Date: Mon, 14 Sep 2020 11:01:17 +0000 Message-ID: References: <20200911083520.24020-1-sachin.saxena@oss.nxp.com> <20200911083520.24020-7-sachin.saxena@oss.nxp.com> In-Reply-To: <20200911083520.24020-7-sachin.saxena@oss.nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: oss.nxp.com; dkim=none (message not signed) header.d=none;oss.nxp.com; dmarc=none action=none header.from=nxp.com; x-originating-ip: [122.176.3.89] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 42032d27-817d-43f2-15d5-08d8589d817a x-ms-traffictypediagnostic: AM6PR04MB4278: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:177; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 4tfD4tMV45cBHLQ0cxfo+sNwzgff2sz8JF8i1dLp1Dt4U83jscQCMDD/NaiOJf5QUYrsYapH7gtBf5JRWsSV0moUrHShyhs9JpkzMTmzOnV+uMCgGNhLgDBzqogzqjtER1WEmwyGOScbAsk3L4WzLWkv+zREuvtEK9Ogz2q8hrDpT1vV0oVcecvKOCezqKme2MyZbvsXNqzF3MkakwTODooMnylDcVBFTd+VeaH4N90tBOsAuED63tGUqFJEgyWJC/g7TsELykq85uDiryDYM5RpJsci0DE7IFDlG0xGRBTRizYkmXc3R+TKsjvgOkiGCrd/ztDUp3BLAMsun4SZfg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB4456.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(39860400002)(376002)(136003)(396003)(346002)(53546011)(9686003)(55016002)(55236004)(316002)(6506007)(44832011)(7696005)(66476007)(478600001)(30864003)(76116006)(66946007)(186003)(26005)(64756008)(66446008)(66556008)(110136005)(83380400001)(5660300002)(52536014)(71200400001)(33656002)(8936002)(8676002)(2906002)(86362001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: zgPm4C6k9tgX/b0/4Bjb6X4pgpwvhLrGNMW5pZ8UKRUU06zR7VXTqxEKHu2rgUZIAEZCmzCZDmBfgHrzzEHqYmtddK3fZZmqBCPjJxB2RJrXW/bA4NM7d3ZEaeD85kRbjMth1G45aoxPaJVSDNbAoSv4NURS11jBtL5J9VE5eb6rOO6Wn5uFebiJqRnC6LcaInsHV1mgDJyYwP+iaySKqSE4RxOYspxmYlhO/Lc0TgC7WRs2DdXacWNZUvcGE1nuxQ5mchxT6F7YUCYLZ13QzrndoB+IQOXa1AxbZwzN5GDRVJ9OGVxP8trjCwb+82Mjx0rku3YK9p3+tv+Y6sL7PfVC3szLEXxs05yXTxfp75VGero+zaQcxaIRPDJ8p24JKmKV89SMqV1O3uJUjck+MoHPwTBm0eJ+hzNumjykGKhF1LVcrX0FxPKYeo80IvWxt2H5xvmjSrx8hDRhtLzkoq04ybGO8cvQ0WwOjC67YkLcvqeJjAikzTthtMJ2BBTGbUbEEknMAfh3SY48VXVjYTAhNC+rM8+GM3wRW+1/8n5Nc438OpTp2pLD18m9IVjZcLLD62RchnO2qtvLIxwtQKQNG7d9HK7D+32BA9RPcAIlLfQPrKprWF5d0821/Mrpeak1ArsVdkB1XM5X8yXyOA== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4456.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 42032d27-817d-43f2-15d5-08d8589d817a X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Sep 2020 11:01:17.7737 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: lpX/T2Qo/lsUqjmhGgWRab25FhCN7NK/6ldHpgc7k9jlaP7sk26cYtxFUbXQVgXIUwg1RHDIJCzptqbWwFJHkA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB4278 Subject: Re: [dpdk-dev] [PATCH v2 6/8] bus/dpaa: enhance link status support 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" Hi , > -----Original Message----- > From: Sachin Saxena (OSS) > Sent: Friday, September 11, 2020 2:05 PM > To: dev@dpdk.org; ferruh.yigit@intel.com > Subject: [PATCH v2 6/8] bus/dpaa: enhance link status support >=20 > From: Rohit Raj >=20 > This patch adds support to get/set link speed, duplex and autoneg mode > status from/to PHY. Enahnce device capabilities to advertise all supporte= d > link speeds according to mac type. >=20 > Also enables fallback support for get link status api where kernel suppor= t is > missing. >=20 > Signed-off-by: Sachin Saxena > Signed-off-by: Rohit Raj > --- > drivers/bus/dpaa/base/qbman/process.c | 123 +++++++++++++++++++--- > drivers/bus/dpaa/include/process.h | 34 +++++- > drivers/bus/dpaa/rte_bus_dpaa_version.map | 3 + > drivers/net/dpaa/dpaa_ethdev.c | 113 ++++++++++++++++---- > 4 files changed, 241 insertions(+), 32 deletions(-) >=20 > diff --git a/drivers/bus/dpaa/base/qbman/process.c > b/drivers/bus/dpaa/base/qbman/process.c > index 6f7e37957..9bc92681c 100644 > --- a/drivers/bus/dpaa/base/qbman/process.c > +++ b/drivers/bus/dpaa/base/qbman/process.c > @@ -8,6 +8,7 @@ > #include > #include > #include > +#include >=20 > #include "process.h" >=20 > @@ -341,30 +342,78 @@ int dpaa_intr_disable(char *if_name) > return 0; > } >=20 > +#define DPAA_IOCTL_GET_IOCTL_VERSION \ > + _IOR(DPAA_IOCTL_MAGIC, 0x14, int) > + [Hemant] This patch has dependency on dpaa kernel driver. If these are new = changes, please also change the minimal kernel dependency in dpaa platform = and dpaa nic documentation? Are these changes already part of kernel tree?=20 Is the kernel dependency documented?=20 > +int dpaa_get_ioctl_version_number(void) > +{ > + int version_num, ret =3D check_fd(); > + > + if (ret) > + return ret; > + > + ret =3D ioctl(fd, DPAA_IOCTL_GET_IOCTL_VERSION, &version_num); > + if (ret) { > + if (errno =3D=3D EINVAL) { > + version_num =3D 1; > + } else { > + printf("Failed to get ioctl version number\n"); > + version_num =3D -1; > + } > + } > + > + return version_num; > +} > + > #define DPAA_IOCTL_GET_LINK_STATUS \ > _IOWR(DPAA_IOCTL_MAGIC, 0x10, struct > usdpaa_ioctl_link_status_args) >=20 > -int dpaa_get_link_status(char *if_name) > +#define DPAA_IOCTL_GET_LINK_STATUS_OLD \ > + _IOWR(DPAA_IOCTL_MAGIC, 0x10, struct > +usdpaa_ioctl_link_status_args_old) > + > + > +int dpaa_get_link_status(char *if_name, struct rte_eth_link *link) > { > - int ret =3D check_fd(); > - struct usdpaa_ioctl_link_status_args args; > + int ioctl_version, ret =3D check_fd(); >=20 > if (ret) > return ret; >=20 > - strcpy(args.if_name, if_name); > - args.link_status =3D 0; > + ioctl_version =3D dpaa_get_ioctl_version_number(); >=20 > - ret =3D ioctl(fd, DPAA_IOCTL_GET_LINK_STATUS, &args); > - if (ret) { > - if (errno =3D=3D EINVAL) > - printf("Failed to get link status: Not Supported\n"); > - else > + if (ioctl_version =3D=3D 2) { > + struct usdpaa_ioctl_link_status_args args; > + > + strcpy(args.if_name, if_name); > + > + ret =3D ioctl(fd, DPAA_IOCTL_GET_LINK_STATUS, &args); > + if (ret) { > printf("Failed to get link status\n"); > - return ret; > + return ret; > + } > + > + link->link_status =3D args.link_status; > + link->link_speed =3D args.link_speed; > + link->link_duplex =3D args.link_duplex; > + link->link_autoneg =3D args.link_autoneg; > + } else { > + struct usdpaa_ioctl_link_status_args_old args; > + > + strcpy(args.if_name, if_name); > + > + ret =3D ioctl(fd, DPAA_IOCTL_GET_LINK_STATUS_OLD, &args); > + if (ret) { > + if (errno =3D=3D EINVAL) > + printf("Get link status: Not Supported\n"); > + else > + printf("Failed to get link status\n"); > + return ret; > + } > + > + link->link_status =3D args.link_status; > } >=20 > - return args.link_status; > + return 0; > } >=20 > #define DPAA_IOCTL_UPDATE_LINK_STATUS \ @@ -393,3 +442,53 @@ int > dpaa_update_link_status(char *if_name, int link_status) >=20 > return 0; > } > + > +#define DPAA_IOCTL_UPDATE_LINK_SPEED \ > + _IOW(DPAA_IOCTL_MAGIC, 0x12, struct > usdpaa_ioctl_update_link_speed) > + > +int dpaa_update_link_speed(char *if_name, int link_speed, int > +link_duplex) { > + struct usdpaa_ioctl_update_link_speed args; > + int ret; > + > + ret =3D check_fd(); > + if (ret) > + return ret; > + > + strcpy(args.if_name, if_name); > + args.link_speed =3D link_speed; > + args.link_duplex =3D link_duplex; > + > + ret =3D ioctl(fd, DPAA_IOCTL_UPDATE_LINK_SPEED, &args); > + if (ret) { > + if (errno =3D=3D EINVAL) > + printf("Failed to set link speed: Not Supported\n"); > + else > + printf("Failed to set link speed\n"); > + return ret; > + } > + > + return ret; > +} > + > +#define DPAA_IOCTL_RESTART_LINK_AUTONEG \ > + _IOW(DPAA_IOCTL_MAGIC, 0x13, char *) > + > +int dpaa_restart_link_autoneg(char *if_name) { > + int ret =3D check_fd(); > + > + if (ret) > + return ret; > + > + ret =3D ioctl(fd, DPAA_IOCTL_RESTART_LINK_AUTONEG, &if_name); > + if (ret) { > + if (errno =3D=3D EINVAL) > + printf("Failed to restart autoneg: Not Supported\n"); > + else > + printf("Failed to restart autoneg\n"); > + return ret; > + } > + > + return ret; > +} > diff --git a/drivers/bus/dpaa/include/process.h > b/drivers/bus/dpaa/include/process.h > index f52ea1635..be52e6f72 100644 > --- a/drivers/bus/dpaa/include/process.h > +++ b/drivers/bus/dpaa/include/process.h > @@ -10,6 +10,7 @@ > #define __PROCESS_H >=20 > #include > +#include >=20 > /* The process device underlies process-wide user/kernel interactions, s= uch > as > * mapping dma_mem memory and providing accompanying ioctl()s. (This > isn't used @@ -86,10 +87,25 @@ int dpaa_intr_enable(char *if_name, int > efd); __rte_internal int dpaa_intr_disable(char *if_name); >=20 > +struct usdpaa_ioctl_link_status_args_old { > + /* network device node name */ > + char if_name[IF_NAME_MAX_LEN]; > + /* link status(ETH_LINK_UP/DOWN) */ > + int link_status; > +}; > + > struct usdpaa_ioctl_link_status_args { > /* network device node name */ > char if_name[IF_NAME_MAX_LEN]; > + /* link status(ETH_LINK_UP/DOWN) */ > int link_status; > + /* link speed (ETH_SPEED_NUM_)*/ > + int link_speed; > + /* link duplex (ETH_LINK_[HALF/FULL]_DUPLEX)*/ > + int link_duplex; > + /* link autoneg (ETH_LINK_AUTONEG/FIXED)*/ > + int link_autoneg; > + > }; >=20 > struct usdpaa_ioctl_update_link_status_args { @@ -99,10 +115,24 @@ > struct usdpaa_ioctl_update_link_status_args { > int link_status; > }; >=20 > -__rte_internal > -int dpaa_get_link_status(char *if_name); > +struct usdpaa_ioctl_update_link_speed { > + /* network device node name*/ > + char if_name[IF_NAME_MAX_LEN]; > + /* link speed (ETH_SPEED_NUM_)*/ > + int link_speed; > + /* link duplex (ETH_LINK_[HALF/FULL]_DUPLEX)*/ > + int link_duplex; > +}; >=20 > +__rte_internal > +int dpaa_get_link_status(char *if_name, struct rte_eth_link *link); > __rte_internal > int dpaa_update_link_status(char *if_name, int link_status); > +__rte_internal > +int dpaa_update_link_speed(char *if_name, int speed, int duplex); > +__rte_internal int dpaa_restart_link_autoneg(char *if_name); > +__rte_internal int dpaa_get_ioctl_version_number(void); >=20 > #endif /* __PROCESS_H */ > diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map > b/drivers/bus/dpaa/rte_bus_dpaa_version.map > index 5b97b6eb2..26436e9fe 100644 > --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map > +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map > @@ -8,10 +8,13 @@ INTERNAL { > bman_query_free_buffers; > bman_release; > bman_thread_irq; > + dpaa_get_ioctl_version_number; > dpaa_get_eth_port_cfg; > dpaa_get_qm_channel_caam; > dpaa_get_qm_channel_pool; > dpaa_get_link_status; > + dpaa_restart_link_autoneg; > + dpaa_update_link_speed; > dpaa_intr_disable; > dpaa_intr_enable; > dpaa_svr_family; > diff --git a/drivers/net/dpaa/dpaa_ethdev.c > b/drivers/net/dpaa/dpaa_ethdev.c index d5eeb280a..66bb6eb00 100644 > --- a/drivers/net/dpaa/dpaa_ethdev.c > +++ b/drivers/net/dpaa/dpaa_ethdev.c > @@ -205,10 +205,12 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev) > uint64_t rx_offloads =3D eth_conf->rxmode.offloads; > uint64_t tx_offloads =3D eth_conf->txmode.offloads; > struct rte_device *rdev =3D dev->device; > + struct rte_eth_link *link =3D &dev->data->dev_link; > struct rte_dpaa_device *dpaa_dev; > struct fman_if *fif =3D dev->process_private; > struct __fman_if *__fif; > struct rte_intr_handle *intr_handle; > + int speed, duplex; > int ret; >=20 > PMD_INIT_FUNC_TRACE(); > @@ -292,6 +294,60 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev) > dev->data->dev_flags &=3D ~RTE_ETH_DEV_INTR_LSC; > } > } > + > + /* Wait for link status to get updated */ > + if (!link->link_status) > + sleep(1); > + > + /* Configure link only if link is UP*/ > + if (link->link_status) { > + if (eth_conf->link_speeds =3D=3D ETH_LINK_SPEED_AUTONEG) { > + /* Start autoneg only if link is not in autoneg mode > */ > + if (!link->link_autoneg) > + dpaa_restart_link_autoneg(__fif- > >node_name); > + } else if (eth_conf->link_speeds & ETH_LINK_SPEED_FIXED) { > + switch (eth_conf->link_speeds & > ~ETH_LINK_SPEED_FIXED) { > + case ETH_LINK_SPEED_10M_HD: > + speed =3D ETH_SPEED_NUM_10M; > + duplex =3D ETH_LINK_HALF_DUPLEX; > + break; > + case ETH_LINK_SPEED_10M: > + speed =3D ETH_SPEED_NUM_10M; > + duplex =3D ETH_LINK_FULL_DUPLEX; > + break; > + case ETH_LINK_SPEED_100M_HD: > + speed =3D ETH_SPEED_NUM_100M; > + duplex =3D ETH_LINK_HALF_DUPLEX; > + break; > + case ETH_LINK_SPEED_100M: > + speed =3D ETH_SPEED_NUM_100M; > + duplex =3D ETH_LINK_FULL_DUPLEX; > + break; > + case ETH_LINK_SPEED_1G: > + speed =3D ETH_SPEED_NUM_1G; > + duplex =3D ETH_LINK_FULL_DUPLEX; > + break; > + case ETH_LINK_SPEED_2_5G: > + speed =3D ETH_SPEED_NUM_2_5G; > + duplex =3D ETH_LINK_FULL_DUPLEX; > + break; > + case ETH_LINK_SPEED_10G: > + speed =3D ETH_SPEED_NUM_10G; > + duplex =3D ETH_LINK_FULL_DUPLEX; > + break; > + default: > + speed =3D ETH_SPEED_NUM_NONE; > + duplex =3D ETH_LINK_FULL_DUPLEX; > + break; > + } > + /* Set link speed */ > + dpaa_update_link_speed(__fif->node_name, speed, > duplex); > + } else { > + /* Manual autoneg - custom advertisement speed. > */ > + printf("Custom Advertisement speeds not > supported\n"); > + } > + } > + > return 0; > } >=20 > @@ -377,6 +433,7 @@ static void dpaa_eth_dev_close(struct rte_eth_dev > *dev) > struct rte_device *rdev =3D dev->device; > struct rte_dpaa_device *dpaa_dev; > struct rte_intr_handle *intr_handle; > + struct rte_eth_link *link =3D &dev->data->dev_link; >=20 > PMD_INIT_FUNC_TRACE(); >=20 > @@ -386,6 +443,10 @@ static void dpaa_eth_dev_close(struct rte_eth_dev > *dev) >=20 > dpaa_eth_dev_stop(dev); >=20 > + /* Reset link to autoneg */ > + if (link->link_status && !link->link_autoneg) > + dpaa_restart_link_autoneg(__fif->node_name); > + > if (intr_handle && intr_handle->fd && > dev->data->dev_conf.intr_conf.lsc !=3D 0) { > dpaa_intr_disable(__fif->node_name); > @@ -446,12 +507,24 @@ static int dpaa_eth_dev_info(struct rte_eth_dev > *dev, > dev_info->flow_type_rss_offloads =3D DPAA_RSS_OFFLOAD_ALL; >=20 > if (fif->mac_type =3D=3D fman_mac_1g) { > - dev_info->speed_capa =3D ETH_LINK_SPEED_1G; > + dev_info->speed_capa =3D ETH_LINK_SPEED_10M_HD > + | ETH_LINK_SPEED_10M > + | ETH_LINK_SPEED_100M_HD > + | ETH_LINK_SPEED_100M > + | ETH_LINK_SPEED_1G; > } else if (fif->mac_type =3D=3D fman_mac_2_5g) { > - dev_info->speed_capa =3D ETH_LINK_SPEED_1G > + dev_info->speed_capa =3D ETH_LINK_SPEED_10M_HD > + | ETH_LINK_SPEED_10M > + | ETH_LINK_SPEED_100M_HD > + | ETH_LINK_SPEED_100M > + | ETH_LINK_SPEED_1G > | ETH_LINK_SPEED_2_5G; > } else if (fif->mac_type =3D=3D fman_mac_10g) { > - dev_info->speed_capa =3D ETH_LINK_SPEED_1G > + dev_info->speed_capa =3D ETH_LINK_SPEED_10M_HD > + | ETH_LINK_SPEED_10M > + | ETH_LINK_SPEED_100M_HD > + | ETH_LINK_SPEED_100M > + | ETH_LINK_SPEED_1G > | ETH_LINK_SPEED_2_5G > | ETH_LINK_SPEED_10G; > } else { > @@ -548,31 +621,35 @@ static int dpaa_eth_link_update(struct > rte_eth_dev *dev, > struct rte_eth_link *link =3D &dev->data->dev_link; > struct fman_if *fif =3D dev->process_private; > struct __fman_if *__fif =3D container_of(fif, struct __fman_if, __if); > - int ret; > + int ret, ioctl_version; >=20 > PMD_INIT_FUNC_TRACE(); >=20 > - if (fif->mac_type =3D=3D fman_mac_1g) > - link->link_speed =3D ETH_SPEED_NUM_1G; > - else if (fif->mac_type =3D=3D fman_mac_2_5g) > - link->link_speed =3D ETH_SPEED_NUM_2_5G; > - else if (fif->mac_type =3D=3D fman_mac_10g) > - link->link_speed =3D ETH_SPEED_NUM_10G; > - else > - DPAA_PMD_ERR("invalid link_speed: %s, %d", > - dpaa_intf->name, fif->mac_type); > + ioctl_version =3D dpaa_get_ioctl_version_number(); > + >=20 > if (dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) { > - ret =3D dpaa_get_link_status(__fif->node_name); > - if (ret < 0) > + ret =3D dpaa_get_link_status(__fif->node_name, link); > + if (ret) > return ret; > - link->link_status =3D ret; > } else { > link->link_status =3D dpaa_intf->valid; > } >=20 > - link->link_duplex =3D ETH_LINK_FULL_DUPLEX; > - link->link_autoneg =3D ETH_LINK_AUTONEG; > + if (ioctl_version < 2) { > + link->link_duplex =3D ETH_LINK_FULL_DUPLEX; > + link->link_autoneg =3D ETH_LINK_AUTONEG; > + > + if (fif->mac_type =3D=3D fman_mac_1g) > + link->link_speed =3D ETH_SPEED_NUM_1G; > + else if (fif->mac_type =3D=3D fman_mac_2_5g) > + link->link_speed =3D ETH_SPEED_NUM_2_5G; > + else if (fif->mac_type =3D=3D fman_mac_10g) > + link->link_speed =3D ETH_SPEED_NUM_10G; > + else > + DPAA_PMD_ERR("invalid link_speed: %s, %d", > + dpaa_intf->name, fif->mac_type); > + } >=20 > DPAA_PMD_INFO("Port %d Link is %s\n", dev->data->port_id, > link->link_status ? "Up" : "Down"); > -- > 2.28.0