@@ -298,7 +298,7 @@ int ocp_set_latency_monitor_feature(int argc, char **argv, struct command *acmd,
298298 int err = -1 ;
299299 _cleanup_nvme_global_ctx_ struct nvme_global_ctx * ctx = NULL ;
300300 _cleanup_nvme_transport_handle_ struct nvme_transport_handle * hdl = NULL ;
301- __u32 result ;
301+ __u64 result ;
302302 struct feature_latency_monitor buf = { 0 };
303303 __u32 nsid = NVME_NSID_ALL ;
304304 struct stat nvme_stat ;
@@ -422,7 +422,7 @@ static int ocp_get_latency_monitor_feature(int argc, char **argv, struct command
422422 _cleanup_nvme_global_ctx_ struct nvme_global_ctx * ctx = NULL ;
423423 _cleanup_nvme_transport_handle_ struct nvme_transport_handle * hdl = NULL ;
424424
425- __u32 result ;
425+ __u64 result ;
426426 int err ;
427427 bool uuid ;
428428 __u8 uuid_index = 0 ;
@@ -462,8 +462,8 @@ static int ocp_get_latency_monitor_feature(int argc, char **argv, struct command
462462 err = nvme_get_features (hdl , cfg .nsid , OCP_FID_LM , cfg .sel , 0 ,
463463 uuid_index , NULL , 0 , & result );
464464 if (!err ) {
465- printf ("get-feature:0xC5 %s value: %#08x \n" ,
466- nvme_select_to_string (cfg .sel ), result );
465+ printf ("get-feature:0xC5 %s value: %#016" PRIx64 " \n" ,
466+ nvme_select_to_string (cfg .sel ), ( uint64_t ) result );
467467
468468 if (cfg .sel == NVME_GET_FEATURES_SEL_SUPPORTED )
469469 nvme_show_select_result (0xC5 , result );
@@ -500,7 +500,7 @@ static int eol_plp_failure_mode_get(struct nvme_transport_handle *hdl, const __u
500500 __u8 sel , bool uuid )
501501{
502502 __u8 uidx = 0 ;
503- __u32 result ;
503+ __u64 result ;
504504 int err ;
505505
506506 if (uuid ) {
@@ -531,7 +531,7 @@ static int eol_plp_failure_mode_set(struct nvme_transport_handle *hdl, const __u
531531 const __u8 fid , __u8 mode , bool sv ,
532532 bool uuid )
533533{
534- __u32 result ;
534+ __u64 result ;
535535 int err ;
536536 __u8 uidx = 0 ;
537537
@@ -689,7 +689,7 @@ static int get_telemetry_data(struct nvme_transport_handle *hdl, __u32 ns, __u8
689689 cmd .cdw12 = (__u32 )(0x00000000FFFFFFFF & offset );
690690 cmd .cdw13 = (__u32 )((0xFFFFFFFF00000000 & offset ) >> 8 );
691691 cmd .cdw14 = 0 ;
692- return nvme_submit_admin_passthru (hdl , & cmd , NULL );
692+ return nvme_submit_admin_passthru (hdl , & cmd );
693693}
694694
695695static void print_telemetry_data_area_1 (struct telemetry_data_area_1 * da1 ,
@@ -838,7 +838,7 @@ static int extract_dump_get_log(struct nvme_transport_handle *hdl, char *feature
838838 nvme_init_get_log (& cmd , nsid , log_id , NVME_CSI_NVM ,
839839 data , transfersize );
840840 nvme_init_get_log_lpo (& cmd , offset );
841- err = nvme_get_log (hdl , & cmd , rae , NVME_LOG_PAGE_PDU_SIZE , NULL );
841+ err = nvme_get_log (hdl , & cmd , rae , NVME_LOG_PAGE_PDU_SIZE );
842842 if (err ) {
843843 if (i > 0 )
844844 goto close_output ;
@@ -1218,7 +1218,7 @@ static int get_telemetry_log_page_data(struct nvme_transport_handle *hdl,
12181218 cmd .cdw10 |= NVME_FIELD_ENCODE (NVME_LOG_TELEM_HOST_LSP_CREATE ,
12191219 NVME_LOG_CDW10_LSP_SHIFT ,
12201220 NVME_LOG_CDW10_LSP_MASK );
1221- err = nvme_get_log (hdl , & cmd , false, NVME_LOG_PAGE_PDU_SIZE , NULL );
1221+ err = nvme_get_log (hdl , & cmd , false, NVME_LOG_PAGE_PDU_SIZE );
12221222 if (err < 0 )
12231223 nvme_show_error ("Failed to fetch the log from drive.\n" );
12241224 else if (err > 0 ) {
@@ -1255,7 +1255,7 @@ static int get_telemetry_log_page_data(struct nvme_transport_handle *hdl,
12551255 nvme_init_get_log (& cmd , NVME_NSID_ALL , log_id , NVME_CSI_NVM ,
12561256 telemetry_log , bs );
12571257 nvme_init_get_log_lpo (& cmd , offset );
1258- err = nvme_get_log (hdl , & cmd , false, NVME_LOG_PAGE_PDU_SIZE , NULL );
1258+ err = nvme_get_log (hdl , & cmd , false, NVME_LOG_PAGE_PDU_SIZE );
12591259 if (err < 0 ) {
12601260 nvme_show_error ("Failed to fetch the log from drive.\n" );
12611261 break ;
@@ -1938,7 +1938,7 @@ static int ocp_device_capabilities_log(int argc, char **argv, struct command *ac
19381938
19391939static int ocp_set_telemetry_profile (struct nvme_transport_handle * hdl , __u8 tps )
19401940{
1941- __u32 result ;
1941+ __u64 result ;
19421942 int err ;
19431943 __u8 uidx = 0 ;
19441944
@@ -2002,18 +2002,18 @@ static int ocp_set_telemetry_profile_feature(int argc, char **argv, struct comma
20022002///////////////////////////////////////////////////////////////////////////////
20032003///////////////////////////////////////////////////////////////////////////////
20042004///////////////////////////////////////////////////////////////////////////////
2005- /// DSSD Power State (Feature Identifier C8h) Get Feature
2005+ /// Telemetry Profile (Feature Identifier C8h) Get Feature
20062006static int ocp_get_telemetry_profile_feature (int argc , char * * argv , struct command * acmd ,
20072007 struct plugin * plugin )
20082008{
2009- const char * desc = "Define Issue Get Feature command (FID: 0xC8) Latency Monitor " ;
2009+ const char * desc = "Define Issue Get Feature command (FID: 0xC8) Telemetry Profile " ;
20102010 const char * sel = "[0-3]: current/default/saved/supported/" ;
20112011 const char * nsid = "Byte[04-07]: Namespace Identifier Valid/Invalid/Inactive" ;
20122012
20132013 _cleanup_nvme_global_ctx_ struct nvme_global_ctx * ctx = NULL ;
20142014 _cleanup_nvme_transport_handle_ struct nvme_transport_handle * hdl = NULL ;
20152015
2016- __u32 result ;
2016+ __u64 result ;
20172017 int err ;
20182018 bool uuid ;
20192019 __u8 uuid_index = 0 ;
@@ -2053,8 +2053,8 @@ static int ocp_get_telemetry_profile_feature(int argc, char **argv, struct comma
20532053 err = nvme_get_features (hdl , cfg .nsid , OCP_FID_TEL_CFG , cfg .sel , 0 ,
20542054 uuid_index , NULL , 0 , & result );
20552055 if (!err ) {
2056- printf ("get-feature:0xC8 %s value: %#08x \n" ,
2057- nvme_select_to_string (cfg .sel ), result );
2056+ printf ("get-feature:0xC8 %s value: %#016" PRIx64 " \n" ,
2057+ nvme_select_to_string (cfg .sel ), ( uint64_t ) result );
20582058
20592059 if (cfg .sel == NVME_GET_FEATURES_SEL_SUPPORTED )
20602060 nvme_show_select_result (0xC8 , result );
@@ -2077,7 +2077,7 @@ set_dssd_power_state(struct nvme_transport_handle *hdl,
20772077 const __u8 fid , __u8 power_state , bool sv ,
20782078 bool uuid )
20792079{
2080- __u32 result ;
2080+ __u64 result ;
20812081 int err ;
20822082 __u8 uidx = 0 ;
20832083
@@ -2154,7 +2154,7 @@ static int set_dssd_power_state_feature(int argc, char **argv, struct command *a
21542154static int get_dssd_power_state (struct nvme_transport_handle * hdl , const __u32 nsid ,
21552155 const __u8 fid , __u8 sel , bool uuid )
21562156{
2157- __u32 result ;
2157+ __u64 result ;
21582158 int err ;
21592159 __u8 uuid_index = 0 ;
21602160
@@ -2169,7 +2169,8 @@ static int get_dssd_power_state(struct nvme_transport_handle *hdl, const __u32 n
21692169
21702170 err = nvme_get_features (hdl , nsid , fid , sel , 0 , uuid_index , NULL , 0 , & result );
21712171 if (!err ) {
2172- printf ("get-feature:0xC7 %s value: %#08x\n" , nvme_select_to_string (sel ), result );
2172+ printf ("get-feature:0xC7 %s value: %#016" PRIx64 "\n" ,
2173+ nvme_select_to_string (sel ), (uint64_t )result );
21732174
21742175 if (sel == NVME_GET_FEATURES_SEL_SUPPORTED )
21752176 nvme_show_select_result (fid , result );
@@ -2246,7 +2247,7 @@ static int set_plp_health_check_interval(int argc, char **argv, struct command *
22462247 _cleanup_nvme_global_ctx_ struct nvme_global_ctx * ctx = NULL ;
22472248 _cleanup_nvme_transport_handle_ struct nvme_transport_handle * hdl = NULL ;
22482249 int err ;
2249- __u32 result ;
2250+ __u64 result ;
22502251 __u8 uidx = 0 ;
22512252
22522253 struct config {
@@ -2305,7 +2306,7 @@ static int get_plp_health_check_interval(int argc, char **argv, struct command *
23052306 const __u8 fid = 0xc6 ;
23062307 _cleanup_nvme_global_ctx_ struct nvme_global_ctx * ctx = NULL ;
23072308 _cleanup_nvme_transport_handle_ struct nvme_transport_handle * hdl = NULL ;
2308- __u32 result ;
2309+ __u64 result ;
23092310 int err ;
23102311
23112312 struct config {
@@ -2328,7 +2329,8 @@ static int get_plp_health_check_interval(int argc, char **argv, struct command *
23282329 err = nvme_get_features (hdl , nsid , OCP_FID_PLPI , cfg .sel , 0 , 0 ,
23292330 NULL , 0 , & result );
23302331 if (!err ) {
2331- printf ("get-feature:0xC6 %s value: %#08x\n" , nvme_select_to_string (cfg .sel ), result );
2332+ printf ("get-feature:0xC6 %s value: %#016" PRIx64 "\n" ,
2333+ nvme_select_to_string (cfg .sel ), (uint64_t )result );
23322334
23332335 if (cfg .sel == NVME_GET_FEATURES_SEL_SUPPORTED )
23342336 nvme_show_select_result (fid , result );
@@ -2356,7 +2358,7 @@ static int set_dssd_async_event_config(int argc, char **argv, struct command *ac
23562358 _cleanup_nvme_global_ctx_ struct nvme_global_ctx * ctx = NULL ;
23572359 _cleanup_nvme_transport_handle_ struct nvme_transport_handle * hdl = NULL ;
23582360 int err ;
2359- __u32 result ;
2361+ __u64 result ;
23602362 __u8 uidx = 0 ;
23612363
23622364 struct config {
@@ -2411,7 +2413,7 @@ static int get_dssd_async_event_config(int argc, char **argv, struct command *ac
24112413 const __u8 fid = OCP_FID_DAEC ;
24122414 _cleanup_nvme_global_ctx_ struct nvme_global_ctx * ctx = NULL ;
24132415 _cleanup_nvme_transport_handle_ struct nvme_transport_handle * hdl = NULL ;
2414- __u32 result ;
2416+ __u64 result ;
24152417 int err ;
24162418
24172419 struct config {
@@ -2433,7 +2435,8 @@ static int get_dssd_async_event_config(int argc, char **argv, struct command *ac
24332435
24342436 err = nvme_get_features (hdl , nsid , fid , cfg .sel , 0 , 0 , NULL , 0 , & result );
24352437 if (!err ) {
2436- printf ("get-feature:0xC9 %s value: %#08x\n" , nvme_select_to_string (cfg .sel ), result );
2438+ printf ("get-feature:0xC9 %s value: %#016" PRIx64 "\n" ,
2439+ nvme_select_to_string (cfg .sel ), (uint64_t )result );
24372440
24382441 if (cfg .sel == NVME_GET_FEATURES_SEL_SUPPORTED )
24392442 nvme_show_select_result (fid , result );
@@ -2672,7 +2675,7 @@ static int error_injection_get(struct nvme_transport_handle *hdl, const __u8 sel
26722675 _cleanup_free_ struct erri_entry * entry = NULL ;
26732676 struct erri_get_cq_entry cq_entry ;
26742677 const __u8 fid = OCP_FID_ERRI ;
2675- __u32 * result = ( __u32 * ) & cq_entry ;
2678+ __u64 result ;
26762679 __u32 data_len = 0 ;
26772680 __u8 uidx = 0 ;
26782681 int err ;
@@ -2696,13 +2699,14 @@ static int error_injection_get(struct nvme_transport_handle *hdl, const __u8 sel
26962699 }
26972700
26982701 err = nvme_get_features (hdl , 0 , fid , sel , 0 , uidx , entry ,
2699- data_len , result );
2702+ data_len , & result );
27002703 if (!err ) {
2704+ cq_entry .nume = result ;
27012705 nvme_show_result ("Number of Error Injections (feature: %#0*x): %#0*x (%s: %d)" ,
27022706 fid ? 4 : 2 , fid , cq_entry .nume ? 10 : 8 , cq_entry .nume ,
27032707 nvme_select_to_string (sel ), cq_entry .nume );
27042708 if (sel == NVME_GET_FEATURES_SEL_SUPPORTED )
2705- nvme_show_select_result (fid , * result );
2709+ nvme_show_select_result (fid , result );
27062710 for (i = 0 ; i < cq_entry .nume ; i ++ ) {
27072711 printf ("Entry: %d, Flags: %x (%s%s), Type: %x (%s), NRTDP: %d\n" , i ,
27082712 entry [i ].flags , entry [i ].enable ? "Enabled" : "Disabled" ,
@@ -2850,7 +2854,7 @@ static int enable_ieee1667_silo_get(struct nvme_transport_handle *hdl, const __u
28502854{
28512855 struct ieee1667_get_cq_entry cq_entry = { 0 };
28522856 const __u8 fid = OCP_FID_1667 ;
2853- __u32 result ;
2857+ __u64 result ;
28542858 __u8 uidx = 0 ;
28552859 int err ;
28562860
@@ -2912,6 +2916,7 @@ static int enable_ieee1667_silo_set(struct nvme_transport_handle *hdl,
29122916 bool save = argconfig_parse_seen (opts , "save" );
29132917 struct ieee1667_get_cq_entry cq_entry ;
29142918 const __u8 fid = OCP_FID_1667 ;
2919+ __u64 result ;
29152920 __u32 cdw11 ;
29162921 __u8 uidx = 0 ;
29172922 int err ;
@@ -2927,7 +2932,8 @@ static int enable_ieee1667_silo_set(struct nvme_transport_handle *hdl,
29272932
29282933 cdw11 = OCP_SET (enable , ENABLE_IEEE1667_SILO );
29292934 err = nvme_set_features (hdl , NVME_NSID_NONE , fid , save ,
2930- cdw11 , 0 , 0 , uidx , 0 , NULL , 0 , (__u32 * )& cq_entry );
2935+ cdw11 , 0 , 0 , uidx , 0 , NULL , 0 , & result );
2936+ memcpy (& cq_entry , & result , sizeof (cq_entry ));
29312937 if (err > 0 ) {
29322938 nvme_show_status (err );
29332939 } else if (err < 0 ) {
0 commit comments