DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rasesh Mody <rasesh.mody@cavium.com>
To: dev@dpdk.org
Cc: Rasesh Mody <rasesh.mody@cavium.com>,
	ferruh.yigit@intel.com, Dept-EngDPDKDev@cavium.com,
	stable@dpdk.org
Subject: [dpdk-dev] [PATCH 3/8] net/qede: fix to update device link structure
Date: Tue,  7 Nov 2017 00:34:20 -0800	[thread overview]
Message-ID: <1510043665-8160-4-git-send-email-rasesh.mody@cavium.com> (raw)
In-Reply-To: <1510043665-8160-1-git-send-email-rasesh.mody@cavium.com>

8ea656f8c app/testpmd: request link status interrupt
requires QEDE PMD to populate the device link structure without
having to query the driver for link status change event.
This patch updates the device link structure when link status event is
received.
Remove unused param from qed_link_update()

Fixes: 86a2265e59d7 ("qede: add SRIOV support")
Fixes: ec94dbc57362 ("qede: add base driver")
Cc: stable@dpdk.org

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
 drivers/net/qede/base/bcm_osal.h  |    4 ++--
 drivers/net/qede/base/ecore_mcp.c |    2 +-
 drivers/net/qede/qede_ethdev.c    |    6 +++++-
 drivers/net/qede/qede_ethdev.h    |    4 ++++
 drivers/net/qede/qede_main.c      |    9 +++++----
 5 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/drivers/net/qede/base/bcm_osal.h b/drivers/net/qede/base/bcm_osal.h
index a384b01..52c2f0e 100644
--- a/drivers/net/qede/base/bcm_osal.h
+++ b/drivers/net/qede/base/bcm_osal.h
@@ -30,7 +30,7 @@
 union ecore_mcp_protocol_stats;
 enum ecore_hw_err_type;
 
-void qed_link_update(struct ecore_hwfn *hwfn, struct ecore_ptt *ptt);
+void qed_link_update(struct ecore_hwfn *hwfn);
 
 #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
 #undef __BIG_ENDIAN
@@ -338,7 +338,7 @@ void *osal_dma_alloc_coherent_aligned(struct ecore_dev *, dma_addr_t *,
 
 #define OSAL_BITMAP_WEIGHT(bitmap, count) 0
 
-#define OSAL_LINK_UPDATE(hwfn, ptt) qed_link_update(hwfn, ptt)
+#define OSAL_LINK_UPDATE(hwfn) qed_link_update(hwfn)
 #define OSAL_TRANSCEIVER_UPDATE(hwfn) nothing
 #define OSAL_DCBX_AEN(hwfn, mib_type) nothing
 
diff --git a/drivers/net/qede/base/ecore_mcp.c b/drivers/net/qede/base/ecore_mcp.c
index 3802aa8..8edd2e9 100644
--- a/drivers/net/qede/base/ecore_mcp.c
+++ b/drivers/net/qede/base/ecore_mcp.c
@@ -1420,7 +1420,7 @@ static void ecore_mcp_handle_link_change(struct ecore_hwfn *p_hwfn,
 	if (p_hwfn->mcp_info->capabilities & FW_MB_PARAM_FEATURE_SUPPORT_EEE)
 		ecore_mcp_read_eee_config(p_hwfn, p_ptt, p_link);
 
-	OSAL_LINK_UPDATE(p_hwfn, p_ptt);
+	OSAL_LINK_UPDATE(p_hwfn);
 out:
 	OSAL_SPIN_UNLOCK(&p_hwfn->mcp_info->link_lock);
 }
diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index 43562bc..4ef08ad 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -1159,6 +1159,9 @@ static int qede_dev_start(struct rte_eth_dev *eth_dev)
 	/* Bring-up the link */
 	qede_dev_set_link_state(eth_dev, true);
 
+	/* Update link status */
+	qede_link_update(eth_dev, 0);
+
 	/* Start/resume traffic */
 	qede_fastpath_start(edev);
 
@@ -1367,7 +1370,7 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev)
 }
 
 /* return 0 means link status changed, -1 means not changed */
-static int
+int
 qede_link_update(struct rte_eth_dev *eth_dev, __rte_unused int wait_to_complete)
 {
 	struct qede_dev *qdev = eth_dev->data->dev_private;
@@ -2625,6 +2628,7 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
 
 	/* Extract key data structures */
 	adapter = eth_dev->data->dev_private;
+	adapter->ethdev = eth_dev;
 	edev = &adapter->edev;
 	pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
 	pci_addr = pci_dev->addr;
diff --git a/drivers/net/qede/qede_ethdev.h b/drivers/net/qede/qede_ethdev.h
index 3212020..6c051c0 100644
--- a/drivers/net/qede/qede_ethdev.h
+++ b/drivers/net/qede/qede_ethdev.h
@@ -210,6 +210,7 @@ struct qede_dev {
 	struct qede_fdir_info fdir_info;
 	bool vlan_strip_flg;
 	char drv_ver[QEDE_PMD_DRV_VER_STR_SIZE];
+	void *ethdev;
 };
 
 /* Non-static functions */
@@ -226,6 +227,9 @@ int qed_fill_eth_dev_info(struct ecore_dev *edev,
 				 struct qed_dev_eth_info *info);
 int qede_dev_set_link_state(struct rte_eth_dev *eth_dev, bool link_up);
 
+int qede_link_update(struct rte_eth_dev *eth_dev,
+		     __rte_unused int wait_to_complete);
+
 int qede_dev_filter_ctrl(struct rte_eth_dev *dev, enum rte_filter_type type,
 			 enum rte_filter_op op, void *arg);
 
diff --git a/drivers/net/qede/qede_main.c b/drivers/net/qede/qede_main.c
index a0c9e03..ae18732 100644
--- a/drivers/net/qede/qede_main.c
+++ b/drivers/net/qede/qede_main.c
@@ -179,7 +179,7 @@ static void qed_handle_bulletin_change(struct ecore_hwfn *hwfn)
 		rte_memcpy(hwfn->hw_info.hw_mac_addr, mac, ETH_ALEN);
 
 	/* Always update link configuration according to bulletin */
-	qed_link_update(hwfn, NULL);
+	qed_link_update(hwfn);
 }
 
 static void qede_vf_task(void *arg)
@@ -629,11 +629,12 @@ static int qed_set_link(struct ecore_dev *edev, struct qed_link_params *params)
 	return rc;
 }
 
-void qed_link_update(struct ecore_hwfn *hwfn, struct ecore_ptt *ptt)
+void qed_link_update(struct ecore_hwfn *hwfn)
 {
-	struct qed_link_output if_link;
+	struct ecore_dev *edev = hwfn->p_dev;
+	struct qede_dev *qdev = (struct qede_dev *)edev;
 
-	qed_fill_link(hwfn, ptt, &if_link);
+	qede_link_update((struct rte_eth_dev *)qdev->ethdev, 0);
 }
 
 static int qed_drain(struct ecore_dev *edev)
-- 
1.7.10.3

  parent reply	other threads:[~2017-11-07  8:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-07  8:34 [dpdk-dev] [PATCH 0/8] net/qede: coverity issue fixes and bug fixes Rasesh Mody
2017-11-07  8:34 ` [dpdk-dev] [PATCH 1/8] net/qede: fix to disable per-VF Tx switching feature Rasesh Mody
2017-11-08  0:53   ` Thomas Monjalon
2017-11-08  1:34     ` Patil, Harish
2017-11-08  1:44       ` Thomas Monjalon
2017-11-08  2:34         ` Patil, Harish
2017-11-07  8:34 ` [dpdk-dev] [PATCH 2/8] net/qede: fix vxlan filter deletion Rasesh Mody
2017-11-07  8:34 ` Rasesh Mody [this message]
2017-11-07  8:34 ` [dpdk-dev] [PATCH 4/8] net/qede: remove duplicate includes Rasesh Mody
2017-11-07  8:34 ` [dpdk-dev] [PATCH 5/8] net/qede: fix to release the acquired ptt Rasesh Mody
2017-11-07  8:34 ` [dpdk-dev] [PATCH 6/8] net/qede/base: fix to initialize filter API return code Rasesh Mody
2017-11-07  8:34 ` [dpdk-dev] [PATCH 7/8] net/qede/base: fix division by zero Rasesh Mody
2017-11-07  8:34 ` [dpdk-dev] [PATCH 8/8] net/qede: fix null pointer dereferences Rasesh Mody
2017-11-07 22:53 ` [dpdk-dev] [PATCH 0/8] net/qede: coverity issue fixes and bug fixes 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=1510043665-8160-4-git-send-email-rasesh.mody@cavium.com \
    --to=rasesh.mody@cavium.com \
    --cc=Dept-EngDPDKDev@cavium.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=stable@dpdk.org \
    /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).