IPoE драйвер на 3.16

Bug reports
maxx
Posts: 4
Joined: 22 Dec 2014, 14:45

Re: IPoE драйвер на 3.16

Post by maxx »

Огромное спасибо. Все работает.

Расшифрую.

В каталог

/accel-ppp-code/drivers/ipoe/

Ложится файл patch

Запускается

patch -p1 < patch

и уже потом выполняется cmake с необходимыми параметрами.
maxx
Posts: 4
Joined: 22 Dec 2014, 14:45

Re: IPoE драйвер на 3.16

Post by maxx »

Подскажите, пожалуйста, (что/из-за чего) это может быть?

Ubuntu 14.04.1

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[ 65%] Building C object accel-pppd/ctrl/ipoe/CMakeFiles/ipoe.dir/ipoe.c.o
/opt/accel-ppp-code/accel-pppd/ctrl/ipoe/ipoe.c:184:67: warning: ‘struct rad_plugin_t’ declared inside parameter list [enabled by default]
static int ipoe_rad_send_request(struct rad_plugin_t *rad, struct rad_packet_t *pack);
^
/opt/accel-ppp-code/accel-pppd/ctrl/ipoe/ipoe.c:184:67: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
/opt/accel-ppp-code/accel-pppd/ctrl/ipoe/ipoe.c:184:12: warning: ‘ipoe_rad_send_request’ declared ‘static’ but never defined [-Wunused-function]
static int ipoe_rad_send_request(struct rad_plugin_t *rad, struct rad_packet_t *pack);
^
/opt/accel-ppp-code/accel-pppd/ctrl/ipoe/ipoe.c:471:13: warning: ‘ipoe_change_addr’ defined but not used [-Wunused-function]
static void ipoe_change_addr(struct ipoe_session *ses, in_addr_t newaddr)
^
[ 66%] Building C object accel-pppd/ctrl/ipoe/CMakeFiles/ipoe.dir/dhcpv4.c.o

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[ 83%] Building C object accel-pppd/extra/CMakeFiles/ippool.dir/ippool.c.o
/opt/accel-ppp-code/accel-pppd/extra/ippool.c:52:12: warning: ‘conf_vendor’ defined but not used [-Wunused-variable]
static int conf_vendor = 0;
^
/opt/accel-ppp-code/accel-pppd/extra/ippool.c:53:12: warning: ‘conf_attr’ defined but not used [-Wunused-variable]
static int conf_attr = 88; // Framed-Pool
^
Linking C shared library libippool.so

[ 83%] Built target ippool

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Dmitry
Администратор
Posts: 954
Joined: 09 Oct 2014, 10:06

Re: IPoE драйвер на 3.16

Post by Dmitry »

не критично
Vasilenko Vitaliy
Posts: 3
Joined: 10 Dec 2014, 10:38

Re: IPoE драйвер на 3.16

Post by Vasilenko Vitaliy »

просьба внести в основную ветку
проверено на ubuntu и debian

Code: Select all

diff --git a/drivers/ipoe/ipoe.c b/drivers/ipoe/ipoe.c
index 16787e9..472e6ef 100644
--- a/drivers/ipoe/ipoe.c
+++ b/drivers/ipoe/ipoe.c
@@ -33,6 +33,11 @@
 
 #include "ipoe.h"
 
+#ifndef u64_stats_fetch_begin_bh
+#define u64_stats_fetch_begin_bh u64_stats_fetch_begin_irq
+#define u64_stats_fetch_retry_bh u64_stats_fetch_retry_irq
+#endif
+
 #define BEGIN_UPDATE 1
 #define UPDATE 2
 #define END_UPDATE 3
Dmitry
Администратор
Posts: 954
Joined: 09 Oct 2014, 10:06

Re: IPoE драйвер на 3.16

Post by Dmitry »

спасибо
InventoR
Posts: 1
Joined: 23 Mar 2015, 21:57

Re: IPoE драйвер на 3.16

Post by InventoR »

Может конечно что-то делаю не так, но патч применил, Debian 7.8 из чистой установки.
В итоге вылет:

Code: Select all

[100%] Generating driver/ipoe.ko
/usr/local/src/drivers/ipoe/driver/ipoe.c: In function ‘ipoe_stats64’:
/usr/local/src/drivers/ipoe/driver/ipoe.c:1080:4: error: implicit declaration of function ‘u64_stats_fetch_begin_irq’ [-Werror=implicit-function-declaration]
/usr/local/src/drivers/ipoe/driver/ipoe.c:1083:3: error: implicit declaration of function ‘u64_stats_fetch_retry_irq’ [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[6]: *** [/usr/local/src/drivers/ipoe/driver/ipoe.o] Error 1
make[5]: *** [_module_/usr/local/src/drivers/ipoe/driver] Error 2
make[4]: *** [sub-make] Error 2
make[3]: *** [all] Error 2
make[2]: *** [drivers/ipoe/driver/ipoe.ko] Error 2
make[1]: *** [drivers/ipoe/CMakeFiles/ipoe_drv.dir/all] Error 2
make: *** [all] Error 2
# 

Code: Select all

# cat /root/accel-ppp.git/drivers/ipoe/ipoe.c|more
#include <linux/capability.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/inetdevice.h>
#include <linux/in.h>
#include <linux/tcp.h>
#include <linux/udp.h>
#include <linux/if_arp.h>
#include <linux/mroute.h>
#include <linux/init.h>
#include <linux/if_ether.h>
#include <linux/if_vlan.h>
#include <linux/semaphore.h>
#include <linux/netfilter_ipv4.h>
#include <linux/u64_stats_sync.h>
#include <linux/version.h>

#include <net/genetlink.h>
#include <net/route.h>
#include <net/sock.h>
#include <net/ip.h>
#include <net/icmp.h>
#include <net/flow.h>
#include <net/xfrm.h>
#include <net/net_namespace.h>
#include <net/netns/generic.h>
#include <net/pkt_sched.h>

#include "ipoe.h"

#ifndef u64_stats_fetch_begin_bh
#define u64_stats_fetch_begin_bh u64_stats_fetch_begin_irq
#define u64_stats_fetch_retry_bh u64_stats_fetch_retry_irq
#endif

#define BEGIN_UPDATE 1
#define UPDATE 2
#define END_UPDATE 3

#define HASH_BITS 0xff

#define IPOE_MAGIC 0x55aa
#define IPOE_MAGIC2 0x67f8bc32

#define IPOE_QUEUE_LEN 100
#define IPOE_RATE_U 3000 //3s
#define IPOE_TIMEOUT_U 30 //5s

#define IPOE_NLMSG_SIZE (NLMSG_DEFAULT_SIZE - GENL_HDRLEN - 128)

#ifndef DEFINE_SEMAPHORE
#define DEFINE_SEMAPHORE(name) struct semaphore name = __SEMAPHORE_INITIALIZER(name, 1)
#endif

#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,35)
struct ipoe_stats {
	struct u64_stats_sync sync;
	u64 packets;
	u64 bytes;
};
#endif
Vasilenko Vitaliy
Posts: 3
Joined: 10 Dec 2014, 10:38

Re: IPoE драйвер на 3.16

Post by Vasilenko Vitaliy »

Можно сделать так
Но будет гадость для пользователей ядра ветки 3.13, у которых версия ниже 3.13.0-30.54
Для пользователей убунты 12.04 нужно будет обновится к последнему ядру (apt-get update && apt-get dist-upgrade), иначе оно не соберется

Code: Select all

diff --git a/drivers/ipoe/ipoe.c b/drivers/ipoe/ipoe.c
index 910e725..fefb4f9 100644
--- a/drivers/ipoe/ipoe.c
+++ b/drivers/ipoe/ipoe.c
@@ -152,7 +152,7 @@ static struct genl_family ipoe_nl_family;
 static struct genl_multicast_group ipoe_nl_mcg;
 #endif
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)
 #define u64_stats_fetch_begin_bh u64_stats_fetch_begin_irq
 #define u64_stats_fetch_retry_bh u64_stats_fetch_retry_irq
 #endif
@@ -243,10 +243,6 @@ static int ipoe_check_interface(int ifindex)
        return r;
 }
 
-#ifndef u64_stats_fetch_begin_bh
-#define u64_stats_fetch_begin_bh u64_stats_fetch_begin_irq
-#define u64_stats_fetch_retry_bh u64_stats_fetch_retry_irq
-#endif
 
 
 static int ipoe_do_nat(struct sk_buff *skb, __be32 new_addr, int to_peer)
Post Reply