From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0072.outbound.protection.outlook.com [104.47.32.72]) by dpdk.org (Postfix) with ESMTP id 10A815F65 for ; Thu, 13 Sep 2018 13:36:01 +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=OBEkErvzCXl52b1fmqLaYoEkyRcQX4CfEYTGhJywPc4=; b=qkJvHcv04m0gdRyyVweoUTEGxPxiXRM2q53S7RAsjFd0maG6LAPxWuWfgbcHhRsvkeyvr6JmRLLjik+qd9x+YBz+Degd4faI1we1GbfmyPfJlooH3gwePRcYFBeN9DiaJtvKl7BbYRoEVPpWe/Cx4rb2XLBKulYt7J4Xx9bAVl0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Igor.Russkikh@aquantia.com; Received: from ubuntubox.rdc.aquantia.com (95.79.108.179) by BLUPR0701MB1650.namprd07.prod.outlook.com (2a01:111:e400:58c6::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.15; Thu, 13 Sep 2018 11:35:58 +0000 From: Igor Russkikh To: dev@dpdk.org Cc: pavel.belous@aquantia.com, igor.russkikh@aquantia.com Date: Thu, 13 Sep 2018 14:35:17 +0300 Message-Id: <1536838528-11800-10-git-send-email-igor.russkikh@aquantia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536838528-11800-1-git-send-email-igor.russkikh@aquantia.com> References: <1536838528-11800-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: VI1PR0202CA0026.eurprd02.prod.outlook.com (2603:10a6:803:14::39) To BLUPR0701MB1650.namprd07.prod.outlook.com (2a01:111:e400:58c6::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 22a1227b-52f8-407e-f303-08d6196d1404 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BLUPR0701MB1650; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1650; 3:aa6W2sD5kSRiwL79TcgMWH1Y35cyrGm/aF65uxH2Y+ddFaa5uMQ6KGZAy5goSG5qtiDuaW1B8sF1UiwpdmvQSnzQReHzJZdwprhceFWTAs8Trvl2aiF5MuIoFmyyUEzKR76uKahBcmRSPAgTpjh+Yj84apCb4g/IaZ+g9SARgxcprAUl/Yj5mHcSBu6kiox95jDHaw/p8in7td9w9ots8LlNaZWzP8l3kJNgFvZg/MxQsIrJBVfcgM/BHQeUVA/y; 25:HDdt/r5Kc0gqrQZrW5M/Qy4vSmqGYT2S++Q9RQxmhdDJMwqVoiQFyjrPu/2qTKURKFG++T+g7gNAR+3cJgq2KknutHa2uNIW/8IgKTRiHmv83rOnhJz535p3T/KMyqO6mg2n1edK0P5QaB0rUfbUU9em4mXKBZwXw68CJZDyRKm1v/Q8E+bMQ/NwC0/HlB1x1n2XM31ju2lCSfLPHk/VAEPKp5Omh+FOBnTyEJ8Kon+/9++VqPhzkYIDZKKb3vaKjgQUom39b9wz9HFUQd4BShdnbm450tHUM/VkiSUaV+nwKhyNbO2qsdZd3DkLwoVJzDNwPxqfMIvpnlbtgQCyBg==; 31:7Xf9BXWafTqvXCX/q6oMQ2zMDsIKwIyFGZLcof6kd1y+U0eRLeSz2ftHSSCSmrrvQzElXl3ohUaQiWMH5fztkNJ1W3MbyCcS+CrkWKhCslzKJrZlbJ5YuIpFzFYJScbKnvLjCmeJuOrB+afYVOLEA2h4N/jYnNbR2WYPsgZ8MDCduwDpCz/P8J0XGJKkdGTkSwwdImrcIIii8mMyp8XCvGEb0BVNZtgsIDqkoBCuLb4= X-MS-TrafficTypeDiagnostic: BLUPR0701MB1650: X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1650; 20:w0QDTB/YDZMHKoLwsuWhfAxMZnYl66AdVZWFUstDai1OHGtYGx4w3R2D/s9iNDGfHDNuqa2+FqplZTK/1qFDPL2U8W1SLZ8whbPLI+NxnD9ISAq8t1n2UafChRPIMY4g3Chnsi9+1JFluiKQrm2mu18tlelDj47hPrMxbV3FB+n8dXBAcMZbQ4mY7lUeanvtvizrCt5Qn8wff9ZJdM+UIj5xrufx+YdaW57jJy2PUNAKAwaKmV3S4VCKhUGECwqGWJ5U3ktFCsMKUpUhoDhkHIBb7YvFAe4OtPMqnpxdyewnT+PEFqw/f9nO1+TZpWPGLl7PtJV4yaSQ+OHRocriHifwbPxOtoR9ttj+blURVOOwaLaZrrEyWsE8fWhNnZv2/hO1twfK8OI2p4bl4Fk7f5bxcjgWW9hXW8troCmWT/vJEntiCyoUaRBIyq56qmpX6/Fom3XsQgMuqw8m0aDugOCgMmzJ03Tx+uIMj9TPiekoLug7U/tmn4zs7wtl849B; 4:R/LL6EUQgihL+1baauXDFjBs7pUYVSJkIO7YaG0ehle5/LRcASSZNsJBMCu66c11qXdN2IVqirghlfYN1iNwRrFGZf+j+7Vo7w/jnUSCpwHhRCLwGoH4+h5xaoU1iS3GWPwcmBz+oAOUlsvojlZ56k+ajK53QwkoojOOw4sP2SFyThkGZFkshqgNJ8oDIKFCZ8ZkY8W9K2BToVLUEvkEdRILsPcYCVXMBHVJLtATXu+2CcsTT35CLHR4E2H4IShgPhV20ChHy6Wlz9bN62vKrg== 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)(8121501046)(5005006)(93006095)(93001095)(3231311)(944501410)(52105095)(10201501046)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201708071742011)(7699050); SRVR:BLUPR0701MB1650; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1650; X-Forefront-PRVS: 07943272E1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39840400004)(366004)(396003)(376002)(136003)(346002)(199004)(189003)(6666003)(6916009)(97736004)(8936002)(68736007)(25786009)(50226002)(81166006)(81156014)(4326008)(107886003)(6486002)(51416003)(2906002)(53936002)(5660300001)(36756003)(86362001)(316002)(52116002)(8676002)(16586007)(7736002)(305945005)(11346002)(446003)(476003)(956004)(47776003)(72206003)(66066001)(44832011)(478600001)(486006)(186003)(26005)(16526019)(14444005)(386003)(48376002)(2351001)(106356001)(2361001)(2616005)(3846002)(105586002)(50466002)(7696005)(6116002)(76176011); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1650; H:ubuntubox.rdc.aquantia.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: aquantia.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1650; 23:rwW607MNW8oVam/92W7UUwCyPZbxNHsSVWOa7rZ?= =?us-ascii?Q?zPVYe2vNt5KA4LYjZzZZOlbUxF1H0wSG4w+U6xkIASTUeTklcn+dwvoGY5jq?= =?us-ascii?Q?5bTlLcQAbKYYeL8Fi1X5FmgNa3eNkAxNaNfxGs6Fq3YK26HrEUK+iZrEQTtB?= =?us-ascii?Q?U75qTeQhiczWgXjcKkVYLvsBWhbl/EVkgofFvEFaoILEpWXveADskgFzaGTf?= =?us-ascii?Q?NeK/Mk7EEPKYJAFEf3FuryRM1IiMykJFZTPnStIeJHbLh5KzOgdjnZHCEswd?= =?us-ascii?Q?4ttca8zXJlFOnHYFHal6GJ3FIyecjKFcV5josX3MpiIF2jzaio3jXLm8ehJ7?= =?us-ascii?Q?S6r9rbS63uS07um+br2M33koLCn6A/i46eyed9olCvOIrhyRmhojNTrNp9YI?= =?us-ascii?Q?OMGaV/QfzhMNDL4AfNtj90fKMOJmsnYcvspJhtjIV5fLbXdT+uVGdNCLYtiW?= =?us-ascii?Q?J+V8TcdRFcTUVMeXIiJDnz13/mR2MBrczYM9lelr5SRy1ei9tFbeHyRbnIJP?= =?us-ascii?Q?jovFNizLfh5r4oYf78MpXCjkmSIFVvZDjCJuNPbnotFNNC4srpFuEzfltlFc?= =?us-ascii?Q?bqQ9tj/b/IXtdSNAAgqf75AXB2lX1wuiFxTEVDlGUO2fguOkUCFfU0XQDZV0?= =?us-ascii?Q?BpC5RIILWXBkhcVM0XbRQeLMXoLtoraW/Sb9X+w/1E3QH+pqyHOyrKckGoBG?= =?us-ascii?Q?OM/iTYI34n6DSRavHC6ydtJwncX/r7tICp/y8E7v8fxcs730PwHYw1E0dfnO?= =?us-ascii?Q?yIqrWb+6ziXJTrjWz2vWOyl5HbRRyszr3P9Q2xGn1stxxfJbua3+loJwmBgt?= =?us-ascii?Q?DAzy6pmcHHBPwZ0gIHdyqBdbi4YkWNnLGFA5D3iHklthHFFO3ClLVbV2qSPm?= =?us-ascii?Q?aRApHh78dLIOat7m41p8kCYKH3gvbJV+u93e6LjxePu7XpMa+9wPwV2i9KWF?= =?us-ascii?Q?BtHiWqUZ3wLJ/JGREV0j0knuAtQcLP58keOqsHnwrlOjYjzXqQkI5/o02tRE?= =?us-ascii?Q?vQuSTDVbprFrj6WBTzvwDR93Oj/761qu8ovmYeZqggZV2ls48IlmQ6uS1/eY?= =?us-ascii?Q?fe107zk6tVGUWdl3YGq/i9yNmc1f9X1geT6+SK7oz0otcZB3KzlSXyz2ILh+?= =?us-ascii?Q?1bOL1iySkICarxAz83HsDIJTuO9+sj3aq7xpGF8SaKlDbBUrINnGH6HChgIa?= =?us-ascii?Q?zlKR033bFGob5jWQEqL+hReBFp/kr4SYihYJDCbaidwKw4EJTDSlJ4X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ODXpo5qwEgOh26AnFzpBHkpXpFayeE4lG3RftaBYV8u3fdXQiUk7PEydAA5Vg=; 7:M+SVuM9jP2IbG6p0MqFGPagfEnATjH1lJzgM+zvXKGbYdqp35RCeQkTNzNIl8WwZSou+WyGfCCUrhULrItNZRpJI/659X39Vv/lwx5IhnnKxWKJqf+QZw1FX1RmqQzqvt2NltnVBMtd63ia5Vw/dk02yXDjH8Mxi9hmf87qmi+7Z3PKf+8PIaQTBKQtPtCGpYWJ/kQBaZJqgXQz80+p8328emWap60mnbtVgVyW/pSDU1cu1b4Qn0pH9xS6QCCbg SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2018 11:35:58.8584 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 22a1227b-52f8-407e-f303-08d6196d1404 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1650 Subject: [dpdk-dev] [PATCH v2 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: Thu, 13 Sep 2018 11:36:01 -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 | 200 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 209 insertions(+) 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 1684c8cd8..6f58b79c9 100644 --- a/drivers/net/atlantic/atl_types.h +++ b/drivers/net/atlantic/atl_types.h @@ -32,4 +32,204 @@ typedef int bool; /* Memory barrier */ #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