From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0089.outbound.protection.outlook.com [104.47.42.89]) by dpdk.org (Postfix) with ESMTP id 7C9CD4F9C for ; Fri, 7 Sep 2018 17:23:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=AQUANTIA1COM.onmicrosoft.com; s=selector1-aquantia-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hqqCx0KSJQ+aE8Gx6fTkLxR2bSefhtelug8af7wPpNg=; b=f9e71MprOtYKzPEA8UioCDEqT5xwWDaW4ojxL7QYfELb6rsrjuEKugK1tTgzpIcbtQMnaMcJkeRSIpABE0pDpRvvzkTYJbhr1a8RxptLkAF0LlH5oJUAwpGLRoIow2b/B65ArS9funxk2NxvT2n5k1JRPV9WLcYDyLCcrsqdi/A= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Igor.Russkikh@aquantia.com; Received: from ubuntubox.rdc.aquantia.com (95.79.108.179) by BLUPR0701MB1652.namprd07.prod.outlook.com (2a01:111:e400:58c6::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.16; Fri, 7 Sep 2018 15:23:19 +0000 From: Igor Russkikh To: dev@dpdk.org Cc: pavel.belous@aquantia.com, Nadezhda.Krupnina@aquantia.com, igor.russkikh@aquantia.com, Simon.Edelhaus@aquantia.com, Corey Melton , Ashish Kumar Date: Fri, 7 Sep 2018 18:21:48 +0300 Message-Id: <1536333719-32155-11-git-send-email-igor.russkikh@aquantia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536333719-32155-1-git-send-email-igor.russkikh@aquantia.com> References: <1536333719-32155-1-git-send-email-igor.russkikh@aquantia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [95.79.108.179] X-ClientProxiedBy: BN6PR20CA0060.namprd20.prod.outlook.com (2603:10b6:404:151::22) To BLUPR0701MB1652.namprd07.prod.outlook.com (2a01:111:e400:58c6::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8cb4757c-822a-4635-135f-08d614d5d885 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BLUPR0701MB1652; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1652; 3:kgJ7AfS2QrSugInZUxj53qP54cD99ty2bD0Bf8abNOe3n5dEaC+nNUaPCjKR751tPcKpDOK0Jk8/SDEhaUEXdZqBY/EvCWMfs13QRk/DvPmOy/b4BpWeEoRJ2pUeKF88quMblLqr28GjtdTZxVgoA9xeRtjnWpAJX31f466C6Qy5EPQDVvWmM5BC5gNeMHeO610peAqX9vGZ3I5B8J0JT00GIvxaeVCAdWaykqgYLrWZ6KVa5M2jpOPXHIBeohsg; 25:kpzh1VQ/6UIU1HjLvmAWzcJzAXvd6U9BOe0U9IrUPs9tOByu4MkSigdWbImwkfNfEX/KesszJjF6QcEBTRE670ngfJeGfIeYUxq3Hivf5ZhMyIgIJaqLDrCSx+3sjLv3k33FhFH4R5CMhRDSsQLkiQhFl4bETaaOhHaOb32ocyg5AhNjAT/pEqAYAL/pd2JI7tZVwTdGWtoTAkt7Tv9zL/lJ2Xy+hsXu/QpJ19z2xkavX6jIBs0HaXuLowqKE6DnTGM3bQ0L/GSrkuWGMF0jwrZoCnnK4IQ3/QUIZKOmHNJ+4EcegIKmyE9DXCNfYAQ1iStdTwY4f21c7XBYYbrH8g==; 31:dTwUqQWuuvvWCrhIzn0QIJL2AN3EIK7dHs6ke+5mICyZ6dIHHrWTC+lE+3r/XhvypMukHXMomEpYmRo1mG1Y2p5H7cVlW51oFXmZJxCI9kBytFzA7Mx4VYa5kQnAI7dc05+8iaRzb/29JR0URPmnU2JmAoNMXQ3gQvMHemsaOL8d0M5vywh2nL/WjPCchlMXzWO+hTIvQSu25xNFoyy9L4rLPmN8ZuWuNjvoP7h+Bzo= X-MS-TrafficTypeDiagnostic: BLUPR0701MB1652: X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1652; 20:uJNydd/r8bbvUXzCSEVEn+Gxge6aIaMM9Zg3Dicv/j0diXtbS6vm6WyHDVXrbPwkiGw82XOKUGDWmOxJwg9atiVy3UOIvpgZf04MUc+cDjx+XTHOmV+0tTYaI51cXHoCc/ATxJOE4oj7AGWwARysQvzmhSjsoto2kvsKRYpMCykqgFOt4/BiPVYyKz7DZhG9rCtN3Q49qNgcZNT1ov0M+qHlbbpdRpSkDMBu7NjeaXosQrKkEUC35dqRDLFykXp5KtD9U9Z5xD5HaIPqRN7g0z4FTqsU33b1ziD5luw8KRALTx2O+BhagR/Rit9XbyFwh4gyo6i+ag/kzYkNoxvETg+5x2eOrIlPjKoRK01vtxaiBBfTtOt8G24fUmKvUzH8AZVMscyuEdFZSFt4iCG4zhdRD63T7tbw2kMjkvu8Oy/SVIsRp8Rg87F9cV3dtIrSeKw2ZT4Q4Md4LTOqXLnyidvO1JL+jXdzISzKpiIsvsmRBhrbKxYgBhq/4W19Apg+; 4:Ut51UaFxPLjEy6rZPE0CFooyzg1M2lKfYkhDhk+fGDJaGYUfyoJyQ2syXZP7UPXRtDZm8bS8YnI1wpc/kZLnHg53TcOR1huR6BUmlYJokx6p6lwahbnlphuMN0kSm3bQQy6y3j1OAAyvKycL38ufuSCDX0uZGgFmQokr3auMA2CJ0qysNewsZxK5rOt2IwAuPjdv85gfoShT6qgoE0+ogEh0IiikW8cCMeijsramZrZ6auIeaVrTjaNrM4RfMd3PBoJkWkClbDktaGAY6fhUbQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231311)(944501410)(52105095)(10201501046)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699050); SRVR:BLUPR0701MB1652; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1652; X-Forefront-PRVS: 07880C4932 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(376002)(366004)(346002)(136003)(189003)(199004)(81156014)(81166006)(44832011)(8936002)(2351001)(486006)(106356001)(2361001)(105586002)(446003)(2906002)(50226002)(476003)(11346002)(956004)(2616005)(305945005)(7736002)(16586007)(316002)(54906003)(14444005)(16526019)(66066001)(26005)(7696005)(52116002)(8676002)(51416003)(76176011)(186003)(386003)(68736007)(478600001)(6666003)(6916009)(6486002)(5660300001)(53936002)(47776003)(4326008)(25786009)(86362001)(48376002)(50466002)(575784001)(72206003)(6116002)(97736004)(36756003)(3846002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1652; H:ubuntubox.rdc.aquantia.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: aquantia.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1652; 23:cK+DFJRjGIuzmarN3syOxD+hW4Gl6zzOURp5fbc?= =?us-ascii?Q?X2+5/sVtCVew9zmJGpSyk5cLTkjw/hyYF8PbRKYP+uz52z1PmoSgp8lz+2vT?= =?us-ascii?Q?5pyIU4FAdc5sgI23pnyaWYLOlhNmKy6sTPa0MB2GWlPjAyPzI9PbY0y1K5xt?= =?us-ascii?Q?OxZtZ1zZBJqEDw8Z+wlDtuD0J8U99vP+bwbMJLSnRboQE/naa52BlMkySXkq?= =?us-ascii?Q?btBngAREDvHIWU8CFV3Clkg2c44Up4l+6kQ2zQWz41QJvNzQz/L3+VfdQX3Q?= =?us-asc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V3KZmiMxb/oPT+f04+njUJlqBzmlcKwMjdCw==; 5:jLRNCJB/0adP/dLpKxYYDbjma7fA/pgi+fQVzF9fIcxkGABHrmmHGGG/2ZxFVMt6KWK9Uy3Gj1Hm0XG8zaY/x0B9tfRiM5BUZ/jOeXNNuL5lhj8t2aQFEl453dL3WMErJ2gF4WaPhh/0t4h0jNP/0WKMElri/mS//VzJ5NswWsQ=; 7:sPqpwWCUV2wOsggO70pp0ZTKaN1CR7rVSPXTvF4b+iwkKt+JOr+Z5Nbmj/7W3RyyRlDbUoYpuMBcTvU+3tL3vwY4/xDgPLXUZaGhrm4SbY/aun3MryPbqeXmA2V71YeHlEqMq31cBDwC+j3yabV01c860NarmOkRX6C/3gVwQtIE07NujeP3ZxevHkyjdD3K+AdOAb0CSsLIb0lSmmy+Y3JBPiVU9l4iguSBBSgIGKdVdn1FDTUrbkNLZZQZYREj SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2018 15:23:19.9262 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8cb4757c-822a-4635-135f-08d614d5d885 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1652 Subject: [dpdk-dev] [PATCH 10/21] net/atlantic: add hw adapter structures and defines 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: Fri, 07 Sep 2018 15:23:26 -0000 From: Pavel Belous These declare statistic structures, hw internal structures and variables. Signed-off-by: Igor Russkikh --- drivers/net/atlantic/atl_ethdev.h | 9 ++ drivers/net/atlantic/atl_types.h | 202 +++++++++++++++++++++++++++++++++++++- 2 files changed, 210 insertions(+), 1 deletion(-) diff --git a/drivers/net/atlantic/atl_ethdev.h b/drivers/net/atlantic/atl_ethdev.h index 5b9fc63c6..ce4bc9544 100644 --- a/drivers/net/atlantic/atl_ethdev.h +++ b/drivers/net/atlantic/atl_ethdev.h @@ -16,12 +16,18 @@ #define ATL_FLAG_NEED_LINK_UPDATE (uint32_t)(1 << 0) #define ATL_FLAG_NEED_LINK_CONFIG (uint32_t)(4 << 0) +struct atl_interrupt { + uint32_t flags; + uint32_t mask; +}; + /* * Structure to store private data for each driver instance (for each port). */ struct atl_adapter { struct aq_hw_s hw; struct aq_hw_cfg_s hw_cfg; + struct atl_sw_stats sw_stats; struct atl_interrupt intr; }; @@ -31,6 +37,9 @@ struct atl_adapter { #define ATL_DEV_PRIVATE_TO_HW(adapter) \ (&((struct atl_adapter *)adapter)->hw) +#define ATL_DEV_PRIVATE_TO_STATS(adapter) \ + (&((struct atl_adapter *)adapter)->sw_stats) + #define ATL_DEV_PRIVATE_TO_INTR(adapter) \ (&((struct atl_adapter *)adapter)->intr) diff --git a/drivers/net/atlantic/atl_types.h b/drivers/net/atlantic/atl_types.h index f1558b0a5..60cbb6cda 100644 --- a/drivers/net/atlantic/atl_types.h +++ b/drivers/net/atlantic/atl_types.h @@ -29,6 +29,206 @@ typedef int bool; #define min(a,b) RTE_MIN(a,b) #define max(a,b) RTE_MAX(a,b) -#define wmb() rte_wmb() +#define wmb() rte_wmb() + +#include "hw_atl/hw_atl_b0_internal.h" +#include "hw_atl/hw_atl_utils.h" + +struct aq_hw_link_status_s { + unsigned int mbps; +}; + +struct aq_stats_s { + u64 uprc; + u64 mprc; + u64 bprc; + u64 erpt; + u64 uptc; + u64 mptc; + u64 bptc; + u64 erpr; + u64 mbtc; + u64 bbtc; + u64 mbrc; + u64 bbrc; + u64 ubrc; + u64 ubtc; + u64 dpc; + u64 dma_pkt_rc; + u64 dma_pkt_tc; + u64 dma_oct_rc; + u64 dma_oct_tc; +}; + +enum atl_bus_speed { + atl_bus_speed_unknown = 0, + atl_bus_speed_2500, + atl_bus_speed_5000, + atl_bus_speed_reserved +}; + +enum atl_bus_width { + atl_bus_width_unknown = 0, + atl_bus_width_pcie_x1, + atl_bus_width_pcie_x2, + atl_bus_width_pcie_x4 = 4, + atl_bus_width_pcie_x8 = 8, + atl_bus_width_reserved +}; + +struct atl_bus_info { + enum atl_bus_speed speed; + enum atl_bus_width width; + + u16 func; + u16 pci_cmd_word; +}; + +struct aq_rss_parameters { + u16 base_cpu_number; + u16 indirection_table_size; + u16 hash_secret_key_size; + u32 hash_secret_key[HW_ATL_B0_RSS_HASHKEY_BITS/8]; + u8 indirection_table[HW_ATL_B0_RSS_REDIRECTION_MAX]; +}; + +struct aq_hw_cfg_s { + bool is_lro; + bool is_rss; + unsigned int num_rss_queues; + int wol; + + int link_speed_msk; + int irq_type; + int irq_mask; + unsigned int vecs; + + bool vlan_strip; + uint32_t vlan_filter[HW_ATL_B0_MAX_VLAN_IDS]; + uint32_t flow_control; + + struct aq_rss_parameters aq_rss; +}; + +struct aq_hw_s { + void *back; + + struct atl_bus_info bus; + + const u32 *mvals; + u16 device_id; + u16 vendor_id; + u16 subsystem_device_id; + u16 subsystem_vendor_id; + u8 revision_id; + bool adapter_stopped; + int api_version; + bool force_full_reset; + bool allow_unsupported_sfp; + bool wol_enabled; + bool need_crosstalk_fix; + + u8 rbl_enabled:1; + struct aq_hw_cfg_s *aq_nic_cfg; + const struct aq_fw_ops *aq_fw_ops; + void *mmio; + + struct aq_hw_link_status_s aq_link_status; + bool is_autoneg; + + struct hw_aq_atl_utils_mbox mbox; + struct hw_atl_stats_s last_stats; + struct aq_stats_s curr_stats; + + u64 speed; + u32 itr_tx; + u32 itr_rx; + unsigned int chip_features; + u32 fw_ver_actual; + u32 mbox_addr; + u32 rpc_addr; + u32 rpc_tid; + struct hw_aq_atl_utils_fw_rpc rpc; +}; + +struct aq_fw_ops { + int (*init)(struct aq_hw_s *self); + + int (*deinit)(struct aq_hw_s *self); + + int (*reset)(struct aq_hw_s *self); + + int (*get_mac_permanent)(struct aq_hw_s *self, u8 *mac); + + int (*set_link_speed)(struct aq_hw_s *self, u32 speed); + + int (*set_state)(struct aq_hw_s *self, + enum hal_atl_utils_fw_state_e state); + + int (*update_link_status)(struct aq_hw_s *self); + + int (*update_stats)(struct aq_hw_s *self); + + int (*set_power)(struct aq_hw_s *self, unsigned int power_state, + u8 *mac); + + int (*get_temp)(struct aq_hw_s *self, int *temp); + + int (*get_cable_len)(struct aq_hw_s *self, int *cable_len); + + int (*set_eee_rate)(struct aq_hw_s *self, u32 speed); + + int (*get_eee_rate)(struct aq_hw_s *self, u32 *rate, + u32 *supported_rates); + + int (*set_flow_control)(struct aq_hw_s *self); + + int (*led_control)(struct aq_hw_s *self, u32 mode); + + int (*get_eeprom)(struct aq_hw_s *self, u32 *data, u32 len); + + int (*set_eeprom)(struct aq_hw_s *self, u32 *data, u32 len); +}; + +struct atl_sw_stats { + u64 crcerrs; + u64 errbc; + u64 mspdc; + u64 mpctotal; + u64 mpc[8]; + u64 mlfc; + u64 mrfc; + u64 rlec; + u64 lxontxc; + u64 lxonrxc; + u64 lxofftxc; + u64 lxoffrxc; + u64 pxontxc[8]; + u64 pxonrxc[8]; + u64 pxofftxc[8]; + u64 pxoffrxc[8]; + u64 gprc; + u64 bprc; + u64 mprc; + u64 gptc; + u64 gorc; + u64 gotc; + u64 tor; + u64 tpr; + u64 tpt; + u64 mptc; + u64 bptc; + u64 xec; + u64 fccrc; + u64 ldpcec; + u64 pcrc8ec; + + u64 rx_nombuf; + u64 q_ipackets[RTE_ETHDEV_QUEUE_STAT_CNTRS]; + u64 q_opackets[RTE_ETHDEV_QUEUE_STAT_CNTRS]; + u64 q_ibytes[RTE_ETHDEV_QUEUE_STAT_CNTRS]; + u64 q_obytes[RTE_ETHDEV_QUEUE_STAT_CNTRS]; + u64 q_errors[RTE_ETHDEV_QUEUE_STAT_CNTRS]; +}; #endif -- 2.13.3.windows.1