socsvn commit: r307239 - soc2016/vincenzo/head/usr.sbin/bhyve

vincenzo at FreeBSD.org vincenzo at FreeBSD.org
Fri Aug 5 14:14:41 UTC 2016


Author: vincenzo
Date: Fri Aug  5 14:14:40 2016
New Revision: 307239
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=307239

Log:
   bhyve: ptnet_regif: fix cookie computation

Modified:
  soc2016/vincenzo/head/usr.sbin/bhyve/pci_ptnetmap_netif.c

Modified: soc2016/vincenzo/head/usr.sbin/bhyve/pci_ptnetmap_netif.c
==============================================================================
--- soc2016/vincenzo/head/usr.sbin/bhyve/pci_ptnetmap_netif.c	Fri Aug  5 14:13:39 2016	(r307238)
+++ soc2016/vincenzo/head/usr.sbin/bhyve/pci_ptnetmap_netif.c	Fri Aug  5 14:14:40 2016	(r307239)
@@ -119,6 +119,7 @@
 
 	for (i = 0; i < sc->num_rings; i++, kick_addr += 4) {
 		struct msix_table_entry *mte;
+		void *cookie = ((void*)sc) + 4*i;
 
 		cfg->entries[i].irqfd = vm_get_fd(vmctx);
 		cfg->entries[i].ioctl.com = VM_LAPIC_MSI;
@@ -133,12 +134,12 @@
 		ret = vm_io_reg_handler(vmctx, kick_addr /* ioaddr */,
 					0 /* in */, 0 /* mask_data */,
 					0 /* data */, VM_IO_REGH_KWEVENTS,
-					(void *)sc + 4*i /* cookie */);
+					cookie /* cookie */);
 		if (ret) {
 			fprintf(stderr, "%s: vm_io_reg_handler %d\n",
 				__func__, ret);
 		}
-		cfg->entries[i].ioeventfd = (uint64_t) (sc + 4*i);
+		cfg->entries[i].ioeventfd = (uint64_t) cookie;
 	}
 
 	ret = ptnetmap_create(sc->ptbe, cfg);


More information about the svn-soc-all mailing list