Print this page
NEX-14556 xnf: panic on Xen 4.x
Reviewed by: Dan Fields <dan.fields@nexenta.com>
Reviewed by: Roman Strashkin <roman.strashkin@nexenta.com>
re #13140 rb4270 hvm_sd module missing dependencies on scsi and cmlb
re #13166 rb4270 Check for Xen HVM even if CPUID signature returns Microsoft Hv
re #13187 rb4270 Fix Xen HVM related warnings


1040         xnfp->xnf_devinfo = devinfo;
1041 
1042         macp->m_type_ident = MAC_PLUGIN_IDENT_ETHER;
1043         macp->m_src_addr = xnfp->xnf_mac_addr;
1044         macp->m_callbacks = &xnf_callbacks;
1045         macp->m_min_sdu = 0;
1046         xnfp->xnf_mtu = ETHERMTU;
1047         macp->m_max_sdu = xnfp->xnf_mtu;
1048 
1049         xnfp->xnf_running = B_FALSE;
1050         xnfp->xnf_connected = B_FALSE;
1051         xnfp->xnf_be_rx_copy = B_FALSE;
1052         xnfp->xnf_be_mcast_control = B_FALSE;
1053         xnfp->xnf_need_sched = B_FALSE;
1054 
1055         xnfp->xnf_rx_head = NULL;
1056         xnfp->xnf_rx_tail = NULL;
1057         xnfp->xnf_rx_new_buffers_posted = B_FALSE;
1058 
1059 #ifdef XPV_HVM_DRIVER
1060         /*
1061          * Report our version to dom0.
1062          */
1063         if (xenbus_printf(XBT_NULL, "guest/xnf", "version", "%d",
1064             HVMPV_XNF_VERS))
1065                 cmn_err(CE_WARN, "xnf: couldn't write version\n");
1066 #endif
1067 
1068         /*
1069          * Get the iblock cookie with which to initialize the mutexes.
1070          */
1071         if (ddi_get_iblock_cookie(devinfo, 0, &xnfp->xnf_icookie)
1072             != DDI_SUCCESS)
1073                 goto failure;
1074 
1075         mutex_init(&xnfp->xnf_txlock,
1076             NULL, MUTEX_DRIVER, xnfp->xnf_icookie);
1077         mutex_init(&xnfp->xnf_rxlock,
1078             NULL, MUTEX_DRIVER, xnfp->xnf_icookie);
1079         mutex_init(&xnfp->xnf_schedlock,
1080             NULL, MUTEX_DRIVER, xnfp->xnf_icookie);
1081         mutex_init(&xnfp->xnf_gref_lock,
1082             NULL, MUTEX_DRIVER, xnfp->xnf_icookie);
1083 
1084         cv_init(&xnfp->xnf_cv_state, NULL, CV_DEFAULT, NULL);
1085         cv_init(&xnfp->xnf_cv_multicast, NULL, CV_DEFAULT, NULL);




1040         xnfp->xnf_devinfo = devinfo;
1041 
1042         macp->m_type_ident = MAC_PLUGIN_IDENT_ETHER;
1043         macp->m_src_addr = xnfp->xnf_mac_addr;
1044         macp->m_callbacks = &xnf_callbacks;
1045         macp->m_min_sdu = 0;
1046         xnfp->xnf_mtu = ETHERMTU;
1047         macp->m_max_sdu = xnfp->xnf_mtu;
1048 
1049         xnfp->xnf_running = B_FALSE;
1050         xnfp->xnf_connected = B_FALSE;
1051         xnfp->xnf_be_rx_copy = B_FALSE;
1052         xnfp->xnf_be_mcast_control = B_FALSE;
1053         xnfp->xnf_need_sched = B_FALSE;
1054 
1055         xnfp->xnf_rx_head = NULL;
1056         xnfp->xnf_rx_tail = NULL;
1057         xnfp->xnf_rx_new_buffers_posted = B_FALSE;
1058 
1059 #ifdef XPV_HVM_DRIVER
1060         /* Report our version to dom0 */
1061         (void) xenbus_printf(XBT_NULL, "guest/xnf", "version", "%d",
1062             HVMPV_XNF_VERS);



1063 #endif
1064 
1065         /*
1066          * Get the iblock cookie with which to initialize the mutexes.
1067          */
1068         if (ddi_get_iblock_cookie(devinfo, 0, &xnfp->xnf_icookie)
1069             != DDI_SUCCESS)
1070                 goto failure;
1071 
1072         mutex_init(&xnfp->xnf_txlock,
1073             NULL, MUTEX_DRIVER, xnfp->xnf_icookie);
1074         mutex_init(&xnfp->xnf_rxlock,
1075             NULL, MUTEX_DRIVER, xnfp->xnf_icookie);
1076         mutex_init(&xnfp->xnf_schedlock,
1077             NULL, MUTEX_DRIVER, xnfp->xnf_icookie);
1078         mutex_init(&xnfp->xnf_gref_lock,
1079             NULL, MUTEX_DRIVER, xnfp->xnf_icookie);
1080 
1081         cv_init(&xnfp->xnf_cv_state, NULL, CV_DEFAULT, NULL);
1082         cv_init(&xnfp->xnf_cv_multicast, NULL, CV_DEFAULT, NULL);