// SPDX-License-Identifier: GPL-2.0-or-later /* * net/sched/em_nbyte.c N-Byte ematch * * Authors: Thomas Graf */ #include #include #include #include #include #include #include #include struct nbyte_data { struct tcf_em_nbyte hdr; char pattern[]; }; static int em_nbyte_change(struct net *net, void *data, int data_len, struct tcf_ematch *em) { struct tcf_em_nbyte *nbyte = data; if (data_len < sizeof(*nbyte) || data_len < (sizeof(*nbyte) + nbyte->len)) return -EINVAL; em->datalen = sizeof(*nbyte) + nbyte->len; em->data = (unsigned long)kmemdup(data, em->datalen, GFP_KERNEL); if (em->data == 0UL) return -ENOMEM; return 0; } static int em_nbyte_match(struct sk_buff *skb, struct tcf_ematch *em, struct tcf_pkt_info *info) { struct nbyte_data *nbyte = (struct nbyte_data *) em->data; unsigned char *ptr = tcf_get_base_ptr(skb, nbyte->hdr.layer); ptr += nbyte->hdr.off; if (!tcf_valid_offset(skb, ptr, nbyte->hdr.len)) return 0; return !memcmp(ptr, nbyte->pattern, nbyte->hdr.len); } static struct tcf_ematch_ops em_nbyte_ops = { .kind = TCF_EM_NBYTE, .change = em_nbyte_change, .match = em_nbyte_match, .owner = THIS_MODULE, .link = LIST_HEAD_INIT(em_nbyte_ops.link) }; static int __init init_em_nbyte(void) { return tcf_em_register(&em_nbyte_ops); } static void __exit exit_em_nbyte(void) { tcf_em_unregister(&em_nbyte_ops); } MODULE_LICENSE("GPL"); module_init(init_em_nbyte); module_exit(exit_em_nbyte); MODULE_ALIAS_TCF_EMATCH(TCF_EM_NBYTE); '/drm-misc/tree/kernel/async.c'>treecommitdiff
AgeCommit message (Expand)AuthorFilesLines
2024-02-09async: Use a dedicated unbound workqueue with raised min_activeTejun Heo1-1/+16
2024-01-10Merge tag 'header_cleanup-2024-01-10' of https://evilpiepirate.org/git/bcachefsLinus Torvalds1-2/+3
2024-01-03async: Introduce async_schedule_dev_nocall()Rafael J. Wysocki1-0/+29
2024-01-03async: Split async_schedule_node_domain()Rafael J. Wysocki1-22/+34
2023-12-20sched.h: move pid helpers to pid.hKent Overstreet1-2/+3
2022-02-03Revert "module, async: async_synchronize_full() on module init iff async is u...Igor Pylypiv1-3/+0
2021-05-07kernel/async.c: remove async_unregister_domain()Rasmus Villemoes1-18/+0
2021-05-07kernel/async.c: stop guarding pr_debug() statementsRasmus Villemoes1-28/+20
2021-05-06kernel/async.c: fix pr_debug statementRasmus Villemoes1-1/+1
2020-07-16treewide: Remove uninitialized_var() usageKees Cook1-2/+2
2019-06-05treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441Thomas Gleixner1-5/+1
2019-04-09treewide: Switch printk users from %pf and %pF to %ps and %pS, respectivelySakari Ailus1-2/+2
2019-01-31async: Add support for queueing on specific NUMA nodeAlexander Duyck1-24/+29
2018-02-06kernel/async.c: revert "async: simplify lowest_in_progress()"Rasmus Villemoes1-8/+12
2017-05-23async: Adjust system_state checksThomas Gleixner1-4/+4
2015-11-19async: export current_is_async()Lukas Wunner1-0/+1
2014-10-09kernel/async.c: switch to pr_foo()Ionut Alexa1-4/+4
2013-03-12async: rename and redefine async_func_ptrLai Jiangshan1-10/+10
2013-03-12async: simplify lowest_in_progress()Lai Jiangshan1-12/+8
2013-01-25async: initialise list heads to fix crashJames Hogan1-0/+2
2013-01-23async: replace list of active domains with global list of pending itemsTejun Heo1-34/+29
2013-01-23async: keep pending tasks on async_domain and remove async_pendingTejun Heo1-49/+14
2013-01-23async: use ULLONG_MAX for infinity cookie valueTejun Heo1-5/+6
2013-01-23async: bring sanity to the use of words domain and runningTejun Heo1-34/+34
2013-01-23Merge branch 'master' into for-3.9-asyncTejun Heo1-7/+23
2013-01-22async: fix __lowest_in_progress()Tejun Heo1-7/+20
2013-01-18workqueue: implement current_is_async()Tejun Heo1-0/+14
2013-01-16module, async: async_synchronize_full() on module init iff async is usedTejun Heo1-0/+3
2012-07-20[SCSI] async: make async_synchronize_full() flush all work regardless of domainDan Williams1-2/+41
2012-07-20[SCSI] async: introduce 'async_domain' typeDan Williams1-18/+17
2012-01-13kernel/async: remove redundant declaration.Rusty Russell1-2/+0
2011-10-31kernel: Map most files to use export.h instead of module.hPaul Gortmaker1-1/+1
2011-09-15async: uninitialized warning correctionsVitaliy Ivanov1-2/+2
2011-06-14async: Fixed an include coding style issuePaul McQuade1-5/+7
2010-07-14async: use workqueue for worker poolTejun Heo1-119/+22
2010-03-30include cleanup: Update gfp.h and slab.h includes to prepare for breaking imp...Tejun Heo1-0/+1
2009-06-08async: Fix lack of boot-time console due to insufficient synchronizationLinus Torvalds1-10/+5
2009-05-24async: make sure independent async domains can't accidentally entangleJames Bottomley1-8/+12
2009-03-28async: remove the temporary (2.6.29) "async is off by default" codeArjan van de Ven1-13/+5
2009-02-08async: use list_move_tailStefan Richter1-2/+1
2009-02-08async: Rename _special -> _domain for clarity.Cornelia Huck1-19/+22
2009-02-08async: Add some documentation.Cornelia Huck1-0/+47
2009-02-08async: Handle kthread_run() return codes.Cornelia Huck1-2/+9
2009-02-08async: Fix running list handling.Cornelia Huck1-2/+2
2009-02-05kernel/async.c: fix printk warningsAndrew Morton1-4/+8
2009-01-12async: fix __lowest_in_progress()Arjan van de Ven1-5/+16
2009-01-09async: make async a command line option for nowArjan van de Ven1-2/+14
2009-01-08async: make async_synchronize_full() more serializingArjan van de Ven1-1/+3
2009-01-07async: don't do the initcall stuff post bootArjan van de Ven1-4/+4
2009-01-07async: Asynchronous function calls to speed up kernel bootArjan van de Ven1-0/+321