From 8aab5d6fabca403d33fd81386558f36f6b378044 Mon Sep 17 00:00:00 2001 From: Rasesh Mody Date: Tue, 7 Nov 2017 00:34:20 -0800 Subject: [PATCH] net/qede: fix device link structure 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 --- 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 a384b01f6b..52c2f0ec98 100644 --- a/drivers/net/qede/base/bcm_osal.h +++ b/drivers/net/qede/base/bcm_osal.h @@ -30,7 +30,7 @@ enum ecore_mcp_protocol_type; 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 @@ u32 qede_find_first_zero_bit(unsigned long *, u32); #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 3802aa808c..8edd2e966f 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 43562bc381..4ef08adec6 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 @@ qede_dev_info_get(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 3212020ef6..6c051c0ef9 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 a0c9e03b91..ae1873215e 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) -- 2.20.1