Skip to content

Commit

Permalink
Merge pull request snabbco#809 from Igalia/no-supervisor-cleanup-for-…
Browse files Browse the repository at this point in the history
…intel_mp

Disable bus-mastering cleanup for intel_mp
  • Loading branch information
wingo authored May 17, 2017
2 parents 7c07e80 + 344e22a commit 5e72f50
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/apps/intel_mp/intel_mp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,7 @@ function Intel1g:init ()
if not self.master then return end
pci.unbind_device_from_linux(self.pciaddress)
pci.set_bus_master(self.pciaddress, true)
pci.disable_bus_master_cleanup(self.pciaddress)

-- 4.5.3 Initialization Sequence
self:disable_interrupts()
Expand Down Expand Up @@ -865,6 +866,7 @@ function Intel82599:init ()
if not self.master then return end
pci.unbind_device_from_linux(self.pciaddress)
pci.set_bus_master(self.pciaddress, true)
pci.disable_bus_master_cleanup(self.pciaddress)

for i=1,math.floor(self.linkup_wait/2) do
self:disable_interrupts()
Expand Down
6 changes: 6 additions & 0 deletions src/lib/hardware/pci.lua
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,12 @@ function set_bus_master (device, enable)
f:close()
end

-- For devices used by some Snabb apps, PCI bus mastering should
-- outlive the life of the process.
function disable_bus_master_cleanup (device)
shm.unlink('group/dma/pci/'..canonical(device))
end

-- Shutdown DMA to prevent "dangling" requests for PCI devices opened
-- by pid (or other processes in its process group).
--
Expand Down

0 comments on commit 5e72f50

Please sign in to comment.