DPDK patches and discussions
 help / color / mirror / Atom feed
From: Igor Russkikh <igor.russkikh@aquantia.com>
To: dev@dpdk.org
Cc: pavel.belous@aquantia.com, Nadezhda.Krupnina@aquantia.com,
	igor.russkikh@aquantia.com, Simon.Edelhaus@aquantia.com,
	Corey Melton <comelton@cisco.com>,
	Ashish Kumar <ashishk2@cisco.com>
Subject: [dpdk-dev] [PATCH 10/21] net/atlantic: add hw adapter structures and defines
Date: Fri,  7 Sep 2018 18:21:48 +0300	[thread overview]
Message-ID: <1536333719-32155-11-git-send-email-igor.russkikh@aquantia.com> (raw)
In-Reply-To: <1536333719-32155-1-git-send-email-igor.russkikh@aquantia.com>

From: Pavel Belous <pavel.belous@aquantia.com>

These declare statistic structures, hw internal structures and variables.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
---
 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

  parent reply	other threads:[~2018-09-07 15:23 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-07 15:21 [dpdk-dev] [PATCH 00/21] net/atlantic: Aquantia aQtion 10G NIC Family DPDK PMD driver Igor Russkikh
2018-09-07 15:21 ` [dpdk-dev] [PATCH 01/21] net/atlantic: atlantic PMD driver skeleton Igor Russkikh
2018-09-11 17:02   ` Stephen Hemminger
2018-09-12 11:49     ` Igor Russkikh
2018-09-07 15:21 ` [dpdk-dev] [PATCH 02/21] net/atlantic: documentation and rel notes Igor Russkikh
2018-09-07 15:21 ` [dpdk-dev] [PATCH 03/21] net/atlantic: logging macroes and some typedefs Igor Russkikh
2018-09-07 15:21 ` [dpdk-dev] [PATCH 04/21] net/atlantic: hw_atl register declarations Igor Russkikh
2018-09-11 17:04   ` Stephen Hemminger
2018-09-07 15:21 ` [dpdk-dev] [PATCH 05/21] net/atlantic: b0 hardware layer main logic Igor Russkikh
2018-09-11 17:04   ` Stephen Hemminger
2018-09-11 17:05   ` Stephen Hemminger
2018-09-07 15:21 ` [dpdk-dev] [PATCH 06/21] net/atlantic: firmware operations layer Igor Russkikh
2018-09-07 15:21 ` [dpdk-dev] [PATCH 07/21] net/atlantic: hardware register access routines Igor Russkikh
2018-09-24  6:29   ` Hemant
2018-09-24  9:00     ` Igor Russkikh
2018-09-07 15:21 ` [dpdk-dev] [PATCH 08/21] net/atlantic: rte device start, stop, initial configuration Igor Russkikh
2018-09-07 15:21 ` [dpdk-dev] [PATCH 09/21] net/atlantic: link status and interrupt management Igor Russkikh
2018-09-07 15:21 ` Igor Russkikh [this message]
2018-09-07 15:21 ` [dpdk-dev] [PATCH 11/21] net/atlantic: RSS and RETA manipulation API Igor Russkikh
2018-09-07 15:21 ` [dpdk-dev] [PATCH 12/21] net/atlantic: flow control configuration Igor Russkikh
2018-09-07 15:21 ` [dpdk-dev] [PATCH 13/21] net/atlantic: MAC address manipulations Igor Russkikh
2018-09-07 15:21 ` [dpdk-dev] [PATCH 14/21] net/atlantic: eeprom and register manipulation routines Igor Russkikh
2018-09-07 15:21 ` [dpdk-dev] [PATCH 15/21] net/atlantic: LED control DPDK and private APIs Igor Russkikh
2018-09-07 15:21 ` [dpdk-dev] [PATCH 16/21] net/atlantic: promisc and allmulti configuration Igor Russkikh
2018-09-07 15:21 ` [dpdk-dev] [PATCH 17/21] net/atlantic: device statistics, xstats Igor Russkikh
2018-09-11 17:06   ` Stephen Hemminger
2018-09-07 15:21 ` [dpdk-dev] [PATCH 18/21] net/atlantic: VLAN filters and offloads Igor Russkikh
2018-09-07 15:21 ` [dpdk-dev] [PATCH 19/21] net/atlantic: device MTU and statuses Igor Russkikh
2018-09-07 15:21 ` [dpdk-dev] [PATCH 20/21] net/atlantic: RX side structures and implementation Igor Russkikh
2018-09-07 15:21 ` [dpdk-dev] [PATCH 21/21] net/atlantic: TX " Igor Russkikh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1536333719-32155-11-git-send-email-igor.russkikh@aquantia.com \
    --to=igor.russkikh@aquantia.com \
    --cc=Nadezhda.Krupnina@aquantia.com \
    --cc=Simon.Edelhaus@aquantia.com \
    --cc=ashishk2@cisco.com \
    --cc=comelton@cisco.com \
    --cc=dev@dpdk.org \
    --cc=pavel.belous@aquantia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).