diff options
author | Tadeusz Struk <tadeusz.struk@intel.com> | 2016-09-25 17:44:23 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-10-02 15:42:17 +0300 |
commit | 0cb2aa690c7ef14ad1f544288349abb5434bb75d (patch) | |
tree | d62ef577d193187d80650315d160fc37d896ecbb /drivers/infiniband/hw/hfi1/sdma.h | |
parent | 3a6982dfd3a7931d679a1aac651fda83ecbad0a0 (diff) | |
download | linux-0cb2aa690c7ef14ad1f544288349abb5434bb75d.tar.xz |
IB/hfi1: Add sysfs interface for affinity setup
Some users want more control over which cpu cores are being used by the
driver. For example, users might want to restrict the driver to some
specified subset of the cores so that they can appropriately partition
processes, irq handlers, and work threads.
To allow the user to fine tune system affinity settings new sysfs
attributes are introduced per sdma engine. This patch adds a new
attribute type for sdma engine and a new cpu_list attribute.
When the user writes a cpu range to the cpu_list attribute the driver
will create an internal cpu->sdma map, which will be used later as a
look-up table to choose an optimal engine for a user requests.
Reviewed-by: Dean Luick <dean.luick@intel.com>
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Reviewed-by: Sebastian Sanchez <sebastian.sanchez@intel.com>
Reviewed-by: Jianxin Xiong <jianxin.xiong@intel.com>
Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/hfi1/sdma.h')
-rw-r--r-- | drivers/infiniband/hw/hfi1/sdma.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/hfi1/sdma.h b/drivers/infiniband/hw/hfi1/sdma.h index b333afa552fc..93025f6ded15 100644 --- a/drivers/infiniband/hw/hfi1/sdma.h +++ b/drivers/infiniband/hw/hfi1/sdma.h @@ -413,6 +413,8 @@ struct sdma_engine { spinlock_t flushlist_lock; /* private: */ struct list_head flushlist; + struct cpumask cpu_mask; + struct kobject kobj; }; int sdma_init(struct hfi1_devdata *dd, u8 port); @@ -1059,6 +1061,12 @@ struct sdma_engine *sdma_select_engine_vl( u32 selector, u8 vl); +struct sdma_engine *sdma_select_user_engine(struct hfi1_devdata *dd, + u32 selector, u8 vl); +ssize_t sdma_get_cpu_to_sde_map(struct sdma_engine *sde, char *buf); +ssize_t sdma_set_cpu_to_sde_map(struct sdma_engine *sde, const char *buf, + size_t count); +int sdma_engine_get_vl(struct sdma_engine *sde); void sdma_seqfile_dump_sde(struct seq_file *s, struct sdma_engine *); #ifdef CONFIG_SDMA_VERBOSITY |