From: Xiao Wang <xiao.w.wang@intel.com>
To: dev@dpdk.org
Cc: jingjing.wu@intel.com, jing.d.chen@intel.com,
Xiao Wang <xiao.w.wang@intel.com>
Subject: [dpdk-dev] [PATCH 1/4] net/fm10k: redefine link status semantics
Date: Sun, 22 Oct 2017 14:37:17 -0700 [thread overview]
Message-ID: <1508708240-69814-2-git-send-email-xiao.w.wang@intel.com> (raw)
In-Reply-To: <1508708240-69814-1-git-send-email-xiao.w.wang@intel.com>
As fm10k host interface is not directly connected to PHY, marking the link
status as UP doesn't mean a lot to the application. So, this patch
basically redefines the link status as the state of switch manager: when
switch manager is running, it's LINK_UP; when switch manager goes down by
calling the fmTerminate function, status turns to LINK_DOWN.
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
---
drivers/net/fm10k/fm10k.h | 1 +
drivers/net/fm10k/fm10k_ethdev.c | 11 +++++++----
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/net/fm10k/fm10k.h b/drivers/net/fm10k/fm10k.h
index 060982b..594dca4 100644
--- a/drivers/net/fm10k/fm10k.h
+++ b/drivers/net/fm10k/fm10k.h
@@ -155,6 +155,7 @@ struct fm10k_dev_info {
struct fm10k_macvlan_filter_info macvlan;
/* Flag to indicate if RX vector conditions satisfied */
bool rx_vec_allowed;
+ bool sm_down;
};
/*
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index 586f482..2587696 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -1256,14 +1256,17 @@ static inline int fm10k_glort_valid(struct fm10k_hw *hw)
fm10k_link_update(struct rte_eth_dev *dev,
__rte_unused int wait_to_complete)
{
+ struct fm10k_dev_info *dev_info =
+ FM10K_DEV_PRIVATE_TO_INFO(dev->data->dev_private);
PMD_INIT_FUNC_TRACE();
- /* The host-interface link is always up. The speed is ~50Gbps per Gen3
- * x8 PCIe interface. For now, we leave the speed undefined since there
- * is no 50Gbps Ethernet. */
+ /* The speed is ~50Gbps per Gen3 x8 PCIe interface. For now, we
+ * leave the speed undefined since there is no 50Gbps Ethernet.
+ */
dev->data->dev_link.link_speed = 0;
dev->data->dev_link.link_duplex = ETH_LINK_FULL_DUPLEX;
- dev->data->dev_link.link_status = ETH_LINK_UP;
+ dev->data->dev_link.link_status =
+ dev_info->sm_down ? ETH_LINK_DOWN : ETH_LINK_UP;
return 0;
}
--
1.8.3.1
next prev parent reply other threads:[~2017-10-22 12:58 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-22 21:37 [dpdk-dev] [PATCH 0/4] net/fm10k: support switch restart Xiao Wang
2017-10-22 21:37 ` Xiao Wang [this message]
2017-10-22 21:37 ` [dpdk-dev] [PATCH 2/4] net/fm10k: support switch restart on PF Xiao Wang
2017-10-22 21:37 ` [dpdk-dev] [PATCH 3/4] net/fm10k: support switch restart on VF Xiao Wang
2017-10-22 21:37 ` [dpdk-dev] [PATCH 4/4] doc: add switch restart support to fm10k guide Xiao Wang
2017-10-23 13:06 ` Mcnamara, John
2017-10-24 1:31 ` Wang, Xiao W
2017-10-24 13:45 ` [dpdk-dev] [PATCH v2 0/4] net/fm10k: support switch restart Xiao Wang
2017-10-24 13:45 ` [dpdk-dev] [PATCH v2 1/4] net/fm10k: redefine link status semantics Xiao Wang
2017-10-24 13:45 ` [dpdk-dev] [PATCH v2 2/4] net/fm10k: support switch restart on PF Xiao Wang
2017-10-24 13:45 ` [dpdk-dev] [PATCH v2 3/4] net/fm10k: support switch restart on VF Xiao Wang
2017-10-24 13:45 ` [dpdk-dev] [PATCH v2 4/4] doc: add switch restart support to fm10k guide Xiao Wang
2017-10-24 10:56 ` Mcnamara, John
2017-10-24 19:29 ` [dpdk-dev] [PATCH v2 0/4] net/fm10k: support switch restart Ferruh Yigit
2017-10-24 19:37 ` Ferruh Yigit
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=1508708240-69814-2-git-send-email-xiao.w.wang@intel.com \
--to=xiao.w.wang@intel.com \
--cc=dev@dpdk.org \
--cc=jing.d.chen@intel.com \
--cc=jingjing.wu@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).