From: Junfeng Guo <junfeng.guo@intel.com>
To: qi.z.zhang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com
Cc: dev@dpdk.org, junfeng.guo@intel.com
Subject: [RFC 7/9] net/idpf: support link update
Date: Sat, 7 May 2022 15:07:24 +0800 [thread overview]
Message-ID: <20220507070726.3263649-8-junfeng.guo@intel.com> (raw)
In-Reply-To: <20220507070726.3263649-1-junfeng.guo@intel.com>
Add ops link_update.
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
---
drivers/net/idpf/idpf_ethdev.c | 22 ++++++++++++++++++++++
drivers/net/idpf/idpf_ethdev.h | 2 ++
2 files changed, 24 insertions(+)
diff --git a/drivers/net/idpf/idpf_ethdev.c b/drivers/net/idpf/idpf_ethdev.c
index 01fd023bfc..39efb387cf 100644
--- a/drivers/net/idpf/idpf_ethdev.c
+++ b/drivers/net/idpf/idpf_ethdev.c
@@ -31,6 +31,27 @@ static int idpf_dev_close(struct rte_eth_dev *dev);
static int idpf_dev_info_get(struct rte_eth_dev *dev,
struct rte_eth_dev_info *dev_info);
+int
+idpf_dev_link_update(struct rte_eth_dev *dev,
+ __rte_unused int wait_to_complete)
+{
+ struct idpf_vport *vport =
+ (struct idpf_vport *)dev->data->dev_private;
+ struct rte_eth_link new_link;
+
+ memset(&new_link, 0, sizeof(new_link));
+
+ new_link.link_speed = RTE_ETH_SPEED_NUM_NONE;
+
+ new_link.link_duplex = RTE_ETH_LINK_FULL_DUPLEX;
+ new_link.link_status = vport->link_up ? RTE_ETH_LINK_UP :
+ RTE_ETH_LINK_DOWN;
+ new_link.link_autoneg = !(dev->data->dev_conf.link_speeds &
+ RTE_ETH_LINK_SPEED_FIXED);
+
+ return rte_eth_linkstatus_set(dev, &new_link);
+}
+
static const struct eth_dev_ops idpf_eth_dev_ops = {
.dev_supported_ptypes_get = idpf_dev_supported_ptypes_get,
.dev_configure = idpf_dev_configure,
@@ -46,6 +67,7 @@ static const struct eth_dev_ops idpf_eth_dev_ops = {
.tx_queue_setup = idpf_tx_queue_setup,
.tx_queue_release = idpf_dev_tx_queue_release,
.dev_infos_get = idpf_dev_info_get,
+ .link_update = idpf_dev_link_update,
};
static int
diff --git a/drivers/net/idpf/idpf_ethdev.h b/drivers/net/idpf/idpf_ethdev.h
index c5aa168d95..5520b2d6ce 100644
--- a/drivers/net/idpf/idpf_ethdev.h
+++ b/drivers/net/idpf/idpf_ethdev.h
@@ -189,6 +189,8 @@ _atomic_set_cmd(struct idpf_adapter *adapter, enum virtchnl_ops ops)
return !ret;
}
+int idpf_dev_link_update(struct rte_eth_dev *dev,
+ __rte_unused int wait_to_complete);
void idpf_handle_virtchnl_msg(struct rte_eth_dev *dev);
int idpf_check_api_version(struct idpf_adapter *adapter);
int idpf_get_caps(struct idpf_adapter *adapter);
--
2.25.1
next prev parent reply other threads:[~2022-05-07 7:08 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-07 7:07 [RFC 0/9] add support for idpf PMD in DPDK Junfeng Guo
2022-05-07 7:07 ` [RFC 1/9] net/idpf/base: introduce base code Junfeng Guo
2022-05-09 9:11 ` [RFC v2 0/9] add support for idpf PMD in DPDK Junfeng Guo
2022-05-09 9:11 ` [RFC v2 1/9] net/idpf/base: introduce base code Junfeng Guo
2022-05-09 9:11 ` [RFC v2 2/9] net/idpf/base: add OS specific implementation Junfeng Guo
2022-05-09 9:11 ` [RFC v2 3/9] net/idpf: support device initialization Junfeng Guo
2022-05-09 9:11 ` [RFC v2 4/9] net/idpf: support queue ops Junfeng Guo
2022-05-09 9:11 ` [RFC v2 5/9] net/idpf: support getting device information Junfeng Guo
2022-05-09 9:11 ` [RFC v2 6/9] net/idpf: support packet type getting Junfeng Guo
2022-05-09 9:11 ` [RFC v2 7/9] net/idpf: support link update Junfeng Guo
2022-05-09 9:11 ` [RFC v2 8/9] net/idpf: support basic Rx/Tx Junfeng Guo
2022-05-09 9:11 ` [RFC v2 9/9] net/idpf: support RSS Junfeng Guo
2022-05-18 8:25 ` [RFC v3 00/11] add support for idpf PMD in DPDK Junfeng Guo
2022-05-18 8:25 ` [RFC v3 01/11] net/idpf/base: introduce base code Junfeng Guo
2022-05-18 15:26 ` Stephen Hemminger
2022-05-18 8:25 ` [RFC v3 02/11] net/idpf/base: add OS specific implementation Junfeng Guo
2022-05-18 8:25 ` [RFC v3 03/11] net/idpf: support device initialization Junfeng Guo
2022-05-18 8:25 ` [RFC v3 04/11] net/idpf: support queue ops Junfeng Guo
2022-05-18 8:25 ` [RFC v3 05/11] net/idpf: support getting device information Junfeng Guo
2022-05-18 8:25 ` [RFC v3 06/11] net/idpf: support packet type getting Junfeng Guo
2022-05-18 8:25 ` [RFC v3 07/11] net/idpf: support link update Junfeng Guo
2022-05-18 8:25 ` [RFC v3 08/11] net/idpf: support basic Rx/Tx Junfeng Guo
2022-05-18 8:25 ` [RFC v3 09/11] net/idpf: support RSS Junfeng Guo
2022-05-18 8:25 ` [RFC v3 10/11] net/idpf: support MTU configuration Junfeng Guo
2022-05-18 8:25 ` [RFC v3 11/11] net/idpf: add CPF device ID for idpf map table Junfeng Guo
2022-05-07 7:07 ` [RFC 2/9] net/idpf/base: add OS specific implementation Junfeng Guo
2022-05-07 7:07 ` [RFC 3/9] net/idpf: support device initialization Junfeng Guo
2022-05-07 7:07 ` [RFC 4/9] net/idpf: support queue ops Junfeng Guo
2022-05-07 7:07 ` [RFC 5/9] net/idpf: support getting device information Junfeng Guo
2022-05-07 7:07 ` [RFC 6/9] net/idpf: support packet type getting Junfeng Guo
2022-05-07 7:07 ` Junfeng Guo [this message]
2022-05-07 7:07 ` [RFC 8/9] net/idpf: support basic Rx/Tx Junfeng Guo
2022-05-07 7:07 ` [RFC 9/9] net/idpf: support RSS Junfeng Guo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220507070726.3263649-8-junfeng.guo@intel.com \
--to=junfeng.guo@intel.com \
--cc=beilei.xing@intel.com \
--cc=dev@dpdk.org \
--cc=jingjing.wu@intel.com \
--cc=qi.z.zhang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).