• Michal Koutný's avatar
    net/sched: Add module aliases for cls_,sch_,act_ modules · 241a94ab
    Michal Koutný authored
    No functional change intended, aliases will be used in followup commits.
    Note for backporters: you may need to add aliases also for modules that
    are already removed in mainline kernel but still in your version.
    
    Patches were generated with the help of Coccinelle scripts like:
    
    cat >scripts/coccinelle/misc/tcf_alias.cocci <<EOD
    virtual patch
    virtual report
    
    @ haskernel @
    @@
    
    @ tcf_has_kind depends on report && haskernel @
    identifier ops;
    constant K;
    @@
    
      static struct tcf_proto_ops ops = {
        .kind = K,
        ...
      };
    +char module_alias = K;
    EOD
    
    /usr/bin/spatch -D report --cocci-file scripts/coccinelle/misc/tcf_alias.cocci \
            --dir . \
            -I ./arch/x86/include -I ./arch/x86/include/generated -I ./include \
            -I ./arch/x86/include/uapi -I ./arch/x86/include/generated/uapi \
            -I ./include/uapi -I ./include/generated/uapi \
            --include ./include/linux/compiler-version.h --include ./include/linux/kconfig.h \
            --jobs 8 --chunksize 1 2>/dev/null | \
            sed 's/char module_alias = "\([^"]*\)";/MODULE_ALIAS_NET_CLS("\1");/'
    
    And analogously for:
    
      static struct tc_action_ops ops = {
        .kind = K,
    
      static struct Qdisc_ops ops = {
        .id = K,
    
    (Someone familiar would be able to fit those into one .cocci file
    without sed post processing.)
    Signed-off-by: default avatarMichal Koutný <mkoutny@suse.com>
    Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
    Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
    Link: https://lore.kernel.org/r/20240201130943.19536-3-mkoutny@suse.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    241a94ab
act_bpf.c 9.92 KB