From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0056.outbound.protection.outlook.com [104.47.41.56]) by dpdk.org (Postfix) with ESMTP id E808F1B5FC; Tue, 7 Nov 2017 09:35:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=dmBP7gx9jtOOjiBw7+M21ps6ki405XpoFWlz50FdXrA=; b=K7dtw0JtHy6XNtVSlSypGHTYoOYs/bpO9+AsAAKiAjHFMtxZ5ZT7G57R7IaLUPzhT9h2YlvKvPuNH7+eOH/oGhtnBmuvDcC990Ih0IwCOmzZPiBj8Asm8XYsEiKn/w7u/DyqkcZ2kPkMsQ0/5AmwyPtpVc3U5yY63oJjlilMZSA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Rasesh.Mody@cavium.com; Received: from cavium.com (198.186.0.2) by CY4PR0701MB3827.namprd07.prod.outlook.com (2603:10b6:910:94::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.197.13; Tue, 7 Nov 2017 08:35:41 +0000 From: Rasesh Mody To: dev@dpdk.org Cc: Rasesh Mody , ferruh.yigit@intel.com, Dept-EngDPDKDev@cavium.com, stable@dpdk.org Date: Tue, 7 Nov 2017 00:34:20 -0800 Message-Id: <1510043665-8160-4-git-send-email-rasesh.mody@cavium.com> X-Mailer: git-send-email 1.7.10.3 In-Reply-To: <1510043665-8160-1-git-send-email-rasesh.mody@cavium.com> References: <1510043665-8160-1-git-send-email-rasesh.mody@cavium.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [198.186.0.2] X-ClientProxiedBy: YQXPR0101CA0004.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c00:15::17) To CY4PR0701MB3827.namprd07.prod.outlook.com (2603:10b6:910:94::33) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d0895094-2525-434b-ff90-08d525ba8831 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603199); SRVR:CY4PR0701MB3827; X-Microsoft-Exchange-Diagnostics: 1; CY4PR0701MB3827; 3:tamKUMrLo8sxSwLV6V4csYte8bvAcoAzg4UMYavZzHqvW+BnG3hqsbmcAlaW5OLv68UxgqpOTymPNZJUV8zkV1YtqiRaFsZB6JCSXyBTWU+1AYzOtVgxaFo0RdZaq2llYreGaYZqAN0kVgsFuqCHrdR03YvrcvtT0r0OJx1yMTnlIdH5QjQNTbXLkurg1zV7BrdUYal3Iz7EmC8mGqTksX9Q5qQqetzcuwj0E8vqFtXUmsNVir24iqkMJmQE1K+k; 25:sy0kzW6vzMFPxt06ImSUgAudJUDN85GZJNNPIFv0pdyBvDYLzqSelEq0SjwwyV3OqeBnFtiOkkEUxdtBKnHQlEFnkAWBRFpXRrjtcFbQqJh88YS/hU/bGElSq/kBkiOo5VTXJ2xlMexx2mmTMEclgek7Hm8oVuC/oAWEDpKu+TKSOWqWH4v71gKI4lPWXbcCxGwQ0ixb1grf2LVwiMUPsd2d0/n+NU8SMUZlrrWursT6O/j+QBpEs8PybjX3SmgEhWeEtMGeJVX81K2pIb2n/Y+L9vhyDv7lVnQBDmnb9tySfOvc+Xk2r2RpnhdTfO0biUDbSjiWXcYqXHBsFS1EFA==; 31:mOBrdjVt90pmbFTVJd+rLYmZedrU/80mFo7rrR61noJIU79Q06ibqd4VPU8/dXZuEnuswLSRNCB8ixBNeE7dZmPvx3ZxrAv5A7AyQuNiC/w/+31qQLSyKeNaFmiN00UfqGlY4JmCxq357NPSXnChHFu9j99tQIEWbGsJo9uk3ns7BTWI/ZM+BGRLQUq8niI7V9wvNedjxkyYb+8VznZdJF5MgNkABxRyIWllps+vt7Q= X-MS-TrafficTypeDiagnostic: CY4PR0701MB3827: X-Microsoft-Exchange-Diagnostics: 1; CY4PR0701MB3827; 20:mq5zOWeBmU2othuxlI9oKYYseNsrfZ0EIhPvUKoLAqF+YAdbLEDPHkcQsTAS6Vl+cwUsG9wmB+TaHNZC204E9oFH4kDm127XATmGJsH+RjT4495m4Tqe5UT7ImNLuhF8GLwnM3V8pZtUL80B+JU+5CGy148iX7vbjQN32MB69LFy3OlpdgYB4WZK3RmqeB1L3mll8oVKc0GnsBoJtdozqL94h+GopxmLde7CAab5BPDegqnFwS9XXMJYA1aLe63WrwO6q4KASuvadUBzt81G93cfqa4YgGT89xjmjifMnS372rLdzGuBgpn5FWUr0i860Wr6nx8VblMIH2Kzf/M07ZqqoImUe4Ei3680ZUEMibEG0r/SCsg7pDZKzoxDjWWMtF7aCPXfTm/XUrZb481WxKVJO86CI7ijUT5aA7gdBmMida0og0LTosXiovwinqx5K0R3TnqUWpQLk+NknUubboQsAiDNml8LXhMjnMqSDlXqKC7pXhCbvpDHBnMqi8zQ; 4:tWjomzuCpaY6lO5mpiJ3aFgB2BEdZjVAPPnt+aODO0Fzf7M1l8TA43tZjhyvBuQ439/6MUbGy21/EdddH937q3JzkH7jXspcD5WnGweOpyMMPuCqRDavohDnNHuKw1ScnwOsBqsl0ypCCrBIkTe0PmOy8iesJlJlZWbaRTNCuD3pe5J11Uw9c5VfEcV/vYGiCpRxNw67kK9gatFc2Q614/zsTofeRoLrFuXzhxm+8jZ2/uEHH2GxCGoJ84QfiDljY2Hpw9umqo9b1A32DOarbA== X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(3231021)(6041248)(20161123562025)(20161123564025)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR0701MB3827; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR0701MB3827; X-Forefront-PRVS: 0484063412 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(189002)(199003)(2351001)(47776003)(575784001)(50226002)(6916009)(15650500001)(36756003)(76176999)(53936002)(8936002)(68736007)(55016002)(2950100002)(4326008)(48376002)(50466002)(50986999)(5003940100001)(66066001)(97736004)(8676002)(86362001)(316002)(16586007)(81156014)(81166006)(2361001)(478600001)(33646002)(72206003)(6666003)(305945005)(21086003)(106356001)(7736002)(69596002)(189998001)(4720700003)(25786009)(2906002)(5660300001)(6116002)(105586002)(16526018)(3846002)(101416001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR0701MB3827; H:cavium.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR0701MB3827; 23:sOaeBr3Z9TmpuDA006ShYNk/Rr7sn0n61gzBsYY?= =?us-ascii?Q?XRH/rxcZA/luGYsHYwCW+tsx5Ntgu8jHfMFsrGcLi55Y3tgt4Ig9Z3Q884w/?= =?us-ascii?Q?5zPQ9kdd2y4AKBS449DYardxX1ydmWMRU2GWLS0CXMAb84GRZ6GNBb0Mws66?= =?us-ascii?Q?pVi6PLWxmAi3wVInrgWVzhwyjbkmYAn3RPeiUW4LKPxIT+RON0NdPHZCDMVd?= =?us-ascii?Q?066PjSrRgbz3dOUZh1vMyYUsC1SKJDxSh3zF0KLJAKy48b0ZzzlJkMDODb1H?= =?us-ascii?Q?0PF0qEyfjgKWkKgaHYVtf5HXPDwLCuuTYbjb53Bi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q?700RbVdTxCfh/b4mutso1uOAAsWoenFpui5m/?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR0701MB3827; 6:VYbv6dy8xAgne9MdJnim0PyqAWJbolthYQLp/P+N76YQNFZQ1ObTCJLbvXJH1Y2v/bMLldqx+7sTdImn+h1uUPHOsMFs4ZH7BMO3vCAaE+OMcyf6t1DwpxgMU+nxkpy5n0dNfMHEaFascf0+0FojrnkKof8Eqb2qxRefvdMfenOMUgH6+vtXl8Cq2HbXfDbtCtQVmbMjz5f94L+ZVpZSyaUWjU6/nHrV7MYf0nb6NBgxUpRTLJLtTXmFEyctXz0qpK1GD8SHJiyaNJN7YdFfGTQiBNigbMujVojxYyzHOY6dbUIURK96ijgwUz3uJ4SMJgWn1b/bW2MGqyz1bEVziMuEuYq/EFx3492aSllK5eY=; 5:I3Fpv8xnR9WQs0M4bZ/QauhqfN/ME1pqivu9/OoXOPJsrWVNZ3C99OyrudH3P/6oLWhGC7FYtKQ8FkBOoQq0agkKKYwWlFfFoYdtVEQjEfAo3RtJ+dBOyCGKXp7txJiTnAvYyenciWeQ8YbBQMP3rtLOYpwIBiVwWiN6+Dr6NQY=; 24:ZcUC2GM8c5+rTEsOCDtF7ZGdTJXxIsE0QjILVFUGfG2uD9uarYKd0Z64kwlIEEHhIUug8LuSRqcLlJNSZsN55lveWiRYzx8llYBVUsyej+8=; 7:sG+2vMqsonjN/GgKCoP3JIRXtDZR/NWGLcUjz6t/A26/k4mwrSp2crWICCKqDBQXo9QYTz9i4sHAzYhyXPqLCAhL9/kxctZt1a7De4oYFgRWzdmTIZZSw30qPMwiVx8MzvPltbqYU/iUEC3waEmMTsR3UuIH2R7OuxOA+O5D2QA+8BYbuy0g/ANXxFONfXK7JDbBJ4ns1T/aG8ZRZzYwceaqo16gNfPDQi5pLfmBZbhyAnIjLFaQR6iU9G8wQfWl SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2017 08:35:41.2072 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d0895094-2525-434b-ff90-08d525ba8831 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR0701MB3827 Subject: [dpdk-dev] [PATCH 3/8] net/qede: fix to update device link structure 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: , X-List-Received-Date: Tue, 07 Nov 2017 08:35:44 -0000 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 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