From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0051.outbound.protection.outlook.com [104.47.40.51]) by dpdk.org (Postfix) with ESMTP id 3C80B2BD8 for ; Sun, 28 May 2017 10:38:15 +0200 (CEST) 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=4al/volhZ+Wh+Ca5Dh9QJv6x6t/+0FxkC/INB+BQfu0=; b=dHcsqQ7geBpn2R9gSMjthIXHDQcSsBKw9O4fUseJbm9uKLqide7Wnzi95aR0Oj0aMiVo9Ar8gkUQiw1KbTgdx7ZQJY5PcHHAoyCcUx5ALvGjzhbB0SOJVmM2m14CymBNQpJNnld7EUrXV5GpvkQ1ceBo5tz/rastohTeun/sRk4= Received: from SN1PR0701CA0016.namprd07.prod.outlook.com (10.162.96.26) by BLUPR0701MB1570.namprd07.prod.outlook.com (10.163.84.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9; Sun, 28 May 2017 08:38:13 +0000 Received: from BN1BFFO11FD026.protection.gbl (2a01:111:f400:7c10::1:175) by SN1PR0701CA0016.outlook.office365.com (2a01:111:e400:5173::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9 via Frontend Transport; Sun, 28 May 2017 08:38:12 +0000 Authentication-Results: spf=none (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=cavium.com; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BN1BFFO11FD026.mail.protection.outlook.com (10.58.144.89) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.1075.5 via Frontend Transport; Sun, 28 May 2017 08:38:12 +0000 Received: from avsmtprelay01.qlc.com (10.1.112.194) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Sun, 28 May 2017 01:38:11 -0700 Received: from avluser05.qlc.com (avluser05.qlc.com [10.1.113.115]) by avsmtprelay01.qlc.com (Postfix) with ESMTP id 309268BF762D9; Sun, 28 May 2017 01:38:11 -0700 (PDT) Received: (from rmody@localhost) by avluser05.qlc.com (8.14.4/8.14.4/Submit) id v4S8cBCG000474; Sun, 28 May 2017 01:38:11 -0700 X-Authentication-Warning: avluser05.qlc.com: rmody set sender to rasesh.mody@cavium.com using -f From: Rasesh Mody To: CC: Harish Patil , Date: Sun, 28 May 2017 01:37:28 -0700 Message-ID: <1495960654-352-2-git-send-email-rasesh.mody@cavium.com> X-Mailer: git-send-email 1.7.10.3 In-Reply-To: <1495960654-352-1-git-send-email-rasesh.mody@cavium.com> References: <1495960654-352-1-git-send-email-rasesh.mody@cavium.com> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39850400002)(39840400002)(39450400003)(39400400002)(39410400002)(2980300002)(428002)(199003)(189002)(9170700003)(81166006)(50226002)(4326008)(8936002)(33646002)(110136004)(107886003)(2351001)(5003940100001)(38730400002)(54906002)(47776003)(575784001)(5660300001)(86362001)(8676002)(478600001)(72206003)(356003)(87636003)(50466002)(48376002)(2950100002)(6666003)(76176999)(50986999)(101416001)(2906002)(305945005)(36756003)(42186005)(6916009)(4720700003)(189998001)(105586002)(106466001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1570; H:CAEXCH02.caveonetworks.com; FPR:; SPF:None; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD026; 1:Ok1xmIxizbsIApdPYoDdl6xOGSPhmoK6DJW3h0NrMigRGKiirNMSxYul7/KYhN8DeR/aOaOs+jWWlY7ESsnQlF1HnMA2jrPa3+6rkwJSBgnfv70nS4miTr6jSlqFOT5Ce67y8XtmKwIcnrqXltuud7q1bRZSvyzr4UM/BQ73vbo4l7zVxJCLsf0dIsP2w5oAvuP+ddwTJpiT0yOBnPrHR5K8cuWrRrVlFzJMkGSE11zyn8uuQpv2fkdGTdS+1hFadOtmN6vyEjjMvMBVGzB2QvJOvcnasK+MuPIxRRCRJ4byzibWZGG6G0k3QXkHVAq6FxYW/Cp1wzhFTZ/BfOLVe9PHfTCDI64A59E56IiK03DrOHOUxS5Y9H9D2jumqcQvY/UzIWm3/1XMSswl+PxyVSCBMYGlugNelXBgnat0vTS9BS5/Hgxq8S+X87u3kLVLcD1krNo3YD3C1v1mCXy1uw== X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BLUPR0701MB1570: X-MS-Office365-Filtering-Correlation-Id: 24a1ebca-1e9e-4d5d-c6a5-08d4a5a4e0c1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081)(201702281549075); SRVR:BLUPR0701MB1570; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1570; 3:y/DLx+zT0M2D+WARS+xKGVVKcRHPLCKE0CMMpSbZys3ihyGG6+cuZ26CppAyznD1wer6I4c1vSbeZjYOwaxLoQne2pip8Tawsz3IOuiD1q8hFrCw/CeZuufug9WrFmD0LpGSlbPYT5l9O1QyItYO3w9hnUu6V8KoS6H6t27CVPtlBtlAYuNXSI8U1KK2STfpFNQhfdP6lGNlWH+uF+aWbZrCNWNQ+K6NVnY3+tgPb9EHCgv+dbjM/dWVzRNw6UAWNxBu4/cMr8fJ9WZVBfKND+3jXHObU2w8ZGPEtgijWBRA8RwDeqf4dhtJPEgKgWZH2Rjp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OkKol+dVZuMcgb4mxFU8blk6BoK7oVXP1wa4cqpYwHqJ2ZCM508k5JoDuMFjf6mA1shJHJZdEVP2qpr9lzfeMLeGllrVdby1uM/gvT2fVU3DAKOzhIshtDdiZnLOQTdMrVqD7V+t73+vAcbUzmizveATayO9ZkYAtskzkmF68/TXKY4gZMqusIFDnM/wfw1IM3UgUtAOGxpeFsQ3xvzlrv9M/96QPEVUOMnRyXqV9gKd8WWxHUdUUuva/TvBwen2XAJS8EmfJ87cx5o/wNvMTV8J2BGNY877LMq9fzHMp0GLCG6+K6jsUvMxgDi0I2/GXp3QypSzl4Qmbwd3VKH0PCwjFeoYIQ4Kb0BCbRyS7xCTahtQx3xIzhKe2jYOGy7RHwHbv3WZadPXcOxp84yOGF2OldiHQZ16yPF48GxkjWADgZe9cjbj4SAJQ1XT8upXcaL9tTC7j4UpNYFiDX9oooiD+xiiDXBj6W5JeqW X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700073)(100105000095)(100000701073)(100105300095)(100000702073)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(13018025)(13016025)(93006095)(93001095)(10201501046)(100000703073)(100105400095)(3002001)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(20161123558100)(20161123555025)(6072148)(100000704073)(100105200095)(100000705073)(100105500095); SRVR:BLUPR0701MB1570; BCL:0; PCL:0; RULEID:(100000800073)(100110000095)(100000801073)(100110300095)(100000802073)(100110100095)(100000803073)(100110400095)(100000804073)(100110200095)(100000805073)(100110500095); SRVR:BLUPR0701MB1570; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1570; 4:tpq/PlCS3Sf/HHP5fsaAcLWhqh3APVx0DOdwZABq?= =?us-ascii?Q?PekrHKyC+AJkH9va6dCdodGDigEDgOKsGZYdq1VXmPooB9cdw0d4PecNiHfy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x96vE4GtNnZR45DuZMZSvPH+XRYUndpTxHSNRePO/VVPney52JuPn?= =?us-ascii?Q?A2JRp0imX/H6R9lqUtaOazKLr9iVG7CzOhkQ3FwG9ZmMKWrWcSDZJJ+2yDI9?= =?us-ascii?Q?u3TE85rCmiGGVv6sVtuTCrlFBAinAd9NH6G9T6kF4f8N7kwnaNzv4yF62zXk?= =?us-ascii?Q?eNhyBQahHuVATX+M/Us25NOyc3019rfBvf+BDjdxj3cgVBzPD0pI2KvYdMHY?= =?us-ascii?Q?Q5FDNtAi+Ut2PFI=3D?= X-Forefront-PRVS: 03218BFD9F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1570; 23:kVRECACm7DTdL07y3qdQAZAjhnJfqSf/Djh1tTQ?= =?us-ascii?Q?JH0pK3g/crj+cSlnOHqwL7Bj95aGiM9af7BA7ciqutVzUPO0F8H+cAAM8CNi?= =?us-ascii?Q?XEgJtz+fsAQAUZ3D+4SzBzgsxv8PW89Tmq+6hj3EAcTQPsXpB8CNBZgleovO?= =?us-ascii?Q?m6w4D6sgP94NC5TXgSXg301I8VYIc5j8rNrUz+G8eEuVKwqE7Qh75m9REzSP?= =?us-ascii?Q?lYMUK5F4XmFGat6qdvbWgt8Mr4xlMZSYjU2VVAIBaoikKvMExwRUahhZHJPZ?= =?us-ascii?Q?ZiGJrkTEac9fRNOzunz09juNjZSM8GPzCQp6KS+t1PZFNI/kfp3+UFoah0I7?= =?us-ascii?Q?MbaGT5uuaAU3z/EvZTCFNkZGM3olUnRfcw686+hFbtuS1h7U5zuvUUAq9UfD?= =?us-ascii?Q?IMupix25NsxXaAFmkSXCZzk9Mlwx9wZCwZetv2MobJ737CT5pKfxynxjmL5z?= =?us-ascii?Q?+ZR9fKhK+OXOKqX1qPz7Qo6rkT3ph8fRNobIbZ434dIxz2ts7R6N9XdOAeHG?= =?us-ascii?Q?ag8l6Yuquhx3OJNnG625yS06ESqzSIQC/ukdY0oP+nzTvFA3biIBBbObS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cepcAyZi6fpTJhtz4Qm7eXTh0zm5VCp8JJIiBw+VFsyVDPZNAgqvFP+oP1TLS7bK3OGvBq7TECEQEKaPzUEEoTQbzQdCJzqY8iRLzzKGcPdKfHjQy2xmF20yFcF/Tb5DuuTWS3q+Ht52Uodm6HbCQ3tFealViySaDZWQ79wApk3yGFALFZ3TsogBqGeNiNV0ysXCZlDVhk0Vnx5FhJYfx5F47p7aemMysBvkPiJXdfv3UEe2oukN1WE5m2K8jBq6HkdxN4P8Rc1VHr/pCe+FeuO4sBZzlrrv5XLw== X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2017 08:38:12.5261 (UTC) X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194; Ip=[50.232.66.26]; Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1570 Subject: [dpdk-dev] [PATCH 1/7] net/qede: refactoring vport handling code 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: Sun, 28 May 2017 08:38:16 -0000 From: Harish Patil The refactoring is mainly for two reasons: - To remove an additional layer of internal callbacks for all vport related operations from the struct qed_eth_ops_pass. Instead, we can invoke base APIs directly. - Splitting a single large vport-update configuration into multiple and independent vport-update operations. Each configuration would touch only the required config bits that needs an update. Signed-off-by: Harish Patil --- drivers/net/qede/qede_eth_if.c | 109 --------------- drivers/net/qede/qede_eth_if.h | 35 ----- drivers/net/qede/qede_ethdev.c | 302 ++++++++++++++++++++++++++++++---------- drivers/net/qede/qede_ethdev.h | 7 + drivers/net/qede/qede_rxtx.c | 106 +++----------- 5 files changed, 259 insertions(+), 300 deletions(-) diff --git a/drivers/net/qede/qede_eth_if.c b/drivers/net/qede/qede_eth_if.c index a3c0b13..7557943 100644 --- a/drivers/net/qede/qede_eth_if.c +++ b/drivers/net/qede/qede_eth_if.c @@ -9,112 +9,6 @@ #include "qede_ethdev.h" static int -qed_start_vport(struct ecore_dev *edev, struct qed_start_vport_params *p_params) -{ - int rc, i; - - for_each_hwfn(edev, i) { - struct ecore_hwfn *p_hwfn = &edev->hwfns[i]; - u8 tx_switching = 0; - struct ecore_sp_vport_start_params start = { 0 }; - - start.tpa_mode = p_params->enable_lro ? ECORE_TPA_MODE_RSC : - ECORE_TPA_MODE_NONE; - start.remove_inner_vlan = p_params->remove_inner_vlan; - start.tx_switching = tx_switching; - start.only_untagged = false; /* untagged only */ - start.drop_ttl0 = p_params->drop_ttl0; - start.concrete_fid = p_hwfn->hw_info.concrete_fid; - start.opaque_fid = p_hwfn->hw_info.opaque_fid; - start.concrete_fid = p_hwfn->hw_info.concrete_fid; - start.handle_ptp_pkts = p_params->handle_ptp_pkts; - start.vport_id = p_params->vport_id; - start.mtu = p_params->mtu; - /* @DPDK - Disable FW placement */ - start.zero_placement_offset = 1; - - rc = ecore_sp_vport_start(p_hwfn, &start); - if (rc) { - DP_ERR(edev, "Failed to start VPORT\n"); - return rc; - } - - DP_VERBOSE(edev, ECORE_MSG_SPQ, - "Started V-PORT %d with MTU %d\n", - p_params->vport_id, p_params->mtu); - } - - ecore_reset_vport_stats(edev); - - return 0; -} - -static int qed_stop_vport(struct ecore_dev *edev, uint8_t vport_id) -{ - int rc, i; - - for_each_hwfn(edev, i) { - struct ecore_hwfn *p_hwfn = &edev->hwfns[i]; - rc = ecore_sp_vport_stop(p_hwfn, - p_hwfn->hw_info.opaque_fid, vport_id); - - if (rc) { - DP_ERR(edev, "Failed to stop VPORT\n"); - return rc; - } - } - - return 0; -} - -static int -qed_update_vport(struct ecore_dev *edev, struct qed_update_vport_params *params) -{ - struct ecore_sp_vport_update_params sp_params; - struct ecore_rss_params sp_rss_params; - int rc, i; - - memset(&sp_params, 0, sizeof(sp_params)); - memset(&sp_rss_params, 0, sizeof(sp_rss_params)); - - /* Translate protocol params into sp params */ - sp_params.vport_id = params->vport_id; - sp_params.update_vport_active_rx_flg = params->update_vport_active_flg; - sp_params.update_vport_active_tx_flg = params->update_vport_active_flg; - sp_params.vport_active_rx_flg = params->vport_active_flg; - sp_params.vport_active_tx_flg = params->vport_active_flg; - sp_params.update_inner_vlan_removal_flg = - params->update_inner_vlan_removal_flg; - sp_params.inner_vlan_removal_flg = params->inner_vlan_removal_flg; - sp_params.update_tx_switching_flg = params->update_tx_switching_flg; - sp_params.tx_switching_flg = params->tx_switching_flg; - sp_params.accept_any_vlan = params->accept_any_vlan; - sp_params.update_accept_any_vlan_flg = - params->update_accept_any_vlan_flg; - sp_params.mtu = params->mtu; - sp_params.sge_tpa_params = params->sge_tpa_params; - - for_each_hwfn(edev, i) { - struct ecore_hwfn *p_hwfn = &edev->hwfns[i]; - - sp_params.opaque_fid = p_hwfn->hw_info.opaque_fid; - rc = ecore_sp_vport_update(p_hwfn, &sp_params, - ECORE_SPQ_MODE_EBLOCK, NULL); - if (rc) { - DP_ERR(edev, "Failed to update VPORT\n"); - return rc; - } - - DP_VERBOSE(edev, ECORE_MSG_SPQ, - "Updated V-PORT %d: active_flag %d [update %d]\n", - params->vport_id, params->vport_active_flg, - params->update_vport_active_flg); - } - - return 0; -} - -static int qed_start_rxq(struct ecore_dev *edev, uint8_t rss_num, struct ecore_queue_start_common_params *p_params, @@ -299,9 +193,6 @@ int qed_configure_filter_rx_mode(struct rte_eth_dev *eth_dev, static const struct qed_eth_ops qed_eth_ops_pass = { INIT_STRUCT_FIELD(common, &qed_common_ops_pass), INIT_STRUCT_FIELD(fill_dev_info, &qed_fill_eth_dev_info), - INIT_STRUCT_FIELD(vport_start, &qed_start_vport), - INIT_STRUCT_FIELD(vport_stop, &qed_stop_vport), - INIT_STRUCT_FIELD(vport_update, &qed_update_vport), INIT_STRUCT_FIELD(q_rx_start, &qed_start_rxq), INIT_STRUCT_FIELD(q_tx_start, &qed_start_txq), INIT_STRUCT_FIELD(q_rx_stop, &qed_stop_rxq), diff --git a/drivers/net/qede/qede_eth_if.h b/drivers/net/qede/qede_eth_if.h index 097e025..be6c7c1 100644 --- a/drivers/net/qede/qede_eth_if.h +++ b/drivers/net/qede/qede_eth_if.h @@ -16,8 +16,6 @@ #define INIT_STRUCT_FIELD(field, value) .field = value -#define QED_ETH_INTERFACE_VERSION 609 - #define QEDE_MAX_MCAST_FILTERS 64 enum qed_filter_rx_mode_type { @@ -47,45 +45,12 @@ struct qed_dev_eth_info { bool is_legacy; }; -struct qed_update_vport_params { - uint8_t vport_id; - uint8_t update_vport_active_flg; - uint8_t vport_active_flg; - uint8_t update_inner_vlan_removal_flg; - uint8_t inner_vlan_removal_flg; - uint8_t update_tx_switching_flg; - uint8_t tx_switching_flg; - uint8_t update_accept_any_vlan_flg; - uint8_t accept_any_vlan; - uint8_t update_rss_flg; - uint16_t mtu; - struct ecore_sge_tpa_params *sge_tpa_params; -}; - -struct qed_start_vport_params { - bool remove_inner_vlan; - bool handle_ptp_pkts; - bool enable_lro; - bool drop_ttl0; - uint8_t vport_id; - uint16_t mtu; - bool clear_stats; -}; - struct qed_eth_ops { const struct qed_common_ops *common; int (*fill_dev_info)(struct ecore_dev *edev, struct qed_dev_eth_info *info); - int (*vport_start)(struct ecore_dev *edev, - struct qed_start_vport_params *params); - - int (*vport_stop)(struct ecore_dev *edev, uint8_t vport_id); - - int (*vport_update)(struct ecore_dev *edev, - struct qed_update_vport_params *params); - int (*q_rx_start)(struct ecore_dev *cdev, uint8_t rss_num, struct ecore_queue_start_common_params *p_params, diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c index 49742ac..0bdad32 100644 --- a/drivers/net/qede/qede_ethdev.c +++ b/drivers/net/qede/qede_ethdev.c @@ -329,6 +329,178 @@ static void qede_print_adapter_info(struct qede_dev *qdev) } #endif +static int +qede_start_vport(struct qede_dev *qdev, uint16_t mtu) +{ + struct ecore_dev *edev = QEDE_INIT_EDEV(qdev); + struct ecore_sp_vport_start_params params; + struct ecore_hwfn *p_hwfn; + int rc; + int i; + + memset(¶ms, 0, sizeof(params)); + params.vport_id = 0; + params.mtu = mtu; + /* @DPDK - Disable FW placement */ + params.zero_placement_offset = 1; + for_each_hwfn(edev, i) { + p_hwfn = &edev->hwfns[i]; + params.concrete_fid = p_hwfn->hw_info.concrete_fid; + params.opaque_fid = p_hwfn->hw_info.opaque_fid; + rc = ecore_sp_vport_start(p_hwfn, ¶ms); + if (rc != ECORE_SUCCESS) { + DP_ERR(edev, "Start V-PORT failed %d\n", rc); + return rc; + } + } + ecore_reset_vport_stats(edev); + DP_INFO(edev, "VPORT started with MTU = %u\n", mtu); + + return 0; +} + +static int +qede_stop_vport(struct ecore_dev *edev) +{ + struct ecore_hwfn *p_hwfn; + uint8_t vport_id; + int rc; + int i; + + vport_id = 0; + for_each_hwfn(edev, i) { + p_hwfn = &edev->hwfns[i]; + rc = ecore_sp_vport_stop(p_hwfn, p_hwfn->hw_info.opaque_fid, + vport_id); + if (rc != ECORE_SUCCESS) { + DP_ERR(edev, "Stop V-PORT failed rc = %d\n", rc); + return rc; + } + } + + return 0; +} + +/* Activate or deactivate vport via vport-update */ +int qede_activate_vport(struct rte_eth_dev *eth_dev, bool flg) +{ + struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev); + struct ecore_dev *edev = QEDE_INIT_EDEV(qdev); + struct ecore_sp_vport_update_params params; + struct ecore_hwfn *p_hwfn; + uint8_t i; + int rc = -1; + + memset(¶ms, 0, sizeof(struct ecore_sp_vport_update_params)); + params.vport_id = 0; + params.update_vport_active_rx_flg = 1; + params.update_vport_active_tx_flg = 1; + params.vport_active_rx_flg = flg; + params.vport_active_tx_flg = flg; + for_each_hwfn(edev, i) { + p_hwfn = &edev->hwfns[i]; + params.opaque_fid = p_hwfn->hw_info.opaque_fid; + rc = ecore_sp_vport_update(p_hwfn, ¶ms, + ECORE_SPQ_MODE_EBLOCK, NULL); + if (rc != ECORE_SUCCESS) { + DP_ERR(edev, "Failed to update vport\n"); + break; + } + } + DP_INFO(edev, "vport %s\n", flg ? "activated" : "deactivated"); + return rc; +} + +static void +qede_update_sge_tpa_params(struct ecore_sge_tpa_params *sge_tpa_params, + uint16_t mtu, bool enable) +{ + /* Enable LRO in split mode */ + sge_tpa_params->tpa_ipv4_en_flg = enable; + sge_tpa_params->tpa_ipv6_en_flg = enable; + sge_tpa_params->tpa_ipv4_tunn_en_flg = false; + sge_tpa_params->tpa_ipv6_tunn_en_flg = false; + /* set if tpa enable changes */ + sge_tpa_params->update_tpa_en_flg = 1; + /* set if tpa parameters should be handled */ + sge_tpa_params->update_tpa_param_flg = enable; + + sge_tpa_params->max_buffers_per_cqe = 20; + /* Enable TPA in split mode. In this mode each TPA segment + * starts on the new BD, so there is one BD per segment. + */ + sge_tpa_params->tpa_pkt_split_flg = 1; + sge_tpa_params->tpa_hdr_data_split_flg = 0; + sge_tpa_params->tpa_gro_consistent_flg = 0; + sge_tpa_params->tpa_max_aggs_num = ETH_TPA_MAX_AGGS_NUM; + sge_tpa_params->tpa_max_size = 0x7FFF; + sge_tpa_params->tpa_min_size_to_start = mtu / 2; + sge_tpa_params->tpa_min_size_to_cont = mtu / 2; +} + +/* Enable/disable LRO via vport-update */ +int qede_enable_tpa(struct rte_eth_dev *eth_dev, bool flg) +{ + struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev); + struct ecore_dev *edev = QEDE_INIT_EDEV(qdev); + struct ecore_sp_vport_update_params params; + struct ecore_sge_tpa_params tpa_params; + struct ecore_hwfn *p_hwfn; + int rc; + int i; + + memset(¶ms, 0, sizeof(struct ecore_sp_vport_update_params)); + memset(&tpa_params, 0, sizeof(struct ecore_sge_tpa_params)); + qede_update_sge_tpa_params(&tpa_params, qdev->mtu, flg); + params.vport_id = 0; + params.sge_tpa_params = &tpa_params; + for_each_hwfn(edev, i) { + p_hwfn = &edev->hwfns[i]; + params.opaque_fid = p_hwfn->hw_info.opaque_fid; + rc = ecore_sp_vport_update(p_hwfn, ¶ms, + ECORE_SPQ_MODE_EBLOCK, NULL); + if (rc != ECORE_SUCCESS) { + DP_ERR(edev, "Failed to update LRO\n"); + return -1; + } + } + + DP_INFO(edev, "LRO is %s\n", flg ? "enabled" : "disabled"); + + return 0; +} + +/* Update MTU via vport-update without doing port restart. + * The vport must be deactivated before calling this API. + */ +int qede_update_mtu(struct rte_eth_dev *eth_dev, uint16_t mtu) +{ + struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev); + struct ecore_dev *edev = QEDE_INIT_EDEV(qdev); + struct ecore_sp_vport_update_params params; + struct ecore_hwfn *p_hwfn; + int rc; + int i; + + memset(¶ms, 0, sizeof(struct ecore_sp_vport_update_params)); + params.vport_id = 0; + params.mtu = mtu; + params.vport_id = 0; + for_each_hwfn(edev, i) { + p_hwfn = &edev->hwfns[i]; + params.opaque_fid = p_hwfn->hw_info.opaque_fid; + rc = ecore_sp_vport_update(p_hwfn, ¶ms, + ECORE_SPQ_MODE_EBLOCK, NULL); + if (rc != ECORE_SUCCESS) { + DP_ERR(edev, "Failed to update MTU\n"); + return -1; + } + } + DP_INFO(edev, "MTU updated to %u\n", mtu); + + return 0; +} + static void qede_set_ucast_cmn_params(struct ecore_filter_ucast *ucast) { memset(ucast, 0, sizeof(struct ecore_filter_ucast)); @@ -565,49 +737,57 @@ static void qede_set_cmn_tunn_param(struct ecore_tunnel_info *p_tunn, qede_mac_addr_add(eth_dev, mac_addr, 0, 0); } -static void qede_config_accept_any_vlan(struct qede_dev *qdev, bool action) +static void qede_config_accept_any_vlan(struct qede_dev *qdev, bool flg) { - struct ecore_dev *edev = &qdev->edev; - struct qed_update_vport_params params = { - .vport_id = 0, - .accept_any_vlan = action, - .update_accept_any_vlan_flg = 1, - }; + struct ecore_dev *edev = QEDE_INIT_EDEV(qdev); + struct ecore_sp_vport_update_params params; + struct ecore_hwfn *p_hwfn; + uint8_t i; int rc; - /* Proceed only if action actually needs to be performed */ - if (qdev->accept_any_vlan == action) - return; - - rc = qdev->ops->vport_update(edev, ¶ms); - if (rc) { - DP_ERR(edev, "Failed to %s accept-any-vlan\n", - action ? "enable" : "disable"); - } else { - DP_INFO(edev, "%s accept-any-vlan\n", - action ? "enabled" : "disabled"); - qdev->accept_any_vlan = action; + memset(¶ms, 0, sizeof(struct ecore_sp_vport_update_params)); + params.vport_id = 0; + params.update_accept_any_vlan_flg = 1; + params.accept_any_vlan = flg; + for_each_hwfn(edev, i) { + p_hwfn = &edev->hwfns[i]; + params.opaque_fid = p_hwfn->hw_info.opaque_fid; + rc = ecore_sp_vport_update(p_hwfn, ¶ms, + ECORE_SPQ_MODE_EBLOCK, NULL); + if (rc != ECORE_SUCCESS) { + DP_ERR(edev, "Failed to configure accept-any-vlan\n"); + return; + } } + + DP_INFO(edev, "%s accept-any-vlan\n", flg ? "enabled" : "disabled"); } -static int qede_vlan_stripping(struct rte_eth_dev *eth_dev, bool set_stripping) +static int qede_vlan_stripping(struct rte_eth_dev *eth_dev, bool flg) { - struct qed_update_vport_params vport_update_params; struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev); struct ecore_dev *edev = QEDE_INIT_EDEV(qdev); + struct ecore_sp_vport_update_params params; + struct ecore_hwfn *p_hwfn; + uint8_t i; int rc; - memset(&vport_update_params, 0, sizeof(vport_update_params)); - vport_update_params.vport_id = 0; - vport_update_params.update_inner_vlan_removal_flg = 1; - vport_update_params.inner_vlan_removal_flg = set_stripping; - rc = qdev->ops->vport_update(edev, &vport_update_params); - if (rc) { - DP_ERR(edev, "Update V-PORT failed %d\n", rc); - return rc; + memset(¶ms, 0, sizeof(struct ecore_sp_vport_update_params)); + params.vport_id = 0; + params.update_inner_vlan_removal_flg = 1; + params.inner_vlan_removal_flg = flg; + for_each_hwfn(edev, i) { + p_hwfn = &edev->hwfns[i]; + params.opaque_fid = p_hwfn->hw_info.opaque_fid; + rc = ecore_sp_vport_update(p_hwfn, ¶ms, + ECORE_SPQ_MODE_EBLOCK, NULL); + if (rc != ECORE_SUCCESS) { + DP_ERR(edev, "Failed to update vport\n"); + return -1; + } } - qdev->vlan_strip_flg = set_stripping; + DP_INFO(edev, "VLAN stripping %s\n", flg ? "enabled" : "disabled"); return 0; } @@ -741,33 +921,6 @@ static void qede_vlan_offload_set(struct rte_eth_dev *eth_dev, int mask) mask, rxmode->hw_vlan_strip, rxmode->hw_vlan_filter); } -static int qede_init_vport(struct qede_dev *qdev) -{ - struct ecore_dev *edev = &qdev->edev; - struct qed_start_vport_params start = {0}; - int rc; - - start.remove_inner_vlan = 1; - start.enable_lro = qdev->enable_lro; - start.mtu = ETHER_MTU + QEDE_ETH_OVERHEAD; - start.vport_id = 0; - start.drop_ttl0 = false; - start.clear_stats = 1; - start.handle_ptp_pkts = 0; - - rc = qdev->ops->vport_start(edev, &start); - if (rc) { - DP_ERR(edev, "Start V-PORT failed %d\n", rc); - return rc; - } - - DP_INFO(edev, - "Start vport ramrod passed, vport_id = %d, MTU = %u\n", - start.vport_id, ETHER_MTU); - - return 0; -} - static void qede_prandom_bytes(uint32_t *buff) { uint8_t i; @@ -863,9 +1016,7 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev) /* Check for the port restart case */ if (qdev->state != QEDE_DEV_INIT) { - rc = qdev->ops->vport_stop(edev, 0); - if (rc != 0) - return rc; + qede_stop_vport(edev); qede_dealloc_fp_resc(eth_dev); } @@ -880,17 +1031,24 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev) if (rc != 0) return rc; - /* Issue VPORT-START with default config values to allow - * other port configurations early on. + /* VF's MTU has to be set using vport-start where as + * PF's MTU can be updated via vport-update. */ - rc = qede_init_vport(qdev); - if (rc != 0) - return rc; + if (IS_VF(edev)) { + if (qede_start_vport(qdev, rxmode->max_rx_pkt_len)) + return -1; + } else { + if (qede_update_mtu(eth_dev, rxmode->max_rx_pkt_len)) + return -1; + } + + qdev->mtu = rxmode->max_rx_pkt_len; + qdev->new_mtu = qdev->mtu; if (!(rxmode->mq_mode == ETH_MQ_RX_RSS || rxmode->mq_mode == ETH_MQ_RX_NONE)) { DP_ERR(edev, "Unsupported RSS mode\n"); - qdev->ops->vport_stop(edev, 0); + qede_stop_vport(edev); qede_dealloc_fp_resc(eth_dev); return -EINVAL; } @@ -898,7 +1056,7 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev) /* Flow director mode check */ rc = qede_check_fdir_support(eth_dev); if (rc) { - qdev->ops->vport_stop(edev, 0); + qede_stop_vport(edev); qede_dealloc_fp_resc(eth_dev); return -EINVAL; } @@ -1106,7 +1264,6 @@ static void qede_dev_close(struct rte_eth_dev *eth_dev) struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev); struct ecore_dev *edev = QEDE_INIT_EDEV(qdev); - int rc; PMD_INIT_FUNC_TRACE(edev); @@ -1122,9 +1279,7 @@ static void qede_dev_close(struct rte_eth_dev *eth_dev) else DP_INFO(edev, "Device is already stopped\n"); - rc = qdev->ops->vport_stop(edev, 0); - if (rc != 0) - DP_ERR(edev, "Failed to stop VPORT\n"); + qede_stop_vport(edev); qede_dealloc_fp_resc(eth_dev); @@ -2322,6 +2477,11 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf) } adapter->state = QEDE_DEV_INIT; + adapter->mtu = ETHER_MTU; + adapter->new_mtu = ETHER_MTU; + if (!is_vf) + if (qede_start_vport(adapter, adapter->mtu)) + return -1; DP_NOTICE(edev, false, "MAC address : %02x:%02x:%02x:%02x:%02x:%02x\n", adapter->primary_mac.addr_bytes[0], diff --git a/drivers/net/qede/qede_ethdev.h b/drivers/net/qede/qede_ethdev.h index e4323a0..62b1de4 100644 --- a/drivers/net/qede/qede_ethdev.h +++ b/drivers/net/qede/qede_ethdev.h @@ -190,6 +190,7 @@ struct qede_dev { struct qede_fastpath *fp_array; uint8_t num_tc; uint16_t mtu; + uint16_t new_mtu; bool rss_enable; struct rte_eth_rss_conf rss_conf; uint16_t rss_ind_table[ECORE_RSS_IND_TABLE_SIZE]; @@ -248,4 +249,10 @@ uint16_t qede_fdir_construct_pkt(struct rte_eth_dev *eth_dev, void qede_fdir_dealloc_resc(struct rte_eth_dev *eth_dev); +int qede_activate_vport(struct rte_eth_dev *eth_dev, bool flg); + +int qede_update_mtu(struct rte_eth_dev *eth_dev, uint16_t mtu); + +int qede_enable_tpa(struct rte_eth_dev *eth_dev, bool flg); + #endif /* _QEDE_ETHDEV_H_ */ diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c index baea1bb..67496f3 100644 --- a/drivers/net/qede/qede_rxtx.c +++ b/drivers/net/qede/qede_rxtx.c @@ -506,42 +506,11 @@ void qede_dealloc_fp_resc(struct rte_eth_dev *eth_dev) PMD_RX_LOG(DEBUG, rxq, "bd_prod %u cqe_prod %u", bd_prod, cqe_prod); } -static void -qede_update_sge_tpa_params(struct ecore_sge_tpa_params *sge_tpa_params, - uint16_t mtu, bool enable) -{ - /* Enable LRO in split mode */ - sge_tpa_params->tpa_ipv4_en_flg = enable; - sge_tpa_params->tpa_ipv6_en_flg = enable; - sge_tpa_params->tpa_ipv4_tunn_en_flg = false; - sge_tpa_params->tpa_ipv6_tunn_en_flg = false; - /* set if tpa enable changes */ - sge_tpa_params->update_tpa_en_flg = 1; - /* set if tpa parameters should be handled */ - sge_tpa_params->update_tpa_param_flg = enable; - - sge_tpa_params->max_buffers_per_cqe = 20; - /* Enable TPA in split mode. In this mode each TPA segment - * starts on the new BD, so there is one BD per segment. - */ - sge_tpa_params->tpa_pkt_split_flg = 1; - sge_tpa_params->tpa_hdr_data_split_flg = 0; - sge_tpa_params->tpa_gro_consistent_flg = 0; - sge_tpa_params->tpa_max_aggs_num = ETH_TPA_MAX_AGGS_NUM; - sge_tpa_params->tpa_max_size = 0x7FFF; - sge_tpa_params->tpa_min_size_to_start = mtu / 2; - sge_tpa_params->tpa_min_size_to_cont = mtu / 2; -} - -static int qede_start_queues(struct rte_eth_dev *eth_dev, - __rte_unused bool clear_stats) +static int qede_start_queues(struct rte_eth_dev *eth_dev) { struct qede_dev *qdev = eth_dev->data->dev_private; struct ecore_dev *edev = &qdev->edev; struct ecore_queue_start_common_params q_params; - struct qed_dev_info *qed_info = &qdev->dev_info.common; - struct qed_update_vport_params vport_update_params; - struct ecore_sge_tpa_params tpa_params; struct qede_tx_queue *txq; struct qede_fastpath *fp; dma_addr_t p_phys_table; @@ -635,35 +604,6 @@ static int qede_start_queues(struct rte_eth_dev *eth_dev, } } - /* Prepare and send the vport enable */ - memset(&vport_update_params, 0, sizeof(vport_update_params)); - /* Update MTU via vport update */ - vport_update_params.mtu = qdev->mtu; - vport_update_params.vport_id = 0; - vport_update_params.update_vport_active_flg = 1; - vport_update_params.vport_active_flg = 1; - - /* @DPDK */ - if (qed_info->mf_mode == MF_NPAR && qed_info->tx_switching) { - /* TBD: Check SRIOV enabled for VF */ - vport_update_params.update_tx_switching_flg = 1; - vport_update_params.tx_switching_flg = 1; - } - - /* TPA */ - if (qdev->enable_lro) { - DP_INFO(edev, "Enabling LRO\n"); - memset(&tpa_params, 0, sizeof(struct ecore_sge_tpa_params)); - qede_update_sge_tpa_params(&tpa_params, qdev->mtu, true); - vport_update_params.sge_tpa_params = &tpa_params; - } - - rc = qdev->ops->vport_update(edev, &vport_update_params); - if (rc) { - DP_ERR(edev, "Update V-PORT failed %d\n", rc); - return rc; - } - return 0; } @@ -1703,7 +1643,18 @@ int qede_dev_start(struct rte_eth_dev *eth_dev) if (qdev->state == QEDE_DEV_CONFIG) qede_init_fp_queue(eth_dev); - rc = qede_start_queues(eth_dev, true); + /* Update MTU only if it has changed */ + if (qdev->mtu != qdev->new_mtu) { + if (qede_update_mtu(eth_dev, qdev->new_mtu)) + return -1; + qdev->mtu = qdev->new_mtu; + /* If MTU has changed then update TPA too */ + if (qdev->enable_lro) + if (qede_enable_tpa(eth_dev, true)) + return -1; + } + + rc = qede_start_queues(eth_dev); if (rc) { DP_ERR(edev, "Failed to start queues\n"); /* TBD: free */ @@ -1719,6 +1670,10 @@ int qede_dev_start(struct rte_eth_dev *eth_dev) if (qede_config_rss(eth_dev)) return -1; + /* Enable vport*/ + if (qede_activate_vport(eth_dev, true)) + return -1; + /* Bring-up the link */ qede_dev_set_link_state(eth_dev, true); @@ -1769,33 +1724,10 @@ static int qede_drain_txq(struct qede_dev *qdev, static int qede_stop_queues(struct qede_dev *qdev) { - struct qed_update_vport_params vport_update_params; struct ecore_dev *edev = &qdev->edev; - struct ecore_sge_tpa_params tpa_params; struct qede_fastpath *fp; int rc, tc, i; - /* Disable the vport */ - memset(&vport_update_params, 0, sizeof(vport_update_params)); - vport_update_params.vport_id = 0; - vport_update_params.update_vport_active_flg = 1; - vport_update_params.vport_active_flg = 0; - vport_update_params.update_rss_flg = 0; - /* Disable TPA */ - if (qdev->enable_lro) { - DP_INFO(edev, "Disabling LRO\n"); - memset(&tpa_params, 0, sizeof(struct ecore_sge_tpa_params)); - qede_update_sge_tpa_params(&tpa_params, qdev->mtu, false); - vport_update_params.sge_tpa_params = &tpa_params; - } - - DP_INFO(edev, "Deactivate vport\n"); - rc = qdev->ops->vport_update(edev, &vport_update_params); - if (rc) { - DP_ERR(edev, "Failed to update vport\n"); - return rc; - } - DP_INFO(edev, "Flushing tx queues\n"); /* Flush Tx queues. If needed, request drain from MCP */ @@ -1928,6 +1860,10 @@ void qede_dev_stop(struct rte_eth_dev *eth_dev) return; } + /* Disable vport */ + if (qede_activate_vport(eth_dev, false)) + return; + if (qede_stop_queues(qdev)) DP_ERR(edev, "Didn't succeed to close queues\n"); -- 1.7.10.3