net: atlantic: 11-2021 fixes
Subsystems (3)
cover net: atlantic: 11-2021 fixes
The patch series contains fixes for atlantic driver to improve support of latest AQC113 chipset.
Please consider applying it to 'net' tree.
Dmitry Bogdanov (2):
atlantic: Increase delay for fw transactions
atlantic: Fix statistics logic for production hardware
Nikita Danilov (2):
atlatnic: enable Nbase-t speeds with base-t
atlantic: Add missing DIDs and fix 115c.
Sameer Saurabh (3):
atlantic: Fix to display FW bundle version instead of FW mac version. Remove Half duplex mode speed capabilities.
atlantic: Remove warn trace message.
.../ethernet/aquantia/atlantic/aq_common.h | 27 ++--- .../net/ethernet/aquantia/atlantic/aq_hw.h | 2 + .../net/ethernet/aquantia/atlantic/aq_nic.c | 10 +- .../ethernet/aquantia/atlantic/aq_pci_func.c | 7 +- .../net/ethernet/aquantia/atlantic/aq_vec.c | 3 - .../aquantia/atlantic/hw_atl/hw_atl_utils.c | 15 ++- .../atlantic/hw_atl/hw_atl_utils_fw2x.c | 3 - .../aquantia/atlantic/hw_atl2/hw_atl2.c | 22 +++- .../aquantia/atlantic/hw_atl2/hw_atl2.h | 2 + .../aquantia/atlantic/hw_atl2/hw_atl2_utils.h | 38 +++++- .../atlantic/hw_atl2/hw_atl2_utils_fw.c | 110 ++++++++++++++---- 11 files changed, 184 insertions(+), 55 deletions(-)
Signature · 1 line
2.27.0
PATCH 1/7 atlantic: Increase delay for fw transactions
From: Dmitry Bogdanov <[email protected]>
The max waiting period (of 1 ms) while reading the data from FW shared buffer is too small for certain types of data (e.g., stats). There's a chance that FW could be updating buffer at the same time and driver would be unsuccessful in reading data. Firmware manual recommends to have 1 sec timeout to fix this issue.
--- .../ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c +5 -2
@@ -84,7 +84,7 @@ static int hw_atl2_shared_buffer_read_block(struct aq_hw_s *self,if (cnt >AQ_A2_FW_READ_TRY_MAX )return -ETIME ;if (tid1.transaction_cnt_a != tid1.transaction_cnt_b) -udelay (1 ); +mdelay (1 ); }while (tid1.transaction_cnt_a != tid1.transaction_cnt_b);hw_atl2_mif_shared_buf_read (self, offset, (u32 *)data, dwords);
@@ -339,8 +339,11 @@ static int aq_a2_fw_update_stats(struct aq_hw_s *self) {struct hw_atl2_priv *priv = (struct hw_atl2_priv *)self->priv;struct statistics_s stats; +int err; -hw_atl2_shared_buffer_read_safe (self, stats, &stats); + err =hw_atl2_shared_buffer_read_safe (self, stats, &stats); +if (err) +return err;#define AQ_SDELTA (_N_, _F_) (self->curr_stats._N_ += \ stats.msm._F_ - priv->last_stats.msm._F_)
Signature · 1 line
2.27.0
Re: [PATCH net 1/7] atlantic: Increase delay for fw transactions
Quoted 21 lines · Sudarsana Reddy Kalluru
From: Dmitry Bogdanov <[email protected]>
The max waiting period (of 1 ms) while reading the data from FW shared buffer is too small for certain types of data (e.g., stats). There's a chance that FW could be updating buffer at the same time and driver would be unsuccessful in reading data. Firmware manual recommends to have 1 sec timeout to fix this issue.
Fixes 5cfd54d7dc186 ("net: atlantic: minimal A2 fw_ops")Signed-off-by Dmitry Bogdanov <[email protected]>Signed-off-by Sudarsana Reddy Kalluru <[email protected]>Signed-off-by Igor Russkikh <[email protected]>--- .../ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c +0
-0
drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c static int hw_atl2_shared_buffer_read_block(struct aq_hw_s *self, · line 88
Quoted 6 lines
drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c +1
-1@@ -84,7 +84,7 @@ static int hw_atl2_shared_buffer_read_block(struct aq_hw_s *self,if (cnt >AQ_A2_FW_READ_TRY_MAX )return -ETIME ;if (tid1.transaction_cnt_a != tid1.transaction_cnt_b) -udelay (1 ); +mdelay (1 ); }while (tid1.transaction_cnt_a != tid1.transaction_cnt_b);
This change is the 1 second timeout.
drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c static int aq_a2_fw_update_stats(struct aq_hw_s *self) · line 346
Quoted 12 lines
drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c +4
-1hw_atl2_mif_shared_buf_read (self, offset, (u32 *)data, dwords);@@ -339,8 +339,11 @@ static int aq_a2_fw_update_stats(struct aq_hw_s *self) {struct hw_atl2_priv *priv = (struct hw_atl2_priv *)self->priv;struct statistics_s stats; +int err; -hw_atl2_shared_buffer_read_safe (self, stats, &stats); + err =hw_atl2_shared_buffer_read_safe (self, stats, &stats); +if (err) +return err;
This change however does not seem to be explained in the commit message. Not discarding an error is a good change, but it needs commenting on.
Also, looking at hw_atl2_shared_buffer_read_block() i notice it returns -ETIME. It should be -ETIMEDOUT.
Andrew
RE: [PATCH net 1/7] atlantic: Increase delay for fw transactions
Quoted 38 lines
-----Original Message-----
From: Andrew Lunn <[email protected]>
Sent: Tuesday, November 30, 2021 8:18 AM
To: Sudarsana Reddy Kalluru <[email protected]>
Cc: [email protected]; [email protected]; Igor Russkikh <[email protected]>; Dmitrii Bezrukov <[email protected]>
Subject: Re: [PATCH net 1/7] atlantic: Increase delay for fw transactionsReview static int hw_atl2_shared_buffer_read_block(struct
Quoted 26 lines · Sudarsana Reddy Kalluru
From: Dmitry Bogdanov <[email protected]>
The max waiting period (of 1 ms) while reading the data from FW shared buffer is too small for certain types of data (e.g., stats). There's a chance that FW could be updating buffer at the same time and driver would be unsuccessful in reading data. Firmware manual recommends to have 1 sec timeout to fix this issue.
Fixes 5cfd54d7dc186 ("net: atlantic: minimal A2 fw_ops")Signed-off-by Dmitry Bogdanov <[email protected]>Signed-off-by Sudarsana Reddy Kalluru <[email protected]>Signed-off-by Igor Russkikh <[email protected]>--- .../ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)diff --git
a/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.cb/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.cindexdd259c8f2f4f..b0e4119b9883100644
---a/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw. +++ c(quoted diff) +0
-0@@ -84,7 +84,7 @@ static int hw_atl2_shared_buffer_read_block(struct
aq_hw_s*self,
Quoted 8 lines
drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c static int hw_atl2_shared_buffer_read_block(struct aq_hw_s *self, · line 88
Quoted 6 lines
drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c +1
-1if (cnt >AQ_A2_FW_READ_TRY_MAX )return -ETIME ;if (tid1.transaction_cnt_a != tid1.transaction_cnt_b) -udelay (1 ); +mdelay (1 ); }while (tid1.transaction_cnt_a != tid1.transaction_cnt_b);This change is the 1 second timeout.
Yes, FW manual suggests 1 sec timeout value. Hence the timeout period is updated from 1ms to 1sec.
Quoted 18 lines
Review static int hw_atl2_shared_buffer_read_block(struct · line 89
Quoted 3 lines
(quoted diff) +0
-0hw_atl2_mif_shared_buf_read(self, offset, (u32 *)data,dwords); @@
drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c static int aq_a2_fw_update_stats(struct aq_hw_s *self) · line 346
Quoted 10 lines
(quoted diff) +0
-1-339,8 +339,11 @@ static int aq_a2_fw_update_stats(struct aq_hw_s*self) {
drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c +4
-1struct hw_atl2_priv *priv = (struct hw_atl2_priv *)self->priv;struct statistics_s stats; +int err; -hw_atl2_shared_buffer_read_safe (self, stats, &stats); + err =hw_atl2_shared_buffer_read_safe (self, stats, &stats); +if (err) +return err;This change however does not seem to be explained in the commit message. Not discarding an error is a good change, but it needs commenting on.
Quoted 2 lines
Also, looking at
hw_atl2_shared_buffer_read_block()i notice it returns - ETIME. It should be-ETIMEDOUT.
Thanks for your inputs. Will discuss about this internally and send the patch to handle all such error paths.
Quoted 2 lines
Andrew
PATCH 2/7 atlatnic: enable Nbase-t speeds with base-t
In reply to Sudarsana Reddy KalluruFrom: Nikita Danilov <[email protected]>
When 2.5G is advertised, N-Base should be advertised against the T-base caps. N5G is out of use in baseline code and driver should treat both 5G and N5G (and also 2.5G and N2.5G) equally from user perspective.
--- .../ethernet/aquantia/atlantic/aq_common.h | 25 +++++++++---------- .../atlantic/hw_atl/hw_atl_utils_fw2x.c | 3 --- .../atlantic/hw_atl2/hw_atl2_utils_fw.c | 4 +-- 3 files changed, 13 insertions(+), 19 deletions(-)
drivers/net/ethernet/aquantia/atlantic/aq_common.h +12 -13
@@ -53,20 +53,19 @@#define AQ_NIC_RATE_10G BIT(0)#define AQ_NIC_RATE_5G BIT(1) -#define AQ_NIC_RATE_5GSR BIT(2) -#define AQ_NIC_RATE_2G5 BIT(3) -#define AQ_NIC_RATE_1G BIT(4) -#define AQ_NIC_RATE_100M BIT(5) -#define AQ_NIC_RATE_10M BIT(6) -#define AQ_NIC_RATE_1G_HALF BIT(7) -#define AQ_NIC_RATE_100M_HALF BIT(8) -#define AQ_NIC_RATE_10M_HALF BIT(9) +#define AQ_NIC_RATE_2G5 BIT(2) +#define AQ_NIC_RATE_1G BIT(3) +#define AQ_NIC_RATE_100M BIT(4) +#define AQ_NIC_RATE_10M BIT(5) +#define AQ_NIC_RATE_1G_HALF BIT(6) +#define AQ_NIC_RATE_100M_HALF BIT(7) +#define AQ_NIC_RATE_10M_HALF BIT(8) -#define AQ_NIC_RATE_EEE_10G BIT(10) -#define AQ_NIC_RATE_EEE_5G BIT(11) -#define AQ_NIC_RATE_EEE_2G5 BIT(12) -#define AQ_NIC_RATE_EEE_1G BIT(13) -#define AQ_NIC_RATE_EEE_100M BIT(14) +#define AQ_NIC_RATE_EEE_10G BIT(9) +#define AQ_NIC_RATE_EEE_5G BIT(10) +#define AQ_NIC_RATE_EEE_2G5 BIT(11) +#define AQ_NIC_RATE_EEE_1G BIT(12) +#define AQ_NIC_RATE_EEE_100M BIT(13)#define AQ_NIC_RATE_EEE_MSK (AQ_NIC_RATE_EEE_10G |\ AQ_NIC_RATE_EEE_5G |\ AQ_NIC_RATE_EEE_2G5 |\
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c +0 -3
@@ -132,9 +132,6 @@ static enum hw_atl_fw2x_rate link_speed_mask_2fw2x_ratemask(u32 speed)if (speed &AQ_NIC_RATE_5G ) rate |=FW2X_RATE_5G ; -if (speed &AQ_NIC_RATE_5GSR ) - rate |=FW2X_RATE_5G ; -if (speed &AQ_NIC_RATE_2G5 ) rate |=FW2X_RATE_2G5 ;
drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c +1 -3
@@ -154,7 +154,7 @@ static void a2_link_speed_mask2fw(u32 speed, { link_options->rate_10G = !!(speed &AQ_NIC_RATE_10G ); link_options->rate_5G = !!(speed &AQ_NIC_RATE_5G ); - link_options->rate_N5G = !!(speed &AQ_NIC_RATE_5GSR ); + link_options->rate_N5G = link_options->rate_5G; link_options->rate_2P5G = !!(speed &AQ_NIC_RATE_2G5 ); link_options->rate_N2P5G = link_options->rate_2P5G; link_options->rate_1G = !!(speed &AQ_NIC_RATE_1G );
@@ -192,8 +192,6 @@ static u32 a2_fw_lkp_to_mask(struct lkp_link_caps_s *lkp_link_caps) rate |=AQ_NIC_RATE_10G ;if (lkp_link_caps->rate_5G) rate |=AQ_NIC_RATE_5G ; -if (lkp_link_caps->rate_N5G) - rate |=AQ_NIC_RATE_5GSR ;if (lkp_link_caps->rate_2P5G) rate |=AQ_NIC_RATE_2G5 ;if (lkp_link_caps->rate_1G)
Signature · 1 line
2.27.0
PATCH 3/7 atlantic: Fix to display FW bundle version instead of FW mac version.
In reply to Sudarsana Reddy KalluruFrom: Sameer Saurabh <[email protected]>
The correct way to reflect firmware version is to use bundle version. Hence populating the same instead of MAC fw version.
--- .../ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c +3 -3
@@ -500,9 +500,9 @@ u32 hw_atl2_utils_get_fw_version(struct aq_hw_s *self)hw_atl2_shared_buffer_read_safe (self, version, &version);/* A2 FW version is stored in reverse order */ -return version.mac.major <<24 | - version.mac.minor <<16 | - version.mac.build; +return version.bundle.major <<24 | + version.bundle.minor <<16 | + version.bundle.build; } int hw_atl2_utils_get_action_resolve_table_caps(struct aq_hw_s *self,
Signature · 1 line
2.27.0
PATCH 4/7 atlantic: Add missing DIDs and fix 115c.
In reply to Sudarsana Reddy KalluruFrom: Nikita Danilov <[email protected]>
At the late production stages new dev ids were introduced. These are now in production, so its important for the driver to recognize these. And also fix the board caps for AQC115C adapter.
--- .../net/ethernet/aquantia/atlantic/aq_common.h | 2 ++ .../ethernet/aquantia/atlantic/aq_pci_func.c | 7 ++++++- .../aquantia/atlantic/hw_atl2/hw_atl2.c | 17 +++++++++++++++++ .../aquantia/atlantic/hw_atl2/hw_atl2.h | 2 ++ 4 files changed, 27 insertions(+), 1 deletion(-)
drivers/net/ethernet/aquantia/atlantic/aq_common.h +2 -0
@@ -40,10 +40,12 @@#define AQ_DEVICE_ID_AQC113DEV 0x00C0#define AQ_DEVICE_ID_AQC113CS 0x94C0 +#define AQ_DEVICE_ID_AQC113CA 0x34C0#define AQ_DEVICE_ID_AQC114CS 0x93C0#define AQ_DEVICE_ID_AQC113 0x04C0#define AQ_DEVICE_ID_AQC113C 0x14C0#define AQ_DEVICE_ID_AQC115C 0x12C0 +#define AQ_DEVICE_ID_AQC116C 0x11C0#define HW_ATL_NIC_NAME "Marvell (aQuantia) AQtion 10Gbit Network Adapter"
drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c +6 -1
@@ -49,6 +49,8 @@ static const struct pci_device_id aq_pci_tbl[] = { { PCI_VDEVICE(AQUANTIA, AQ_DEVICE_ID_AQC113), }, { PCI_VDEVICE(AQUANTIA, AQ_DEVICE_ID_AQC113C), }, { PCI_VDEVICE(AQUANTIA, AQ_DEVICE_ID_AQC115C), }, + { PCI_VDEVICE(AQUANTIA, AQ_DEVICE_ID_AQC113CA), }, + { PCI_VDEVICE(AQUANTIA, AQ_DEVICE_ID_AQC116C), }, {} };
@@ -85,7 +87,10 @@ static const struct aq_board_revision_s hw_atl_boards[] = { { AQ_DEVICE_ID_AQC113CS, AQ_HWREV_ANY, &hw_atl2_ops, &hw_atl2_caps_aqc113, }, { AQ_DEVICE_ID_AQC114CS, AQ_HWREV_ANY, &hw_atl2_ops, &hw_atl2_caps_aqc113, }, { AQ_DEVICE_ID_AQC113C, AQ_HWREV_ANY, &hw_atl2_ops, &hw_atl2_caps_aqc113, }, - { AQ_DEVICE_ID_AQC115C, AQ_HWREV_ANY, &hw_atl2_ops, &hw_atl2_caps_aqc113, }, + { AQ_DEVICE_ID_AQC115C, AQ_HWREV_ANY, &hw_atl2_ops, &hw_atl2_caps_aqc115c, }, + { AQ_DEVICE_ID_AQC113CA, AQ_HWREV_ANY, &hw_atl2_ops, &hw_atl2_caps_aqc113, }, + { AQ_DEVICE_ID_AQC116C, AQ_HWREV_ANY, &hw_atl2_ops, &hw_atl2_caps_aqc116c, }, + };MODULE_DEVICE_TABLE (pci, aq_pci_tbl);
drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c +17 -0
@@ -72,6 +72,23 @@ const struct aq_hw_caps_s hw_atl2_caps_aqc113 = { AQ_NIC_RATE_10M_HALF, }; +const struct aq_hw_caps_s hw_atl2_caps_aqc115c = { +DEFAULT_BOARD_BASIC_CAPABILITIES , + .media_type =AQ_HW_MEDIA_TYPE_TP , + .link_speed_msk =AQ_NIC_RATE_2G5 | +AQ_NIC_RATE_1G | +AQ_NIC_RATE_100M | +AQ_NIC_RATE_10M , +}; + +const struct aq_hw_caps_s hw_atl2_caps_aqc116c = { +DEFAULT_BOARD_BASIC_CAPABILITIES , + .media_type =AQ_HW_MEDIA_TYPE_TP , + .link_speed_msk =AQ_NIC_RATE_1G | +AQ_NIC_RATE_100M | +AQ_NIC_RATE_10M , +}; +static u32 hw_atl2_sem_act_rslvr_get (struct aq_hw_s *self) {return hw_atl_reg_glb_cpu_sem_get (self,HW_ATL2_FW_SM_ACT_RSLVR );
drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.h +2 -0
@@ -9,6 +9,8 @@#include "aq_common.h" extern const struct aq_hw_caps_s hw_atl2_caps_aqc113; +extern const struct aq_hw_caps_s hw_atl2_caps_aqc115c; +extern const struct aq_hw_caps_s hw_atl2_caps_aqc116c;extern const struct aq_hw_ops hw_atl2_ops;#endif /* HW_ATL2_H */
Signature · 1 line
2.27.0
PATCH 5/7 Remove Half duplex mode speed capabilities.
In reply to Sudarsana Reddy KalluruFrom: Sameer Saurabh <[email protected]>
Since Half Duplex mode has been deprecated by the firmware, driver should not advertise Half Duplex speed in ethtool support link speed values.
--- drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c +1 -4
@@ -65,11 +65,8 @@ const struct aq_hw_caps_s hw_atl2_caps_aqc113 = {AQ_NIC_RATE_5G |AQ_NIC_RATE_2G5 |AQ_NIC_RATE_1G | -AQ_NIC_RATE_1G_HALF |AQ_NIC_RATE_100M | -AQ_NIC_RATE_100M_HALF | -AQ_NIC_RATE_10M | - AQ_NIC_RATE_10M_HALF, + AQ_NIC_RATE_10M, }; const struct aq_hw_caps_s hw_atl2_caps_aqc115c = {
Signature · 1 line
2.27.0
PATCH 6/7 atlantic: Fix statistics logic for production hardware
In reply to Sudarsana Reddy KalluruFrom: Dmitry Bogdanov <[email protected]>
B0 is the main and widespread device revision of atlantic2 HW. In the current state, driver will incorrectly fetch the statistics for this revision.
--- .../net/ethernet/aquantia/atlantic/aq_hw.h | 2 + .../net/ethernet/aquantia/atlantic/aq_nic.c | 10 +- .../aquantia/atlantic/hw_atl/hw_atl_utils.c | 15 ++- .../aquantia/atlantic/hw_atl2/hw_atl2_utils.h | 38 ++++++- .../atlantic/hw_atl2/hw_atl2_utils_fw.c | 101 ++++++++++++++---- 5 files changed, 139 insertions(+), 27 deletions(-)
drivers/net/ethernet/aquantia/atlantic/aq_hw.h +2 -0
@@ -80,6 +80,8 @@ struct aq_hw_link_status_s { };struct aq_stats_s { +u64 brc; +u64 btc;u64 uprc;u64 mprc;u64 bprc;
drivers/net/ethernet/aquantia/atlantic/aq_nic.c +8 -2
@@ -905,8 +905,14 @@ u64 *aq_nic_get_stats(struct aq_nic_s *self, u64 *data) data[++i] = stats->mbtc; data[++i] = stats->bbrc; data[++i] = stats->bbtc; - data[++i] = stats->ubrc + stats->mbrc + stats->bbrc; - data[++i] = stats->ubtc + stats->mbtc + stats->bbtc; +if (stats->brc) + data[++i] = stats->brc; +else + data[++i] = stats->ubrc + stats->mbrc + stats->bbrc; +if (stats->btc) + data[++i] = stats->btc; +else + data[++i] = stats->ubtc + stats->mbtc + stats->bbtc; data[++i] = stats->dma_pkt_rc; data[++i] = stats->dma_pkt_tc; data[++i] = stats->dma_oct_rc;
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c +13 -2
@@ -867,12 +867,20 @@ static int hw_atl_fw1x_deinit(struct aq_hw_s *self)int hw_atl_utils_update_stats (struct aq_hw_s *self) {struct aq_stats_s *cs = &self->curr_stats; +struct aq_stats_s curr_stats = *cs;struct hw_atl_utils_mbox mbox; +bool corrupted_stats = false;hw_atl_utils_mpi_read_stats (self, &mbox); -#define AQ_SDELTA (_N_) (self->curr_stats._N_ += \ - mbox.stats._N_ - self->last_stats._N_) +#define AQ_SDELTA (_N_) \ +do { \ + if (!corrupted_stats && \ + ((s64)(mbox.stats._N_ - self->last_stats._N_)) >= 0) \ + curr_stats._N_ += mbox.stats._N_ - self->last_stats._N_; \ + else \ + corrupted_stats = true; \ +} while (0)if (self->aq_link_status.mbps) {AQ_SDELTA (uprc);
@@ -892,6 +900,9 @@ int hw_atl_utils_update_stats(struct aq_hw_s *self)AQ_SDELTA (bbrc);AQ_SDELTA (bbtc);AQ_SDELTA (dpc); + +if (!corrupted_stats) + *cs = curr_stats; }#undef AQ_SDELTA
drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils.h +34 -4
@@ -239,7 +239,8 @@ struct version_s {u8 minor;u16 build; } phy; -u32 rsvd; + u32 drv_iface_ver:4; + u32 rsvd:28; };struct link_status_s {
@@ -424,7 +425,7 @@ struct cable_diag_status_s {u16 rsvd2; }; -struct statistics_s { +struct statistics_a0_s {struct {u32 link_up;u32 link_down;
@@ -457,6 +458,33 @@ struct statistics_s {u32 reserve_fw_gap; }; +struct __packed statistics_b0_s { +u64 rx_good_octets; +u64 rx_pause_frames; +u64 rx_good_frames; +u64 rx_errors; +u64 rx_unicast_frames; +u64 rx_multicast_frames; +u64 rx_broadcast_frames; + +u64 tx_good_octets; +u64 tx_pause_frames; +u64 tx_good_frames; +u64 tx_errors; +u64 tx_unicast_frames; +u64 tx_multicast_frames; +u64 tx_broadcast_frames; + +u32 main_loop_cycles; +}; + +struct __packed statistics_s { +union __packed { +struct statistics_a0_s a0; +struct statistics_b0_s b0; + }; +}; +struct filter_caps_s {u8 l2_filters_base_index:6 ;u8 flexible_filter_mask:2 ;
@@ -545,7 +573,7 @@ struct management_status_s {u32 rsvd5; }; -struct fw_interface_out { +struct __packed fw_interface_out {struct transaction_counter_s transaction_id;struct version_s version;struct link_status_s link_status;
@@ -569,7 +597,6 @@ struct fw_interface_out {struct core_dump_s core_dump;u32 rsvd11;struct statistics_s stats; -u32 rsvd12;struct filter_caps_s filter_caps;struct device_caps_s device_caps;u32 rsvd13;
@@ -592,6 +619,9 @@ struct fw_interface_out {#define AQ_HOST_MODE_LOW_POWER 3U#define AQ_HOST_MODE_SHUTDOWN 4U +#define AQ_A2_FW_INTERFACE_A0 0 +#define AQ_A2_FW_INTERFACE_B0 1 +int hw_atl2_utils_initfw (struct aq_hw_s *self,const struct aq_fw_ops **fw_ops);int hw_atl2_utils_soft_reset (struct aq_hw_s *self);
drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c +82 -19
117 lines not on this page · raw message
Signature · 1 line
2.27.0
PATCH 7/7 atlantic: Remove warn trace message.
In reply to Sudarsana Reddy KalluruFrom: Sameer Saurabh <[email protected]>
Remove the warn trace message - it's not a correct check here, because the function can still be called on the device in DOWN state
--- drivers/net/ethernet/aquantia/atlantic/aq_vec.c | 3 --- 1 file changed, 3 deletions(-)
drivers/net/ethernet/aquantia/atlantic/aq_vec.c +0 -3
@@ -362,9 +362,6 @@ unsigned int aq_vec_get_sw_stats(struct aq_vec_s *self, const unsigned int tc, u {unsigned int count; -WARN_ONCE (!aq_vec_is_valid_tc (self, tc), -"Invalid tc %u (#rx=%u, #tx=%u)\n" , - tc, self->rx_rings, self->tx_rings);if (!aq_vec_is_valid_tc (self, tc))return 0 ;
Signature · 1 line
2.27.0
This series was applied to netdev/net.git (master) by David S. Miller <[email protected]>:
Hello:
This series was applied to netdev/net.git (master) by David S. Miller <[email protected]>:
Quoted 10 lines · On Mon, 29 Nov 2021 05:28:22 -0800 you wrote:
The patch series contains fixes for atlantic driver to improve support of latest AQC113 chipset.
Please consider applying it to 'net' tree.
Dmitry Bogdanov (2):
atlantic: Increase delay for fw transactions
atlantic: Fix statistics logic for production hardware[...]
Here is the summary with links:
- [net,1/7] atlantic: Increase delay for fw transactions
https://git.kernel.org/netdev/net/c/aa1dcb5646fd - [net,2/7] atlatnic: enable Nbase-t speeds with base-t https://git.kernel.org/netdev/net/c/aa685acd98ea - [net,3/7] atlantic: Fix to display FW bundle version instead of FW mac version. https://git.kernel.org/netdev/net/c/2465c802232b - [net,4/7] atlantic: Add missing DIDs and fix 115c. https://git.kernel.org/netdev/net/c/413d5e09caa5 - [net,5/7] Remove Half duplex mode speed capabilities. https://git.kernel.org/netdev/net/c/03fa512189eb - [net,6/7] atlantic: Fix statistics logic for production hardware https://git.kernel.org/netdev/net/c/2087ced0fc3a - [net,7/7] atlantic: Remove warn trace message. https://git.kernel.org/netdev/net/c/060a0fb721ec
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html