numam-spdk/examples/interrupt_tgt/interrupt_plugin.py
Liu Xiaodong 74db63dcda interrupt_tgt: add RPC to set interrupt mode
Plugin RPC method 'reactor_set_interrupt_mode' is added
to set specific reactor run in interrupt mode or back
to poll mode.

Based on this RPC, scenarios later can be implemented
to verify interrupt mode functionality.

Change-Id: I9785e6942299bab7c949780faf18216e293f0b1d
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7347
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-04-26 06:58:36 +00:00

16 lines
686 B
Python

from rpc.client import print_json
def reactor_set_interrupt_mode(args):
params = {'lcore': args.lcore, 'disable_interrupt': args.disable_interrupt}
return args.client.call('reactor_set_interrupt_mode', params)
def spdk_rpc_plugin_initialize(subparsers):
p = subparsers.add_parser('reactor_set_interrupt_mode',
help="""Set reactor to interrupt or back to poll mode.""")
p.add_argument('lcore', type=int, help='lcore of the reactor')
p.add_argument('-d', '--disable-interrupt', dest='disable_interrupt', action='store_true',
help='Set reactor back to poll mode')
p.set_defaults(func=reactor_set_interrupt_mode)