Changeset 32631


Ignore:
Timestamp:
Jul 9, 2017, 3:29:29 PM (2 weeks ago)
Author:
brainslayer
Message:

compile as single module. this allows better compiler optimization and reduces size

Location:
src/linux/universal
Files:
8 added
4 deleted
29 edited

Legend:

Unmodified
Added
Removed
  • src/linux/universal/linux-3.10/net/Makefile

    r32626 r32631  
    1818obj-$(CONFIG_NETFILTER)         += netfilter/
    1919obj-m                           += shortcut-fe/
    20 obj-m                           += fast-classifier/
    2120obj-$(CONFIG_INET)              += ipv4/
    2221obj-$(CONFIG_XFRM)              += xfrm/
  • src/linux/universal/linux-3.10/net/shortcut-fe/Makefile

    r32625 r32631  
    1515ccflags-$(SFE_SUPPORT_IPV6) += -DSFE_SUPPORT_IPV6
    1616
    17 ifdef SFE_SUPPORT_IPV6
    18 obj-m += shortcut-fe-ipv6.o
    19 endif
     17shortcut-fe-objs := sfe_cm.o
    2018
    21 obj-m += shortcut-fe-cm.o
    22 
    23 shortcut-fe-objs := \
    24         sfe_ipv4.o
    25 
    26 ifdef SFE_SUPPORT_IPV6
    27 shortcut-fe-ipv6-objs := \
    28         sfe_ipv6.o
    29 endif
    30 
    31 shortcut-fe-cm-objs := \
    32         sfe_cm.o
    33 
  • src/linux/universal/linux-3.10/net/shortcut-fe/sfe_backport.h

    r32625 r32631  
    1616 */
    1717
     18#ifndef SFE_BACKPORT_H
     19#define SFE_BACKPORT_H
    1820#include <linux/version.h>
    1921
     
    158160#define sfe_hash_for_each(name, bkt, obj, member) \
    159161        hash_for_each(name, bkt, obj, member)
     162
     163#endif
  • src/linux/universal/linux-3.10/net/shortcut-fe/sfe_cm.c

    r32628 r32631  
    3636#include "sfe_cm.h"
    3737#include "sfe_backport.h"
     38
     39#include "sfe_ipv4.c"
     40#ifdef SFE_SUPPORT_IPV6
     41#include "sfe_ipv6.c"
     42#endif
     43#include "fast-classifier.c"
    3844
    3945typedef enum sfe_cm_exception {
     
    10001006        size_t i, j;
    10011007
     1008#ifdef SFE_SUPPORT_IPV6
     1009        sfe_ipv6_init();
     1010#endif
     1011        sfe_ipv4_init();
     1012
    10021013        DEBUG_INFO("SFE CM init\n");
    10031014
     
    10581069        sfe_ipv4_register_sync_rule_callback(sfe_cm_sync_rule);
    10591070        sfe_ipv6_register_sync_rule_callback(sfe_cm_sync_rule);
     1071        fast_classifier_init();
     1072
    10601073        return 0;
    10611074
     
    10751088
    10761089exit1:
     1090        sfe_ipv4_exit();
     1091#ifdef SFE_SUPPORT_IPV6
     1092        sfe_ipv6_exit();
     1093#endif
     1094
    10771095        return result;
    10781096}
     
    10861104
    10871105        DEBUG_INFO("SFE CM exit\n");
     1106        fast_classifier_exit();
    10881107
    10891108        /*
     
    11201139
    11211140        kobject_put(sc->sys_sfe_cm);
     1141        sfe_ipv4_exit();
     1142#ifdef SFE_SUPPORT_IPV6
     1143        sfe_ipv6_exit();
     1144#endif
    11221145}
    11231146
  • src/linux/universal/linux-3.10/net/shortcut-fe/sfe_cm.h

    r32625 r32631  
    1616 */
    1717
     18#ifndef SFE_CM_H
     19#define SFE_CM_H
    1820/*
    1921 * connection flags.
     
    168170 * IPv4 APIs used by connection manager
    169171 */
    170 int sfe_ipv4_recv(struct net_device *dev, struct sk_buff *skb);
    171 int sfe_ipv4_create_rule(struct sfe_connection_create *sic);
    172 void sfe_ipv4_destroy_rule(struct sfe_connection_destroy *sid);
    173 void sfe_ipv4_destroy_all_rules_for_dev(struct net_device *dev);
    174 void sfe_ipv4_register_sync_rule_callback(sfe_sync_rule_callback_t callback);
    175 void sfe_ipv4_update_rule(struct sfe_connection_create *sic);
    176 void sfe_ipv4_mark_rule(struct sfe_connection_mark *mark);
     172static int sfe_ipv4_recv(struct net_device *dev, struct sk_buff *skb);
     173static int sfe_ipv4_create_rule(struct sfe_connection_create *sic);
     174static void sfe_ipv4_destroy_rule(struct sfe_connection_destroy *sid);
     175static void sfe_ipv4_destroy_all_rules_for_dev(struct net_device *dev);
     176static void sfe_ipv4_register_sync_rule_callback(sfe_sync_rule_callback_t callback);
     177static void sfe_ipv4_update_rule(struct sfe_connection_create *sic);
     178static void sfe_ipv4_mark_rule(struct sfe_connection_mark *mark);
    177179
    178180#ifdef SFE_SUPPORT_IPV6
     
    180182 * IPv6 APIs used by connection manager
    181183 */
    182 int sfe_ipv6_recv(struct net_device *dev, struct sk_buff *skb);
    183 int sfe_ipv6_create_rule(struct sfe_connection_create *sic);
    184 void sfe_ipv6_destroy_rule(struct sfe_connection_destroy *sid);
    185 void sfe_ipv6_destroy_all_rules_for_dev(struct net_device *dev);
    186 void sfe_ipv6_register_sync_rule_callback(sfe_sync_rule_callback_t callback);
    187 void sfe_ipv6_update_rule(struct sfe_connection_create *sic);
    188 void sfe_ipv6_mark_rule(struct sfe_connection_mark *mark);
     184static int sfe_ipv6_recv(struct net_device *dev, struct sk_buff *skb);
     185static int sfe_ipv6_create_rule(struct sfe_connection_create *sic);
     186static void sfe_ipv6_destroy_rule(struct sfe_connection_destroy *sid);
     187static void sfe_ipv6_destroy_all_rules_for_dev(struct net_device *dev);
     188static void sfe_ipv6_register_sync_rule_callback(sfe_sync_rule_callback_t callback);
     189static void sfe_ipv6_update_rule(struct sfe_connection_create *sic);
     190static void sfe_ipv6_mark_rule(struct sfe_connection_mark *mark);
    189191#else
    190192static inline int sfe_ipv6_recv(struct net_device *dev, struct sk_buff *skb)
     
    258260        return is_v4 ? sfe_ipv4_addr_equal(a->ip, b->ip) : sfe_ipv6_addr_equal(a->ip6, b->ip6);
    259261}
     262#endif
  • src/linux/universal/linux-3.10/net/shortcut-fe/sfe_ipv4.c

    r32625 r32631  
    32743274 * sfe_ipv4_init()
    32753275 */
    3276 static int __init sfe_ipv4_init(void)
     3276static int sfe_ipv4_init(void)
    32773277{
    32783278        struct sfe_ipv4 *si = &__si;
     
    33333333 * sfe_ipv4_exit()
    33343334 */
    3335 static void __exit sfe_ipv4_exit(void)
     3335static void sfe_ipv4_exit(void)
    33363336{
    33373337        struct sfe_ipv4 *si = &__si;
     
    33533353
    33543354}
    3355 
    3356 module_init(sfe_ipv4_init)
    3357 module_exit(sfe_ipv4_exit)
    3358 
    3359 EXPORT_SYMBOL(sfe_ipv4_recv);
    3360 EXPORT_SYMBOL(sfe_ipv4_create_rule);
    3361 EXPORT_SYMBOL(sfe_ipv4_destroy_rule);
    3362 EXPORT_SYMBOL(sfe_ipv4_destroy_all_rules_for_dev);
    3363 EXPORT_SYMBOL(sfe_ipv4_register_sync_rule_callback);
    3364 EXPORT_SYMBOL(sfe_ipv4_mark_rule);
    3365 EXPORT_SYMBOL(sfe_ipv4_update_rule);
    3366 
    3367 MODULE_DESCRIPTION("Shortcut Forwarding Engine - IPv4 edition");
    3368 MODULE_LICENSE("Dual BSD/GPL");
    3369 
  • src/linux/universal/linux-3.10/net/shortcut-fe/sfe_ipv6.c

    r32625 r32631  
    927927 * Will take hash lock upon entry
    928928 */
    929 void sfe_ipv6_mark_rule(struct sfe_connection_mark *mark)
     929static void sfe_ipv6_mark_rule(struct sfe_connection_mark *mark)
    930930{
    931931        struct sfe_ipv6 *si = &__si6;
     
    21332133 * Returns 1 if the packet is forwarded or 0 if it isn't.
    21342134 */
    2135 int sfe_ipv6_recv(struct net_device *dev, struct sk_buff *skb)
     2135static int sfe_ipv6_recv(struct net_device *dev, struct sk_buff *skb)
    21362136{
    21372137        struct sfe_ipv6 *si = &__si6;
     
    23132313 *      update forwarding rule after rule is created.
    23142314 */
    2315 void sfe_ipv6_update_rule(struct sfe_connection_create *sic)
     2315static void sfe_ipv6_update_rule(struct sfe_connection_create *sic)
    23162316{
    23172317        struct sfe_ipv6_connection *c;
     
    23372337 *      Create a forwarding rule.
    23382338 */
    2339 int sfe_ipv6_create_rule(struct sfe_connection_create *sic)
     2339static int sfe_ipv6_create_rule(struct sfe_connection_create *sic)
    23402340{
    23412341        struct sfe_ipv6 *si = &__si6;
     
    26042604 *      Destroy a forwarding rule.
    26052605 */
    2606 void sfe_ipv6_destroy_rule(struct sfe_connection_destroy *sid)
     2606static void sfe_ipv6_destroy_rule(struct sfe_connection_destroy *sid)
    26072607{
    26082608        struct sfe_ipv6 *si = &__si6;
     
    26452645 *      Register a callback for rule synchronization.
    26462646 */
    2647 void sfe_ipv6_register_sync_rule_callback(sfe_sync_rule_callback_t sync_rule_callback)
     2647static void sfe_ipv6_register_sync_rule_callback(sfe_sync_rule_callback_t sync_rule_callback)
    26482648{
    26492649        struct sfe_ipv6 *si = &__si6;
     
    26792679 * If we pass dev as NULL then this destroys all connections.
    26802680 */
    2681 void sfe_ipv6_destroy_all_rules_for_dev(struct net_device *dev)
     2681static void sfe_ipv6_destroy_all_rules_for_dev(struct net_device *dev)
    26822682{
    26832683        struct sfe_ipv6 *si = &__si6;
     
    32673267 * sfe_ipv6_init()
    32683268 */
    3269 static int __init sfe_ipv6_init(void)
     3269static int sfe_ipv6_init(void)
    32703270{
    32713271        struct sfe_ipv6 *si = &__si6;
     
    33263326 * sfe_ipv6_exit()
    33273327 */
    3328 static void __exit sfe_ipv6_exit(void)
     3328static void sfe_ipv6_exit(void)
    33293329{
    33303330        struct sfe_ipv6 *si = &__si6;
     
    33453345        kobject_put(si->sys_sfe_ipv6);
    33463346}
    3347 
    3348 module_init(sfe_ipv6_init)
    3349 module_exit(sfe_ipv6_exit)
    3350 
    3351 EXPORT_SYMBOL(sfe_ipv6_recv);
    3352 EXPORT_SYMBOL(sfe_ipv6_create_rule);
    3353 EXPORT_SYMBOL(sfe_ipv6_destroy_rule);
    3354 EXPORT_SYMBOL(sfe_ipv6_destroy_all_rules_for_dev);
    3355 EXPORT_SYMBOL(sfe_ipv6_register_sync_rule_callback);
    3356 EXPORT_SYMBOL(sfe_ipv6_mark_rule);
    3357 EXPORT_SYMBOL(sfe_ipv6_update_rule);
    3358 
    3359 MODULE_DESCRIPTION("Shortcut Forwarding Engine - IPv6 support");
    3360 MODULE_LICENSE("Dual BSD/GPL");
    3361 
  • src/linux/universal/linux-3.18/arch/arm/crypto/aesbs-core.S

    r25370 r32631  
    5959# define BSAES_ASM_EXTENDED_KEY
    6060# define XTS_CHAIN_TWEAK
    61 # define __ARM_ARCH__   7
     61# define __ARM_ARCH__ __LINUX_ARM_ARCH__
     62# define __ARM_MAX_ARCH__ 7
    6263#endif
    6364
     
    6667#endif
    6768
    68 #if __ARM_ARCH__>=7
     69#if __ARM_MAX_ARCH__>=7
     70.arch   armv7-a
     71.fpu    neon
     72
    6973.text
    7074.syntax unified         @ ARMv7-capable assembler is expected to handle this
     
    7478.code   32
    7579#endif
    76 
    77 .fpu    neon
    7880
    7981.type   _bsaes_decrypt8,%function
     
    20962098        adr     r2, .Lxts_magic
    20972099
     2100#ifndef XTS_CHAIN_TWEAK
    20982101        tst     r9, #0xf                        @ if not multiple of 16
    20992102        it      ne                              @ Thumb2 thing, sanity check in ARM
    21002103        subne   r9, #0x10                       @ subtract another 16 bytes
     2104#endif
    21012105        subs    r9, #0x80
    21022106
  • src/linux/universal/linux-3.18/net/Makefile

    r32626 r32631  
    1818obj-$(CONFIG_NETFILTER)         += netfilter/
    1919obj-m                           += shortcut-fe/
    20 obj-m                           += fast-classifier/
    2120obj-$(CONFIG_INET)              += ipv4/
    2221obj-$(CONFIG_XFRM)              += xfrm/
  • src/linux/universal/linux-3.18/net/shortcut-fe/Makefile

    r32625 r32631  
    1515ccflags-$(SFE_SUPPORT_IPV6) += -DSFE_SUPPORT_IPV6
    1616
    17 ifdef SFE_SUPPORT_IPV6
    18 obj-m += shortcut-fe-ipv6.o
    19 endif
     17shortcut-fe-objs := sfe_cm.o
    2018
    21 obj-m += shortcut-fe-cm.o
    22 
    23 shortcut-fe-objs := \
    24         sfe_ipv4.o
    25 
    26 ifdef SFE_SUPPORT_IPV6
    27 shortcut-fe-ipv6-objs := \
    28         sfe_ipv6.o
    29 endif
    30 
    31 shortcut-fe-cm-objs := \
    32         sfe_cm.o
    33 
  • src/linux/universal/linux-3.18/net/shortcut-fe/sfe_backport.h

    r32625 r32631  
    1616 */
    1717
     18#ifndef SFE_BACKPORT_H
     19#define SFE_BACKPORT_H
    1820#include <linux/version.h>
    1921
     
    158160#define sfe_hash_for_each(name, bkt, obj, member) \
    159161        hash_for_each(name, bkt, obj, member)
     162
     163#endif
  • src/linux/universal/linux-3.18/net/shortcut-fe/sfe_cm.c

    r32628 r32631  
    3636#include "sfe_cm.h"
    3737#include "sfe_backport.h"
     38
     39#include "sfe_ipv4.c"
     40#ifdef SFE_SUPPORT_IPV6
     41#include "sfe_ipv6.c"
     42#endif
     43#include "fast-classifier.c"
    3844
    3945typedef enum sfe_cm_exception {
     
    10001006        size_t i, j;
    10011007
     1008#ifdef SFE_SUPPORT_IPV6
     1009        sfe_ipv6_init();
     1010#endif
     1011        sfe_ipv4_init();
     1012
    10021013        DEBUG_INFO("SFE CM init\n");
    10031014
     
    10581069        sfe_ipv4_register_sync_rule_callback(sfe_cm_sync_rule);
    10591070        sfe_ipv6_register_sync_rule_callback(sfe_cm_sync_rule);
     1071        fast_classifier_init();
     1072
    10601073        return 0;
    10611074
     
    10751088
    10761089exit1:
     1090        sfe_ipv4_exit();
     1091#ifdef SFE_SUPPORT_IPV6
     1092        sfe_ipv6_exit();
     1093#endif
     1094
    10771095        return result;
    10781096}
     
    10861104
    10871105        DEBUG_INFO("SFE CM exit\n");
     1106        fast_classifier_exit();
    10881107
    10891108        /*
     
    11201139
    11211140        kobject_put(sc->sys_sfe_cm);
     1141        sfe_ipv4_exit();
     1142#ifdef SFE_SUPPORT_IPV6
     1143        sfe_ipv6_exit();
     1144#endif
    11221145}
    11231146
  • src/linux/universal/linux-3.18/net/shortcut-fe/sfe_cm.h

    r32625 r32631  
    1616 */
    1717
     18#ifndef SFE_CM_H
     19#define SFE_CM_H
    1820/*
    1921 * connection flags.
     
    168170 * IPv4 APIs used by connection manager
    169171 */
    170 int sfe_ipv4_recv(struct net_device *dev, struct sk_buff *skb);
    171 int sfe_ipv4_create_rule(struct sfe_connection_create *sic);
    172 void sfe_ipv4_destroy_rule(struct sfe_connection_destroy *sid);
    173 void sfe_ipv4_destroy_all_rules_for_dev(struct net_device *dev);
    174 void sfe_ipv4_register_sync_rule_callback(sfe_sync_rule_callback_t callback);
    175 void sfe_ipv4_update_rule(struct sfe_connection_create *sic);
    176 void sfe_ipv4_mark_rule(struct sfe_connection_mark *mark);
     172static int sfe_ipv4_recv(struct net_device *dev, struct sk_buff *skb);
     173static int sfe_ipv4_create_rule(struct sfe_connection_create *sic);
     174static void sfe_ipv4_destroy_rule(struct sfe_connection_destroy *sid);
     175static void sfe_ipv4_destroy_all_rules_for_dev(struct net_device *dev);
     176static void sfe_ipv4_register_sync_rule_callback(sfe_sync_rule_callback_t callback);
     177static void sfe_ipv4_update_rule(struct sfe_connection_create *sic);
     178static void sfe_ipv4_mark_rule(struct sfe_connection_mark *mark);
    177179
    178180#ifdef SFE_SUPPORT_IPV6
     
    180182 * IPv6 APIs used by connection manager
    181183 */
    182 int sfe_ipv6_recv(struct net_device *dev, struct sk_buff *skb);
    183 int sfe_ipv6_create_rule(struct sfe_connection_create *sic);
    184 void sfe_ipv6_destroy_rule(struct sfe_connection_destroy *sid);
    185 void sfe_ipv6_destroy_all_rules_for_dev(struct net_device *dev);
    186 void sfe_ipv6_register_sync_rule_callback(sfe_sync_rule_callback_t callback);
    187 void sfe_ipv6_update_rule(struct sfe_connection_create *sic);
    188 void sfe_ipv6_mark_rule(struct sfe_connection_mark *mark);
     184static int sfe_ipv6_recv(struct net_device *dev, struct sk_buff *skb);
     185static int sfe_ipv6_create_rule(struct sfe_connection_create *sic);
     186static void sfe_ipv6_destroy_rule(struct sfe_connection_destroy *sid);
     187static void sfe_ipv6_destroy_all_rules_for_dev(struct net_device *dev);
     188static void sfe_ipv6_register_sync_rule_callback(sfe_sync_rule_callback_t callback);
     189static void sfe_ipv6_update_rule(struct sfe_connection_create *sic);
     190static void sfe_ipv6_mark_rule(struct sfe_connection_mark *mark);
    189191#else
    190192static inline int sfe_ipv6_recv(struct net_device *dev, struct sk_buff *skb)
     
    258260        return is_v4 ? sfe_ipv4_addr_equal(a->ip, b->ip) : sfe_ipv6_addr_equal(a->ip6, b->ip6);
    259261}
     262#endif
  • src/linux/universal/linux-3.18/net/shortcut-fe/sfe_ipv4.c

    r32625 r32631  
    32743274 * sfe_ipv4_init()
    32753275 */
    3276 static int __init sfe_ipv4_init(void)
     3276static int sfe_ipv4_init(void)
    32773277{
    32783278        struct sfe_ipv4 *si = &__si;
     
    33333333 * sfe_ipv4_exit()
    33343334 */
    3335 static void __exit sfe_ipv4_exit(void)
     3335static void sfe_ipv4_exit(void)
    33363336{
    33373337        struct sfe_ipv4 *si = &__si;
     
    33533353
    33543354}
    3355 
    3356 module_init(sfe_ipv4_init)
    3357 module_exit(sfe_ipv4_exit)
    3358 
    3359 EXPORT_SYMBOL(sfe_ipv4_recv);
    3360 EXPORT_SYMBOL(sfe_ipv4_create_rule);
    3361 EXPORT_SYMBOL(sfe_ipv4_destroy_rule);
    3362 EXPORT_SYMBOL(sfe_ipv4_destroy_all_rules_for_dev);
    3363 EXPORT_SYMBOL(sfe_ipv4_register_sync_rule_callback);
    3364 EXPORT_SYMBOL(sfe_ipv4_mark_rule);
    3365 EXPORT_SYMBOL(sfe_ipv4_update_rule);
    3366 
    3367 MODULE_DESCRIPTION("Shortcut Forwarding Engine - IPv4 edition");
    3368 MODULE_LICENSE("Dual BSD/GPL");
    3369 
  • src/linux/universal/linux-3.18/net/shortcut-fe/sfe_ipv6.c

    r32625 r32631  
    927927 * Will take hash lock upon entry
    928928 */
    929 void sfe_ipv6_mark_rule(struct sfe_connection_mark *mark)
     929static void sfe_ipv6_mark_rule(struct sfe_connection_mark *mark)
    930930{
    931931        struct sfe_ipv6 *si = &__si6;
     
    21332133 * Returns 1 if the packet is forwarded or 0 if it isn't.
    21342134 */
    2135 int sfe_ipv6_recv(struct net_device *dev, struct sk_buff *skb)
     2135static int sfe_ipv6_recv(struct net_device *dev, struct sk_buff *skb)
    21362136{
    21372137        struct sfe_ipv6 *si = &__si6;
     
    23132313 *      update forwarding rule after rule is created.
    23142314 */
    2315 void sfe_ipv6_update_rule(struct sfe_connection_create *sic)
     2315static void sfe_ipv6_update_rule(struct sfe_connection_create *sic)
    23162316{
    23172317        struct sfe_ipv6_connection *c;
     
    23372337 *      Create a forwarding rule.
    23382338 */
    2339 int sfe_ipv6_create_rule(struct sfe_connection_create *sic)
     2339static int sfe_ipv6_create_rule(struct sfe_connection_create *sic)
    23402340{
    23412341        struct sfe_ipv6 *si = &__si6;
     
    26042604 *      Destroy a forwarding rule.
    26052605 */
    2606 void sfe_ipv6_destroy_rule(struct sfe_connection_destroy *sid)
     2606static void sfe_ipv6_destroy_rule(struct sfe_connection_destroy *sid)
    26072607{
    26082608        struct sfe_ipv6 *si = &__si6;
     
    26452645 *      Register a callback for rule synchronization.
    26462646 */
    2647 void sfe_ipv6_register_sync_rule_callback(sfe_sync_rule_callback_t sync_rule_callback)
     2647static void sfe_ipv6_register_sync_rule_callback(sfe_sync_rule_callback_t sync_rule_callback)
    26482648{
    26492649        struct sfe_ipv6 *si = &__si6;
     
    26792679 * If we pass dev as NULL then this destroys all connections.
    26802680 */
    2681 void sfe_ipv6_destroy_all_rules_for_dev(struct net_device *dev)
     2681static void sfe_ipv6_destroy_all_rules_for_dev(struct net_device *dev)
    26822682{
    26832683        struct sfe_ipv6 *si = &__si6;
     
    32673267 * sfe_ipv6_init()
    32683268 */
    3269 static int __init sfe_ipv6_init(void)
     3269static int sfe_ipv6_init(void)
    32703270{
    32713271        struct sfe_ipv6 *si = &__si6;
     
    33263326 * sfe_ipv6_exit()
    33273327 */
    3328 static void __exit sfe_ipv6_exit(void)
     3328static void sfe_ipv6_exit(void)
    33293329{
    33303330        struct sfe_ipv6 *si = &__si6;
     
    33453345        kobject_put(si->sys_sfe_ipv6);
    33463346}
    3347 
    3348 module_init(sfe_ipv6_init)
    3349 module_exit(sfe_ipv6_exit)
    3350 
    3351 EXPORT_SYMBOL(sfe_ipv6_recv);
    3352 EXPORT_SYMBOL(sfe_ipv6_create_rule);
    3353 EXPORT_SYMBOL(sfe_ipv6_destroy_rule);
    3354 EXPORT_SYMBOL(sfe_ipv6_destroy_all_rules_for_dev);
    3355 EXPORT_SYMBOL(sfe_ipv6_register_sync_rule_callback);
    3356 EXPORT_SYMBOL(sfe_ipv6_mark_rule);
    3357 EXPORT_SYMBOL(sfe_ipv6_update_rule);
    3358 
    3359 MODULE_DESCRIPTION("Shortcut Forwarding Engine - IPv6 support");
    3360 MODULE_LICENSE("Dual BSD/GPL");
    3361 
  • src/linux/universal/linux-4.4/net/Makefile

    r32626 r32631  
    1616obj-$(CONFIG_NETFILTER)         += netfilter/
    1717obj-m                           += shortcut-fe/
    18 obj-m                           += fast-classifier/
    1918obj-$(CONFIG_INET)              += ipv4/
    2019obj-$(CONFIG_XFRM)              += xfrm/
  • src/linux/universal/linux-4.4/net/shortcut-fe/Makefile

    r32625 r32631  
    1515ccflags-$(SFE_SUPPORT_IPV6) += -DSFE_SUPPORT_IPV6
    1616
    17 ifdef SFE_SUPPORT_IPV6
    18 obj-m += shortcut-fe-ipv6.o
    19 endif
     17shortcut-fe-objs := sfe_cm.o
    2018
    21 obj-m += shortcut-fe-cm.o
    22 
    23 shortcut-fe-objs := \
    24         sfe_ipv4.o
    25 
    26 ifdef SFE_SUPPORT_IPV6
    27 shortcut-fe-ipv6-objs := \
    28         sfe_ipv6.o
    29 endif
    30 
    31 shortcut-fe-cm-objs := \
    32         sfe_cm.o
    33 
  • src/linux/universal/linux-4.4/net/shortcut-fe/sfe_backport.h

    r32625 r32631  
    1616 */
    1717
     18#ifndef SFE_BACKPORT_H
     19#define SFE_BACKPORT_H
    1820#include <linux/version.h>
    1921
     
    158160#define sfe_hash_for_each(name, bkt, obj, member) \
    159161        hash_for_each(name, bkt, obj, member)
     162
     163#endif
  • src/linux/universal/linux-4.4/net/shortcut-fe/sfe_cm.c

    r32628 r32631  
    3636#include "sfe_cm.h"
    3737#include "sfe_backport.h"
     38
     39#include "sfe_ipv4.c"
     40#ifdef SFE_SUPPORT_IPV6
     41#include "sfe_ipv6.c"
     42#endif
     43#include "fast-classifier.c"
    3844
    3945typedef enum sfe_cm_exception {
     
    10001006        size_t i, j;
    10011007
     1008#ifdef SFE_SUPPORT_IPV6
     1009        sfe_ipv6_init();
     1010#endif
     1011        sfe_ipv4_init();
     1012
    10021013        DEBUG_INFO("SFE CM init\n");
    10031014
     
    10581069        sfe_ipv4_register_sync_rule_callback(sfe_cm_sync_rule);
    10591070        sfe_ipv6_register_sync_rule_callback(sfe_cm_sync_rule);
     1071        fast_classifier_init();
     1072
    10601073        return 0;
    10611074
     
    10751088
    10761089exit1:
     1090        sfe_ipv4_exit();
     1091#ifdef SFE_SUPPORT_IPV6
     1092        sfe_ipv6_exit();
     1093#endif
     1094
    10771095        return result;
    10781096}
     
    10861104
    10871105        DEBUG_INFO("SFE CM exit\n");
     1106        fast_classifier_exit();
    10881107
    10891108        /*
     
    11201139
    11211140        kobject_put(sc->sys_sfe_cm);
     1141        sfe_ipv4_exit();
     1142#ifdef SFE_SUPPORT_IPV6
     1143        sfe_ipv6_exit();
     1144#endif
    11221145}
    11231146
  • src/linux/universal/linux-4.4/net/shortcut-fe/sfe_cm.h

    r32625 r32631  
    1616 */
    1717
     18#ifndef SFE_CM_H
     19#define SFE_CM_H
    1820/*
    1921 * connection flags.
     
    168170 * IPv4 APIs used by connection manager
    169171 */
    170 int sfe_ipv4_recv(struct net_device *dev, struct sk_buff *skb);
    171 int sfe_ipv4_create_rule(struct sfe_connection_create *sic);
    172 void sfe_ipv4_destroy_rule(struct sfe_connection_destroy *sid);
    173 void sfe_ipv4_destroy_all_rules_for_dev(struct net_device *dev);
    174 void sfe_ipv4_register_sync_rule_callback(sfe_sync_rule_callback_t callback);
    175 void sfe_ipv4_update_rule(struct sfe_connection_create *sic);
    176 void sfe_ipv4_mark_rule(struct sfe_connection_mark *mark);
     172static int sfe_ipv4_recv(struct net_device *dev, struct sk_buff *skb);
     173static int sfe_ipv4_create_rule(struct sfe_connection_create *sic);
     174static void sfe_ipv4_destroy_rule(struct sfe_connection_destroy *sid);
     175static void sfe_ipv4_destroy_all_rules_for_dev(struct net_device *dev);
     176static void sfe_ipv4_register_sync_rule_callback(sfe_sync_rule_callback_t callback);
     177static void sfe_ipv4_update_rule(struct sfe_connection_create *sic);
     178static void sfe_ipv4_mark_rule(struct sfe_connection_mark *mark);
    177179
    178180#ifdef SFE_SUPPORT_IPV6
     
    180182 * IPv6 APIs used by connection manager
    181183 */
    182 int sfe_ipv6_recv(struct net_device *dev, struct sk_buff *skb);
    183 int sfe_ipv6_create_rule(struct sfe_connection_create *sic);
    184 void sfe_ipv6_destroy_rule(struct sfe_connection_destroy *sid);
    185 void sfe_ipv6_destroy_all_rules_for_dev(struct net_device *dev);
    186 void sfe_ipv6_register_sync_rule_callback(sfe_sync_rule_callback_t callback);
    187 void sfe_ipv6_update_rule(struct sfe_connection_create *sic);
    188 void sfe_ipv6_mark_rule(struct sfe_connection_mark *mark);
     184static int sfe_ipv6_recv(struct net_device *dev, struct sk_buff *skb);
     185static int sfe_ipv6_create_rule(struct sfe_connection_create *sic);
     186static void sfe_ipv6_destroy_rule(struct sfe_connection_destroy *sid);
     187static void sfe_ipv6_destroy_all_rules_for_dev(struct net_device *dev);
     188static void sfe_ipv6_register_sync_rule_callback(sfe_sync_rule_callback_t callback);
     189static void sfe_ipv6_update_rule(struct sfe_connection_create *sic);
     190static void sfe_ipv6_mark_rule(struct sfe_connection_mark *mark);
    189191#else
    190192static inline int sfe_ipv6_recv(struct net_device *dev, struct sk_buff *skb)
     
    258260        return is_v4 ? sfe_ipv4_addr_equal(a->ip, b->ip) : sfe_ipv6_addr_equal(a->ip6, b->ip6);
    259261}
     262#endif
  • src/linux/universal/linux-4.4/net/shortcut-fe/sfe_ipv4.c

    r32625 r32631  
    32743274 * sfe_ipv4_init()
    32753275 */
    3276 static int __init sfe_ipv4_init(void)
     3276static int sfe_ipv4_init(void)
    32773277{
    32783278        struct sfe_ipv4 *si = &__si;
     
    33333333 * sfe_ipv4_exit()
    33343334 */
    3335 static void __exit sfe_ipv4_exit(void)
     3335static void sfe_ipv4_exit(void)
    33363336{
    33373337        struct sfe_ipv4 *si = &__si;
     
    33533353
    33543354}
    3355 
    3356 module_init(sfe_ipv4_init)
    3357 module_exit(sfe_ipv4_exit)
    3358 
    3359 EXPORT_SYMBOL(sfe_ipv4_recv);
    3360 EXPORT_SYMBOL(sfe_ipv4_create_rule);
    3361 EXPORT_SYMBOL(sfe_ipv4_destroy_rule);
    3362 EXPORT_SYMBOL(sfe_ipv4_destroy_all_rules_for_dev);
    3363 EXPORT_SYMBOL(sfe_ipv4_register_sync_rule_callback);
    3364 EXPORT_SYMBOL(sfe_ipv4_mark_rule);
    3365 EXPORT_SYMBOL(sfe_ipv4_update_rule);
    3366 
    3367 MODULE_DESCRIPTION("Shortcut Forwarding Engine - IPv4 edition");
    3368 MODULE_LICENSE("Dual BSD/GPL");
    3369 
  • src/linux/universal/linux-4.4/net/shortcut-fe/sfe_ipv6.c

    r32625 r32631  
    927927 * Will take hash lock upon entry
    928928 */
    929 void sfe_ipv6_mark_rule(struct sfe_connection_mark *mark)
     929static void sfe_ipv6_mark_rule(struct sfe_connection_mark *mark)
    930930{
    931931        struct sfe_ipv6 *si = &__si6;
     
    21332133 * Returns 1 if the packet is forwarded or 0 if it isn't.
    21342134 */
    2135 int sfe_ipv6_recv(struct net_device *dev, struct sk_buff *skb)
     2135static int sfe_ipv6_recv(struct net_device *dev, struct sk_buff *skb)
    21362136{
    21372137        struct sfe_ipv6 *si = &__si6;
     
    23132313 *      update forwarding rule after rule is created.
    23142314 */
    2315 void sfe_ipv6_update_rule(struct sfe_connection_create *sic)
     2315static void sfe_ipv6_update_rule(struct sfe_connection_create *sic)
    23162316{
    23172317        struct sfe_ipv6_connection *c;
     
    23372337 *      Create a forwarding rule.
    23382338 */
    2339 int sfe_ipv6_create_rule(struct sfe_connection_create *sic)
     2339static int sfe_ipv6_create_rule(struct sfe_connection_create *sic)
    23402340{
    23412341        struct sfe_ipv6 *si = &__si6;
     
    26042604 *      Destroy a forwarding rule.
    26052605 */
    2606 void sfe_ipv6_destroy_rule(struct sfe_connection_destroy *sid)
     2606static void sfe_ipv6_destroy_rule(struct sfe_connection_destroy *sid)
    26072607{
    26082608        struct sfe_ipv6 *si = &__si6;
     
    26452645 *      Register a callback for rule synchronization.
    26462646 */
    2647 void sfe_ipv6_register_sync_rule_callback(sfe_sync_rule_callback_t sync_rule_callback)
     2647static void sfe_ipv6_register_sync_rule_callback(sfe_sync_rule_callback_t sync_rule_callback)
    26482648{
    26492649        struct sfe_ipv6 *si = &__si6;
     
    26792679 * If we pass dev as NULL then this destroys all connections.
    26802680 */
    2681 void sfe_ipv6_destroy_all_rules_for_dev(struct net_device *dev)
     2681static void sfe_ipv6_destroy_all_rules_for_dev(struct net_device *dev)
    26822682{
    26832683        struct sfe_ipv6 *si = &__si6;
     
    32673267 * sfe_ipv6_init()
    32683268 */
    3269 static int __init sfe_ipv6_init(void)
     3269static int sfe_ipv6_init(void)
    32703270{
    32713271        struct sfe_ipv6 *si = &__si6;
     
    33263326 * sfe_ipv6_exit()
    33273327 */
    3328 static void __exit sfe_ipv6_exit(void)
     3328static void sfe_ipv6_exit(void)
    33293329{
    33303330        struct sfe_ipv6 *si = &__si6;
     
    33453345        kobject_put(si->sys_sfe_ipv6);
    33463346}
    3347 
    3348 module_init(sfe_ipv6_init)
    3349 module_exit(sfe_ipv6_exit)
    3350 
    3351 EXPORT_SYMBOL(sfe_ipv6_recv);
    3352 EXPORT_SYMBOL(sfe_ipv6_create_rule);
    3353 EXPORT_SYMBOL(sfe_ipv6_destroy_rule);
    3354 EXPORT_SYMBOL(sfe_ipv6_destroy_all_rules_for_dev);
    3355 EXPORT_SYMBOL(sfe_ipv6_register_sync_rule_callback);
    3356 EXPORT_SYMBOL(sfe_ipv6_mark_rule);
    3357 EXPORT_SYMBOL(sfe_ipv6_update_rule);
    3358 
    3359 MODULE_DESCRIPTION("Shortcut Forwarding Engine - IPv6 support");
    3360 MODULE_LICENSE("Dual BSD/GPL");
    3361 
  • src/linux/universal/linux-4.9/net/Makefile

    r32626 r32631  
    1616obj-$(CONFIG_NETFILTER)         += netfilter/
    1717obj-m                           += shortcut-fe/
    18 obj-m                           += fast-classifier/
    1918obj-$(CONFIG_INET)              += ipv4/
    2019obj-$(CONFIG_XFRM)              += xfrm/
  • src/linux/universal/linux-4.9/net/shortcut-fe/Makefile

    r32625 r32631  
    1515ccflags-$(SFE_SUPPORT_IPV6) += -DSFE_SUPPORT_IPV6
    1616
    17 ifdef SFE_SUPPORT_IPV6
    18 obj-m += shortcut-fe-ipv6.o
    19 endif
     17shortcut-fe-objs := sfe_cm.o
    2018
    21 obj-m += shortcut-fe-cm.o
    22 
    23 shortcut-fe-objs := \
    24         sfe_ipv4.o
    25 
    26 ifdef SFE_SUPPORT_IPV6
    27 shortcut-fe-ipv6-objs := \
    28         sfe_ipv6.o
    29 endif
    30 
    31 shortcut-fe-cm-objs := \
    32         sfe_cm.o
    33 
  • src/linux/universal/linux-4.9/net/shortcut-fe/sfe_backport.h

    r32625 r32631  
    1616 */
    1717
     18#ifndef SFE_BACKPORT_H
     19#define SFE_BACKPORT_H
    1820#include <linux/version.h>
    1921
     
    158160#define sfe_hash_for_each(name, bkt, obj, member) \
    159161        hash_for_each(name, bkt, obj, member)
     162
     163#endif
  • src/linux/universal/linux-4.9/net/shortcut-fe/sfe_cm.c

    r32628 r32631  
    3636#include "sfe_cm.h"
    3737#include "sfe_backport.h"
     38
     39#include "sfe_ipv4.c"
     40#ifdef SFE_SUPPORT_IPV6
     41#include "sfe_ipv6.c"
     42#endif
     43#include "fast-classifier.c"
    3844
    3945typedef enum sfe_cm_exception {
     
    10001006        size_t i, j;
    10011007
     1008#ifdef SFE_SUPPORT_IPV6
     1009        sfe_ipv6_init();
     1010#endif
     1011        sfe_ipv4_init();
     1012
    10021013        DEBUG_INFO("SFE CM init\n");
    10031014
     
    10581069        sfe_ipv4_register_sync_rule_callback(sfe_cm_sync_rule);
    10591070        sfe_ipv6_register_sync_rule_callback(sfe_cm_sync_rule);
     1071        fast_classifier_init();
     1072
    10601073        return 0;
    10611074
     
    10751088
    10761089exit1:
     1090        sfe_ipv4_exit();
     1091#ifdef SFE_SUPPORT_IPV6
     1092        sfe_ipv6_exit();
     1093#endif
     1094
    10771095        return result;
    10781096}
     
    10861104
    10871105        DEBUG_INFO("SFE CM exit\n");
     1106        fast_classifier_exit();
    10881107
    10891108        /*
     
    11201139
    11211140        kobject_put(sc->sys_sfe_cm);
     1141        sfe_ipv4_exit();
     1142#ifdef SFE_SUPPORT_IPV6
     1143        sfe_ipv6_exit();
     1144#endif
    11221145}
    11231146
  • src/linux/universal/linux-4.9/net/shortcut-fe/sfe_cm.h

    r32625 r32631  
    1616 */
    1717
     18#ifndef SFE_CM_H
     19#define SFE_CM_H
    1820/*
    1921 * connection flags.
     
    168170 * IPv4 APIs used by connection manager
    169171 */
    170 int sfe_ipv4_recv(struct net_device *dev, struct sk_buff *skb);
    171 int sfe_ipv4_create_rule(struct sfe_connection_create *sic);
    172 void sfe_ipv4_destroy_rule(struct sfe_connection_destroy *sid);
    173 void sfe_ipv4_destroy_all_rules_for_dev(struct net_device *dev);
    174 void sfe_ipv4_register_sync_rule_callback(sfe_sync_rule_callback_t callback);
    175 void sfe_ipv4_update_rule(struct sfe_connection_create *sic);
    176 void sfe_ipv4_mark_rule(struct sfe_connection_mark *mark);
     172static int sfe_ipv4_recv(struct net_device *dev, struct sk_buff *skb);
     173static int sfe_ipv4_create_rule(struct sfe_connection_create *sic);
     174static void sfe_ipv4_destroy_rule(struct sfe_connection_destroy *sid);
     175static void sfe_ipv4_destroy_all_rules_for_dev(struct net_device *dev);
     176static void sfe_ipv4_register_sync_rule_callback(sfe_sync_rule_callback_t callback);
     177static void sfe_ipv4_update_rule(struct sfe_connection_create *sic);
     178static void sfe_ipv4_mark_rule(struct sfe_connection_mark *mark);
    177179
    178180#ifdef SFE_SUPPORT_IPV6
     
    180182 * IPv6 APIs used by connection manager
    181183 */
    182 int sfe_ipv6_recv(struct net_device *dev, struct sk_buff *skb);
    183 int sfe_ipv6_create_rule(struct sfe_connection_create *sic);
    184 void sfe_ipv6_destroy_rule(struct sfe_connection_destroy *sid);
    185 void sfe_ipv6_destroy_all_rules_for_dev(struct net_device *dev);
    186 void sfe_ipv6_register_sync_rule_callback(sfe_sync_rule_callback_t callback);
    187 void sfe_ipv6_update_rule(struct sfe_connection_create *sic);
    188 void sfe_ipv6_mark_rule(struct sfe_connection_mark *mark);
     184static int sfe_ipv6_recv(struct net_device *dev, struct sk_buff *skb);
     185static int sfe_ipv6_create_rule(struct sfe_connection_create *sic);
     186static void sfe_ipv6_destroy_rule(struct sfe_connection_destroy *sid);
     187static void sfe_ipv6_destroy_all_rules_for_dev(struct net_device *dev);
     188static void sfe_ipv6_register_sync_rule_callback(sfe_sync_rule_callback_t callback);
     189static void sfe_ipv6_update_rule(struct sfe_connection_create *sic);
     190static void sfe_ipv6_mark_rule(struct sfe_connection_mark *mark);
    189191#else
    190192static inline int sfe_ipv6_recv(struct net_device *dev, struct sk_buff *skb)
     
    258260        return is_v4 ? sfe_ipv4_addr_equal(a->ip, b->ip) : sfe_ipv6_addr_equal(a->ip6, b->ip6);
    259261}
     262#endif
  • src/linux/universal/linux-4.9/net/shortcut-fe/sfe_ipv4.c

    r32625 r32631  
    32743274 * sfe_ipv4_init()
    32753275 */
    3276 static int __init sfe_ipv4_init(void)
     3276static int sfe_ipv4_init(void)
    32773277{
    32783278        struct sfe_ipv4 *si = &__si;
     
    33333333 * sfe_ipv4_exit()
    33343334 */
    3335 static void __exit sfe_ipv4_exit(void)
     3335static void sfe_ipv4_exit(void)
    33363336{
    33373337        struct sfe_ipv4 *si = &__si;
     
    33533353
    33543354}
    3355 
    3356 module_init(sfe_ipv4_init)
    3357 module_exit(sfe_ipv4_exit)
    3358 
    3359 EXPORT_SYMBOL(sfe_ipv4_recv);
    3360 EXPORT_SYMBOL(sfe_ipv4_create_rule);
    3361 EXPORT_SYMBOL(sfe_ipv4_destroy_rule);
    3362 EXPORT_SYMBOL(sfe_ipv4_destroy_all_rules_for_dev);
    3363 EXPORT_SYMBOL(sfe_ipv4_register_sync_rule_callback);
    3364 EXPORT_SYMBOL(sfe_ipv4_mark_rule);
    3365 EXPORT_SYMBOL(sfe_ipv4_update_rule);
    3366 
    3367 MODULE_DESCRIPTION("Shortcut Forwarding Engine - IPv4 edition");
    3368 MODULE_LICENSE("Dual BSD/GPL");
    3369 
  • src/linux/universal/linux-4.9/net/shortcut-fe/sfe_ipv6.c

    r32625 r32631  
    927927 * Will take hash lock upon entry
    928928 */
    929 void sfe_ipv6_mark_rule(struct sfe_connection_mark *mark)
     929static void sfe_ipv6_mark_rule(struct sfe_connection_mark *mark)
    930930{
    931931        struct sfe_ipv6 *si = &__si6;
     
    21332133 * Returns 1 if the packet is forwarded or 0 if it isn't.
    21342134 */
    2135 int sfe_ipv6_recv(struct net_device *dev, struct sk_buff *skb)
     2135static int sfe_ipv6_recv(struct net_device *dev, struct sk_buff *skb)
    21362136{
    21372137        struct sfe_ipv6 *si = &__si6;
     
    23132313 *      update forwarding rule after rule is created.
    23142314 */
    2315 void sfe_ipv6_update_rule(struct sfe_connection_create *sic)
     2315static void sfe_ipv6_update_rule(struct sfe_connection_create *sic)
    23162316{
    23172317        struct sfe_ipv6_connection *c;
     
    23372337 *      Create a forwarding rule.
    23382338 */
    2339 int sfe_ipv6_create_rule(struct sfe_connection_create *sic)
     2339static int sfe_ipv6_create_rule(struct sfe_connection_create *sic)
    23402340{
    23412341        struct sfe_ipv6 *si = &__si6;
     
    26042604 *      Destroy a forwarding rule.
    26052605 */
    2606 void sfe_ipv6_destroy_rule(struct sfe_connection_destroy *sid)
     2606static void sfe_ipv6_destroy_rule(struct sfe_connection_destroy *sid)
    26072607{
    26082608        struct sfe_ipv6 *si = &__si6;
     
    26452645 *      Register a callback for rule synchronization.
    26462646 */
    2647 void sfe_ipv6_register_sync_rule_callback(sfe_sync_rule_callback_t sync_rule_callback)
     2647static void sfe_ipv6_register_sync_rule_callback(sfe_sync_rule_callback_t sync_rule_callback)
    26482648{
    26492649        struct sfe_ipv6 *si = &__si6;
     
    26792679 * If we pass dev as NULL then this destroys all connections.
    26802680 */
    2681 void sfe_ipv6_destroy_all_rules_for_dev(struct net_device *dev)
     2681static void sfe_ipv6_destroy_all_rules_for_dev(struct net_device *dev)
    26822682{
    26832683        struct sfe_ipv6 *si = &__si6;
     
    32673267 * sfe_ipv6_init()
    32683268 */
    3269 static int __init sfe_ipv6_init(void)
     3269static int sfe_ipv6_init(void)
    32703270{
    32713271        struct sfe_ipv6 *si = &__si6;
     
    33263326 * sfe_ipv6_exit()
    33273327 */
    3328 static void __exit sfe_ipv6_exit(void)
     3328static void sfe_ipv6_exit(void)
    33293329{
    33303330        struct sfe_ipv6 *si = &__si6;
     
    33453345        kobject_put(si->sys_sfe_ipv6);
    33463346}
    3347 
    3348 module_init(sfe_ipv6_init)
    3349 module_exit(sfe_ipv6_exit)
    3350 
    3351 EXPORT_SYMBOL(sfe_ipv6_recv);
    3352 EXPORT_SYMBOL(sfe_ipv6_create_rule);
    3353 EXPORT_SYMBOL(sfe_ipv6_destroy_rule);
    3354 EXPORT_SYMBOL(sfe_ipv6_destroy_all_rules_for_dev);
    3355 EXPORT_SYMBOL(sfe_ipv6_register_sync_rule_callback);
    3356 EXPORT_SYMBOL(sfe_ipv6_mark_rule);
    3357 EXPORT_SYMBOL(sfe_ipv6_update_rule);
    3358 
    3359 MODULE_DESCRIPTION("Shortcut Forwarding Engine - IPv6 support");
    3360 MODULE_LICENSE("Dual BSD/GPL");
    3361 
Note: See TracChangeset for help on using the changeset viewer.