What are default and maximum values of dev_loss_tmo in Red Hat Enterprise Linux 6

博客围绕Red Hat Enterprise Linux 5和6系统展开,探讨了dev_loss_tmo的默认值和最大值问题。默认值因驱动/设备而异,如Qlogic适配器为35秒,Emulex适配器为30秒,可通过模块参数修改;最大值为600秒,设为0或大于600则用驱动内部超时值。

https://access.redhat.com/solutions/755663

 SOLUTION 已验证 - 已更新 2016年十一月29日21:49 - 

English 

环境

  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 6

问题

What’s the default value of dev_loss_tmo?
What’s the maximum value of dev_loss_tmo?

决议

The default dev_loss_tmo value varies, depending on which driver/device is used. If a Qlogic adapter is used, the default is 35 seconds, while if an Emulex adapter is used, it is 30 seconds. The dev_loss_tmo value can be changed via the scsi_transport_fc module parameter dev_loss_tmo, although the driver can override this timeout value.

The maximum dev_loss_tmo value is 600 seconds. If dev_loss_tmo is set to zero or any value greater than 600, the driver's internal timeouts will be used instead.

For more information, see the Storage Administration Guide.

void evt_add_general_device_handler(struct ubus_app *app, struct blob_attr *msg) { char *dev_id=NULL, *dev_mac=NULL, *dev_ip=NULL, *dev_model=NULL, *network_mode=NULL; char *dev_category=NULL, *dev_alias=NULL, *dev_avatar = NULL; int storage_enable = 0; DEV_INFO *dev_info = NULL; MEDIACENTER_CTX *mediacenter_ctx = (MEDIACENTER_CTX*)get_top_ctx(); if (!mediacenter_ctx) { DBG_ERR("top ctx NULL\n"); return; } /* parse parameters */ if (!msg) { DBG_ERR("msg NULL\n"); goto out; } struct blobmsg ( blobmsg_string deviceId, blobmsg_string mac, blobmsg_string ipaddr, blobmsg_string model, blobmsg_string alias, blobmsg_string avatar, blobmsg_string category, blobmsg_string network_mode, blobmsg_int32 hub_storage_enabled ) (my_struct, msg, false); if (!my_struct.deviceId || !my_struct.ipaddr || !my_struct.mac || !my_struct.model || !my_struct.network_mode) { DBG_ERR("param error\n"); goto out; } dev_id = blobmsg_get_string(my_struct.deviceId); dev_mac = blobmsg_get_string(my_struct.mac); dev_ip = blobmsg_get_string(my_struct.ipaddr); dev_model = blobmsg_get_string(my_struct.model); network_mode = blobmsg_get_string(my_struct.network_mode); if(my_struct.category){ dev_category = blobmsg_get_string(my_struct.category); } if (my_struct.alias){ dev_alias = blobmsg_get_string(my_struct.alias); DBG_ERR("dev_alias:%s\n", dev_alias); } if (my_struct.avatar){ dev_avatar = blobmsg_get_string(my_struct.avatar); DBG_ERR("dev_avatar:%s\n", dev_avatar); } if(my_struct.hub_storage_enabled){ storage_enable = blobmsg_get_u32(my_struct.hub_storage_enabled); } #ifndef HARDDISK_STORAGE if (storage_enable == 0) { return; } #endif dev_info = dev_info_new(mediacenter_ctx, dev_id, dev_ip, dev_mac, dev_model, dev_category, dev_alias, dev_avatar, DEV_COMMON_CAM, storage_enable, msg); if (!dev_info) { DBG_ERR("dev_info_new failed, %s\n", dev_id); goto out; } #ifdef AI_ENHANCE /*if new dev, sync all familiar to uci config*/ Ai_Enhance_FamiliarNotifyConfig_Update(dev_info); #endif dev_info->top_ctx = mediacenter_ctx; dev_info->network_mode = (0 == strncmp("wired", network_mode, strlen("wired"))) ? 0 : 1; /* refresh all devices' region info */ tapocare_update_region_info(mediacenter_ctx); uloop_timeout_set(&mediacenter_ctx->pSd->up_sd_usage_tmo, 10); dev_info->local_online = 1; dev_info->check_local_online.cb = check_general_local_online_cb; uloop_timeout_set(&dev_info->check_local_online, TIMEOUT_CHECK_LOCAL_ONLINE); dev_info->check_lonn_conn.cb = check_general_long_conn_cb; uloop_timeout_set(&dev_info->check_lonn_conn, 5000); out: return; }
09-18
void evt_device_list_general_handler(struct ubus_app *app, struct blob_attr *msg) { struct blob_attr *cur = NULL; int rem = 0; char *dev_id = NULL, *dev_mac = NULL, *dev_ip = NULL, *dev_model = NULL, *dev_category = NULL, *dev_alias = NULL, *dev_avatar = NULL; DEV_INFO *dev_info = NULL; MEDIACENTER_CTX *mediacenter_ctx = (MEDIACENTER_CTX*)get_top_ctx(); int general_camera = 0; int hub_storage_enable = -1; if (!mediacenter_ctx) { DBG_ERR("top ctx NULL\n"); return; } /* parse parameters */ if (!msg) { DBG_ERR("msg NULL\n"); goto out; } struct blobmsg ( blobmsg_array devices, ) (my_struct, msg, false); if (!my_struct.devices) { DBG_ERR("param error\n"); goto out; } blobmsg_for_each_attr(cur, my_struct.devices, rem) { if (cur) { struct blobmsg ( blobmsg_int32 general_camera, blobmsg_string deviceId, blobmsg_string mac, blobmsg_string ipaddr, blobmsg_string model, blobmsg_string alias, blobmsg_string category, blobmsg_string avatar, blobmsg_int32 storage_enable, blobmsg_int32 hub_bitmap, blobmsg_int32 ai_enhance_enable, blobmsg_int32 face_notification, blobmsg_int32 familiar_enable, blobmsg_int32 stranger_enable, blobmsg_int32 stranger_alarm_count, blobmsg_array face_id, ) (info, cur, false); if (!info.general_camera || !info.deviceId || !info.ipaddr || !info.model || !info.mac || !info.alias) { continue; } general_camera = blobmsg_get_u32(info.general_camera); if (0 == general_camera) { continue; } dev_id = blobmsg_get_string(info.deviceId); dev_mac = blobmsg_get_string(info.mac); dev_ip = blobmsg_get_string(info.ipaddr); dev_model = blobmsg_get_string(info.model); dev_alias = blobmsg_get_string(info.alias); if(info.category){ dev_category = blobmsg_get_string(info.category); } if(info.avatar){ dev_avatar = blobmsg_get_string(info.avatar); DBG_ERR("dev_avatar: %s\n", dev_avatar); } if (info.storage_enable){ hub_storage_enable = blobmsg_get_u32(info.storage_enable); DBG_ERR("hub_storage_enable:%d\n", hub_storage_enable); } if(hub_storage_enable == 0){ DBG_ERR("skip mac:[%s]\n", dev_mac); continue; } /* add device */ dev_info = dev_info_new(mediacenter_ctx, dev_id, dev_ip, dev_mac, dev_model, dev_category, dev_alias, dev_avatar, DEV_COMMON_CAM, hub_storage_enable, cur); if (!dev_info) { DBG_ERR("dev_info_new failed, %s\n", dev_id); continue; } #ifdef AI_ENHANCE if(info.hub_bitmap){ dev_info->hub_bitmap = blobmsg_get_u32(info.hub_bitmap); } if (info.ai_enhance_enable){ dev_info->ai_enhanced = blobmsg_get_u32(info.ai_enhance_enable); if(dev_info->ai_enhanced == 1) { Ai_Enhance_AlgoDev_Init(dev_info->dev_id, dev_info->dev_model, dev_info->dev_mac); } } if(info.face_notification){ dev_info->face_notification = blobmsg_get_u32(info.face_notification); } if(info.familiar_enable){ dev_info->familiar_enable = blobmsg_get_u32(info.familiar_enable); } if(info.stranger_enable){ dev_info->stranger_enable = blobmsg_get_u32(info.stranger_enable); } if(info.stranger_alarm_count){ dev_info->stranger_alarm_count = blobmsg_get_u32(info.stranger_alarm_count); } if(info.face_id){ memset(dev_info->FamiliarNotify_List, 0, sizeof(dev_info->FamiliarNotify_List)); struct blob_attr *pos = NULL; int rem2 = 0, index = 0; U64 tmp_face_id = 0; blobmsg_for_each_attr(pos, info.face_id, rem2) { if(pos) { tmp_face_id = strtoull(blobmsg_get_string(pos), NULL, 10); index = Ai_Enhance_GetIndex_From_Faceid(tmp_face_id); if(index >= 0 && index < FD_FACE_SUPPORT_NUM) { dev_info->FamiliarNotify_List[index] = tmp_face_id; } } } } else { if(info.familiar_enable) { memset(dev_info->FamiliarNotify_List, 0, sizeof(dev_info->FamiliarNotify_List)); } else { /*设备没配过人脸开关,默认生成所有熟人*/ Ai_Enhance_FamiliarNotifyConfig_Update(dev_info); } } #endif dev_info->top_ctx = mediacenter_ctx; dev_info->local_online = 1; dev_info->check_local_online.cb = check_general_local_online_cb; uloop_timeout_set(&dev_info->check_local_online, TIMEOUT_CHECK_LOCAL_ONLINE); dev_info->check_lonn_conn.cb = check_general_long_conn_cb; uloop_timeout_set(&dev_info->check_lonn_conn, 5000); } } /* refresh all devices' region info */ tapocare_update_region_info(mediacenter_ctx); uloop_timeout_set(&mediacenter_ctx->pSd->up_sd_usage_tmo, 10); out: return; }
最新发布
09-18
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值