From 8bd6afdb942624c18b64731bcbc1c22bfea00be9 Mon Sep 17 00:00:00 2001 From: hselasky Date: Mon, 14 Dec 2015 10:03:04 +0000 Subject: [PATCH] MFC r290003: Add support for binding IRQs to CPUs in the LinuxKPI. The new function added is for BSD only and does not exist in Linux. Sponsored by: Mellanox Technologies git-svn-id: svn://svn.freebsd.org/base/stable/10@292192 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/ofed/include/linux/interrupt.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/sys/ofed/include/linux/interrupt.h b/sys/ofed/include/linux/interrupt.h index d97d6a901..4c4b0082f 100644 --- a/sys/ofed/include/linux/interrupt.h +++ b/sys/ofed/include/linux/interrupt.h @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2015 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -117,6 +117,23 @@ request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags, return 0; } +static inline int +bind_irq_to_cpu(unsigned int irq, int cpu_id) +{ + struct irq_ent *irqe; + struct device *dev; + + dev = _pci_find_irq_dev(irq); + if (dev == NULL) + return (-ENOENT); + + irqe = _irq_ent(dev, irq); + if (irqe == NULL) + return (-ENOENT); + + return (-bus_bind_intr(dev->bsddev, irqe->res, cpu_id)); +} + static inline void free_irq(unsigned int irq, void *device) { -- 2.45.0