From: Andre Guedes <andre.guedes@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH ethtool 4/4] igc: Parse ETQF registers
Date: Tue, 7 Jul 2020 16:48:00 -0700 [thread overview]
Message-ID: <20200707234800.39119-5-andre.guedes@intel.com> (raw)
In-Reply-To: <20200707234800.39119-1-andre.guedes@intel.com>
This patch adds support for parsing the EType Queue Filter (ETQF)
registers fields.
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
---
igc.c | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/igc.c b/igc.c
index 6a2e06d..9c0a750 100644
--- a/igc.c
+++ b/igc.c
@@ -59,6 +59,14 @@
#define VLANPQF_VP7QSEL 0x30000000
#define VLANPQF_VP7PBSEL 0x40000000
#define VLANPQF_VLANP7V 0x80000000
+#define ETQF_ETYPE 0x0000FFFF
+#define ETQF_QUEUE 0x00070000
+#define ETQF_ETYPE_LEN 0x01F00000
+#define ETQF_ETYPE_LEN_EN 0x02000000
+#define ETQF_FILTER_EN 0x04000000
+#define ETQF_IMMEDIATE_INTR 0x20000000
+#define ETQF_1588_TIMESTAMP 0x40000000
+#define ETQF_QUEUE_EN 0x80000000
#define RAH_QSEL_SHIFT 18
#define VLANPQF_VP1QSEL_SHIFT 4
@@ -68,6 +76,8 @@
#define VLANPQF_VP5QSEL_SHIFT 20
#define VLANPQF_VP6QSEL_SHIFT 24
#define VLANPQF_VP7QSEL_SHIFT 28
+#define ETQF_QUEUE_SHIFT 16
+#define ETQF_ETYPE_LEN_SHIFT 20
static const char *bit_to_boolean(u32 val)
{
@@ -245,5 +255,29 @@ int igc_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
bit_to_prio(reg & VLANPQF_VP7PBSEL),
bit_to_boolean(reg & VLANPQF_VLANP7V));
+ offset = 205;
+
+ for (i = 0; i < 8; i++) {
+ reg = regs_buff[offset + i];
+ printf("%04d: ETQF (EType Queue Filter %d) \n"
+ " EType: %04X\n"
+ " EType Length: %d\n"
+ " EType Length Enable: %s\n"
+ " Queue: %d\n"
+ " Queue Enable: %s\n"
+ " Immediate Interrupt: %s\n"
+ " 1588 Time Stamp: %s\n"
+ " Filter Enable: %s\n",
+ offset + i, i,
+ reg & ETQF_ETYPE,
+ (reg & ETQF_ETYPE_LEN) >> ETQF_ETYPE_LEN_SHIFT,
+ bit_to_boolean(reg & ETQF_ETYPE_LEN_EN),
+ (reg & ETQF_QUEUE) >> ETQF_QUEUE_SHIFT,
+ bit_to_boolean(reg & ETQF_QUEUE_EN),
+ bit_to_enable(reg & ETQF_IMMEDIATE_INTR),
+ bit_to_enable(reg & ETQF_1588_TIMESTAMP),
+ bit_to_boolean(reg & ETQF_FILTER_EN));
+ }
+
return 0;
}
--
2.26.2
next prev parent reply other threads:[~2020-07-07 23:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-07 23:47 [Intel-wired-lan] [PATCH ethtool 0/4] Add support for IGC driver Andre Guedes
2020-07-07 23:47 ` [Intel-wired-lan] [PATCH ethtool 1/4] Add IGC driver support Andre Guedes
2020-07-07 23:47 ` [Intel-wired-lan] [PATCH ethtool 2/4] igc: Parse RCTL register fields Andre Guedes
2020-07-07 23:47 ` [Intel-wired-lan] [PATCH ethtool 3/4] igc: Parse VLANPQF " Andre Guedes
2020-07-07 23:48 ` Andre Guedes [this message]
2020-07-20 0:10 ` [Intel-wired-lan] [PATCH ethtool 0/4] Add support for IGC driver Michal Kubecek
2020-07-20 18:27 ` Andre Guedes
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=20200707234800.39119-5-andre.guedes@intel.com \
--to=andre.guedes@intel.com \
--cc=intel-wired-lan@osuosl.org \
/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