Skip to content

Commit a03137e

Browse files
Suraj Jitindar Singhsj-aws
Suraj Jitindar Singh
authored andcommitted
ENA: Update to v2.8.0
Source: https://github.com/amzn/amzn-drivers/ Change Log: ## r2.8.0 release notes **Notes** * The driver is now dependent on the ptp module for loading See README for more details. **New Features** * Add support for PTP HW clock * Add support for SRD metrics Feature's enablement and documentation would be in future release **Bug Fixes** * Fix potential sign extension issue * Reduce memory footprint of some structs * Fix updating rx_copybreak issue * Fix xdp drops handling due to multibuf packets * Handle ena_calc_io_queue_size() possible errors * Destroy correct amount of xdp queues upon failure **Minor Changes** * Remove wide LLQ comment on supported versions * Backport uapi/bpf.h inclusion * Add a counter for driver's reset failures * Take xdp packets stats into account in ena_get_stats64() * Make queue stats code cleaner by removing if block * Remove redundant empty line * Remove confusing comment * Remove flag reading code duplication * Replace ENA local ENA_NAPI_BUDGET to global NAPI_POLL_WEIGHT * Change default print level for netif_ prints * Relocate skb_tx_timestamp() to improve time stamping accuracy * Backport bpf_warn_invalid_xdp_action() change * Fix incorrect indentation using spaces * Driver now compiles with Linux kernel 5.19 Signed-off-by: Suraj Jitindar Singh <[email protected]>
1 parent f612b8d commit a03137e

File tree

15 files changed

+1095
-127
lines changed

15 files changed

+1095
-127
lines changed

drivers/amazon/net/ena/Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@
66

77
obj-$(CONFIG_AMAZON_ENA_ETHERNET) += ena.o
88

9-
ena-y := ena_netdev.o ena_ethtool.o ena_lpc.o ena_xdp.o dim.o ena_devlink.o \
10-
net_dim.o ena_com.o ena_eth_com.o
9+
ena-y := ena_netdev.o ena_ethtool.o ena_lpc.o ena_phc.o ena_xdp.o dim.o \
10+
ena_devlink.o net_dim.o ena_com.o ena_eth_com.o
1111

1212
ena-$(CONFIG_SYSFS) += ena_sysfs.o
1313

1414
ifdef TEST_AF_XDP
1515
ccflags-y += -DENA_TEST_AF_XDP
1616
endif
17+
18+
ifdef ENA_PHC_INCLUDE
19+
ccflags-y += -DENA_PHC_INCLUDE
20+
endif

drivers/amazon/net/ena/ena_admin_defs.h

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,15 @@ enum ena_admin_aq_feature_id {
5050
ENA_ADMIN_AENQ_CONFIG = 26,
5151
ENA_ADMIN_LINK_CONFIG = 27,
5252
ENA_ADMIN_HOST_ATTR_CONFIG = 28,
53+
ENA_ADMIN_PHC_CONFIG = 29,
5354
ENA_ADMIN_FEATURES_OPCODE_NUM = 32,
5455
};
5556

5657
/* device capabilities */
5758
enum ena_admin_aq_caps_id {
5859
ENA_ADMIN_ENI_STATS = 0,
60+
/* ENA SRD customer metrics */
61+
ENA_ADMIN_ENA_SRD_INFO = 1,
5962
};
6063

6164
enum ena_admin_placement_policy_type {
@@ -104,13 +107,29 @@ enum ena_admin_get_stats_type {
104107
ENA_ADMIN_GET_STATS_TYPE_EXTENDED = 1,
105108
/* extra HW stats for specific network interface */
106109
ENA_ADMIN_GET_STATS_TYPE_ENI = 2,
110+
/* extra HW stats for ENA SRD */
111+
ENA_ADMIN_GET_STATS_TYPE_ENA_SRD = 3,
107112
};
108113

109114
enum ena_admin_get_stats_scope {
110115
ENA_ADMIN_SPECIFIC_QUEUE = 0,
111116
ENA_ADMIN_ETH_TRAFFIC = 1,
112117
};
113118

119+
enum ena_admin_get_phc_type {
120+
ENA_ADMIN_PHC_TYPE_READLESS = 0,
121+
};
122+
123+
/* ENA SRD configuration for ENI */
124+
enum ena_admin_ena_srd_flags {
125+
/* Feature enabled */
126+
ENA_ADMIN_ENA_SRD_ENABLED = BIT(0),
127+
/* UDP support enabled */
128+
ENA_ADMIN_ENA_SRD_UDP_ENABLED = BIT(1),
129+
/* Bypass Rx UDP ordering */
130+
ENA_ADMIN_ENA_SRD_UDP_ORDERING_BYPASS_ENABLED = BIT(2),
131+
};
132+
114133
struct ena_admin_aq_common_desc {
115134
/* 11:0 : command_id
116135
* 15:12 : reserved12
@@ -424,6 +443,32 @@ struct ena_admin_eni_stats {
424443
u64 linklocal_allowance_exceeded;
425444
};
426445

446+
struct ena_admin_ena_srd_stats {
447+
/* Number of packets transmitted over ENA SRD */
448+
u64 ena_srd_tx_pkts;
449+
450+
/* Number of packets transmitted or could have been
451+
* transmitted over ENA SRD
452+
*/
453+
u64 ena_srd_eligible_tx_pkts;
454+
455+
/* Number of packets received over ENA SRD */
456+
u64 ena_srd_rx_pkts;
457+
458+
/* Percentage of the ENA SRD resources that is in use */
459+
u64 ena_srd_resource_utilization;
460+
};
461+
462+
/* ENA SRD Statistics Command */
463+
struct ena_admin_ena_srd_info {
464+
/* ENA SRD configuration bitmap. See ena_admin_ena_srd_flags for
465+
* details
466+
*/
467+
u64 flags;
468+
469+
struct ena_admin_ena_srd_stats ena_srd_stats;
470+
};
471+
427472
struct ena_admin_acq_get_stats_resp {
428473
struct ena_admin_acq_common_desc acq_common_desc;
429474

@@ -433,6 +478,8 @@ struct ena_admin_acq_get_stats_resp {
433478
struct ena_admin_basic_stats basic_stats;
434479

435480
struct ena_admin_eni_stats eni_stats;
481+
482+
struct ena_admin_ena_srd_info ena_srd_info;
436483
} u;
437484
};
438485

@@ -970,6 +1017,43 @@ struct ena_admin_queue_ext_feature_desc {
9701017
};
9711018
};
9721019

1020+
struct ena_admin_feature_phc_desc {
1021+
/* PHC type as defined in enum ena_admin_get_phc_type,
1022+
* used only for GET command.
1023+
*/
1024+
u8 type;
1025+
1026+
/* Reserved - MBZ */
1027+
u8 reserved1[3];
1028+
1029+
/* PHC doorbell address as an offset to PCIe MMIO REG BAR,
1030+
* used only for GET command.
1031+
*/
1032+
u32 doorbell_offset;
1033+
1034+
/* Max time for valid PHC retrieval, passing this threshold will
1035+
* fail the get-time request and block PHC requests for
1036+
* block_timeout_usec, used only for GET command.
1037+
*/
1038+
u32 expire_timeout_usec;
1039+
1040+
/* PHC requests block period, blocking starts if PHC request expired
1041+
* in order to prevent floods on busy device,
1042+
* used only for GET command.
1043+
*/
1044+
u32 block_timeout_usec;
1045+
1046+
/* Shared PHC physical address (ena_admin_phc_resp),
1047+
* used only for SET command.
1048+
*/
1049+
struct ena_common_mem_addr output_address;
1050+
1051+
/* Shared PHC Size (ena_admin_phc_resp),
1052+
* used only for SET command.
1053+
*/
1054+
u32 output_length;
1055+
};
1056+
9731057
struct ena_admin_get_feat_resp {
9741058
struct ena_admin_acq_common_desc acq_common_desc;
9751059

@@ -1000,6 +1084,8 @@ struct ena_admin_get_feat_resp {
10001084

10011085
struct ena_admin_ena_hw_hints hw_hints;
10021086

1087+
struct ena_admin_feature_phc_desc phc;
1088+
10031089
struct ena_admin_get_extra_properties_strings_desc extra_properties_strings;
10041090

10051091
struct ena_admin_get_extra_properties_flags_desc extra_properties_flags;
@@ -1036,6 +1122,9 @@ struct ena_admin_set_feat_cmd {
10361122

10371123
/* LLQ configuration */
10381124
struct ena_admin_feature_llq_desc llq;
1125+
1126+
/* PHC configuration */
1127+
struct ena_admin_feature_phc_desc phc;
10391128
} u;
10401129
};
10411130

@@ -1114,6 +1203,16 @@ struct ena_admin_ena_mmio_req_read_less_resp {
11141203
u32 reg_val;
11151204
};
11161205

1206+
struct ena_admin_phc_resp {
1207+
u16 req_id;
1208+
1209+
u8 reserved1[6];
1210+
1211+
u64 timestamp;
1212+
1213+
u8 reserved2[48];
1214+
};
1215+
11171216
/* aq_common_desc */
11181217
#define ENA_ADMIN_AQ_COMMON_DESC_COMMAND_ID_MASK GENMASK(11, 0)
11191218
#define ENA_ADMIN_AQ_COMMON_DESC_PHASE_MASK BIT(0)

0 commit comments

Comments
 (0)