From laforge at gnumonks.org Wed Jan 4 10:28:58 2017 From: laforge at gnumonks.org (Harald Welte) Date: Wed, 4 Jan 2017 11:28:58 +0100 Subject: libosmocore[master]: libosmocoding: migrate transcoding routines from OsmoBTS In-Reply-To: References: Message-ID: <20170104102858.kfwd7smzyorpndtq@nataraja> On Wed, Jan 04, 2017 at 08:55:45AM +0000, Vadim Yanitskiy wrote: > I think it's due to --enable-sanitize, because > when I am trying to compile libosmocore this way: > > ./configure --enable-static --enable-sanitize > make check > > Some other tests fail (current master version, clang-3.6): > > Regression tests. > 8: gea FAILED (testsuite.at:51) > 9: msgfile FAILED (testsuite.at:59) > 15: lapd FAILED (testsuite.at:96) > 16: gsm0808 FAILED (testsuite.at:102) > 17: gsm0408 FAILED (testsuite.at:108) > 30: bssgp-fc FAILED (testsuite.at:190) I pushed some fixes,see https://gerrit.osmocom.org/1530 and https://gerrit.osmocom.org/1531 - the remaining failures are all LeakSanitizer warnings, and I suspect that while we release all memory back to talloc, talloc itself doesn't release it back to glibc malloc/free, and hence LeakSanitizer is kicking in. A quick online search didn't seem like anyone else has yet come up with a solution for this, so I guess we should turn it off. I remember some discussion on the list about a year ago where the concensus was to disable LeakSanitizer by environment variables on the buildhost anyway? -- - Harald Welte http://laforge.gnumonks.org/ ============================================================================ "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6) From axilirator at gmail.com Thu Jan 5 19:07:53 2017 From: axilirator at gmail.com (Vadim Yanitskiy) Date: Fri, 6 Jan 2017 02:07:53 +0700 Subject: [libosmocore 0.9.6.35-3faa] testsuite: 8 9 15 16 17 30 failed Message-ID: Ubuntu 16.04.1 LTS gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) Configured with: --enable-static --enable-sanitize See attachment please. With best regards, Vadim Yanitskiy. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: testsuite.log Type: text/x-log Size: 53978 bytes Desc: not available URL: From msuraev at sysmocom.de Fri Jan 6 09:57:04 2017 From: msuraev at sysmocom.de (Max) Date: Fri, 6 Jan 2017 10:57:04 +0100 Subject: [libosmocore 0.9.6.35-3faa] testsuite: 8 9 15 16 17 30 failed In-Reply-To: References: Message-ID: <0a9b8f82-aaa7-dfeb-9da1-592a8ae9b4c6@sysmocom.de> Hi. I can confirm test failure of gea, msgfile, lapd, gsm0808, gsm0408, bssgp-fc with gcc 6.2.0 on ubuntu 16.10. I wonder why we do not see those in jenkins with Debian - could it be difference in compiler version? Would it make sense to add another ubuntu-based test build to jenkins? Note, that couple of those should be fixed by gerrit #1530 and 1531. On 05.01.2017 20:07, Vadim Yanitskiy wrote: > Ubuntu 16.04.1 LTS > gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) > Configured with: --enable-static --enable-sanitize > > See attachment please. > > With best regards, > Vadim Yanitskiy. -- Max Suraev http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Geschaeftsfuehrer / Managing Director: Harald Welte From laforge at gnumonks.org Fri Jan 6 10:42:37 2017 From: laforge at gnumonks.org (Harald Welte) Date: Fri, 6 Jan 2017 11:42:37 +0100 Subject: RFC: OsmoDevCon 2017 planning In-Reply-To: <20161210191139.rxtzqrdmsifwgi4s@nataraja> References: <20161210191139.rxtzqrdmsifwgi4s@nataraja> Message-ID: <20170106104237.aqx53judskjh5c7v@nataraja> Dear all, we're currently working towards scheduling the public day (OsmoCon) on April 21st and the invitation-only OsmoDevCon from April 22nd through 24th, 2017. If you have any serious concerns with the dates above, please speak up now, while we still have a chance to change it. Regards, Harald -- - Harald Welte http://laforge.gnumonks.org/ ============================================================================ "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6) From axilirator at gmail.com Fri Jan 6 20:14:15 2017 From: axilirator at gmail.com (Vadim Yanitskiy) Date: Sat, 7 Jan 2017 03:14:15 +0700 Subject: libosmocore[master]: libosmocoding: migrate transcoding routines from OsmoBTS In-Reply-To: <20170104102858.kfwd7smzyorpndtq@nataraja> References: <20170104102858.kfwd7smzyorpndtq@nataraja> Message-ID: Hi, > I pushed some fixes,see https://gerrit.osmocom.org/1530 and > https://gerrit.osmocom.org/1531 - the remaining failures are all > LeakSanitizer warnings, and I suspect that while we release all memory > back to talloc, talloc itself doesn't release it back to glibc > malloc/free, and hence LeakSanitizer is kicking in. Just rebased to a new version with both changes applied, and I can confirm, that the 'gea' test is ok now. Other still fail. >> Max wrote: > I wonder why this has not been triggering jenkins build failures? > Are we using it wrong? Interesting questions for me too. Which GCC version is used on buildhost? Was one compiled manually? With best regards, Vadim Yanitskiy. 2017-01-04 17:28 GMT+07:00 Harald Welte : > On Wed, Jan 04, 2017 at 08:55:45AM +0000, Vadim Yanitskiy wrote: > > I think it's due to --enable-sanitize, because > > when I am trying to compile libosmocore this way: > > > > ./configure --enable-static --enable-sanitize > > make check > > > > Some other tests fail (current master version, clang-3.6): > > > > Regression tests. > > 8: gea FAILED ( > testsuite.at:51) > > 9: msgfile FAILED ( > testsuite.at:59) > > 15: lapd FAILED ( > testsuite.at:96) > > 16: gsm0808 FAILED ( > testsuite.at:102) > > 17: gsm0408 FAILED ( > testsuite.at:108) > > 30: bssgp-fc FAILED ( > testsuite.at:190) > > I pushed some fixes,see https://gerrit.osmocom.org/1530 and > https://gerrit.osmocom.org/1531 - the remaining failures are all > LeakSanitizer warnings, and I suspect that while we release all memory > back to talloc, talloc itself doesn't release it back to glibc > malloc/free, and hence LeakSanitizer is kicking in. > > A quick online search didn't seem like anyone else has yet come up with > a solution for this, so I guess we should turn it off. I remember some > discussion on the list about a year ago where the concensus was to > disable LeakSanitizer by environment variables on the buildhost anyway? > -- > - Harald Welte > http://laforge.gnumonks.org/ > ============================================================ > ================ > "Privacy in residential applications is a desirable marketing option." > (ETSI EN 300 175-7 Ch. > A6) > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nhofmeyr at sysmocom.de Sat Jan 7 01:12:25 2017 From: nhofmeyr at sysmocom.de (Neels Hofmeyr) Date: Sat, 7 Jan 2017 02:12:25 +0100 Subject: libosmocore[master]: libosmocoding: migrate transcoding routines from OsmoBTS In-Reply-To: References: <20170104102858.kfwd7smzyorpndtq@nataraja> Message-ID: <20170107011225.GC4777@my.box> On Sat, Jan 07, 2017 at 03:14:15AM +0700, Vadim Yanitskiy wrote: > Which GCC version is used on buildhost? # gcc --version gcc (Debian 4.9.2-10) 4.9.2 Let me know whether I should do anything there, preferably sticking to Debian packages. ~N -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From mardnh at gmx.de Sat Jan 7 21:39:55 2017 From: mardnh at gmx.de (Martin Hauke) Date: Sat, 7 Jan 2017 22:39:55 +0100 Subject: [libosmocore 0.9.6.48-3419] testsuite: 28 failed Message-ID: <0b9f095b-31c8-93c8-16f4-3f3c35a359a4@gmx.de> -------------------------------------------------------------------- 28: stats FAILED (testsuite.at:177) -------------------------------------------------------------------- os: openSUSE Tumbleweed arch: armv7l compiler: gcc (SUSE Linux) 6.2.1 20161209 [gcc-6-branch revision 243481] configure options: default I have attached testsuite.log best regards, Martin -------------- next part -------------- ## ------------------------------------- ## ## libosmocore 0.9.6.48-3419 test suite. ## ## ------------------------------------- ## testsuite: command line was: $ ./testsuite ## --------- ## ## Platform. ## ## --------- ## hostname = loki uname -m = armv7l uname -r = 4.4.36-8-default uname -s = Linux uname -v = #1 SMP Fri Dec 9 16:18:38 UTC 2016 (3ec5648) /usr/bin/uname -p = armv7l /bin/uname -X = unknown /bin/arch = armv7l /usr/bin/arch -k = unknown /usr/convex/getsysinfo = unknown /usr/bin/hostinfo = unknown /bin/machine = unknown /usr/bin/oslevel = unknown /bin/universe = unknown PATH: /usr/local/src/libosmocore/tests PATH: /sbin PATH: /usr/sbin PATH: /usr/local/sbin PATH: /root/bin PATH: /usr/local/bin PATH: /usr/bin PATH: /bin PATH: /usr/games testsuite: atconfig: | # Configurable variable values for building test suites. | # Generated by ./config.status. | # Copyright (C) 2012 Free Software Foundation, Inc. | | # The test suite will define top_srcdir=/../.. etc. | at_testdir='tests' | abs_builddir='/usr/local/src/libosmocore/tests' | at_srcdir='.' | abs_srcdir='/usr/local/src/libosmocore/tests' | at_top_srcdir='..' | abs_top_srcdir='/usr/local/src/libosmocore' | at_top_build_prefix='../' | abs_top_builddir='/usr/local/src/libosmocore' | | # Backward compatibility with Autotest <= 2.59b: | at_top_builddir=$at_top_build_prefix | | AUTOTEST_PATH='tests' | | SHELL=${CONFIG_SHELL-'/bin/sh'} testsuite: atlocal: | enable_sim_test='yes' ## ---------------- ## ## Tested programs. ## ## ---------------- ## ## ------------------ ## ## Running the tests. ## ## ------------------ ## testsuite: starting at: Sat Jan 7 22:15:51 CET 2017 1. a5 (testsuite.at:6): ok (0m0.198s 0m0.029s) 2. kasumi (testsuite.at:12): ok (0m0.224s 0m0.007s) 3. bits (testsuite.at:18): ok (0m0.206s 0m0.030s) 4. bitvec (testsuite.at:24): ok (0m0.230s 0m0.015s) 5. bitcomp (testsuite.at:30): ok (0m0.235s 0m0.002s) 6. conv (testsuite.at:36): ok (0m0.206s 0m0.032s) 7. msgb (testsuite.at:42): ok (0m0.239s 0m0.006s) 8. gea (testsuite.at:48): ok (0m0.248s 0m0.000s) 9. msgfile (testsuite.at:55): ok (0m0.210s 0m0.038s) 10. sms (testsuite.at:63): ok (0m0.225s 0m0.030s) 11. smscb (testsuite.at:69): ok (0m0.208s 0m0.014s) 12. ussd (testsuite.at:75): ok (0m0.273s 0m0.014s) 13. auth (testsuite.at:81): ok (0m0.204s 0m0.041s) 14. comp128 (testsuite.at:87): ok (0m0.278s 0m0.016s) 15. lapd (testsuite.at:93): ok (0m0.231s 0m0.021s) 16. gsm0808 (testsuite.at:99): ok (0m0.235s 0m0.010s) 17. gsm0408 (testsuite.at:105): ok (0m0.233s 0m0.020s) 18. gprs (testsuite.at:111): ok (0m0.202s 0m0.044s) 19. logging (testsuite.at:117): ok (0m0.217s 0m0.040s) 20. codec (testsuite.at:124): ok (0m0.220s 0m0.018s) 21. fr (testsuite.at:130): ok (0m0.235s 0m0.035s) 22. loggingrb (testsuite.at:137): ok (0m0.232s 0m0.028s) 23. strrb (testsuite.at:144): ok (0m0.225s 0m0.020s) 24. vty (testsuite.at:150): ok (0m0.256s 0m0.035s) 25. gprs-bssgp (testsuite.at:156): ok (0m0.216s 0m0.028s) 26. gprs-ns (testsuite.at:162): ok (0m0.279s 0m0.022s) 27. utils (testsuite.at:168): ok (0m0.239s 0m0.041s) 29. write_queue (testsuite.at:180): ok (0m0.225s 0m0.016s) 30. bssgp-fc (testsuite.at:186): ok (0m1.120s 0m0.136s) 31. sim (testsuite.at:193): ok (0m0.266s 0m0.025s) 32. timer (testsuite.at:200): ok (0m0.215s 0m0.027s) 33. tlv (testsuite.at:206): ok (0m0.386s 0m0.016s) 34. gsup (testsuite.at:212): ok (0m0.506s 0m0.019s) 35. fsm (testsuite.at:218): ok (0m0.256s 0m0.022s) 36. oap (testsuite.at:225): ok (0m0.239s 0m0.030s) testsuite: ending at: Sat Jan 7 22:16:12 CET 2017 testsuite: test suite duration: 0h 0m 21s ## ------------- ## ## Test results. ## ## ------------- ## ERROR: All 36 tests were run, 1 failed unexpectedly. ## ------------------------ ## ## Summary of the failures. ## ## ------------------------ ## Failed tests: libosmocore 0.9.6.48-3419 test suite test groups: NUM: FILE-NAME:LINE TEST-GROUP-NAME KEYWORDS 28: testsuite.at:174 stats stats ## ---------------------- ## ## Detailed failed tests. ## ## ---------------------- ## # -*- compilation -*- 28. testsuite.at:174: testing stats ... ./testsuite.at:177: $abs_top_builddir/tests/stats/stats_test stderr: --- expout 2017-01-07 22:16:03.000000000 +0100 +++ /usr/local/src/libosmocore/tests/testsuite.dir/at-groups/28/stdout 2017-01-07 22:16:04.000000000 +0100 @@ -10,36 +10,36 @@ test1: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 test2: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 test1: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 - test2: item p= g=test.one i=2 n=item.a v=-1 u=ma - test1: item p= g=test.one i=2 n=item.a v=-1 u=ma - test2: item p= g=test.one i=2 n=item.b v=-1 u=kb - test1: item p= g=test.one i=2 n=item.b v=-1 u=kb - test2: item p= g=test.one i=1 n=item.a v=-1 u=ma - test1: item p= g=test.one i=1 n=item.a v=-1 u=ma - test2: item p= g=test.one i=1 n=item.b v=-1 u=kb - test1: item p= g=test.one i=1 n=item.b v=-1 u=kb + test2: item p= g=test.one i=2 n=item.a v=74324 u=ma + test1: item p= g=test.one i=2 n=item.a v=74324 u=ma + test2: item p= g=test.one i=2 n=item.b v=74324 u=kb + test1: item p= g=test.one i=2 n=item.b v=74324 u=kb + test2: item p= g=test.one i=1 n=item.a v=74324 u=ma + test1: item p= g=test.one i=1 n=item.a v=74324 u=ma + test2: item p= g=test.one i=1 n=item.b v=74324 u=kb + test1: item p= g=test.one i=1 n=item.b v=74324 u=kb report (srep1 global): test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 test2: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 test2: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 - test2: item p= g=test.one i=2 n=item.a v=-1 u=ma - test2: item p= g=test.one i=2 n=item.b v=-1 u=kb - test2: item p= g=test.one i=1 n=item.a v=-1 u=ma - test2: item p= g=test.one i=1 n=item.b v=-1 u=kb + test2: item p= g=test.one i=2 n=item.a v=74324 u=ma + test2: item p= g=test.one i=2 n=item.b v=74324 u=kb + test2: item p= g=test.one i=1 n=item.a v=74324 u=ma + test2: item p= g=test.one i=1 n=item.b v=74324 u=kb report (srep1 peer): test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 test2: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 test2: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 - test2: item p= g=test.one i=2 n=item.a v=-1 u=ma - test1: item p= g=test.one i=2 n=item.a v=-1 u=ma - test2: item p= g=test.one i=2 n=item.b v=-1 u=kb - test1: item p= g=test.one i=2 n=item.b v=-1 u=kb - test2: item p= g=test.one i=1 n=item.a v=-1 u=ma - test1: item p= g=test.one i=1 n=item.a v=-1 u=ma - test2: item p= g=test.one i=1 n=item.b v=-1 u=kb - test1: item p= g=test.one i=1 n=item.b v=-1 u=kb + test2: item p= g=test.one i=2 n=item.a v=74324 u=ma + test1: item p= g=test.one i=2 n=item.a v=74324 u=ma + test2: item p= g=test.one i=2 n=item.b v=74324 u=kb + test1: item p= g=test.one i=2 n=item.b v=74324 u=kb + test2: item p= g=test.one i=1 n=item.a v=74324 u=ma + test1: item p= g=test.one i=1 n=item.a v=74324 u=ma + test2: item p= g=test.one i=1 n=item.b v=74324 u=kb + test1: item p= g=test.one i=1 n=item.b v=74324 u=kb report (srep1 subscriber): test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 test1: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 @@ -49,56 +49,56 @@ test1: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 test2: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 test1: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 - test2: item p= g=test.one i=2 n=item.a v=-1 u=ma - test1: item p= g=test.one i=2 n=item.a v=-1 u=ma - test2: item p= g=test.one i=2 n=item.b v=-1 u=kb - test1: item p= g=test.one i=2 n=item.b v=-1 u=kb - test2: item p= g=test.one i=1 n=item.a v=-1 u=ma - test1: item p= g=test.one i=1 n=item.a v=-1 u=ma - test2: item p= g=test.one i=1 n=item.b v=-1 u=kb - test1: item p= g=test.one i=1 n=item.b v=-1 u=kb + test2: item p= g=test.one i=2 n=item.a v=74324 u=ma + test1: item p= g=test.one i=2 n=item.a v=74324 u=ma + test2: item p= g=test.one i=2 n=item.b v=74324 u=kb + test1: item p= g=test.one i=2 n=item.b v=74324 u=kb + test2: item p= g=test.one i=1 n=item.a v=74324 u=ma + test1: item p= g=test.one i=1 n=item.a v=74324 u=ma + test2: item p= g=test.one i=1 n=item.b v=74324 u=kb + test1: item p= g=test.one i=1 n=item.b v=74324 u=kb report (srep2 disabled): test2: close test1: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 test1: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 test1: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 test1: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 - test1: item p= g=test.one i=2 n=item.a v=-1 u=ma - test1: item p= g=test.one i=2 n=item.b v=-1 u=kb - test1: item p= g=test.one i=1 n=item.a v=-1 u=ma - test1: item p= g=test.one i=1 n=item.b v=-1 u=kb + test1: item p= g=test.one i=2 n=item.a v=74324 u=ma + test1: item p= g=test.one i=2 n=item.b v=74324 u=kb + test1: item p= g=test.one i=1 n=item.a v=74324 u=ma + test1: item p= g=test.one i=1 n=item.b v=74324 u=kb report (srep2 enabled, no flush forced): test2: open test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 test2: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 test2: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 - test2: item p= g=test.one i=2 n=item.a v=-1 u=ma - test2: item p= g=test.one i=2 n=item.b v=-1 u=kb - test2: item p= g=test.one i=1 n=item.a v=-1 u=ma - test2: item p= g=test.one i=1 n=item.b v=-1 u=kb + test2: item p= g=test.one i=2 n=item.a v=74324 u=ma + test2: item p= g=test.one i=2 n=item.b v=74324 u=kb + test2: item p= g=test.one i=1 n=item.a v=74324 u=ma + test2: item p= g=test.one i=1 n=item.b v=74324 u=kb report (should be empty): report (group 1, counter 1 update): test2: counter p= g=ctr-test.one i=1 n=ctr.a v=1 d=1 test1: counter p= g=ctr-test.one i=1 n=ctr.a v=1 d=1 report (group 1, item 1 update): - test2: item p= g=test.one i=1 n=item.a v=10 u=ma - test1: item p= g=test.one i=1 n=item.a v=10 u=ma + test2: item p= g=test.one i=1 n=item.a v=74324 u=ma + test1: item p= g=test.one i=1 n=item.a v=74324 u=ma report (remove statg1, ctrg1): test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 test1: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 test1: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test2: item p= g=test.one i=2 n=item.a v=-1 u=ma - test1: item p= g=test.one i=2 n=item.a v=-1 u=ma - test2: item p= g=test.one i=2 n=item.b v=-1 u=kb - test1: item p= g=test.one i=2 n=item.b v=-1 u=kb + test2: item p= g=test.one i=2 n=item.a v=74324 u=ma + test1: item p= g=test.one i=2 n=item.a v=74324 u=ma + test2: item p= g=test.one i=2 n=item.b v=74324 u=kb + test1: item p= g=test.one i=2 n=item.b v=74324 u=kb report (remove srep1): test1: close test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test2: item p= g=test.one i=2 n=item.a v=-1 u=ma - test2: item p= g=test.one i=2 n=item.b v=-1 u=kb + test2: item p= g=test.one i=2 n=item.a v=74324 u=ma + test2: item p= g=test.one i=2 n=item.b v=74324 u=kb report (remove statg2): test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 28. testsuite.at:174: 28. stats (testsuite.at:174): FAILED (testsuite.at:177) ## ------------- ## ## ../config.log ## ## ------------- ## | This file contains any messages produced by compilers while | running configure, to aid debugging if configure makes a mistake. | | It was created by libosmocore configure 0.9.6.48-3419, which was | generated by GNU Autoconf 2.69. Invocation command line was | | $ configure | | ## --------- ## | ## Platform. ## | ## --------- ## | | hostname = loki | uname -m = armv7l | uname -r = 4.4.36-8-default | uname -s = Linux | uname -v = #1 SMP Fri Dec 9 16:18:38 UTC 2016 (3ec5648) | | /usr/bin/uname -p = armv7l | /bin/uname -X = unknown | | /bin/arch = armv7l | /usr/bin/arch -k = unknown | /usr/convex/getsysinfo = unknown | /usr/bin/hostinfo = unknown | /bin/machine = unknown | /usr/bin/oslevel = unknown | /bin/universe = unknown | | PATH: /sbin | PATH: /usr/sbin | PATH: /usr/local/sbin | PATH: /root/bin | PATH: /usr/local/bin | PATH: /usr/bin | PATH: /bin | PATH: /usr/bin/X11 | PATH: /usr/games | | | ## ----------- ## | ## Core tests. ## | ## ----------- ## | | configure:2387: checking for a BSD-compatible install | configure:2455: result: /usr/bin/install -c | configure:2466: checking whether build environment is sane | configure:2521: result: yes | configure:2672: checking for a thread-safe mkdir -p | configure:2711: result: /usr/bin/mkdir -p | configure:2718: checking for gawk | configure:2734: found /usr/bin/gawk | configure:2745: result: gawk | configure:2756: checking whether make sets $(MAKE) | configure:2782: result: no | configure:2807: checking whether make supports nested variables | configure:2824: result: no | configure:2964: checking whether make supports nested variables | configure:2981: result: no | configure:2993: checking whether make sets $(MAKE) | configure:3019: result: no | configure:3073: checking for gcc | configure:3089: found /usr/bin/gcc | configure:3100: result: gcc | configure:3329: checking for C compiler version | configure:3338: gcc --version >&5 | gcc (SUSE Linux) 6.2.1 20161209 [gcc-6-branch revision 243481] | Copyright (C) 2016 Free Software Foundation, Inc. | This is free software; see the source for copying conditions. There is NO | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | | configure:3349: $? = 0 | configure:3338: gcc -v >&5 | Using built-in specs. | COLLECT_GCC=gcc | COLLECT_LTO_WRAPPER=/usr/lib/gcc/armv7hl-suse-linux-gnueabi/6/lto-wrapper | Target: armv7hl-suse-linux-gnueabi | Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib --libexecdir=/usr/lib --enable-languages=c,c++,objc,fortran,obj-c++,java,go --enable-checking=release --with-gxx-include-dir=/usr/include/c++/6 --enable-ssp --disable-libssp --disable-libvtv --disable-libmpx --disable-libcc1 --enable-plugin --with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --disable-libgcj --with-slibdir=/lib --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-version-specific-runtime-libs --enable-linker-build-id --enable-linux-futex --enable-gnu-indirect-function --program-suffix=-6 --without-system-libunwind --with-arch=armv7-a --with-tune=cortex-a15 --with-float=hard --with-abi=aapcs-linux --with-fpu=vfpv3-d16 --disable-sjlj-exceptions --build=armv7hl-suse-linux-gnueabi --host=armv7hl-suse-linux-gnueabi | Thread model: posix | gcc version 6.2.1 20161209 [gcc-6-branch revision 243481] (SUSE Linux) | configure:3349: $? = 0 | configure:3338: gcc -V >&5 | gcc: error: unrecognized command line option '-V' | gcc: fatal error: no input files | compilation terminated. | configure:3349: $? = 1 | configure:3338: gcc -qversion >&5 | gcc: error: unrecognized command line option '-qversion'; did you mean '--version'? | gcc: fatal error: no input files | compilation terminated. | configure:3349: $? = 1 | configure:3369: checking whether the C compiler works | configure:3391: gcc conftest.c >&5 | configure:3395: $? = 0 | configure:3443: result: yes | configure:3446: checking for C compiler default output file name | configure:3448: result: a.out | configure:3454: checking for suffix of executables | configure:3461: gcc -o conftest conftest.c >&5 | configure:3465: $? = 0 | configure:3487: result: | configure:3509: checking whether we are cross compiling | configure:3517: gcc -o conftest conftest.c >&5 | configure:3521: $? = 0 | configure:3528: ./conftest | configure:3532: $? = 0 | configure:3547: result: no | configure:3552: checking for suffix of object files | configure:3574: gcc -c conftest.c >&5 | configure:3578: $? = 0 | configure:3599: result: o | configure:3603: checking whether we are using the GNU C compiler | configure:3622: gcc -c conftest.c >&5 | configure:3622: $? = 0 | configure:3631: result: yes | configure:3640: checking whether gcc accepts -g | configure:3660: gcc -c -g conftest.c >&5 | configure:3660: $? = 0 | configure:3701: result: yes | configure:3718: checking for gcc option to accept ISO C89 | configure:3781: gcc -c -g -O2 conftest.c >&5 | configure:3781: $? = 0 | configure:3794: result: none needed | configure:3819: checking whether gcc understands -c and -o together | configure:3841: gcc -c conftest.c -o conftest2.o | configure:3844: $? = 0 | configure:3841: gcc -c conftest.c -o conftest2.o | configure:3844: $? = 0 | configure:3856: result: yes | configure:3884: checking for style of include used by make | configure:3912: result: none | configure:3938: checking dependency style of gcc | configure:4049: result: none | configure:4094: checking build system type | configure:4108: result: armv7l-unknown-linux-gnueabihf | configure:4128: checking host system type | configure:4141: result: armv7l-unknown-linux-gnueabihf | configure:4182: checking how to print strings | configure:4209: result: printf | configure:4230: checking for a sed that does not truncate output | configure:4294: result: /usr/bin/sed | configure:4312: checking for grep that handles long lines and -e | configure:4370: result: /usr/bin/grep | configure:4375: checking for egrep | configure:4437: result: /usr/bin/grep -E | configure:4442: checking for fgrep | configure:4504: result: /usr/bin/grep -F | configure:4539: checking for ld used by gcc | configure:4606: result: /usr/armv7hl-suse-linux-gnueabi/bin/ld | configure:4613: checking if the linker (/usr/armv7hl-suse-linux-gnueabi/bin/ld) is GNU ld | configure:4628: result: yes | configure:4640: checking for BSD- or MS-compatible name lister (nm) | configure:4694: result: /usr/bin/nm -B | configure:4824: checking the name lister (/usr/bin/nm -B) interface | configure:4831: gcc -c -g -O2 conftest.c >&5 | configure:4834: /usr/bin/nm -B "conftest.o" | configure:4837: output | 00000000 B some_variable | configure:4844: result: BSD nm | configure:4847: checking whether ln -s works | configure:4851: result: yes | configure:4859: checking the maximum length of command line arguments | configure:4990: result: 1572864 | configure:5038: checking how to convert armv7l-unknown-linux-gnueabihf file names to armv7l-unknown-linux-gnueabihf format | configure:5078: result: func_convert_file_noop | configure:5085: checking how to convert armv7l-unknown-linux-gnueabihf file names to toolchain format | configure:5105: result: func_convert_file_noop | configure:5112: checking for /usr/armv7hl-suse-linux-gnueabi/bin/ld option to reload object files | configure:5119: result: -r | configure:5193: checking for objdump | configure:5209: found /usr/bin/objdump | configure:5220: result: objdump | configure:5252: checking how to recognize dependent libraries | configure:5452: result: pass_all | configure:5537: checking for dlltool | configure:5567: result: no | configure:5597: checking how to associate runtime and link libraries | configure:5624: result: printf %s\n | configure:5685: checking for ar | configure:5701: found /usr/bin/ar | configure:5712: result: ar | configure:5749: checking for archiver @FILE support | configure:5766: gcc -c -g -O2 conftest.c >&5 | configure:5766: $? = 0 | configure:5769: ar cru libconftest.a @conftest.lst >&5 | configure:5772: $? = 0 | configure:5777: ar cru libconftest.a @conftest.lst >&5 | ar: conftest.o: No such file or directory | configure:5780: $? = 1 | configure:5792: result: @ | configure:5850: checking for strip | configure:5866: found /usr/bin/strip | configure:5877: result: strip | configure:5949: checking for ranlib | configure:5965: found /usr/bin/ranlib | configure:5976: result: ranlib | configure:6078: checking command to parse /usr/bin/nm -B output from gcc object | configure:6231: gcc -c -g -O2 conftest.c >&5 | configure:6234: $? = 0 | configure:6238: /usr/bin/nm -B conftest.o \| sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' | sed '/ __gnu_lto/d' \> conftest.nm | configure:6241: $? = 0 | configure:6307: gcc -o conftest -g -O2 conftest.c conftstm.o >&5 | configure:6310: $? = 0 | configure:6348: result: ok | configure:6395: checking for sysroot | configure:6425: result: no | configure:6432: checking for a working dd | configure:6470: result: /usr/bin/dd | configure:6474: checking how to truncate binary pipes | configure:6489: result: /usr/bin/dd bs=4096 count=1 | configure:6818: checking for mt | configure:6848: result: no | configure:6868: checking if : is a manifest tool | configure:6874: : '-?' | configure:6882: result: no | configure:7559: checking how to run the C preprocessor | configure:7590: gcc -E conftest.c | configure:7590: $? = 0 | configure:7604: gcc -E conftest.c | conftest.c:11:28: fatal error: ac_nonexistent.h: No such file or directory | #include | ^ | compilation terminated. | configure:7604: $? = 1 | configure: failed program was: | | /* confdefs.h */ | | #define PACKAGE_NAME "libosmocore" | | #define PACKAGE_TARNAME "libosmocore" | | #define PACKAGE_VERSION "0.9.6.48-3419" | | #define PACKAGE_STRING "libosmocore 0.9.6.48-3419" | | #define PACKAGE_BUGREPORT "openbsc at lists.osmocom.org" | | #define PACKAGE_URL "" | | #define PACKAGE "libosmocore" | | #define VERSION "0.9.6.48-3419" | | /* end confdefs.h. */ | | #include | configure:7629: result: gcc -E | configure:7649: gcc -E conftest.c | configure:7649: $? = 0 | configure:7663: gcc -E conftest.c | conftest.c:11:28: fatal error: ac_nonexistent.h: No such file or directory | #include | ^ | compilation terminated. | configure:7663: $? = 1 | configure: failed program was: | | /* confdefs.h */ | | #define PACKAGE_NAME "libosmocore" | | #define PACKAGE_TARNAME "libosmocore" | | #define PACKAGE_VERSION "0.9.6.48-3419" | | #define PACKAGE_STRING "libosmocore 0.9.6.48-3419" | | #define PACKAGE_BUGREPORT "openbsc at lists.osmocom.org" | | #define PACKAGE_URL "" | | #define PACKAGE "libosmocore" | | #define VERSION "0.9.6.48-3419" | | /* end confdefs.h. */ | | #include | configure:7692: checking for ANSI C header files | configure:7712: gcc -c -g -O2 conftest.c >&5 | configure:7712: $? = 0 | configure:7785: gcc -o conftest -g -O2 conftest.c >&5 | configure:7785: $? = 0 | configure:7785: ./conftest | configure:7785: $? = 0 | configure:7796: result: yes | configure:7809: checking for sys/types.h | configure:7809: gcc -c -g -O2 conftest.c >&5 | configure:7809: $? = 0 | configure:7809: result: yes | configure:7809: checking for sys/stat.h | configure:7809: gcc -c -g -O2 conftest.c >&5 | configure:7809: $? = 0 | configure:7809: result: yes | configure:7809: checking for stdlib.h | configure:7809: gcc -c -g -O2 conftest.c >&5 | configure:7809: $? = 0 | configure:7809: result: yes | configure:7809: checking for string.h | configure:7809: gcc -c -g -O2 conftest.c >&5 | configure:7809: $? = 0 | configure:7809: result: yes | configure:7809: checking for memory.h | configure:7809: gcc -c -g -O2 conftest.c >&5 | configure:7809: $? = 0 | configure:7809: result: yes | configure:7809: checking for strings.h | configure:7809: gcc -c -g -O2 conftest.c >&5 | configure:7809: $? = 0 | configure:7809: result: yes | configure:7809: checking for inttypes.h | configure:7809: gcc -c -g -O2 conftest.c >&5 | configure:7809: $? = 0 | configure:7809: result: yes | configure:7809: checking for stdint.h | configure:7809: gcc -c -g -O2 conftest.c >&5 | configure:7809: $? = 0 | configure:7809: result: yes | configure:7809: checking for unistd.h | configure:7809: gcc -c -g -O2 conftest.c >&5 | configure:7809: $? = 0 | configure:7809: result: yes | configure:7823: checking for dlfcn.h | configure:7823: gcc -c -g -O2 conftest.c >&5 | configure:7823: $? = 0 | configure:7823: result: yes | configure:8077: checking for objdir | configure:8092: result: .libs | configure:8356: checking if gcc supports -fno-rtti -fno-exceptions | configure:8374: gcc -c -g -O2 -fno-rtti -fno-exceptions conftest.c >&5 | cc1: warning: command line option '-fno-rtti' is valid for C++/ObjC++ but not for C | configure:8378: $? = 0 | configure:8391: result: no | configure:8749: checking for gcc option to produce PIC | configure:8756: result: -fPIC -DPIC | configure:8764: checking if gcc PIC flag -fPIC -DPIC works | configure:8782: gcc -c -g -O2 -fPIC -DPIC -DPIC conftest.c >&5 | configure:8786: $? = 0 | configure:8799: result: yes | configure:8828: checking if gcc static flag -static works | configure:8856: result: no | configure:8871: checking if gcc supports -c -o file.o | configure:8892: gcc -c -g -O2 -o out/conftest2.o conftest.c >&5 | configure:8896: $? = 0 | configure:8918: result: yes | configure:8926: checking if gcc supports -c -o file.o | configure:8973: result: yes | configure:9006: checking whether the gcc linker (/usr/armv7hl-suse-linux-gnueabi/bin/ld) supports shared libraries | configure:10265: result: yes | configure:10302: checking whether -lc should be explicitly linked in | configure:10310: gcc -c -g -O2 conftest.c >&5 | configure:10313: $? = 0 | configure:10328: gcc -shared -fPIC -DPIC conftest.o -v -Wl,-soname -Wl,conftest -o conftest 2\>\&1 \| /usr/bin/grep -lc \>/dev/null 2\>\&1 | configure:10331: $? = 0 | configure:10345: result: no | configure:10505: checking dynamic linker characteristics | configure:11086: gcc -o conftest -g -O2 -Wl,-rpath -Wl,/foo conftest.c >&5 | configure:11086: $? = 0 | configure:11323: result: GNU/Linux ld.so | configure:11445: checking how to hardcode library paths into programs | configure:11470: result: immediate | configure:12018: checking whether stripping libraries is possible | configure:12023: result: yes | configure:12058: checking if libtool supports shared libraries | configure:12060: result: yes | configure:12063: checking whether to build shared libraries | configure:12088: result: yes | configure:12091: checking whether to build static libraries | configure:12095: result: no | configure:12137: checking for pkg-config | configure:12155: found /usr/bin/pkg-config | configure:12168: result: /usr/bin/pkg-config | configure:12234: checking for pkg-config | configure:12252: found /usr/bin/pkg-config | configure:12264: result: /usr/bin/pkg-config | configure:12289: checking pkg-config is at least version 0.20 | configure:12292: result: yes | configure:12312: checking for ANSI C header files | configure:12416: result: yes | configure:12427: checking execinfo.h usability | configure:12427: gcc -c -g -O2 conftest.c >&5 | configure:12427: $? = 0 | configure:12427: result: yes | configure:12427: checking execinfo.h presence | configure:12427: gcc -E conftest.c | configure:12427: $? = 0 | configure:12427: result: yes | configure:12427: checking for execinfo.h | configure:12427: result: yes | configure:12427: checking sys/select.h usability | configure:12427: gcc -c -g -O2 conftest.c >&5 | configure:12427: $? = 0 | configure:12427: result: yes | configure:12427: checking sys/select.h presence | configure:12427: gcc -E conftest.c | configure:12427: $? = 0 | configure:12427: result: yes | configure:12427: checking for sys/select.h | configure:12427: result: yes | configure:12427: checking sys/socket.h usability | configure:12427: gcc -c -g -O2 conftest.c >&5 | configure:12427: $? = 0 | configure:12427: result: yes | configure:12427: checking sys/socket.h presence | configure:12427: gcc -E conftest.c | configure:12427: $? = 0 | configure:12427: result: yes | configure:12427: checking for sys/socket.h | configure:12427: result: yes | configure:12427: checking syslog.h usability | configure:12427: gcc -c -g -O2 conftest.c >&5 | configure:12427: $? = 0 | configure:12427: result: yes | configure:12427: checking syslog.h presence | configure:12427: gcc -E conftest.c | configure:12427: $? = 0 | configure:12427: result: yes | configure:12427: checking for syslog.h | configure:12427: result: yes | configure:12427: checking ctype.h usability | configure:12427: gcc -c -g -O2 conftest.c >&5 | configure:12427: $? = 0 | configure:12427: result: yes | configure:12427: checking ctype.h presence | configure:12427: gcc -E conftest.c | configure:12427: $? = 0 | configure:12427: result: yes | configure:12427: checking for ctype.h | configure:12427: result: yes | configure:12427: checking netinet/tcp.h usability | configure:12427: gcc -c -g -O2 conftest.c >&5 | configure:12427: $? = 0 | configure:12427: result: yes | configure:12427: checking netinet/tcp.h presence | configure:12427: gcc -E conftest.c | configure:12427: $? = 0 | configure:12427: result: yes | configure:12427: checking for netinet/tcp.h | configure:12427: result: yes | configure:12438: checking for size_t | configure:12438: gcc -c -g -O2 conftest.c >&5 | configure:12438: $? = 0 | configure:12438: gcc -c -g -O2 conftest.c >&5 | conftest.c: In function 'main': | conftest.c:66:21: error: expected expression before ')' token | if (sizeof ((size_t))) | ^ | configure:12438: $? = 1 | configure: failed program was: | | /* confdefs.h */ | | #define PACKAGE_NAME "libosmocore" | | #define PACKAGE_TARNAME "libosmocore" | | #define PACKAGE_VERSION "0.9.6.48-3419" | | #define PACKAGE_STRING "libosmocore 0.9.6.48-3419" | | #define PACKAGE_BUGREPORT "openbsc at lists.osmocom.org" | | #define PACKAGE_URL "" | | #define PACKAGE "libosmocore" | | #define VERSION "0.9.6.48-3419" | | #define STDC_HEADERS 1 | | #define HAVE_SYS_TYPES_H 1 | | #define HAVE_SYS_STAT_H 1 | | #define HAVE_STDLIB_H 1 | | #define HAVE_STRING_H 1 | | #define HAVE_MEMORY_H 1 | | #define HAVE_STRINGS_H 1 | | #define HAVE_INTTYPES_H 1 | | #define HAVE_STDINT_H 1 | | #define HAVE_UNISTD_H 1 | | #define HAVE_DLFCN_H 1 | | #define LT_OBJDIR ".libs/" | | #define STDC_HEADERS 1 | | #define HAVE_EXECINFO_H 1 | | #define HAVE_SYS_SELECT_H 1 | | #define HAVE_SYS_SOCKET_H 1 | | #define HAVE_SYSLOG_H 1 | | #define HAVE_CTYPE_H 1 | | #define HAVE_NETINET_TCP_H 1 | | /* end confdefs.h. */ | | #include | | #ifdef HAVE_SYS_TYPES_H | | # include | | #endif | | #ifdef HAVE_SYS_STAT_H | | # include | | #endif | | #ifdef STDC_HEADERS | | # include | | # include | | #else | | # ifdef HAVE_STDLIB_H | | # include | | # endif | | #endif | | #ifdef HAVE_STRING_H | | # if !defined STDC_HEADERS && defined HAVE_MEMORY_H | | # include | | # endif | | # include | | #endif | | #ifdef HAVE_STRINGS_H | | # include | | #endif | | #ifdef HAVE_INTTYPES_H | | # include | | #endif | | #ifdef HAVE_STDINT_H | | # include | | #endif | | #ifdef HAVE_UNISTD_H | | # include | | #endif | | int | | main () | | { | | if (sizeof ((size_t))) | | return 0; | | ; | | return 0; | | } | configure:12438: result: yes | configure:12451: checking for working alloca.h | configure:12468: gcc -o conftest -g -O2 conftest.c >&5 | configure:12468: $? = 0 | configure:12476: result: yes | configure:12484: checking for alloca | configure:12521: gcc -o conftest -g -O2 conftest.c >&5 | configure:12521: $? = 0 | configure:12529: result: yes | configure:12635: checking for library containing dlopen | configure:12666: gcc -o conftest -g -O2 conftest.c >&5 | /tmp/cc2HehrS.o: In function `main': | /usr/local/src/libosmocore/conftest.c:43: undefined reference to `dlopen' | collect2: error: ld returned 1 exit status | configure:12666: $? = 1 | configure: failed program was: | | /* confdefs.h */ | | #define PACKAGE_NAME "libosmocore" | | #define PACKAGE_TARNAME "libosmocore" | | #define PACKAGE_VERSION "0.9.6.48-3419" | | #define PACKAGE_STRING "libosmocore 0.9.6.48-3419" | | #define PACKAGE_BUGREPORT "openbsc at lists.osmocom.org" | | #define PACKAGE_URL "" | | #define PACKAGE "libosmocore" | | #define VERSION "0.9.6.48-3419" | | #define STDC_HEADERS 1 | | #define HAVE_SYS_TYPES_H 1 | | #define HAVE_SYS_STAT_H 1 | | #define HAVE_STDLIB_H 1 | | #define HAVE_STRING_H 1 | | #define HAVE_MEMORY_H 1 | | #define HAVE_STRINGS_H 1 | | #define HAVE_INTTYPES_H 1 | | #define HAVE_STDINT_H 1 | | #define HAVE_UNISTD_H 1 | | #define HAVE_DLFCN_H 1 | | #define LT_OBJDIR ".libs/" | | #define STDC_HEADERS 1 | | #define HAVE_EXECINFO_H 1 | | #define HAVE_SYS_SELECT_H 1 | | #define HAVE_SYS_SOCKET_H 1 | | #define HAVE_SYSLOG_H 1 | | #define HAVE_CTYPE_H 1 | | #define HAVE_NETINET_TCP_H 1 | | #define HAVE_ALLOCA_H 1 | | #define HAVE_ALLOCA 1 | | /* end confdefs.h. */ | | | | /* Override any GCC internal prototype to avoid an error. | | Use char because int might match the return type of a GCC | | builtin and then its argument prototype would still apply. */ | | #ifdef __cplusplus | | extern "C" | | #endif | | char dlopen (); | | int | | main () | | { | | return dlopen (); | | ; | | return 0; | | } | configure:12666: gcc -o conftest -g -O2 conftest.c -ldl >&5 | configure:12666: $? = 0 | configure:12683: result: -ldl | configure:12693: checking for backtrace in -lexecinfo | configure:12718: gcc -o conftest -g -O2 conftest.c -lexecinfo >&5 | /usr/lib/gcc/armv7hl-suse-linux-gnueabi/6/../../../../armv7hl-suse-linux-gnueabi/bin/ld: cannot find -lexecinfo | collect2: error: ld returned 1 exit status | configure:12718: $? = 1 | configure: failed program was: | | /* confdefs.h */ | | #define PACKAGE_NAME "libosmocore" | | #define PACKAGE_TARNAME "libosmocore" | | #define PACKAGE_VERSION "0.9.6.48-3419" | | #define PACKAGE_STRING "libosmocore 0.9.6.48-3419" | | #define PACKAGE_BUGREPORT "openbsc at lists.osmocom.org" | | #define PACKAGE_URL "" | | #define PACKAGE "libosmocore" | | #define VERSION "0.9.6.48-3419" | | #define STDC_HEADERS 1 | | #define HAVE_SYS_TYPES_H 1 | | #define HAVE_SYS_STAT_H 1 | | #define HAVE_STDLIB_H 1 | | #define HAVE_STRING_H 1 | | #define HAVE_MEMORY_H 1 | | #define HAVE_STRINGS_H 1 | | #define HAVE_INTTYPES_H 1 | | #define HAVE_STDINT_H 1 | | #define HAVE_UNISTD_H 1 | | #define HAVE_DLFCN_H 1 | | #define LT_OBJDIR ".libs/" | | #define STDC_HEADERS 1 | | #define HAVE_EXECINFO_H 1 | | #define HAVE_SYS_SELECT_H 1 | | #define HAVE_SYS_SOCKET_H 1 | | #define HAVE_SYSLOG_H 1 | | #define HAVE_CTYPE_H 1 | | #define HAVE_NETINET_TCP_H 1 | | #define HAVE_ALLOCA_H 1 | | #define HAVE_ALLOCA 1 | | /* end confdefs.h. */ | | | | /* Override any GCC internal prototype to avoid an error. | | Use char because int might match the return type of a GCC | | builtin and then its argument prototype would still apply. */ | | #ifdef __cplusplus | | extern "C" | | #endif | | char backtrace (); | | int | | main () | | { | | return backtrace (); | | ; | | return 0; | | } | configure:12727: result: no | configure:12739: checking for doxygen | configure:12770: result: false | configure:12790: checking if gcc supports -fvisibility=hidden | configure:12796: gcc -c -g -O2 -fvisibility=hidden conftest.c >&5 | configure:12796: $? = 0 | configure:12797: result: yes | configure:12811: checking whether struct tm has tm_gmtoff member | configure:12835: gcc -o conftest -g -O2 conftest.c >&5 | configure:12835: $? = 0 | configure:12845: result: yes | configure:12859: checking for TALLOC | configure:12866: $PKG_CONFIG --exists --print-errors "talloc >= 2.0.1" | configure:12869: $? = 0 | configure:12883: $PKG_CONFIG --exists --print-errors "talloc >= 2.0.1" | configure:12886: $? = 0 | configure:12944: result: yes | configure:12964: checking for PCSC | configure:12971: $PKG_CONFIG --exists --print-errors "libpcsclite" | configure:12974: $? = 0 | configure:12988: $PKG_CONFIG --exists --print-errors "libpcsclite" | configure:12991: $? = 0 | configure:13049: result: yes | configure:13378: checking that generated files are newer than configure | configure:13384: result: done | configure:13463: creating ./config.status | | ## ---------------------- ## | ## Running config.status. ## | ## ---------------------- ## | | This file was extended by libosmocore config.status 0.9.6.48-3419, which was | generated by GNU Autoconf 2.69. Invocation command line was | | CONFIG_FILES = | CONFIG_HEADERS = | CONFIG_LINKS = | CONFIG_COMMANDS = | $ ./config.status | | on loki | | config.status:1150: creating libosmocore.pc | config.status:1150: creating libosmocodec.pc | config.status:1150: creating libosmovty.pc | config.status:1150: creating libosmogsm.pc | config.status:1150: creating libosmogb.pc | config.status:1150: creating libosmoctrl.pc | config.status:1150: creating libosmosim.pc | config.status:1150: creating include/Makefile | config.status:1150: creating src/Makefile | config.status:1150: creating src/vty/Makefile | config.status:1150: creating src/codec/Makefile | config.status:1150: creating src/sim/Makefile | config.status:1150: creating src/gsm/Makefile | config.status:1150: creating src/gb/Makefile | config.status:1150: creating src/ctrl/Makefile | config.status:1150: creating tests/Makefile | config.status:1150: creating tests/atlocal | config.status:1150: creating utils/Makefile | config.status:1150: creating Doxyfile.core | config.status:1150: creating Doxyfile.gsm | config.status:1150: creating Doxyfile.vty | config.status:1150: creating Doxyfile.codec | config.status:1150: creating Makefile | config.status:1150: creating config.h | config.status:1379: executing tests/atconfig commands | config.status:1379: executing depfiles commands | config.status:1379: executing libtool commands | | ## ---------------- ## | ## Cache variables. ## | ## ---------------- ## | | ac_cv_build=armv7l-unknown-linux-gnueabihf | ac_cv_c_compiler_gnu=yes | ac_cv_env_CC_set= | ac_cv_env_CC_value= | ac_cv_env_CFLAGS_set= | ac_cv_env_CFLAGS_value= | ac_cv_env_CPPFLAGS_set= | ac_cv_env_CPPFLAGS_value= | ac_cv_env_CPP_set= | ac_cv_env_CPP_value= | ac_cv_env_LDFLAGS_set= | ac_cv_env_LDFLAGS_value= | ac_cv_env_LIBS_set= | ac_cv_env_LIBS_value= | ac_cv_env_LT_SYS_LIBRARY_PATH_set= | ac_cv_env_LT_SYS_LIBRARY_PATH_value= | ac_cv_env_PCSC_CFLAGS_set= | ac_cv_env_PCSC_CFLAGS_value= | ac_cv_env_PCSC_LIBS_set= | ac_cv_env_PCSC_LIBS_value= | ac_cv_env_PKG_CONFIG_LIBDIR_set= | ac_cv_env_PKG_CONFIG_LIBDIR_value= | ac_cv_env_PKG_CONFIG_PATH_set= | ac_cv_env_PKG_CONFIG_PATH_value= | ac_cv_env_PKG_CONFIG_set= | ac_cv_env_PKG_CONFIG_value= | ac_cv_env_TALLOC_CFLAGS_set= | ac_cv_env_TALLOC_CFLAGS_value= | ac_cv_env_TALLOC_LIBS_set= | ac_cv_env_TALLOC_LIBS_value= | ac_cv_env_build_alias_set= | ac_cv_env_build_alias_value= | ac_cv_env_host_alias_set= | ac_cv_env_host_alias_value= | ac_cv_env_target_alias_set= | ac_cv_env_target_alias_value= | ac_cv_func_alloca_works=yes | ac_cv_header_ctype_h=yes | ac_cv_header_dlfcn_h=yes | ac_cv_header_execinfo_h=yes | ac_cv_header_inttypes_h=yes | ac_cv_header_memory_h=yes | ac_cv_header_netinet_tcp_h=yes | ac_cv_header_stdc=yes | ac_cv_header_stdint_h=yes | ac_cv_header_stdlib_h=yes | ac_cv_header_string_h=yes | ac_cv_header_strings_h=yes | ac_cv_header_sys_select_h=yes | ac_cv_header_sys_socket_h=yes | ac_cv_header_sys_stat_h=yes | ac_cv_header_sys_types_h=yes | ac_cv_header_syslog_h=yes | ac_cv_header_unistd_h=yes | ac_cv_host=armv7l-unknown-linux-gnueabihf | ac_cv_lib_execinfo_backtrace=no | ac_cv_objext=o | ac_cv_path_DOXYGEN=false | ac_cv_path_EGREP='/usr/bin/grep -E' | ac_cv_path_FGREP='/usr/bin/grep -F' | ac_cv_path_GREP=/usr/bin/grep | ac_cv_path_PKG_CONFIG_INSTALLED=/usr/bin/pkg-config | ac_cv_path_SED=/usr/bin/sed | ac_cv_path_ac_pt_PKG_CONFIG=/usr/bin/pkg-config | ac_cv_path_install='/usr/bin/install -c' | ac_cv_path_lt_DD=/usr/bin/dd | ac_cv_path_mkdir=/usr/bin/mkdir | ac_cv_prog_AWK=gawk | ac_cv_prog_CPP='gcc -E' | ac_cv_prog_ac_ct_AR=ar | ac_cv_prog_ac_ct_CC=gcc | ac_cv_prog_ac_ct_OBJDUMP=objdump | ac_cv_prog_ac_ct_RANLIB=ranlib | ac_cv_prog_ac_ct_STRIP=strip | ac_cv_prog_cc_c89= | ac_cv_prog_cc_g=yes | ac_cv_prog_make_make_set=no | ac_cv_search_dlopen=-ldl | ac_cv_type_size_t=yes | ac_cv_working_alloca_h=yes | am_cv_CC_dependencies_compiler_type=none | am_cv_make_support_nested_variables=no | am_cv_prog_cc_c_o=yes | lt_cv_ar_at_file=@ | lt_cv_archive_cmds_need_lc=no | lt_cv_deplibs_check_method=pass_all | lt_cv_file_magic_cmd='$MAGIC_CMD' | lt_cv_file_magic_test_file= | lt_cv_ld_reload_flag=-r | lt_cv_nm_interface='BSD nm' | lt_cv_objdir=.libs | lt_cv_path_LD=/usr/armv7hl-suse-linux-gnueabi/bin/ld | lt_cv_path_NM='/usr/bin/nm -B' | lt_cv_path_mainfest_tool=no | lt_cv_prog_compiler_c_o=yes | lt_cv_prog_compiler_pic='-fPIC -DPIC' | lt_cv_prog_compiler_pic_works=yes | lt_cv_prog_compiler_rtti_exceptions=no | lt_cv_prog_compiler_static_works=no | lt_cv_prog_gnu_ld=yes | lt_cv_sharedlib_from_linklib_cmd='printf %s\n' | lt_cv_shlibpath_overrides_runpath=yes | lt_cv_sys_global_symbol_pipe='sed -n -e '\''s/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p'\'' | sed '\''/ __gnu_lto/d'\''' | lt_cv_sys_global_symbol_to_c_name_address='sed -n -e '\''s/^: \(.*\) .*$/ {"\1", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW][ABCDGIRSTW]* .* \(.*\)$/ {"\1", (void *) \&\1},/p'\''' | lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='sed -n -e '\''s/^: \(.*\) .*$/ {"\1", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW][ABCDGIRSTW]* .* \(lib.*\)$/ {"\1", (void *) \&\1},/p'\'' -e '\''s/^[ABCDGIRSTW][ABCDGIRSTW]* .* \(.*\)$/ {"lib\1", (void *) \&\1},/p'\''' | lt_cv_sys_global_symbol_to_cdecl='sed -n -e '\''s/^T .* \(.*\)$/extern int \1();/p'\'' -e '\''s/^[ABCDGIRSTW][ABCDGIRSTW]* .* \(.*\)$/extern char \1;/p'\''' | lt_cv_sys_global_symbol_to_import= | lt_cv_sys_max_cmd_len=1572864 | lt_cv_to_host_file_cmd=func_convert_file_noop | lt_cv_to_tool_file_cmd=func_convert_file_noop | lt_cv_truncate_bin='/usr/bin/dd bs=4096 count=1' | osmo_cv_tm_includes_tm_gmtoff=yes | pkg_cv_PCSC_CFLAGS='-pthread -I/usr/include/PCSC' | pkg_cv_PCSC_LIBS=-lpcsclite | pkg_cv_TALLOC_CFLAGS= | pkg_cv_TALLOC_LIBS=-ltalloc | | ## ----------------- ## | ## Output variables. ## | ## ----------------- ## | | ACLOCAL='${SHELL} /usr/local/src/libosmocore/missing aclocal-1.15' | ALLOCA='' | AMDEPBACKSLASH='\' | AMDEP_FALSE='#' | AMDEP_TRUE='' | AMTAR='$${TAR-tar}' | AM_BACKSLASH='\' | AM_DEFAULT_V='0' | AM_DEFAULT_VERBOSITY='0' | AM_V='0' | AR='ar' | AUTOCONF='${SHELL} /usr/local/src/libosmocore/missing autoconf' | AUTOHEADER='${SHELL} /usr/local/src/libosmocore/missing autoheader' | AUTOMAKE='${SHELL} /usr/local/src/libosmocore/missing automake-1.15' | AWK='gawk' | BACKTRACE_LIB='' | CC='gcc' | CCDEPMODE='depmode=none' | CFLAGS='-g -O2' | CPP='gcc -E' | CPPFLAGS='' | CYGPATH_W='echo' | DEFS='-DHAVE_CONFIG_H' | DEPDIR='.deps' | DLLTOOL='false' | DOXYGEN='false' | DSYMUTIL='' | DUMPBIN='' | ECHO_C='' | ECHO_N='-n' | ECHO_T='' | EGREP='/usr/bin/grep -E' | ENABLE_GB_FALSE='#' | ENABLE_GB_TRUE='' | ENABLE_MSGFILE_FALSE='#' | ENABLE_MSGFILE_TRUE='' | ENABLE_PCSC='yes' | ENABLE_PCSC_FALSE='#' | ENABLE_PCSC_TRUE='' | ENABLE_PLUGIN_FALSE='#' | ENABLE_PLUGIN_TRUE='' | ENABLE_SERIAL_FALSE='#' | ENABLE_SERIAL_TRUE='' | ENABLE_UTILITIES_FALSE='#' | ENABLE_UTILITIES_TRUE='' | ENABLE_VTY_FALSE='#' | ENABLE_VTY_TRUE='' | EXEEXT='' | FGREP='/usr/bin/grep -F' | GREP='/usr/bin/grep' | HAVE_DOXYGEN_FALSE='' | HAVE_DOXYGEN_TRUE='#' | INSTALL_DATA='${INSTALL} -m 644' | INSTALL_PROGRAM='${INSTALL}' | INSTALL_SCRIPT='${INSTALL}' | INSTALL_STRIP_PROGRAM='$(install_sh) -c -s' | LD='/usr/armv7hl-suse-linux-gnueabi/bin/ld' | LDFLAGS='' | LIBOBJS='' | LIBRARY_DL='-ldl ' | LIBS='' | LIBTOOL='$(SHELL) $(top_builddir)/libtool' | LIPO='' | LN_S='ln -s' | LTLDFLAGS_OSMOGB='-Wl,--version-script=$(srcdir)/libosmogb.map' | LTLDFLAGS_OSMOGSM='-Wl,--version-script=$(srcdir)/libosmogsm.map' | LTLIBOBJS='' | LT_SYS_LIBRARY_PATH='' | MAKEINFO='${SHELL} /usr/local/src/libosmocore/missing makeinfo' | MANIFEST_TOOL=':' | MKDIR_P='/usr/bin/mkdir -p' | NM='/usr/bin/nm -B' | NMEDIT='' | OBJDUMP='objdump' | OBJEXT='o' | OTOOL64='' | OTOOL='' | PACKAGE='libosmocore' | PACKAGE_BUGREPORT='openbsc at lists.osmocom.org' | PACKAGE_NAME='libosmocore' | PACKAGE_STRING='libosmocore 0.9.6.48-3419' | PACKAGE_TARNAME='libosmocore' | PACKAGE_URL='' | PACKAGE_VERSION='0.9.6.48-3419' | PATH_SEPARATOR=':' | PCSC_CFLAGS='-pthread -I/usr/include/PCSC' | PCSC_LIBS='-lpcsclite' | PKG_CONFIG='/usr/bin/pkg-config' | PKG_CONFIG_INSTALLED='/usr/bin/pkg-config' | PKG_CONFIG_LIBDIR='' | PKG_CONFIG_PATH='' | RANLIB='ranlib' | SED='/usr/bin/sed' | SET_MAKE='MAKE=make' | SHELL='/bin/sh' | STRIP='strip' | SYMBOL_VISIBILITY='-fvisibility=hidden' | TALLOC_CFLAGS='' | TALLOC_LIBS='-ltalloc' | VERSION='0.9.6.48-3419' | ac_ct_AR='ar' | ac_ct_CC='gcc' | ac_ct_DUMPBIN='' | am__EXEEXT_FALSE='' | am__EXEEXT_TRUE='#' | am__fastdepCC_FALSE='' | am__fastdepCC_TRUE='#' | am__include='#' | am__isrc='' | am__leading_dot='.' | am__nodep='_no' | am__quote='' | am__tar='$${TAR-tar} chof - "$$tardir"' | am__untar='$${TAR-tar} xf -' | bindir='${exec_prefix}/bin' | build='armv7l-unknown-linux-gnueabihf' | build_alias='' | build_cpu='armv7l' | build_os='linux-gnueabihf' | build_vendor='unknown' | datadir='${datarootdir}' | datarootdir='${prefix}/share' | docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' | dvidir='${docdir}' | exec_prefix='${prefix}' | host='armv7l-unknown-linux-gnueabihf' | host_alias='' | host_cpu='armv7l' | host_os='linux-gnueabihf' | host_vendor='unknown' | htmldir='${docdir}' | includedir='${prefix}/include' | infodir='${datarootdir}/info' | install_sh='${SHELL} /usr/local/src/libosmocore/install-sh' | libdir='${exec_prefix}/lib' | libexecdir='${exec_prefix}/libexec' | localedir='${datarootdir}/locale' | localstatedir='${prefix}/var' | mandir='${datarootdir}/man' | mkdir_p='$(MKDIR_P)' | oldincludedir='/usr/include' | pdfdir='${docdir}' | prefix='/usr/local' | program_transform_name='s,x,x,' | psdir='${docdir}' | sbindir='${exec_prefix}/sbin' | sharedstatedir='${prefix}/com' | sysconfdir='${prefix}/etc' | target_alias='' | | ## ----------- ## | ## confdefs.h. ## | ## ----------- ## | | /* confdefs.h */ | #define PACKAGE_NAME "libosmocore" | #define PACKAGE_TARNAME "libosmocore" | #define PACKAGE_VERSION "0.9.6.48-3419" | #define PACKAGE_STRING "libosmocore 0.9.6.48-3419" | #define PACKAGE_BUGREPORT "openbsc at lists.osmocom.org" | #define PACKAGE_URL "" | #define PACKAGE "libosmocore" | #define VERSION "0.9.6.48-3419" | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DLFCN_H 1 | #define LT_OBJDIR ".libs/" | #define STDC_HEADERS 1 | #define HAVE_EXECINFO_H 1 | #define HAVE_SYS_SELECT_H 1 | #define HAVE_SYS_SOCKET_H 1 | #define HAVE_SYSLOG_H 1 | #define HAVE_CTYPE_H 1 | #define HAVE_NETINET_TCP_H 1 | #define HAVE_ALLOCA_H 1 | #define HAVE_ALLOCA 1 | #define HAVE_TM_GMTOFF_IN_TM 1 | #define BSC_FD_CHECK 1 | | configure: exit 0 From axilirator at gmail.com Sun Jan 8 09:30:36 2017 From: axilirator at gmail.com (Vadim Yanitskiy) Date: Sun, 8 Jan 2017 16:30:36 +0700 Subject: Relicensing optimized Viterbi decoder Message-ID: Hi Tom, Recently I already asked for your permission to relicense the GSM 05.03 code from OpenBTS, and now I am contacting you with the same purpose. I am going to move your optimized Viterbi decoder forward, but currently it is licensed under the LGPL v2.1 (or later). To avoid license mix within the core Osmocom library, it would be better to relicense your code to the same one, if you agree. So, the question is: do you agree to relicense your code under the GPLv2-or-later? With best regards, Vadim Yanitskiy. -------------- next part -------------- An HTML attachment was scrubbed... URL: From laforge at gnumonks.org Sun Jan 8 13:49:51 2017 From: laforge at gnumonks.org (Harald Welte) Date: Sun, 8 Jan 2017 14:49:51 +0100 Subject: Relicensing optimized Viterbi decoder In-Reply-To: References: Message-ID: <20170108134951.2up6a3ucngzojdst@nataraja> Hi Vadim and Tom, as LGPL v2.1-or-later is compatible with GPLv2-or-later, there is not really a strict requirement for license compatibiltiy reasons. Any application that links against the GPL-v2-or-later libosmocore has no license compatibility issues with LGPLv2-or-later, as GPLv2 is the stricter of the two licenses anyway. Still, it is of course good if the entire library is covered under one license, and people don't have to research and follow different license terms for each file. Most importantly, we don't want people to assume all of the librray is LGPL, which is clearly not our intention. Regards, Harald -- - Harald Welte http://laforge.gnumonks.org/ ============================================================================ "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6) From nhofmeyr at sysmocom.de Sun Jan 8 17:09:35 2017 From: nhofmeyr at sysmocom.de (Neels Hofmeyr) Date: Sun, 8 Jan 2017 18:09:35 +0100 Subject: log messages summary Message-ID: <20170108170935.GA23638@my.box> Hi Max, you recently tend to have very general commit log summaries. The summary should best contain a hint at the general area the patch is about, so a reader can quickly know whether a patch could be related to a given other topic. I've asked so on gerrit a few times, and now also found a couple of commits merged IMHO with ETOOGENERAL, so I thought I'd drop a note: osmo-bts: 2017-01-06 17:30 Max o Log socket path on error 2017-01-02 18:17 Max o Move code to libosmocore 2016-11-11 17:44 Max o Remove duplicated code osmo-pcu: 2017-01-06 17:20 Max o Log socket path on connection 2017-01-05 18:26 Max o Improve logging Would be nice to add an indicator to the summary in the future. A small word or phrase in the beginning is enough, like 'rsl: frobnicate', or include a function name or -prefix for code dup / moved code. Thanks! ~N -- - Neels Hofmeyr http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Gesch?ftsf?hrer / Managing Directors: Harald Welte -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From msuraev at sysmocom.de Mon Jan 9 11:34:45 2017 From: msuraev at sysmocom.de (Max) Date: Mon, 9 Jan 2017 12:34:45 +0100 Subject: libosmocore[master]: libosmocoding: migrate transcoding routines from OsmoBTS In-Reply-To: <20170107011225.GC4777@my.box> References: <20170104102858.kfwd7smzyorpndtq@nataraja> <20170107011225.GC4777@my.box> Message-ID: I'd suggest following: 1) disable leak sanitizer via env variable as suggested by Harald (until we find a way to make it compatible with talloc) 2) add latest ubuntu as test builder in addition to debian - it has much newer toolchain and hence can help us catch more bugs On 07.01.2017 02:12, Neels Hofmeyr wrote: > On Sat, Jan 07, 2017 at 03:14:15AM +0700, Vadim Yanitskiy wrote: >> Which GCC version is used on buildhost? > # gcc --version > gcc (Debian 4.9.2-10) 4.9.2 > > Let me know whether I should do anything there, preferably sticking to Debian > packages. > > ~N -- Max Suraev http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Geschaeftsfuehrer / Managing Director: Harald Welte From laforge at gnumonks.org Mon Jan 9 12:14:31 2017 From: laforge at gnumonks.org (Harald Welte) Date: Mon, 9 Jan 2017 13:14:31 +0100 Subject: Contribute to Osmocom and receive a free 3.5G femtocell Message-ID: <20170109121431.izdrv2lwez2lc3hq@nataraja> Dear all, not everyone might have seen the news item that was posted in late December on our website at http://osmocom.org/news/62 I'm looking forward to receiving your proposal on how you would contribute to the Osmocom project if you were to receive one of those free 3.5G femtocells. Quote of the news item below: ------ So please excuse me to cross-post this over several Osmocom project mailing lists. I know that a number of people have either hacked on femtocells in the past, or at least expressed interest in doing so... Osmocom's support for 2G/GSM is mature and widespread. Since 2016, we're taking on the next level: 3G/3.5G. The key to running your own 3G network is to obtain actual 3G cell hardware -- here is an exciting opportunity to get started: No less than 50 femtocells will be given away for free by sysmocom, one of the main drivers of the Osmocom project. To receive a free 3G femtocell, tell us how you will help the Osmocom project drive 3.5G forward if you had one, before the end of January 2017. This marks the launch of the 3.5G Acceleration Project, backed by the Osmocom community. Join us! Find further details on the 3.5G Acceleration Project and receiving your own 3G femtocell for free at https://sysmocom.de/downloads/accelerate_3g5_cfp.pdf. ------ Best regards and happy hacking, Harald Welte -- - Harald Welte http://laforge.gnumonks.org/ ============================================================================ "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6) -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: From nhofmeyr at sysmocom.de Mon Jan 9 15:12:27 2017 From: nhofmeyr at sysmocom.de (Neels Hofmeyr) Date: Mon, 9 Jan 2017 16:12:27 +0100 Subject: redmine main page Message-ID: <20170109151227.GA3455@my.box> I find the link https://osmocom.org/news/ quite valuable, but it's not easy to get there. I would expect a "News" link on http://osmocom.org to point there, so I placed one. We do have a "Planet" link -> http://planet.osmocom.org/ , which is currently broken. Firefox outright refuses to display it: the certificate is invalid/unknown/expired and the site is marked as "only show when secure", so one cannot add a security exception (fail: that should be the user's choice!). Chromium redirects to https://admin-trac.openmoko.org/trac/ ... doesn't match. So I took the liberty to remove the "Planet" link -- for now? All this by editing, in our redmine jail, file /usr/local/www/redmine-3.2.3/plugins/impressum_plugin/init.rb Feedback welcome! ~N -- - Neels Hofmeyr http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Gesch?ftsf?hrer / Managing Directors: Harald Welte -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From laforge at gnumonks.org Mon Jan 9 17:24:57 2017 From: laforge at gnumonks.org (Harald Welte) Date: Mon, 9 Jan 2017 18:24:57 +0100 Subject: redmine main page In-Reply-To: <20170109151227.GA3455@my.box> References: <20170109151227.GA3455@my.box> Message-ID: <20170109172457.cqd7j75c5aop447a@nataraja> On Mon, Jan 09, 2017 at 04:12:27PM +0100, Neels Hofmeyr wrote: > I find the link https://osmocom.org/news/ quite valuable, but it's not easy to > get there. I would expect a "News" link on http://osmocom.org to point there, > so I placed one. Thanks. > We do have a "Planet" link -> http://planet.osmocom.org/ , which is currently broken. > Firefox outright refuses to display it: the certificate is > invalid/unknown/expired and the site is marked as "only show when secure", so > one cannot add a security exception (fail: that should be the user's choice!). > Chromium redirects to https://admin-trac.openmoko.org/trac/ ... doesn't match. > So I took the liberty to remove the "Planet" link -- for now? ?!? the link you indicate is http, not https. How and why would this lead to a certificat error? I can access the site via http without trouble from firefox and chrome. So please bring it back, thanks :) Also, where does the 'marking' you indicate come from? -- - Harald Welte http://laforge.gnumonks.org/ ============================================================================ "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6) From alexander.chemeris at gmail.com Mon Jan 9 18:24:04 2017 From: alexander.chemeris at gmail.com (Alexander Chemeris) Date: Mon, 9 Jan 2017 21:24:04 +0300 Subject: redmine main page In-Reply-To: <20170109151227.GA3455@my.box> References: <20170109151227.GA3455@my.box> Message-ID: Hi all, On Jan 9, 2017 6:12 PM, "Neels Hofmeyr" wrote: We do have a "Planet" link -> http://planet.osmocom.org/ , which is currently broken. Firefox outright refuses to display it: the certificate is invalid/unknown/expired and the site is marked as "only show when secure", so one cannot add a security exception (fail: that should be the user's choice!). Chromium redirects to https://admin-trac.openmoko.org/trac/ ... doesn't match. So I took the liberty to remove the "Planet" link -- for now Speaking of HTTPS - is there a plan to use something like letsencrypt to generate a valid certificate? I remember it was discussed, but not sure what was decided. We'd be happy to help set it up (we're using it on our web sites with nginx), but it's quite straightforward to setup. The "trickiest" part is to setup a script to automatically renew the certificate and restart your web server. Please excuse typos. Written with a touchscreen keyboard. -- Regards, Alexander Chemeris CEO Fairwaves, Inc. https://fairwaves.co -------------- next part -------------- An HTML attachment was scrubbed... URL: From holger at freyther.de Mon Jan 9 18:37:37 2017 From: holger at freyther.de (Holger Freyther) Date: Mon, 9 Jan 2017 19:37:37 +0100 Subject: redmine main page In-Reply-To: <20170109172457.cqd7j75c5aop447a@nataraja> References: <20170109151227.GA3455@my.box> <20170109172457.cqd7j75c5aop447a@nataraja> Message-ID: <70F452A6-0890-4395-8E92-1E36A20ED5D5@freyther.de> > On 9 Jan 2017, at 18:24, Harald Welte wrote: > Hi! > ?!? the link you indicate is http, not https. How and why would this > lead to a certificat error? I can access the site via http without > trouble from firefox and chrome. So please bring it back, thanks :) > > Also, where does the 'marking' you indicate come from? I might have caused it by briefly enabling HTTP Strict Transport Security[1] for all of osmocom.org (and apparently with a too big max-age) to try to score better in the then new mozilla tool... HSTS informs the browser that certain (sub-)domains should only be accessed through TLS and to do that for a period of time. sorry holger [1] https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security From holger at freyther.de Mon Jan 9 18:40:42 2017 From: holger at freyther.de (Holger Freyther) Date: Mon, 9 Jan 2017 19:40:42 +0100 Subject: redmine main page In-Reply-To: References: <20170109151227.GA3455@my.box> Message-ID: <9E4ED36E-31B0-4904-9727-27BAB4AA28C1@freyther.de> > On 9 Jan 2017, at 19:24, Alexander Chemeris wrote: Hi! > We'd be happy to help set it up (we're using it on our web sites with nginx), but it's quite straightforward to setup. The "trickiest" part is to setup a script to automatically renew the certificate and restart your web server. thank you for the offer. What domains are missing? In theory we should have: osmocom.org www.osmocom.org bb.osmocom.org sdr.osmocom.org openbsc.osmocom.org gmr.osmocom.org tetra.osmocom.org security.osmocom.org lists.osmocom.org projects.osmocom.org ftp.osmocom.org patchwork.osmocom.org gerrit.osmocom.org jenkins.osmocom.org git.osmocom.org cgit.osmocom.org holger From alexander.chemeris at gmail.com Mon Jan 9 18:50:52 2017 From: alexander.chemeris at gmail.com (Alexander Chemeris) Date: Mon, 9 Jan 2017 21:50:52 +0300 Subject: redmine main page In-Reply-To: <9E4ED36E-31B0-4904-9727-27BAB4AA28C1@freyther.de> References: <20170109151227.GA3455@my.box> <9E4ED36E-31B0-4904-9727-27BAB4AA28C1@freyther.de> Message-ID: Hi Holger, As mentioned by Neels - https://planet.osmocom.org don't seem to have a valid certificate (I've only checked from my phone so far, though). Please excuse typos. Written with a touchscreen keyboard. -- Regards, Alexander Chemeris CEO Fairwaves, Inc. https://fairwaves.co On Jan 9, 2017 9:40 PM, "Holger Freyther" wrote: > On 9 Jan 2017, at 19:24, Alexander Chemeris wrote: Hi! > We'd be happy to help set it up (we're using it on our web sites with nginx), but it's quite straightforward to setup. The "trickiest" part is to setup a script to automatically renew the certificate and restart your web server. thank you for the offer. What domains are missing? In theory we should have: osmocom.org www.osmocom.org bb.osmocom.org sdr.osmocom.org openbsc.osmocom.org gmr.osmocom.org tetra.osmocom.org security.osmocom.org lists.osmocom.org projects.osmocom.org ftp.osmocom.org patchwork.osmocom.org gerrit.osmocom.org jenkins.osmocom.org git.osmocom.org cgit.osmocom.org holger -------------- next part -------------- An HTML attachment was scrubbed... URL: From laforge at gnumonks.org Mon Jan 9 19:22:51 2017 From: laforge at gnumonks.org (Harald Welte) Date: Mon, 9 Jan 2017 20:22:51 +0100 Subject: planet via https (was Re: redmine main page) In-Reply-To: References: <20170109151227.GA3455@my.box> <9E4ED36E-31B0-4904-9727-27BAB4AA28C1@freyther.de> Message-ID: <20170109192251.yuwgvi5hsklebqqc@nataraja> Dear all, On Mon, Jan 09, 2017 at 09:50:52PM +0300, Alexander Chemeris wrote: > As mentioned by Neels - https://planet.osmocom.org don't seem to have a > valid certificate (I've only checked from my phone so far, though). planet.osmocom.org is running on the same planet installation as planet.openmoko.org and planet.netfilter.org, as I didn't see the point in maintaining three different planet installations for the different projects as I worked on them. There probably was never any intention to have planet.osmocom.org be reachable via https, at least not consciously and not by me. It is probably simply an artefact of some other https service running on the same IP address, completely unrelated. If somebody wants to migrate the planet configuration to the osmocom.org setup, let me know, I can create a tar-ball of the configuration and the planet version that is used to generate it. I really don't think that it is a good idea to change configuration on the planet.{openmoko,netfilter}.org server to include a certificate for osmocom.org. An alternative solution might be a reverse proxy, with a https-proxy at the osmocom server, which then forwards wia http to the real server (openmoko)? I also do think we have more pressing needs in the project than to spend time on this, as the planet is a public web site anyway, with no cookies, log-in or user authentication being transmitted. So yes, there is a chance of people doing MITM and modifying the content of the planet, but is that really a threat that we care about? Am I missing something? Regards, Harald -- - Harald Welte http://laforge.gnumonks.org/ ============================================================================ "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6) From laforge at gnumonks.org Mon Jan 9 19:44:26 2017 From: laforge at gnumonks.org (Harald Welte) Date: Mon, 9 Jan 2017 20:44:26 +0100 Subject: RFC: OsmoDevCon 2017 planning In-Reply-To: <20170106104237.aqx53judskjh5c7v@nataraja> References: <20161210191139.rxtzqrdmsifwgi4s@nataraja> <20170106104237.aqx53judskjh5c7v@nataraja> Message-ID: <20170109194426.2bvjcsr7gshvfwxf@nataraja> Dear all, thanks for the constructive discussion and feedback. The format and dates have now been settled: * public OsmoCon on 21st of April, 2017 for users + operators some initial information at https://osmocom.org/projects/osmo-dev-con/wiki/OsmoCon2017 - official information will be launched once venue + schedule + website is clear * private OsmoDevCon on 22nd through 24th of April 2017 for known contributors If you're interested in attending OsmoDevCon, please add your name to https://osmocom.org/projects/osmo-dev-con/wiki/OsmoDevCon2017#Requested until the end of January. Looking forward to meeting all of you, Harald -- - Harald Welte http://laforge.gnumonks.org/ ============================================================================ "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6) From nhofmeyr at sysmocom.de Mon Jan 9 20:00:03 2017 From: nhofmeyr at sysmocom.de (Neels Hofmeyr) Date: Mon, 9 Jan 2017 21:00:03 +0100 Subject: redmine main page In-Reply-To: <20170109172457.cqd7j75c5aop447a@nataraja> References: <20170109151227.GA3455@my.box> <20170109172457.cqd7j75c5aop447a@nataraja> Message-ID: <20170109200003.GB3455@my.box> On Mon, Jan 09, 2017 at 06:24:57PM +0100, Harald Welte wrote: > > We do have a "Planet" link -> http://planet.osmocom.org/ , which is currently broken. > > ?!? the link you indicate is http, not https. How and why would this > lead to a certificat error? I can access the site via http without > trouble from firefox and chrome. So please bring it back, thanks :) Tried again. First I thought it's the https-everywhere plugin, but even when I completely uninstall that plugin, my firefox still gets redirected to https://planet.osmocom.org -- so I guess it's Holger's fault :) Indeed, when I use Chromium and enter http://planet.osmocom.org I can see the page. With https:// I get redirected to https://admin-trac.openmoko.org/trac/. +1 for fixing the https. I put "Planet" back in there. ~N -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From ynezz at true.cz Mon Jan 9 19:57:51 2017 From: ynezz at true.cz (Petr =?iso-8859-2?Q?=A9tetiar?=) Date: Mon, 9 Jan 2017 20:57:51 +0100 Subject: Quectel EC20 question Message-ID: <20170109195751.GC12143@ibawizard.net> Hi, according to a lot of sources one would think, that EC20 is based around the Qualcomm MDM9615, but the picture of naked EC20[1] clearly shows, that there is Qualcomm MDM9215 chip soldered on the board. Which source is true? :-) Or it's just a wrong text on that BGA? 1. https://osmocom.org/attachments/download/2501/ec20-naked-top.jpg -- ynezz From tom at tsou.cc Mon Jan 9 21:49:10 2017 From: tom at tsou.cc (Tom Tsou) Date: Mon, 9 Jan 2017 13:49:10 -0800 Subject: Relicensing optimized Viterbi decoder In-Reply-To: <20170108134951.2up6a3ucngzojdst@nataraja> References: <20170108134951.2up6a3ucngzojdst@nataraja> Message-ID: Harald and Vadim, I agree that it is preferable to cover the entire library under a single license. The benefits of a single license outweigh the limited value added by having a few files under the less restrictive license. I approve the re-licensing of the code contained within the optimized Viterbi patchset "core/conv: Fast Viterbi decoding", originally posted to the OpenBSC mailing list on April 28, 2014, from LGPLv2.1 or later to GPLv2 or later. -TT On Sun, Jan 8, 2017 at 5:49 AM, Harald Welte wrote: > Hi Vadim and Tom, > > as LGPL v2.1-or-later is compatible with GPLv2-or-later, there is not > really a strict requirement for license compatibiltiy reasons. Any > application that links against the GPL-v2-or-later libosmocore has no > license compatibility issues with LGPLv2-or-later, as GPLv2 is the > stricter of the two licenses anyway. > > Still, it is of course good if the entire library is covered under one > license, and people don't have to research and follow different license > terms for each file. Most importantly, we don't want people to assume > all of the librray is LGPL, which is clearly not our intention. > > Regards, > Harald > > -- > - Harald Welte http://laforge.gnumonks.org/ > ============================================================================ > "Privacy in residential applications is a desirable marketing option." > (ETSI EN 300 175-7 Ch. A6) From hosseinamini2578 at gmail.com Sun Jan 8 06:41:02 2017 From: hosseinamini2578 at gmail.com (Hossein Amini) Date: Sun, 8 Jan 2017 10:11:02 +0330 Subject: [openbsc 0.15.0.621-80ab] testsuite: 3 5 failed Message-ID: hi I compliled OpenBSC in linux kernel 4.2.* and all test was successful but when upgrade my linux to kernel v4.8.* , we face 2 failed test. logs attached Regards Hossein -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: testsuite.log Type: application/octet-stream Size: 57751 bytes Desc: not available URL: From laforge at gnumonks.org Tue Jan 10 02:03:37 2017 From: laforge at gnumonks.org (Harald Welte) Date: Tue, 10 Jan 2017 03:03:37 +0100 Subject: Quectel EC20 question In-Reply-To: <20170109195751.GC12143@ibawizard.net> References: <20170109195751.GC12143@ibawizard.net> Message-ID: <20170110020337.izbphso6cvh7ubdz@nataraja> Hi Petr, On Mon, Jan 09, 2017 at 08:57:51PM +0100, Petr ?tetiar wrote: > according to a lot of sources one would think, that EC20 is based around the > Qualcomm MDM9615, but the picture of naked EC20[1] clearly shows, that there > is Qualcomm MDM9215 chip soldered on the board. Which source is true? :-) Or > it's just a wrong text on that BGA? I think it is simply the fact that (at least) for the Linux on the Cortex-A5 it doesn't make any difference whether it's running on a 9615 or a 9215. The difference is presumably primarily in the cellular radio interface and possibly DSP capacity? From the few publicly available information the 9615 adds Ev-DO (3GPP2) capability, while the 9215 is GSM/UMTS/LTE (3GPP) only? btw: I just created a new mailing list for any future public discussion on the Qualcomm Linux based cellular modems, see qc-linux-modems at lists.osmocom.org and/or https://lists.osmocom.org/mailman/listinfo/qc-linux-modems -- - Harald Welte http://laforge.gnumonks.org/ ============================================================================ "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6) From 246tnt at gmail.com Tue Jan 10 08:23:39 2017 From: 246tnt at gmail.com (Sylvain Munaut) Date: Tue, 10 Jan 2017 09:23:39 +0100 Subject: [openbsc 0.15.0.621-80ab] testsuite: 3 5 failed In-Reply-To: References: Message-ID: > I compliled OpenBSC in linux kernel 4.2.* and all test was successful but > when upgrade my linux to kernel v4.8.* , we face 2 failed test. > logs attached That has nothing to do with your kernel, your setup is just broken in some way : /home/osmocom/openbsc/openbsc/tests/testsuite.dir/at-groups/3/test-source: line 27: 28496 Segmentation fault (core dumped) $abs_top_builddir/tests/db/db_test /home/osmocom/openbsc/openbsc/tests/mgcp/mgcp_test: error while loading shared libraries: libosmonetif.so.3: cannot open shared object file: No such file or directory First one is a crash, would need to see the actual backtrace to see what's up. Second is a linking issue, your library setup is broken somewhere. Cheers, Sylvain From nhofmeyr at sysmocom.de Tue Jan 10 11:37:40 2017 From: nhofmeyr at sysmocom.de (Neels Hofmeyr) Date: Tue, 10 Jan 2017 12:37:40 +0100 Subject: [openbsc 0.15.0.621-80ab] testsuite: 3 5 failed In-Reply-To: References: Message-ID: <20170110113740.GA1988@ass40.sysmocom.de> On Tue, Jan 10, 2017 at 09:23:39AM +0100, Sylvain Munaut wrote: > First one is a crash, would need to see the actual backtrace to see > what's up. Second is a linking issue, your library setup is broken > somewhere. In other words, 'make clean; make install' in all self built source trees may fix it. ~N -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From nhofmeyr at sysmocom.de Tue Jan 10 11:45:16 2017 From: nhofmeyr at sysmocom.de (Neels Hofmeyr) Date: Tue, 10 Jan 2017 12:45:16 +0100 Subject: gerrit #1411, asan fix for egprs_puncturing_values Message-ID: <20170110114516.GB1988@ass40.sysmocom.de> I would like to see https://gerrit.osmocom.org/#/c/1411/ fixed and merged. Firstly, the way the code is written leaves it unclear whether it works as intended. Secondly, this is blocking the effort to do more sanitizer builds in jenkins / gerrit build jobs. Aravind, would you please provide feedback on your availability -- will you get around to this any time soon, or should we try to assign this to someone else? Thanks! ~N -- - Neels Hofmeyr http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Gesch?ftsf?hrer / Managing Directors: Harald Welte -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From ynezz at true.cz Tue Jan 10 13:01:59 2017 From: ynezz at true.cz (Petr =?iso-8859-2?Q?=A9tetiar?=) Date: Tue, 10 Jan 2017 14:01:59 +0100 Subject: Quectel EC20 question In-Reply-To: <20170110020337.izbphso6cvh7ubdz@nataraja> References: <20170109195751.GC12143@ibawizard.net> <20170110020337.izbphso6cvh7ubdz@nataraja> Message-ID: <20170110130158.GE12143@ibawizard.net> Harald Welte [2017-01-10 03:03:37]: Hi, > I think it is simply the fact that (at least) for the Linux on the Cortex-A5 it > doesn't make any difference whether it's running on a 9615 or a 9215. indeed, but I was rather asking this, because it's probably better to look around for documentation for 9215 then for 9615. Maybe some blocks are going to be same, but who knows. I should probably download finaly the kernel sources and look around to find this question myself :-) > The difference is presumably primarily in the cellular radio interface > and possibly DSP capacity? From the few publicly available information > the 9615 adds Ev-DO (3GPP2) capability, while the 9215 is GSM/UMTS/LTE > (3GPP) only? Maybe it's the only difference, yes. > btw: I just created a new mailing list for any future public discussion > on the Qualcomm Linux based cellular modems Good, thanks! -- ynezz From msuraev at sysmocom.de Tue Jan 10 13:29:58 2017 From: msuraev at sysmocom.de (Max) Date: Tue, 10 Jan 2017 14:29:58 +0100 Subject: gerrit #1411, asan fix for egprs_puncturing_values In-Reply-To: <20170110114516.GB1988@ass40.sysmocom.de> References: <20170110114516.GB1988@ass40.sysmocom.de> Message-ID: <8db30070-794e-18d0-38a4-1550cfbbc08f@sysmocom.de> While this is ongoing we could enable sanitizer builds for all the libosmo* projects. The point which is unclear to me yet, should all the dependencies build with sanitizer enabled as well, or we can enable it on per-project basis independently? For example: libosmo-abis depends on libosmocore. Does it mean that we should build libosmocore with sanitizer enabled as well when building it as a dependency for libosmo-abis sanitizer build? On 10.01.2017 12:45, Neels Hofmeyr wrote: > Secondly, this is blocking the effort to do more sanitizer builds in jenkins > / gerrit build jobs. -- Max Suraev http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Geschaeftsfuehrer / Managing Director: Harald Welte From nhofmeyr at sysmocom.de Tue Jan 10 15:33:36 2017 From: nhofmeyr at sysmocom.de (Neels Hofmeyr) Date: Tue, 10 Jan 2017 16:33:36 +0100 Subject: gerrit #1411, asan fix for egprs_puncturing_values In-Reply-To: <8db30070-794e-18d0-38a4-1550cfbbc08f@sysmocom.de> References: <20170110114516.GB1988@ass40.sysmocom.de> <8db30070-794e-18d0-38a4-1550cfbbc08f@sysmocom.de> Message-ID: <20170110153336.GD3082@ass40.sysmocom.de> On Tue, Jan 10, 2017 at 02:29:58PM +0100, Max wrote: > While this is ongoing we could enable sanitizer builds for all the libosmo* > projects. I'll gladly switch more builds to sanitizer when we have ./configure --enable-sanitize options, as I said before. Would (still) be nice to see some patches like https://gerrit.osmocom.org/#/c/974/ submitted for the other libraries. Thanks! ~N -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From holger at freyther.de Tue Jan 10 20:13:40 2017 From: holger at freyther.de (Holger Freyther) Date: Tue, 10 Jan 2017 21:13:40 +0100 Subject: planet via https (was Re: redmine main page) In-Reply-To: <20170109192251.yuwgvi5hsklebqqc@nataraja> References: <20170109151227.GA3455@my.box> <9E4ED36E-31B0-4904-9727-27BAB4AA28C1@freyther.de> <20170109192251.yuwgvi5hsklebqqc@nataraja> Message-ID: <43E274C4-65FD-44A8-BB6B-779327898E08@freyther.de> > On 9 Jan 2017, at 20:22, Harald Welte wrote: > > Dear all, Hi! > There probably was never any intention to have planet.osmocom.org be > reachable via https, at least not consciously and not by me. It is > probably simply an artefact of some other https service running on the > same IP address, completely unrelated. my apologies for temporarily adding HSTS without fully understanding the consequences. Time will solve it (and make browsers expire it but I don't remember the max-age that I used) > An alternative solution might be a reverse proxy, with a https-proxy at > the osmocom server, which then forwards wia http to the real server > (openmoko)? This might be a neat solution to fix-up the HSTS issue I caused. I would not want to separate the three planes but playing proxy sounds reasonable. Shall I create a ticket for you updating the DNS to point to the usual CNAME for our Osmocom webservices? thank you holger From laforge at gnumonks.org Tue Jan 10 20:17:52 2017 From: laforge at gnumonks.org (Harald Welte) Date: Tue, 10 Jan 2017 21:17:52 +0100 Subject: planet via https (was Re: redmine main page) In-Reply-To: <43E274C4-65FD-44A8-BB6B-779327898E08@freyther.de> References: <20170109151227.GA3455@my.box> <9E4ED36E-31B0-4904-9727-27BAB4AA28C1@freyther.de> <20170109192251.yuwgvi5hsklebqqc@nataraja> <43E274C4-65FD-44A8-BB6B-779327898E08@freyther.de> Message-ID: <20170110201752.tpbhor4typ2ro22y@nataraja> Hi Holger, On Tue, Jan 10, 2017 at 09:13:40PM +0100, Holger Freyther wrote: > my apologies for temporarily adding HSTS without fully understanding > the consequences. Time will solve it (and make browsers expire it but > I don't remember the max-age that I used) absolutely no issue at all, don't worry. I didn't even know HSTS existed.... > Shall I create a ticket for you updating the DNS to point to the usual > CNAME for our Osmocom webservices? sure, feel free to do that once the proxy is running. Thanks! -- - Harald Welte http://laforge.gnumonks.org/ ============================================================================ "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6) From nhofmeyr at sysmocom.de Wed Jan 11 14:58:35 2017 From: nhofmeyr at sysmocom.de (Neels Hofmeyr) Date: Wed, 11 Jan 2017 15:58:35 +0100 Subject: gerrit #1411, asan fix for egprs_puncturing_values In-Reply-To: <20170110114516.GB1988@ass40.sysmocom.de> References: <20170110114516.GB1988@ass40.sysmocom.de> Message-ID: <20170111145835.GA4827@ass40.sysmocom.de> FYI, Aravind replied off-list. I will move back to gerrit #1411 for further comments. ~N On Tue, Jan 10, 2017 at 12:45:16PM +0100, Neels Hofmeyr wrote: > I would like to see https://gerrit.osmocom.org/#/c/1411/ fixed and merged. [...] -- - Neels Hofmeyr http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Gesch?ftsf?hrer / Managing Directors: Harald Welte -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From msuraev at sysmocom.de Wed Jan 11 19:07:08 2017 From: msuraev at sysmocom.de (Max) Date: Wed, 11 Jan 2017 20:07:08 +0100 Subject: jenkins env update Message-ID: <3d74ea41-f01d-a676-d741-ac887e6d549e@sysmocom.de> Hi. Please add autoconf-archive package to jenkins build slaves. It contains handy macro necessary for gerrit #1368. -- Max Suraev http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Geschaeftsfuehrer / Managing Director: Harald Welte From axilirator at gmail.com Thu Jan 12 11:30:12 2017 From: axilirator at gmail.com (Vadim Yanitskiy) Date: Thu, 12 Jan 2017 18:30:12 +0700 Subject: [PATCH 4/4] core/conv: Add optimized Viterbi decoding Message-ID: Hi Tom and all, After a quick look at the 4th patch, related to your optimized Viterbi decoder, I have noticed that currently the convolutional code definitions from the 'src/gsm/gsm0503_conv.c' are out of the 'tests/conv' test coverage... So, I would like to extend the test coverage. All I need are the test vectors, which I'll add to existing ones. Some of them I already found in your 4th patch, but some pending I need to write myself. Right now I have a simple question... Let's look at one example: { .name = "GSM RACH (non-recursive, flushed, not punctured)", .code = &gsm_conv_rach, .in_len = 14, .out_len = 36, // ??? .has_vec = 0, .vec_in = { }, .vec_out = { }, } As I noticed, the 'in_len' may be taken from the code definition: const struct osmo_conv_code gsm0503_rach = { .N = 2, .K = 5, .len = 14, // The 'in_len' is here! .next_output = xcch_output, .next_state = xcch_state, }; But I don't know how to calculate the 'out_len'... Could you please give me some hint? I already started to work on your 4th patch: https://gerrit.osmocom.org/1542 https://gerrit.osmocom.org/1543 With best regards, Vadim Yanitskiy. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nhofmeyr at sysmocom.de Thu Jan 12 11:51:58 2017 From: nhofmeyr at sysmocom.de (Neels Hofmeyr) Date: Thu, 12 Jan 2017 12:51:58 +0100 Subject: jenkins env update In-Reply-To: <3d74ea41-f01d-a676-d741-ac887e6d549e@sysmocom.de> References: <3d74ea41-f01d-a676-d741-ac887e6d549e@sysmocom.de> Message-ID: <20170112115158.GA1826@my.box> On Wed, Jan 11, 2017 at 08:07:08PM +0100, Max wrote: > Please add autoconf-archive package to jenkins build slaves. It contains > handy macro necessary for gerrit #1368. Added autoconf-archive: * to the build slave master OS * to the docker file used to build openbsc.git * to the FreeBSD build slave Please verify that it works as intended, thanks! ~N -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From msuraev at sysmocom.de Thu Jan 12 12:30:04 2017 From: msuraev at sysmocom.de (Max) Date: Thu, 12 Jan 2017 13:30:04 +0100 Subject: jenkins env update In-Reply-To: <20170112115158.GA1826@my.box> References: <3d74ea41-f01d-a676-d741-ac887e6d549e@sysmocom.de> <20170112115158.GA1826@my.box> Message-ID: <71b4bd63-52a7-955e-ebb8-5300266ad2b0@sysmocom.de> Thanks! Works like a charm now. On 12.01.2017 12:51, Neels Hofmeyr wrote: > Added autoconf-archive: > > * to the build slave master OS > * to the docker file used to build openbsc.git > * to the FreeBSD build slave > > Please verify that it works as intended, thanks! > > ~N > -- Max Suraev http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Geschaeftsfuehrer / Managing Director: Harald Welte From snehasish.cse at live.com Sat Jan 14 16:33:52 2017 From: snehasish.cse at live.com (Snehasish Kar) Date: Sat, 14 Jan 2017 16:33:52 +0000 Subject: Intregation with usrp Message-ID: Hi I want to intregate my openbsc code with a usrp. Please help me with it. BR Snehasish From nhofmeyr at sysmocom.de Mon Jan 16 12:10:12 2017 From: nhofmeyr at sysmocom.de (Neels Hofmeyr) Date: Mon, 16 Jan 2017 13:10:12 +0100 Subject: Intregation with usrp In-Reply-To: References: Message-ID: <20170116121012.GB2434@my.box> On Sat, Jan 14, 2017 at 04:33:52PM +0000, Snehasish Kar wrote: > Hi > I want to intregate my openbsc code with a usrp. Please help me with it. This wiki page might help, otherwise search the wiki until you have actual questions to ask... https://osmocom.org/projects/osmotrx/wiki/OsmoTRX https://osmocom.org/search?utf8=%E2%9C%93&q=usrp&scope=all&all_words=&all_words=1&titles_only=&wiki_pages=1&projects=1&attachments=0&options=0&commit=Submit ~N -- - Neels Hofmeyr http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Gesch?ftsf?hrer / Managing Directors: Harald Welte -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From akibsayyed at gmail.com Mon Jan 16 13:03:57 2017 From: akibsayyed at gmail.com (Akib Sayyed) Date: Mon, 16 Jan 2017 17:03:57 +0400 Subject: What hardware is needed for 3G Message-ID: Dear list I would like to know what hardware is needed for running 3G network. -- Akib Sayyed Matrix-Shell akibsayyed at gmail.com akibsayyed at matrixshell.com Mob:- +91-966-514-2243 -------------- next part -------------- An HTML attachment was scrubbed... URL: From axilirator at gmail.com Mon Jan 16 13:29:27 2017 From: axilirator at gmail.com (Vadim Yanitskiy) Date: Mon, 16 Jan 2017 20:29:27 +0700 Subject: [PATCH 4/4] core/conv: Add optimized Viterbi decoding In-Reply-To: References: Message-ID: Thanks to Sylvain, He pointed me out to the src/conv.c//osmo_conv_get_output_length(). I just implemented this function in Python, and finished related commit. With best regards, Vadim Yanitskiy. 2017-01-12 18:30 GMT+07:00 Vadim Yanitskiy : > Hi Tom and all, > > After a quick look at the 4th patch, related to your optimized > Viterbi decoder, I have noticed that currently the convolutional > code definitions from the 'src/gsm/gsm0503_conv.c' are out of > the 'tests/conv' test coverage... > > So, I would like to extend the test coverage. All I need are > the test vectors, which I'll add to existing ones. Some of them > I already found in your 4th patch, but some pending I need to > write myself. > > Right now I have a simple question... > Let's look at one example: > > { > .name = "GSM RACH (non-recursive, flushed, not punctured)", > .code = &gsm_conv_rach, > .in_len = 14, > .out_len = 36, // ??? > .has_vec = 0, > .vec_in = { }, > .vec_out = { }, > } > > As I noticed, the 'in_len' may be taken from the code definition: > > const struct osmo_conv_code gsm0503_rach = { > .N = 2, > .K = 5, > .len = 14, // The 'in_len' is here! > .next_output = xcch_output, > .next_state = xcch_state, > }; > > But I don't know how to calculate the 'out_len'... > Could you please give me some hint? > > I already started to work on your 4th patch: > https://gerrit.osmocom.org/1542 > https://gerrit.osmocom.org/1543 > > With best regards, > Vadim Yanitskiy. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nhofmeyr at sysmocom.de Mon Jan 16 13:35:37 2017 From: nhofmeyr at sysmocom.de (Neels Hofmeyr) Date: Mon, 16 Jan 2017 14:35:37 +0100 Subject: What hardware is needed for 3G In-Reply-To: References: Message-ID: <20170116133537.GA6032@my.box> On Mon, Jan 16, 2017 at 05:03:57PM +0400, Akib Sayyed wrote: > Dear list > > I would like to know what hardware is needed for running 3G network. You need a 3G femto cell that talks the Iuh protocol over IP. Related: sysmocom's recent announcement for free femto cells: https://www.sysmocom.de/ or https://osmocom.org/news/62 ~N -- - Neels Hofmeyr http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Gesch?ftsf?hrer / Managing Directors: Harald Welte -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From nhofmeyr at sysmocom.de Mon Jan 16 14:05:01 2017 From: nhofmeyr at sysmocom.de (Neels Hofmeyr) Date: Mon, 16 Jan 2017 15:05:01 +0100 Subject: jenkins.osmocom.org build slave Message-ID: <20170116140500.GB6032@my.box> Previously I wrote about the "Broken Pipe" error sporadically causing our gerrit tests to fail for unknown reasons. To try and avoid those (successfully as it seems), I reduced the nr of executors for our OsmocomBuild1 debian slave to 2; used to be 6 IIRC. My argument was that 'make -j 9' would anyway utlize the resources, except during the python testing phase. But the build slave queue is getting awfully long sometimes and builds are just sitting and waiting for a long time. But when I 'top' on the build slave, I see the CPU idling between 50% and 90% ... assuming that the CPU activity in docker is also shown on the host OS. So now I increased the nr of executors to 3, seraching the optimum that still avoids the 'Broken Pipe' error. Would of course be much nicer to fix this particular curious failure and just hammer the nr of executors up to the roof again. ~N -- - Neels Hofmeyr http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Gesch?ftsf?hrer / Managing Directors: Harald Welte -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From holger at freyther.de Mon Jan 16 14:44:35 2017 From: holger at freyther.de (Holger Freyther) Date: Mon, 16 Jan 2017 15:44:35 +0100 Subject: jenkins.osmocom.org build slave In-Reply-To: <20170116140500.GB6032@my.box> References: <20170116140500.GB6032@my.box> Message-ID: > On 16 Jan 2017, at 15:05, Neels Hofmeyr wrote: > > But the build slave queue is getting awfully long sometimes and builds are just > sitting and waiting for a long time. But when I 'top' on the build slave, I see > the CPU idling between 50% and 90% ... assuming that the CPU activity in docker > is also shown on the host OS. So now I increased the nr of executors to 3, > seraching the optimum that still avoids the 'Broken Pipe' error. Would of > course be much nicer to fix this particular curious failure and just hammer the > nr of executors up to the roof again. thank you. I assume we run into a user limit but I don't know how to make the kernel report it (or which mib file to read). So another dimension is to use sysctl to tune things... holger From msuraev at sysmocom.de Mon Jan 16 14:54:22 2017 From: msuraev at sysmocom.de (Max) Date: Mon, 16 Jan 2017 15:54:22 +0100 Subject: redmine issue Message-ID: <2a7186b5-793b-c6da-a0f8-00a0faf5fb34@sysmocom.de> Hi. I've hit strange issue with redmine: https://osmocom.org/issues/1836 gives 403 error but https://osmocom.org/issues/71 works for example. Is this intended due to some access control restrictions or it's a glitch in our setup? -- Max Suraev http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Geschaeftsfuehrer / Managing Director: Harald Welte From holger at freyther.de Mon Jan 16 16:38:18 2017 From: holger at freyther.de (Holger Freyther) Date: Mon, 16 Jan 2017 17:38:18 +0100 Subject: redmine issue In-Reply-To: <2a7186b5-793b-c6da-a0f8-00a0faf5fb34@sysmocom.de> References: <2a7186b5-793b-c6da-a0f8-00a0faf5fb34@sysmocom.de> Message-ID: <463126C6-3605-4C38-A49D-C53F8CE60C21@freyther.de> > On 16 Jan 2017, at 15:54, Max wrote: > > Hi. > > I've hit strange issue with redmine: > https://osmocom.org/issues/1836 gives 403 error > but > https://osmocom.org/issues/71 works for example. > > Is this intended due to some access control restrictions or it's a glitch in our setup? 404 -> during trac/redmine import I deleted projects/tickets but the id is a "auto increment" so it will always move forward and some ticket numbers simply do not exist. 403 -> The ticket belongs to the "SIM card related Projects" project but the ticket module has been disabled for this project.. hence no one has permission to see this ticket. The project has only one such hidden ticket. cheers holger From akibsayyed at gmail.com Tue Jan 17 07:10:45 2017 From: akibsayyed at gmail.com (Akib Sayyed) Date: Tue, 17 Jan 2017 11:10:45 +0400 Subject: What hardware is needed for 3G In-Reply-To: <20170116133537.GA6032@my.box> References: <20170116133537.GA6032@my.box> Message-ID: What specific vendor and model number is required for same. On Mon, Jan 16, 2017 at 5:35 PM, Neels Hofmeyr wrote: > On Mon, Jan 16, 2017 at 05:03:57PM +0400, Akib Sayyed wrote: > > Dear list > > > > I would like to know what hardware is needed for running 3G network. > > You need a 3G femto cell that talks the Iuh protocol over IP. > Related: sysmocom's recent announcement for free femto cells: > https://www.sysmocom.de/ or https://osmocom.org/news/62 > > ~N > > > -- > - Neels Hofmeyr http://www.sysmocom.de/ > ======================================================================= > * sysmocom - systems for mobile communications GmbH > * Alt-Moabit 93 > * 10559 Berlin, Germany > * Sitz / Registered office: Berlin, HRB 134158 B > * Gesch?ftsf?hrer / Managing Directors: Harald Welte > -- Akib Sayyed Matrix-Shell akibsayyed at gmail.com akibsayyed at matrixshell.com Mob:- +91-966-514-2243 -------------- next part -------------- An HTML attachment was scrubbed... URL: From msuraev at sysmocom.de Tue Jan 17 11:00:16 2017 From: msuraev at sysmocom.de (Max) Date: Tue, 17 Jan 2017 12:00:16 +0100 Subject: AMR SID length? Message-ID: <796d372f-c954-bf88-11e7-8f4662f3c919@sysmocom.de> Hi. There seems to be a disagreement between Osmocom libraries as to which is the length of AMR SID RTP payload. According to libosmocodec it's 7 bytes (see amr_len_by_ft in gsm690.c), according to libosmo-netif it's 6 bytes (see amr_ft_to_bytes in amr.c). However, than I look at 3GPP TS 26.101 Table 6 it seems like it should be 8 bytes. Reading http://www.rfc-base.org/txt/rfc-4867.txt did not shed a light except that it can't be lower than 5 bytes. Please help me out - what's the right number of bytes? -- Max Suraev http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Geschaeftsfuehrer / Managing Director: Harald Welte From laforge at gnumonks.org Tue Jan 17 11:18:50 2017 From: laforge at gnumonks.org (Harald Welte) Date: Tue, 17 Jan 2017 12:18:50 +0100 Subject: What hardware is needed for 3G In-Reply-To: References: <20170116133537.GA6032@my.box> Message-ID: <20170117111850.2foihmdmnm2x37ne@nataraja> On Tue, Jan 17, 2017 at 11:10:45AM +0400, Akib Sayyed wrote: > What specific vendor and model number is required for same. Any vendor or model that supports Iuh ?!? -- - Harald Welte http://laforge.gnumonks.org/ ============================================================================ "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6) From akibsayyed at gmail.com Tue Jan 17 13:12:28 2017 From: akibsayyed at gmail.com (Akib Sayyed) Date: Tue, 17 Jan 2017 17:12:28 +0400 Subject: What hardware is needed for 3G In-Reply-To: <20170117111850.2foihmdmnm2x37ne@nataraja> References: <20170116133537.GA6032@my.box> <20170117111850.2foihmdmnm2x37ne@nataraja> Message-ID: Thanks for information. On Tue, Jan 17, 2017 at 3:18 PM, Harald Welte wrote: > On Tue, Jan 17, 2017 at 11:10:45AM +0400, Akib Sayyed wrote: > > What specific vendor and model number is required for same. > > Any vendor or model that supports Iuh ?!? > > -- > - Harald Welte > http://laforge.gnumonks.org/ > ============================================================ > ================ > "Privacy in residential applications is a desirable marketing option." > (ETSI EN 300 175-7 Ch. > A6) > -- Akib Sayyed Matrix-Shell akibsayyed at gmail.com akibsayyed at matrixshell.com Mob:- +91-966-514-2243 -------------- next part -------------- An HTML attachment was scrubbed... URL: From akibsayyed at gmail.com Tue Jan 17 13:17:54 2017 From: akibsayyed at gmail.com (Akib Sayyed) Date: Tue, 17 Jan 2017 17:17:54 +0400 Subject: What hardware is needed for 3G In-Reply-To: References: <20170116133537.GA6032@my.box> <20170117111850.2foihmdmnm2x37ne@nataraja> Message-ID: can you guys suggest any place where we can buy these femtocells. On Tue, Jan 17, 2017 at 5:12 PM, Akib Sayyed wrote: > Thanks for information. > > On Tue, Jan 17, 2017 at 3:18 PM, Harald Welte > wrote: > >> On Tue, Jan 17, 2017 at 11:10:45AM +0400, Akib Sayyed wrote: >> > What specific vendor and model number is required for same. >> >> Any vendor or model that supports Iuh ?!? >> >> -- >> - Harald Welte >> http://laforge.gnumonks.org/ >> ============================================================ >> ================ >> "Privacy in residential applications is a desirable marketing option." >> (ETSI EN 300 175-7 Ch. >> A6) >> > > > > -- > Akib Sayyed > Matrix-Shell > akibsayyed at gmail.com > akibsayyed at matrixshell.com > Mob:- +91-966-514-2243 > > -- Akib Sayyed Matrix-Shell akibsayyed at gmail.com akibsayyed at matrixshell.com Mob:- +91-966-514-2243 -------------- next part -------------- An HTML attachment was scrubbed... URL: From holger at freyther.de Tue Jan 17 14:34:00 2017 From: holger at freyther.de (Holger Freyther) Date: Tue, 17 Jan 2017 15:34:00 +0100 Subject: osmo_sock_init API changes Message-ID: <0A1E5972-E5D3-4192-9D97-0B441473E517@freyther.de> Hey, osmo_sock_init is nice but I have hit a missing feature. I want to be able to make an outgoing connection but need to specify the src ip (and maybe src port too). a.) I could extend osmo_sock_init to have a src_ip and src_port in the parameter and issue a bind between the socket(2) and connect(2). b.) I could add a cb function that is passing the fd to the cb and do the bind (or others do setsockopt). Any other ideas? Preferences? Comments? holger From laforge at gnumonks.org Tue Jan 17 16:42:05 2017 From: laforge at gnumonks.org (Harald Welte) Date: Tue, 17 Jan 2017 17:42:05 +0100 Subject: Intregation with usrp In-Reply-To: References: Message-ID: <20170117164205.k2kvwtauyooi6rjn@nataraja> Dear Snehasish, On Sat, Jan 14, 2017 at 04:33:52PM +0000, Snehasish Kar wrote: > I want to intregate my openbsc code with a usrp. Please help me with it. OpenBSC never "integrates" directly with a USRP. OsmoTRX speaks to the USRP, and OsmoTRX talks to OsmoBTS, which then speaks Abis to OpenBSC. Also, you can use OpenBSC with OsmoBTS and OsmoTRX and a USRP for many years. Your questions sounds as if that was a kind of new configuration that hadn't been supported before? What kind of code are you referring to when saying "my openbsc code"? -- - Harald Welte http://laforge.gnumonks.org/ ============================================================================ "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6) From snehasish.cse at live.com Tue Jan 17 17:26:33 2017 From: snehasish.cse at live.com (Snehasish Kar) Date: Tue, 17 Jan 2017 17:26:33 +0000 Subject: Intregation with usrp In-Reply-To: <20170117164205.k2kvwtauyooi6rjn@nataraja> References: <20170117164205.k2kvwtauyooi6rjn@nataraja> Message-ID: Sorry for that, the thing is I tried compiling osmo-BTs but it gave a lots of error, seems that the current version of libosmo-abis have some compatibility issue with Osmo-bts. And I don't find any wiki on how to compile osmo-BTS. BR Snehasish Kar > On 17-Jan-2017, at 10:44 PM, Harald Welte wrote: > > Dear Snehasish, > >> On Sat, Jan 14, 2017 at 04:33:52PM +0000, Snehasish Kar wrote: >> I want to intregate my openbsc code with a usrp. Please help me with it. > > OpenBSC never "integrates" directly with a USRP. OsmoTRX speaks to the > USRP, and OsmoTRX talks to OsmoBTS, which then speaks Abis to OpenBSC. > > Also, you can use OpenBSC with OsmoBTS and OsmoTRX and a USRP for many > years. Your questions sounds as if that was a kind of new configuration > that hadn't been supported before? > > What kind of code are you referring to when saying "my openbsc code"? > > -- > - Harald Welte http://laforge.gnumonks.org/ > ============================================================================ > "Privacy in residential applications is a desirable marketing option." > (ETSI EN 300 175-7 Ch. A6) From msuraev at sysmocom.de Tue Jan 17 18:07:06 2017 From: msuraev at sysmocom.de (Max) Date: Tue, 17 Jan 2017 19:07:06 +0100 Subject: redmine issue In-Reply-To: <463126C6-3605-4C38-A49D-C53F8CE60C21@freyther.de> References: <2a7186b5-793b-c6da-a0f8-00a0faf5fb34@sysmocom.de> <463126C6-3605-4C38-A49D-C53F8CE60C21@freyther.de> Message-ID: What's so special about sim projects? Should tickets module be enabled for them? On 16.01.2017 17:38, Holger Freyther wrote: > > 403 -> The ticket belongs to the "SIM card related Projects" project but the ticket > module has been disabled for this project.. hence no one has permission to see this > ticket. The project has only one such hidden ticket. > > > cheers > holger -- Max Suraev http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Geschaeftsfuehrer / Managing Director: Harald Welte From msuraev at sysmocom.de Tue Jan 17 19:42:16 2017 From: msuraev at sysmocom.de (Max) Date: Tue, 17 Jan 2017 20:42:16 +0100 Subject: osmo_sock_init API changes In-Reply-To: <0A1E5972-E5D3-4192-9D97-0B441473E517@freyther.de> References: <0A1E5972-E5D3-4192-9D97-0B441473E517@freyther.de> Message-ID: <323f02ee-61e0-e09f-af9e-9312991395d0@sysmocom.de> Hi. Currently there's a way to init and register socket for "server side" (BSC_FD_READ) via osmo_sock_init_ofd() but there seems to be no counterpart for "client side" (BSC_FD_WRITE) which could be useful in few places too. We can modify osmo_sock_init_ofd() to check for OSMO_SOCK_F_CONNECT flag and register with BSC_FD_WRITE or we can add separate function. Or maybe it's already available somehow and I just don't see it. On 17.01.2017 15:34, Holger Freyther wrote: > Hey, > > osmo_sock_init is nice but I have hit a missing feature. I want to > be able to make an outgoing connection but need to specify the src > ip (and maybe src port too). > > a.) I could extend osmo_sock_init to have a src_ip and src_port in > the parameter and issue a bind between the socket(2) and connect(2). > > b.) I could add a cb function that is passing the fd to the cb and > do the bind (or others do setsockopt). > > > Any other ideas? Preferences? Comments? > > holger > -- Max Suraev http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Geschaeftsfuehrer / Managing Director: Harald Welte From admin at opensuse.org Tue Jan 17 20:01:06 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 17 Jan 2017 20:01:06 +0000 Subject: Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <587e780d882b5_6baf4b1184917cc@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-trx failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-trx Last lines of build log: [ 408s] #define HAVE_SYS_TYPES_H 1 [ 408s] #define HAVE_SYS_STAT_H 1 [ 408s] #define HAVE_STDLIB_H 1 [ 408s] #define HAVE_STRING_H 1 [ 408s] #define HAVE_MEMORY_H 1 [ 408s] #define HAVE_STRINGS_H 1 [ 408s] #define HAVE_INTTYPES_H 1 [ 408s] #define HAVE_STDINT_H 1 [ 408s] #define HAVE_UNISTD_H 1 [ 408s] #define HAVE_DLFCN_H 1 [ 408s] #define LT_OBJDIR ".libs/" [ 408s] #define STDC_HEADERS 1 [ 408s] #define HAVE_BYTESWAP_H 1 [ 408s] #define TIME_WITH_SYS_TIME 1 [ 408s] [ 408s] configure: exit 1 [ 408s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/x86_64-linux-gnu --libexecdir=${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 408s] debian/rules:6: recipe for target 'build' failed [ 408s] make: *** [build] Error 255 [ 408s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 408s] [ 408s] cloud116 failed "build osmo-trx_0.1.9.20170117.dsc" at Tue Jan 17 20:00:47 UTC 2017. [ 408s] [ 408s] ### VM INTERACTION START ### [ 411s] [ 364.791340] reboot: Power down [ 412s] ### VM INTERACTION END ### [ 412s] [ 412s] cloud116 failed "build osmo-trx_0.1.9.20170117.dsc" at Tue Jan 17 20:00:52 UTC 2017. [ 412s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jan 17 20:02:31 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 17 Jan 2017 20:02:31 +0000 Subject: Build failure of network:osmocom:nightly/osmo-stp in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <587e787ce9009_6baf4b11849214a@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-stp/xUbuntu_16.10/i586 Package network:osmocom:nightly/osmo-stp failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-stp Last lines of build log: [ 80s] gcc -DHAVE_CONFIG_H -I. -I.. -I../include -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/ -DNO_UNIPORTE -g -O2 -fdebug-prefix-map=/usr/src/packages/BUILD=. -fstack-protector-strong -Wformat -Werror=format-security -c -o vty_interface_cmds.o vty_interface_cmds.c [ 80s] gcc -DHAVE_CONFIG_H -I. -I.. -I../include -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/ -DNO_UNIPORTE -g -O2 -fdebug-prefix-map=/usr/src/packages/BUILD=. -fstack-protector-strong -Wformat -Werror=format-security -c -o mgcp_patch.o mgcp_patch.c [ 80s] gcc -DHAVE_CONFIG_H -I. -I.. -I../include -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/ -DNO_UNIPORTE -g -O2 -fdebug-prefix-map=/usr/src/packages/BUILD=. -fstack-protector-strong -Wformat -Werror=format-security -c -o mgcp_callagent.o mgcp_callagent.c [ 80s] gcc -DHAVE_CONFIG_H -I. -I.. -I../include -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/ -DNO_UNIPORTE -g -O2 -fdebug-prefix-map=/usr/src/packages/BUILD=. -fstack-protector-strong -Wformat -Werror=format-security -c -o isup_filter.o isup_filter.c [ 80s] gcc -Wall -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/ -DNO_UNIPORTE -g -O2 -fdebug-prefix-map=/usr/src/packages/BUILD=. -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -o cellmgr_ng main.o mtp_layer3.o thread.o ipaccess.o pcap.o bss_patch.o bssap_sccp.o bsc_sccp.o bsc_ussd.o links.o msc_conn.o link_udp.o snmp_mtp.o debug.o isup.o mtp_link.o counter.o sccp_state.o bsc.o ss7_application.o vty_interface_legacy.o vty_interface_cmds.o mgcp_patch.o mgcp_callagent.o isup_filter.o -ltalloc -losmocore -ltalloc -losmogsm -losmocore -ltalloc -losmovty -losmocore -losmosccp -losmoxua -lpthread -lnetsnmp -lcrypto [ 80s] /usr/lib/gcc/i686-linux-gnu/6/../../../i386-linux-gnu/libosmosccp.so: undefined reference to `talloc_free' [ 80s] collect2: error: ld returned 1 exit status [ 80s] Makefile:425: recipe for target 'cellmgr_ng' failed [ 80s] make[3]: *** [cellmgr_ng] Error 1 [ 80s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 80s] Makefile:380: recipe for target 'all-recursive' failed [ 80s] make[2]: *** [all-recursive] Error 1 [ 80s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 80s] Makefile:321: recipe for target 'all' failed [ 80s] make[1]: *** [all] Error 2 [ 80s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 80s] dh_auto_build: make -j1 returned exit code 2 [ 80s] debian/rules:23: recipe for target 'build' failed [ 80s] make: *** [build] Error 2 [ 80s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 80s] [ 80s] lamb09 failed "build cellmgr-ng_1.4.7.20170117.dsc" at Tue Jan 17 20:02:13 UTC 2017. [ 80s] [ 80s] ### VM INTERACTION START ### [ 83s] [ 70.380259] reboot: Power down [ 84s] ### VM INTERACTION END ### [ 84s] [ 84s] lamb09 failed "build cellmgr-ng_1.4.7.20170117.dsc" at Tue Jan 17 20:02:17 UTC 2017. [ 84s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jan 17 20:03:41 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 17 Jan 2017 20:03:41 +0000 Subject: Build failure of network:osmocom:nightly/osmo-stp in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <587e78aabe103_6abf4b118497596@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-stp/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-stp failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-stp Last lines of build log: [ 123s] gcc -DHAVE_CONFIG_H -I. -I.. -I../include -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/ -DNO_UNIPORTE -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -c -o vty_interface_cmds.o vty_interface_cmds.c [ 123s] gcc -DHAVE_CONFIG_H -I. -I.. -I../include -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/ -DNO_UNIPORTE -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -c -o mgcp_patch.o mgcp_patch.c [ 123s] gcc -DHAVE_CONFIG_H -I. -I.. -I../include -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/ -DNO_UNIPORTE -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -c -o mgcp_callagent.o mgcp_callagent.c [ 123s] gcc -DHAVE_CONFIG_H -I. -I.. -I../include -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/ -DNO_UNIPORTE -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -c -o isup_filter.o isup_filter.c [ 123s] gcc -Wall -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/ -DNO_UNIPORTE -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -o cellmgr_ng main.o mtp_layer3.o thread.o ipaccess.o pcap.o bss_patch.o bssap_sccp.o bsc_sccp.o bsc_ussd.o links.o msc_conn.o link_udp.o snmp_mtp.o debug.o isup.o mtp_link.o counter.o sccp_state.o bsc.o ss7_application.o vty_interface_legacy.o vty_interface_cmds.o mgcp_patch.o mgcp_callagent.o isup_filter.o -ltalloc -losmocore -ltalloc -losmogsm -losmocore -ltalloc -losmovty -losmocore -losmosccp -losmoxua -lpthread -lnetsnmp -lcrypto [ 123s] /usr/lib/gcc/i686-linux-gnu/5/../../../i386-linux-gnu/libosmosccp.so: undefined reference to `talloc_free' [ 123s] collect2: error: ld returned 1 exit status [ 123s] Makefile:425: recipe for target 'cellmgr_ng' failed [ 123s] make[3]: *** [cellmgr_ng] Error 1 [ 123s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 123s] Makefile:380: recipe for target 'all-recursive' failed [ 123s] make[2]: *** [all-recursive] Error 1 [ 123s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 123s] Makefile:321: recipe for target 'all' failed [ 123s] make[1]: *** [all] Error 2 [ 123s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 123s] dh_auto_build: make -j1 returned exit code 2 [ 123s] debian/rules:23: recipe for target 'build' failed [ 123s] make: *** [build] Error 2 [ 123s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 123s] [ 123s] lamb16 failed "build cellmgr-ng_1.4.7.20170117.dsc" at Tue Jan 17 20:03:26 UTC 2017. [ 123s] [ 123s] ### VM INTERACTION START ### [ 127s] [ 113.842641] reboot: Power down [ 127s] ### VM INTERACTION END ### [ 127s] [ 127s] lamb16 failed "build cellmgr-ng_1.4.7.20170117.dsc" at Tue Jan 17 20:03:30 UTC 2017. [ 127s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jan 17 20:06:56 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 17 Jan 2017 20:06:56 +0000 Subject: Build failure of network:osmocom:nightly/osmo-stp in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <587e796b8587e_6b3f4b11849584e@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-stp/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/osmo-stp failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-stp Last lines of build log: [ 78s] gcc -DHAVE_CONFIG_H -I. -I.. -I../include -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/ -DNO_UNIPORTE -g -O2 -fdebug-prefix-map=/usr/src/packages/BUILD=. -fstack-protector-strong -Wformat -Werror=format-security -c -o vty_interface_cmds.o vty_interface_cmds.c [ 79s] gcc -DHAVE_CONFIG_H -I. -I.. -I../include -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/ -DNO_UNIPORTE -g -O2 -fdebug-prefix-map=/usr/src/packages/BUILD=. -fstack-protector-strong -Wformat -Werror=format-security -c -o mgcp_patch.o mgcp_patch.c [ 79s] gcc -DHAVE_CONFIG_H -I. -I.. -I../include -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/ -DNO_UNIPORTE -g -O2 -fdebug-prefix-map=/usr/src/packages/BUILD=. -fstack-protector-strong -Wformat -Werror=format-security -c -o mgcp_callagent.o mgcp_callagent.c [ 79s] gcc -DHAVE_CONFIG_H -I. -I.. -I../include -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/ -DNO_UNIPORTE -g -O2 -fdebug-prefix-map=/usr/src/packages/BUILD=. -fstack-protector-strong -Wformat -Werror=format-security -c -o isup_filter.o isup_filter.c [ 79s] gcc -Wall -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/ -DNO_UNIPORTE -g -O2 -fdebug-prefix-map=/usr/src/packages/BUILD=. -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -o cellmgr_ng main.o mtp_layer3.o thread.o ipaccess.o pcap.o bss_patch.o bssap_sccp.o bsc_sccp.o bsc_ussd.o links.o msc_conn.o link_udp.o snmp_mtp.o debug.o isup.o mtp_link.o counter.o sccp_state.o bsc.o ss7_application.o vty_interface_legacy.o vty_interface_cmds.o mgcp_patch.o mgcp_callagent.o isup_filter.o -ltalloc -losmocore -ltalloc -losmogsm -losmocore -ltalloc -losmovty -losmocore -losmosccp -losmoxua -lpthread -lnetsnmp -lcrypto [ 79s] /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libosmosccp.so: undefined reference to `talloc_free' [ 79s] collect2: error: ld returned 1 exit status [ 79s] Makefile:425: recipe for target 'cellmgr_ng' failed [ 79s] make[3]: *** [cellmgr_ng] Error 1 [ 79s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 79s] Makefile:380: recipe for target 'all-recursive' failed [ 79s] make[2]: *** [all-recursive] Error 1 [ 79s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 79s] Makefile:321: recipe for target 'all' failed [ 79s] make[1]: *** [all] Error 2 [ 79s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 79s] dh_auto_build: make -j1 returned exit code 2 [ 79s] debian/rules:23: recipe for target 'build' failed [ 79s] make: *** [build] Error 2 [ 79s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 79s] [ 79s] lamb07 failed "build cellmgr-ng_1.4.7.20170117.dsc" at Tue Jan 17 20:06:44 UTC 2017. [ 79s] [ 79s] ### VM INTERACTION START ### [ 82s] [ 68.378653] reboot: Power down [ 82s] ### VM INTERACTION END ### [ 82s] [ 82s] lamb07 failed "build cellmgr-ng_1.4.7.20170117.dsc" at Tue Jan 17 20:06:47 UTC 2017. [ 82s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jan 17 20:08:03 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 17 Jan 2017 20:08:03 +0000 Subject: Build failure of network:osmocom:nightly/libosmo-netif in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <587e79be9b3c2_6b3f4b1184959c4@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-netif/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/libosmo-netif failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmo-netif Last lines of build log: [ 194s] [ 194s] You may investigate any problem if you feel able to do so, in which [ 194s] case the test suite provides a good starting point. Its output may [ 194s] be found below `tests/testsuite.dir'. [ 194s] [ 194s] Makefile:641: recipe for target 'check-local' failed [ 194s] make[4]: *** [check-local] Error 1 [ 194s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 194s] Makefile:494: recipe for target 'check-am' failed [ 194s] make[3]: *** [check-am] Error 2 [ 194s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 194s] Makefile:466: recipe for target 'check-recursive' failed [ 194s] make[2]: *** [check-recursive] Error 1 [ 194s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 194s] Makefile:757: recipe for target 'check' failed [ 194s] make[1]: *** [check] Error 2 [ 194s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 194s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 194s] debian/rules:13: recipe for target 'build' failed [ 194s] make: *** [build] Error 2 [ 194s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 194s] [ 194s] cloud116 failed "build libosmo-netif_0.0.7.20170117.dsc" at Tue Jan 17 20:07:51 UTC 2017. [ 194s] [ 194s] ### VM INTERACTION START ### [ 198s] ### VM INTERACTION END ### [ 198s] [ 198s] cloud116 failed "build libosmo-netif_0.0.7.20170117.dsc" at Tue Jan 17 20:07:55 UTC 2017. [ 198s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jan 17 20:12:03 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 17 Jan 2017 20:12:03 +0000 Subject: Build failure of network:osmocom:nightly/osmo-stp in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <587e7ab7268fd_6abf4b118497711@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-stp/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-stp failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-stp Last lines of build log: [ 99s] gcc -DHAVE_CONFIG_H -I. -I.. -I../include -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/ -DNO_UNIPORTE -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -c -o vty_interface_cmds.o vty_interface_cmds.c [ 100s] gcc -DHAVE_CONFIG_H -I. -I.. -I../include -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/ -DNO_UNIPORTE -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -c -o mgcp_patch.o mgcp_patch.c [ 100s] gcc -DHAVE_CONFIG_H -I. -I.. -I../include -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/ -DNO_UNIPORTE -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -c -o mgcp_callagent.o mgcp_callagent.c [ 100s] gcc -DHAVE_CONFIG_H -I. -I.. -I../include -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/ -DNO_UNIPORTE -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -c -o isup_filter.o isup_filter.c [ 100s] gcc -Wall -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/ -DNO_UNIPORTE -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -o cellmgr_ng main.o mtp_layer3.o thread.o ipaccess.o pcap.o bss_patch.o bssap_sccp.o bsc_sccp.o bsc_ussd.o links.o msc_conn.o link_udp.o snmp_mtp.o debug.o isup.o mtp_link.o counter.o sccp_state.o bsc.o ss7_application.o vty_interface_legacy.o vty_interface_cmds.o mgcp_patch.o mgcp_callagent.o isup_filter.o -ltalloc -losmocore -ltalloc -losmogsm -losmocore -ltalloc -losmovty -losmocore -losmosccp -losmoxua -lpthread -lnetsnmp -lcrypto [ 100s] /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libosmosccp.so: undefined reference to `talloc_free' [ 100s] collect2: error: ld returned 1 exit status [ 100s] Makefile:425: recipe for target 'cellmgr_ng' failed [ 100s] make[3]: *** [cellmgr_ng] Error 1 [ 100s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 100s] Makefile:380: recipe for target 'all-recursive' failed [ 100s] make[2]: *** [all-recursive] Error 1 [ 100s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 100s] Makefile:321: recipe for target 'all' failed [ 100s] make[1]: *** [all] Error 2 [ 100s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 100s] dh_auto_build: make -j1 returned exit code 2 [ 100s] debian/rules:23: recipe for target 'build' failed [ 100s] make: *** [build] Error 2 [ 100s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 100s] [ 100s] lamb04 failed "build cellmgr-ng_1.4.7.20170117.dsc" at Tue Jan 17 20:11:55 UTC 2017. [ 100s] [ 100s] ### VM INTERACTION START ### [ 103s] [ 89.910909] reboot: Power down [ 103s] ### VM INTERACTION END ### [ 103s] [ 103s] lamb04 failed "build cellmgr-ng_1.4.7.20170117.dsc" at Tue Jan 17 20:11:58 UTC 2017. [ 103s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jan 17 20:12:37 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 17 Jan 2017 20:12:37 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <587e7ac9376b7_6baf4b11849256c@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.04/i586 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 219s] [ 219s] Makefile:718: recipe for target 'check-local' failed [ 219s] make[5]: *** [check-local] Error 1 [ 219s] make[5]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 219s] Makefile:569: recipe for target 'check-am' failed [ 219s] make[4]: *** [check-am] Error 2 [ 219s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 219s] Makefile:421: recipe for target 'check-recursive' failed [ 219s] make[3]: *** [check-recursive] Error 1 [ 219s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 219s] Makefile:484: recipe for target 'check-recursive' failed [ 219s] make[2]: *** [check-recursive] Error 1 [ 219s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 219s] Makefile:775: recipe for target 'check' failed [ 219s] make[1]: *** [check] Error 2 [ 219s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 219s] dh_auto_test: make -j1 check returned exit code 2 [ 219s] debian/rules:13: recipe for target 'build' failed [ 219s] make: *** [build] Error 2 [ 219s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 219s] [ 219s] cloud120 failed "build openbsc_0.15.1.20170117.dsc" at Tue Jan 17 20:12:17 UTC 2017. [ 219s] [ 219s] ### VM INTERACTION START ### [ 222s] [ 201.329022] reboot: Power down [ 223s] ### VM INTERACTION END ### [ 223s] [ 223s] cloud120 failed "build openbsc_0.15.1.20170117.dsc" at Tue Jan 17 20:12:21 UTC 2017. [ 223s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jan 17 19:54:30 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 17 Jan 2017 19:54:30 +0000 Subject: Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <587e7686bd2a6_6baf4b1184911b4@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-trx failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-trx Last lines of build log: [ 145s] #define HAVE_SYS_TYPES_H 1 [ 145s] #define HAVE_SYS_STAT_H 1 [ 145s] #define HAVE_STDLIB_H 1 [ 145s] #define HAVE_STRING_H 1 [ 145s] #define HAVE_MEMORY_H 1 [ 145s] #define HAVE_STRINGS_H 1 [ 145s] #define HAVE_INTTYPES_H 1 [ 145s] #define HAVE_STDINT_H 1 [ 145s] #define HAVE_UNISTD_H 1 [ 145s] #define HAVE_DLFCN_H 1 [ 145s] #define LT_OBJDIR ".libs/" [ 145s] #define STDC_HEADERS 1 [ 145s] #define HAVE_BYTESWAP_H 1 [ 145s] #define TIME_WITH_SYS_TIME 1 [ 145s] [ 145s] configure: exit 1 [ 145s] dh_auto_configure: ./configure --build=i686-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/i386-linux-gnu --libexecdir=${prefix}/lib/i386-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 145s] debian/rules:6: recipe for target 'build' failed [ 145s] make: *** [build] Error 255 [ 145s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 145s] [ 146s] lamb04 failed "build osmo-trx_0.1.9.20170117.dsc" at Tue Jan 17 19:54:15 UTC 2017. [ 146s] [ 146s] ### VM INTERACTION START ### [ 149s] [ 135.329906] reboot: Power down [ 149s] ### VM INTERACTION END ### [ 149s] [ 149s] lamb04 failed "build osmo-trx_0.1.9.20170117.dsc" at Tue Jan 17 19:54:19 UTC 2017. [ 149s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jan 17 19:54:47 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 17 Jan 2017 19:54:47 +0000 Subject: Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <587e76a919271_6baf4b118491214@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/osmo-trx failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-trx Last lines of build log: [ 119s] #define HAVE_SYS_TYPES_H 1 [ 119s] #define HAVE_SYS_STAT_H 1 [ 119s] #define HAVE_STDLIB_H 1 [ 119s] #define HAVE_STRING_H 1 [ 119s] #define HAVE_MEMORY_H 1 [ 119s] #define HAVE_STRINGS_H 1 [ 119s] #define HAVE_INTTYPES_H 1 [ 119s] #define HAVE_STDINT_H 1 [ 119s] #define HAVE_UNISTD_H 1 [ 119s] #define HAVE_DLFCN_H 1 [ 119s] #define LT_OBJDIR ".libs/" [ 119s] #define STDC_HEADERS 1 [ 119s] #define HAVE_BYTESWAP_H 1 [ 119s] #define TIME_WITH_SYS_TIME 1 [ 119s] [ 119s] configure: exit 1 [ 119s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/x86_64-linux-gnu --libexecdir=${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 119s] debian/rules:6: recipe for target 'build' failed [ 119s] make: *** [build] Error 2 [ 119s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 119s] [ 119s] lamb04 failed "build osmo-trx_0.1.9.20170117.dsc" at Tue Jan 17 19:54:41 UTC 2017. [ 119s] [ 119s] ### VM INTERACTION START ### [ 122s] [ 109.442861] reboot: Power down [ 122s] ### VM INTERACTION END ### [ 122s] [ 122s] lamb04 failed "build osmo-trx_0.1.9.20170117.dsc" at Tue Jan 17 19:54:45 UTC 2017. [ 122s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jan 17 19:56:14 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 17 Jan 2017 19:56:14 +0000 Subject: Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <587e76ec73068_6abf4b118497274@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/xUbuntu_16.10/i586 Package network:osmocom:nightly/osmo-trx failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-trx Last lines of build log: [ 241s] #define STDC_HEADERS 1 [ 241s] #define HAVE_SYS_TYPES_H 1 [ 241s] #define HAVE_SYS_STAT_H 1 [ 241s] #define HAVE_STDLIB_H 1 [ 241s] #define HAVE_STRING_H 1 [ 241s] #define HAVE_MEMORY_H 1 [ 241s] #define HAVE_STRINGS_H 1 [ 241s] #define HAVE_INTTYPES_H 1 [ 241s] #define HAVE_STDINT_H 1 [ 241s] #define HAVE_UNISTD_H 1 [ 241s] #define HAVE_DLFCN_H 1 [ 241s] #define LT_OBJDIR ".libs/" [ 241s] #define STDC_HEADERS 1 [ 241s] #define HAVE_BYTESWAP_H 1 [ 241s] #define TIME_WITH_SYS_TIME 1 [ 241s] [ 241s] configure: exit 1 [ 241s] dh_auto_configure: ./configure --build=i686-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/i386-linux-gnu --libexecdir=${prefix}/lib/i386-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 241s] debian/rules:6: recipe for target 'build' failed [ 241s] make: *** [build] Error 2 [ 241s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 241s] [ 241s] cloud106 failed "build osmo-trx_0.1.9.20170117.dsc" at Tue Jan 17 19:55:56 UTC 2017. [ 241s] [ 241s] ### VM INTERACTION START ### [ 245s] ### VM INTERACTION END ### [ 245s] [ 245s] cloud106 failed "build osmo-trx_0.1.9.20170117.dsc" at Tue Jan 17 19:56:01 UTC 2017. [ 245s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jan 17 19:55:57 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 17 Jan 2017 19:55:57 +0000 Subject: Build failure of network:osmocom:nightly/osmo-trx in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <587e76e2d76ad_6abf4b1184971de@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-trx failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-trx Last lines of build log: [ 132s] #define HAVE_STDLIB_H 1 [ 132s] #define HAVE_STRING_H 1 [ 132s] #define HAVE_MEMORY_H 1 [ 132s] #define HAVE_STRINGS_H 1 [ 132s] #define HAVE_INTTYPES_H 1 [ 132s] #define HAVE_STDINT_H 1 [ 132s] #define HAVE_UNISTD_H 1 [ 132s] #define HAVE_DLFCN_H 1 [ 132s] #define LT_OBJDIR ".libs/" [ 132s] #define STDC_HEADERS 1 [ 132s] #define HAVE_BYTESWAP_H 1 [ 132s] #define TIME_WITH_SYS_TIME 1 [ 132s] [ 132s] configure: exit 1 [ 132s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=[ 117.804251] serial8250: too much work for irq4 [ 132s] ${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --libdir=${prefix}/lib/x86_64-linux-gnu --libexecdir=${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 132s] debian/rules:6: recipe for target 'build' failed [ 132s] make: *** [build] Error 255 [ 132s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 132s] [ 132s] lamb13 failed "build osmo-trx_0.1.9.20170117.dsc" at Tue Jan 17 19:55:38 UTC 2017. [ 132s] [ 132s] ### VM INTERACTION START ### [ 133s] Powering off. [ 133s] [ 119.012402] reboot: Power down [ 133s] ### VM INTERACTION END ### [ 133s] [ 133s] lamb13 failed "build osmo-trx_0.1.9.20170117.dsc" at Tue Jan 17 19:55:40 UTC 2017. [ 133s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jan 17 19:55:04 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 17 Jan 2017 19:55:04 +0000 Subject: Build failure of network:osmocom:nightly/osmo-trx in Debian_8.0/i586 In-Reply-To: References: Message-ID: <587e76ad17eb1_6baf4b11849132c@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/Debian_8.0/i586 Package network:osmocom:nightly/osmo-trx failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-trx Last lines of build log: [ 186s] #define HAVE_SYS_STAT_H 1 [ 186s] #define HAVE_STDLIB_H 1 [ 186s] #define HAVE_STRING_H 1 [ 186s] #define HAVE_MEMORY_H 1 [ 186s] #define HAVE_STRINGS_H 1 [ 186s] #define HAVE_INTTYPES_H 1 [ 186s] #define HAVE_STDINT_H 1 [ 186s] #define HAVE_UNISTD_H 1 [ 186s] #define HAVE_DLFCN_H 1 [ 186s] #define LT_OBJDIR ".libs/" [ 186s] #define STDC_HEADERS 1 [ 186s] #define HAVE_BYTESWAP_H 1 [ 186s] #define TIME_WITH_SYS_TIME 1 [ 186s] [ 186s] configure: exit 1 [ 186s] dh_auto_configure: ./configure --build=i586-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --libdir=${prefix}/lib/i386-linux-gnu --libexecdir=${prefix}/lib/i386-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 186s] debian/rules:6: recipe for target 'build' failed [ 186s] make: *** [build] Error 255 [ 186s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 186s] [ 186s] cloud122 failed "build osmo-trx_0.1.9.20170117.dsc" at Tue Jan 17 19:54:48 UTC 2017. [ 186s] [ 186s] ### VM INTERACTION START ### [ 187s] Powering off. [ 187s] [ 156.454218] reboot: Power down [ 189s] ### VM INTERACTION END ### [ 189s] [ 189s] cloud122 failed "build osmo-trx_0.1.9.20170117.dsc" at Tue Jan 17 19:54:51 UTC 2017. [ 189s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jan 17 20:20:59 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 17 Jan 2017 20:20:59 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <587e7cb257838_6abf4b1184980b9@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/xUbuntu_16.10/i586 Package network:osmocom:nightly/osmo-bts failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 264s] ## ----------- ## [ 264s] [ 264s] /* confdefs.h */ [ 264s] #define PACKAGE_NAME "osmo-bts" [ 264s] #define PACKAGE_TARNAME "osmo-bts" [ 264s] #define PACKAGE_VERSION "0.5.0.20170117" [ 264s] #define PACKAGE_STRING "osmo-bts 0.5.0.20170117" [ 264s] #define PACKAGE_BUGREPORT "openbsc-devel at lists.openbsc.org" [ 264s] #define PACKAGE_URL "" [ 264s] #define PACKAGE "osmo-bts" [ 264s] #define VERSION "0.5.0.20170117" [ 264s] #define STDC_HEADERS 1 [ 264s] [ 264s] configure: exit 1 [ 264s] dh_auto_configure: ./configure --build=i686-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/i386-linux-gnu --libexecdir=${prefix}/lib/i386-linux-gnu --disable-maintainer-mode --disable-dependency-tracking --enable-trx returned exit code 1 [ 264s] debian/rules:22: recipe for target 'override_dh_auto_configure' failed [ 264s] make[1]: *** [override_dh_auto_configure] Error 2 [ 264s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 264s] debian/rules:12: recipe for target 'build' failed [ 264s] make: *** [build] Error 2 [ 264s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 264s] [ 264s] build11a failed "build osmo-bts_0.5.0.20170117.dsc" at Tue Jan 17 20:20:46 UTC 2017. [ 264s] [ 264s] ### VM INTERACTION START ### [ 268s] ### VM INTERACTION END ### [ 269s] [ 269s] build11a failed "build osmo-bts_0.5.0.20170117.dsc" at Tue Jan 17 20:20:51 UTC 2017. [ 269s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From laforge at gnumonks.org Wed Jan 18 06:59:40 2017 From: laforge at gnumonks.org (Harald Welte) Date: Wed, 18 Jan 2017 07:59:40 +0100 Subject: Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_16.04/x86_64 In-Reply-To: <587e780d882b5_6baf4b1184917cc@build.opensuse.org> References: <587e780d882b5_6baf4b1184917cc@build.opensuse.org> Message-ID: <20170118065940.h6gse74yjdt6qtkk@nataraja> Dear all, On Tue, Jan 17, 2017 at 08:01:06PM +0000, OBS Notification wrote: > Package network:osmocom:nightly/osmo-trx failed to build in xUbuntu_16.04/x86_64 should we keep the build notifications here on this list (which probably would mean more build failures right now than human discussion), or should I send them to the redmine or other list? Even a new list? I am somewhat undecided. Having the posts here means that the social pressure increases to fix those issues *fast*. However, if that's not possible for some reason, we get continued mails...What do you think? Regards, Harald -- - Harald Welte http://laforge.gnumonks.org/ ============================================================================ "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6) From laforge at gnumonks.org Tue Jan 17 23:00:07 2017 From: laforge at gnumonks.org (Harald Welte) Date: Wed, 18 Jan 2017 00:00:07 +0100 Subject: redmine issue In-Reply-To: References: <2a7186b5-793b-c6da-a0f8-00a0faf5fb34@sysmocom.de> <463126C6-3605-4C38-A49D-C53F8CE60C21@freyther.de> Message-ID: <20170117230007.vjdj5r7bh24ir6cv@nataraja> On Tue, Jan 17, 2017 at 07:07:06PM +0100, Max wrote: > What's so special about sim projects? Should tickets module be enabled for > them? The idea is that the sub-projects have tickets, but not the parent project iseelf (as it is more like a category than a project). -- - Harald Welte http://laforge.gnumonks.org/ ============================================================================ "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6) From alexander.chemeris at gmail.com Wed Jan 18 08:20:31 2017 From: alexander.chemeris at gmail.com (Alexander Chemeris) Date: Wed, 18 Jan 2017 11:20:31 +0300 Subject: Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_16.04/x86_64 In-Reply-To: <20170118065940.h6gse74yjdt6qtkk@nataraja> References: <587e780d882b5_6baf4b1184917cc@build.opensuse.org> <20170118065940.h6gse74yjdt6qtkk@nataraja> Message-ID: There is no social pressure if no one is reading the list, because it's spammed by a bot.. I believe it's too many emails at the email rate the build system is currently sending. I'd vote to either send those mail somewhere else or to find a way to send a single email for all projects and only when a breakage starts (i.e. not for every commit) Please excuse typos. Written with a touchscreen keyboard. -- Regards, Alexander Chemeris CEO Fairwaves, Inc. https://fairwaves.co On Jan 18, 2017 10:15 AM, "Harald Welte" wrote: > Dear all, > > On Tue, Jan 17, 2017 at 08:01:06PM +0000, OBS Notification wrote: > > Package network:osmocom:nightly/osmo-trx failed to build in > xUbuntu_16.04/x86_64 > > should we keep the build notifications here on this list (which probably > would mean more build failures right now than human discussion), or > should I send them to the redmine or other list? Even a new list? > > I am somewhat undecided. Having the posts here means that the social > pressure increases to fix those issues *fast*. However, if that's not > possible for some reason, we get continued mails...What do you think? > > Regards, > Harald > > -- > - Harald Welte > http://laforge.gnumonks.org/ > ============================================================ > ================ > "Privacy in residential applications is a desirable marketing option." > (ETSI EN 300 175-7 Ch. > A6) > -------------- next part -------------- An HTML attachment was scrubbed... URL: From msuraev at sysmocom.de Wed Jan 18 10:02:02 2017 From: msuraev at sysmocom.de (Max) Date: Wed, 18 Jan 2017 11:02:02 +0100 Subject: Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_16.04/x86_64 In-Reply-To: <20170118065940.h6gse74yjdt6qtkk@nataraja> References: <587e780d882b5_6baf4b1184917cc@build.opensuse.org> <20170118065940.h6gse74yjdt6qtkk@nataraja> Message-ID: <7b8bffe1-f8b7-157e-a422-b1da7f427068@sysmocom.de> Hi. One of the options would be to disable builds for packages which are known to be problematic. Also, huge chunk of the failures comes from 14.04 repo - are we really interesting in supporting this? Other than that: - build failures for osmo-stp should be fixed once gerrit #1616 is merged - build failures for osmo-bts should be fixed once gerrit #1621 is merged - OpenBSC build failure for 16.04 i586 seems to be related to libdbi issue (will be fixed once vlr work is merged, shall we disable it until than?) - libosmo-netif build failure for 16.10 x86_64 puzzles me as this is unreproducible locally or in jenkins: is there any way to extract build artifacts from OBS to look into testsuite.log? -- Max Suraev http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Geschaeftsfuehrer / Managing Director: Harald Welte From msuraev at sysmocom.de Wed Jan 18 11:03:05 2017 From: msuraev at sysmocom.de (Max) Date: Wed, 18 Jan 2017 12:03:05 +0100 Subject: redmine issue In-Reply-To: <20170117230007.vjdj5r7bh24ir6cv@nataraja> References: <2a7186b5-793b-c6da-a0f8-00a0faf5fb34@sysmocom.de> <463126C6-3605-4C38-A49D-C53F8CE60C21@freyther.de> <20170117230007.vjdj5r7bh24ir6cv@nataraja> Message-ID: <1430050b-d3f6-d02b-61d2-c13c36794129@sysmocom.de> Ah, got that. So the right thing to do would be to move the ticket into subproject? On 18.01.2017 00:00, Harald Welte wrote: > On Tue, Jan 17, 2017 at 07:07:06PM +0100, Max wrote: >> What's so special about sim projects? Should tickets module be enabled for >> them? > The idea is that the sub-projects have tickets, but not the parent > project iseelf (as it is more like a category than a project). -- Max Suraev http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Geschaeftsfuehrer / Managing Director: Harald Welte From msuraev at sysmocom.de Wed Jan 18 12:41:46 2017 From: msuraev at sysmocom.de (Max) Date: Wed, 18 Jan 2017 13:41:46 +0100 Subject: Intregation with usrp In-Reply-To: References: <20170117164205.k2kvwtauyooi6rjn@nataraja> Message-ID: That's highly unlikely as each commit goes through jenkins tester. Are you sure you've used latest version? On 17.01.2017 18:26, Snehasish Kar wrote: > Sorry for that, the thing is I tried compiling osmo-BTs but it gave a lots of error, seems that the current version of libosmo-abis have some compatibility issue with Osmo-bts. > -- Max Suraev http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Geschaeftsfuehrer / Managing Director: Harald Welte From keith at rhizomatica.org Wed Jan 18 16:27:48 2017 From: keith at rhizomatica.org (Keith) Date: Wed, 18 Jan 2017 17:27:48 +0100 Subject: Add VTY command to immediately expire user (set expire_lu to now) Message-ID: Hi all, ( so.. by way of finding out what is the best way to do this kind of thing, I went ahead and submitted my patch to gerrit. ) I've added a command to the vty to set the expire_lu value for the subscriber to now. My personal use case for this is that I wanted a way to set lac = GSM_LAC_RESERVED_DETACHED when I know that the MS is not there, (because I know it has gone to another nitb with a different lac) and therefore I no longer want to page it and I also don't want it showing up as connected when I poll the hlr for lac>0 via sqlite3. So if I set the expire_lu to now, openbsc will very shortly afterwards, issue <0002> gsm_subscriber.c:366 Expiring inactive subscriber...... I'm not sure if this would be considered something anybody else might want, or confusing for users, and I haven't fully tested (yet) what might happen if the mobile has not in fact done an IMSI attach to another lac yet I expire it. Also, my C programming history is nill. I have no idea if setting a time_t to time(0) is cool, or will result in sky falling down. I'm not quite sure if it's necessary to call subscr_put() I also realise I left a pointless rc declaration in there. oh well.. guess I learn about submitting patch set 2.. So the unwritten question is, with ideas like this, should I first ask here on the list for opinion on the theoretical merits or not of such an idea, or should I just submit to gerrit and should the discussion, if any, happen there? Many Thanks! k/ From msuraev at sysmocom.de Wed Jan 18 16:33:44 2017 From: msuraev at sysmocom.de (Max) Date: Wed, 18 Jan 2017 17:33:44 +0100 Subject: osmo_sock_init API changes In-Reply-To: <0A1E5972-E5D3-4192-9D97-0B441473E517@freyther.de> References: <0A1E5972-E5D3-4192-9D97-0B441473E517@freyther.de> Message-ID: <2c76182d-11d1-230c-db5d-9950502a7db3@sysmocom.de> See also gerrit #1624 for proposed implementation. -- Max Suraev http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Geschaeftsfuehrer / Managing Director: Harald Welte From holger at freyther.de Wed Jan 18 12:35:54 2017 From: holger at freyther.de (Holger Freyther) Date: Wed, 18 Jan 2017 13:35:54 +0100 Subject: Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_16.04/x86_64 In-Reply-To: <20170118065940.h6gse74yjdt6qtkk@nataraja> References: <587e780d882b5_6baf4b1184917cc@build.opensuse.org> <20170118065940.h6gse74yjdt6qtkk@nataraja> Message-ID: > On 18 Jan 2017, at 07:59, Harald Welte wrote: > > Dear all, > > On Tue, Jan 17, 2017 at 08:01:06PM +0000, OBS Notification wrote: >> Package network:osmocom:nightly/osmo-trx failed to build in xUbuntu_16.04/x86_64 > > should we keep the build notifications here on this list (which probably > would mean more build failures right now than human discussion), or > should I send them to the redmine or other list? Even a new list? > > I am somewhat undecided. Having the posts here means that the social > pressure increases to fix those issues *fast*. However, if that's not > possible for some reason, we get continued mails...What do you think? Probably not to this mailinglist. I was looking into using osc pr -c and creating a jenkins job that will execute/check it. Then we would be edge triggered but "race" a bit with when will the build complete. Roughly...run once every couple of hours * Use osc pr -c and check CSV file if everything is complete * Check failed or unresolvable Configure job to send mail on first failure (and when fixed)? what do you think? holger From laforge at gnumonks.org Wed Jan 18 17:08:54 2017 From: laforge at gnumonks.org (Harald Welte) Date: Wed, 18 Jan 2017 18:08:54 +0100 Subject: osmo-trx jenkins In-Reply-To: References: <2ea481fb-0042-815c-6e1c-2e25eb0ee890@sysmocom.de> <20161024235225.GA3707@my.box> Message-ID: <20170118170854.wdagiobuf6qlojbr@nataraja> Hi Tom, I'm sorry to have to get back to this topic, but I think we have to re-introduce support for "old" UHD versions in osmo-trx. It is creating too much fall-out and breakage down the road. On Mon, Oct 24, 2016 at 05:21:40PM -0700, Tom Tsou wrote: > UHD versions prior to 3.9 are no longer actively maintained. The 3.9 > series of releases is the current 'long term support' version. The problem is that Ettus did apparently not coordinate with major distributions to ensure that such a 'long term support' version is actually packated in their regular and/or long-term-support distributions. AFAICT, we now have broken package builds for Debian 8.0, Ubuntu 16.04 and 16.10. I know Debian is known for shipping relatively old versions which has created issues here and there, but I absolutely don't think anyone would claim that the two Ubuntu Linux distributions released in 2016 are "old" by any means. > PPA packages are available. > > https://launchpad.net/~ettusresearch/+archive/ubuntu/uhd-3.9.lts That may be the case, but it apparently is not possible to add such external package feed to "standard" / "commonly used" build systems like OBS, which we use. So we have the choice of building yet another set of uhd drivers for all supported distributions, or we have to enable osmo-trx to support older UHD versions. > It's a hard requirement for some features - namely multi-carrier BTS. > On the code level, we currently need to add additional ifdef's in > order to support older UHD API and behavioral version dependencies. So if I read this correctly, with a few #ifdefs, even multi-carrier can be supported? Regards, Harald -- - Harald Welte http://laforge.gnumonks.org/ ============================================================================ "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6) From nhofmeyr at sysmocom.de Wed Jan 18 17:21:27 2017 From: nhofmeyr at sysmocom.de (Neels Hofmeyr) Date: Wed, 18 Jan 2017 18:21:27 +0100 Subject: Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_16.04/x86_64 In-Reply-To: <20170118065940.h6gse74yjdt6qtkk@nataraja> References: <587e780d882b5_6baf4b1184917cc@build.opensuse.org> <20170118065940.h6gse74yjdt6qtkk@nataraja> Message-ID: <20170118172127.GA12799@ass40.sysmocom.de> I would put it either on our high-noise gerrit-log@ list, or if that's too cross-topic create a new one. I personally would subscribe. With a separate list, filtering is easy. Social pressure could be exerted by me or someone else subscribed posting to openbsc@ that it's still not fixed or something like that. ~N On Wed, Jan 18, 2017 at 07:59:40AM +0100, Harald Welte wrote: > Dear all, > > On Tue, Jan 17, 2017 at 08:01:06PM +0000, OBS Notification wrote: > > Package network:osmocom:nightly/osmo-trx failed to build in xUbuntu_16.04/x86_64 > > should we keep the build notifications here on this list (which probably > would mean more build failures right now than human discussion), or > should I send them to the redmine or other list? Even a new list? > > I am somewhat undecided. Having the posts here means that the social > pressure increases to fix those issues *fast*. However, if that's not > possible for some reason, we get continued mails...What do you think? > > Regards, > Harald > > -- > - Harald Welte http://laforge.gnumonks.org/ > ============================================================================ > "Privacy in residential applications is a desirable marketing option." > (ETSI EN 300 175-7 Ch. A6) -- - Neels Hofmeyr http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Gesch?ftsf?hrer / Managing Directors: Harald Welte -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From nhofmeyr at sysmocom.de Wed Jan 18 17:41:34 2017 From: nhofmeyr at sysmocom.de (Neels Hofmeyr) Date: Wed, 18 Jan 2017 18:41:34 +0100 Subject: Add VTY command to immediately expire user (set expire_lu to now) In-Reply-To: References: Message-ID: <20170118174134.GB12799@ass40.sysmocom.de> Hi Keith, I see https://gerrit.osmocom.org/#/c/1623/, so let's discuss further details about the patch there. Nice to see a patch from you :) On Wed, Jan 18, 2017 at 05:27:48PM +0100, Keith wrote: > So the unwritten question is, with ideas like this, should I first ask > here on the list for opinion on the theoretical merits or not of such an > idea, or should I just submit to gerrit and should the discussion, if > any, happen there? yes, let's discuss patches on gerrit "only". Here only if you're really unsure in general and there is no patch to discuss (yet). ~N -- - Neels Hofmeyr http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Gesch?ftsf?hrer / Managing Directors: Harald Welte -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From laforge at gnumonks.org Wed Jan 18 18:56:08 2017 From: laforge at gnumonks.org (Harald Welte) Date: Wed, 18 Jan 2017 19:56:08 +0100 Subject: Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_16.04/x86_64 In-Reply-To: <7b8bffe1-f8b7-157e-a422-b1da7f427068@sysmocom.de> References: <587e780d882b5_6baf4b1184917cc@build.opensuse.org> <20170118065940.h6gse74yjdt6qtkk@nataraja> <7b8bffe1-f8b7-157e-a422-b1da7f427068@sysmocom.de> Message-ID: <20170118185608.ssatquv3drvk6cw7@nataraja> On Wed, Jan 18, 2017 at 11:02:02AM +0100, Max wrote: > One of the options would be to disable builds for packages which are known > to be problematic. They still need to be resolved. > Also, huge chunk of the failures comes from 14.04 repo - > are we really interesting in supporting this? no, simply remove it. -- - Harald Welte http://laforge.gnumonks.org/ ============================================================================ "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6) From nhofmeyr at sysmocom.de Wed Jan 18 23:33:47 2017 From: nhofmeyr at sysmocom.de (Neels Hofmeyr) Date: Thu, 19 Jan 2017 00:33:47 +0100 Subject: Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_16.04/x86_64 In-Reply-To: References: <587e780d882b5_6baf4b1184917cc@build.opensuse.org> <20170118065940.h6gse74yjdt6qtkk@nataraja> Message-ID: <20170118233347.GA3308@my.box> On Wed, Jan 18, 2017 at 01:35:54PM +0100, Holger Freyther wrote: > Configure job to send mail on first failure (and when fixed)? edge triggered mails would be fine on openbsc@ ~N -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From tom at tsou.cc Thu Jan 19 00:18:20 2017 From: tom at tsou.cc (Tom Tsou) Date: Wed, 18 Jan 2017 16:18:20 -0800 Subject: osmo-trx jenkins In-Reply-To: <20170118170854.wdagiobuf6qlojbr@nataraja> References: <2ea481fb-0042-815c-6e1c-2e25eb0ee890@sysmocom.de> <20161024235225.GA3707@my.box> <20170118170854.wdagiobuf6qlojbr@nataraja> Message-ID: On Wed, Jan 18, 2017 at 9:08 AM, Harald Welte wrote: > I'm sorry to have to get back to this topic, but I think we have to > re-introduce support for "old" UHD versions in osmo-trx. It is creating > too much fall-out and breakage down the road. Understood. The more recent 3.9 series of UHD releases is the recommended version by Ettus Research and the reason behind the recent change, however, enforcing the requirement seems to create as many issues as it solves. > On Mon, Oct 24, 2016 at 05:21:40PM -0700, Tom Tsou wrote: >> PPA packages are available. >> >> https://launchpad.net/~ettusresearch/+archive/ubuntu/uhd-3.9.lts > > That may be the case, but it apparently is not possible to add such > external package feed to "standard" / "commonly used" build systems like > OBS, which we use. So we have the choice of building yet another set of > uhd drivers for all supported distributions, or we have to enable > osmo-trx to support older UHD versions. I briefly looked into the PPA approach, but did not arrive at any obvious solution. I am not opposed to reintroducing older version support. > So if I read this correctly, with a few #ifdefs, even multi-carrier can > be supported? Some features will likely be disabled with older UHD versions. Some amount of investigation and testing will be needed to clarify feature-version dependencies. I am looking into those dependencies now. -TT From msuraev at sysmocom.de Thu Jan 19 09:48:11 2017 From: msuraev at sysmocom.de (Max) Date: Thu, 19 Jan 2017 10:48:11 +0100 Subject: osmo-trx jenkins In-Reply-To: References: <2ea481fb-0042-815c-6e1c-2e25eb0ee890@sysmocom.de> <20161024235225.GA3707@my.box> <20170118170854.wdagiobuf6qlojbr@nataraja> Message-ID: Hi. One alternative would be to add newer uhd build into OBS and than re-use it from network :osmocom :nightly I'm not familiar with ppa but I guess it should not be too different from obs. On 19.01.2017 01:18, Tom Tsou wrote: > >> That may be the case, but it apparently is not possible to add such >> external package feed to "standard" / "commonly used" build systems like >> OBS, which we use. So we have the choice of building yet another set of >> uhd drivers for all supported distributions, or we have to enable >> osmo-trx to support older UHD versions. > I briefly looked into the PPA approach, but did not arrive at any > obvious solution. I am not opposed to reintroducing older version > support. -- Max Suraev http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Geschaeftsfuehrer / Managing Director: Harald Welte From laforge at gnumonks.org Thu Jan 19 10:48:31 2017 From: laforge at gnumonks.org (Harald Welte) Date: Thu, 19 Jan 2017 11:48:31 +0100 Subject: Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_16.04/x86_64 In-Reply-To: <20170118065940.h6gse74yjdt6qtkk@nataraja> References: <587e780d882b5_6baf4b1184917cc@build.opensuse.org> <20170118065940.h6gse74yjdt6qtkk@nataraja> Message-ID: <20170119104831.2agrytdis2jshqwl@nataraja> On Wed, Jan 18, 2017 at 07:59:40AM +0100, Harald Welte wrote: > should we keep the build notifications here on this list (which probably > would mean more build failures right now than human discussion), or > should I send them to the redmine or other list? Even a new list? I've now re-configured the build failures to go to gerrit-log at lists.osmocom.org instead. -- - Harald Welte http://laforge.gnumonks.org/ ============================================================================ "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6) From laforge at gnumonks.org Thu Jan 19 10:47:53 2017 From: laforge at gnumonks.org (Harald Welte) Date: Thu, 19 Jan 2017 11:47:53 +0100 Subject: redmine issue In-Reply-To: <1430050b-d3f6-d02b-61d2-c13c36794129@sysmocom.de> References: <2a7186b5-793b-c6da-a0f8-00a0faf5fb34@sysmocom.de> <463126C6-3605-4C38-A49D-C53F8CE60C21@freyther.de> <20170117230007.vjdj5r7bh24ir6cv@nataraja> <1430050b-d3f6-d02b-61d2-c13c36794129@sysmocom.de> Message-ID: <20170119104753.eljql36lgp5sh32y@nataraja> On Wed, Jan 18, 2017 at 12:03:05PM +0100, Max wrote: > Ah, got that. So the right thing to do would be to move the ticket into > subproject? yes, done. It was the only ticket assigned to the 'SIM card related Projects' umbrella project -- - Harald Welte http://laforge.gnumonks.org/ ============================================================================ "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6) From nhofmeyr at sysmocom.de Thu Jan 19 12:56:52 2017 From: nhofmeyr at sysmocom.de (Neels Hofmeyr) Date: Thu, 19 Jan 2017 13:56:52 +0100 Subject: Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_16.04/x86_64 In-Reply-To: <20170118065940.h6gse74yjdt6qtkk@nataraja> References: <587e780d882b5_6baf4b1184917cc@build.opensuse.org> <20170118065940.h6gse74yjdt6qtkk@nataraja> Message-ID: <20170119125652.GA1758@my.box> BTW, my reply to this email resulted in a ticket being created automatically at opensuse.org alerting the admins there, without my intention. That's because the mail recipients included the address OBS Notification Keep an eye out in the future to exclude this mail address if you come across it, or all of us will create OBS tickets to their admins' annoyance... ~N -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From snehasish.cse at LIVE.COM Fri Jan 20 11:58:53 2017 From: snehasish.cse at LIVE.COM (Snehasish Kar) Date: Fri, 20 Jan 2017 11:58:53 +0000 Subject: Omsobts -osmotrx communication problem Message-ID: Hi I have installed osmobts and osmotrx with openbsc, to enable openbsc with usrp. But whenever I tried running the three applications, I gave the following error in osmobts. Please help me with it. <000b> trx_if.c:490 Tx burst length 0 invalid > <000b> trx_if.c:490 Tx burst length 0 invalid > <000b> trx_if.c:490 Tx burst length 0 invalid > <000b> trx_if.c:490 Tx burst length 0 invalid > <000b> trx_if.c:490 Tx burst length 0 invalid > <000b> trx_if.c:490 Tx burst length 0 invalid > <000b> trx_if.c:490 Tx burst length 0 invalid > <000b> trx_if.c:490 Tx burst length 0 invalid > <000b> trx_if.c:490 Tx burst length 0 invalid > <000b> trx_if.c:490 Tx burst length 0 invalid > <000b> trx_if.c:490 Tx burst length 0 invalid > <000b> trx_if.c:490 Tx burst length 0 invalid > <000b> trx_if.c:490 Tx burst length 0 invalid > <000b> trx_if.c:490 Tx burst length 0 invalid > <000b> trx_if.c:490 Tx burst length 0 invalid > <000b> trx_if.c:490 Tx burst length 0 invalid > <000b> trx_if.c:490 Tx burst length 0 invalid BR Snehasish -------------- next part -------------- An HTML attachment was scrubbed... URL: From nhofmeyr at sysmocom.de Fri Jan 20 23:05:06 2017 From: nhofmeyr at sysmocom.de (Neels Hofmeyr) Date: Sat, 21 Jan 2017 00:05:06 +0100 Subject: Omsobts -osmotrx communication problem In-Reply-To: References: Message-ID: <20170120230506.GA2475@my.box> On Fri, Jan 20, 2017 at 11:58:53AM +0000, Snehasish Kar wrote: > Hi > > I have installed osmobts and osmotrx with openbsc, to enable openbsc with usrp. But whenever I tried running the three applications, I gave the following error in osmobts. Please help me with it. > > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid If I remember correctly, osmo-bts-trx will at startup show a bunch of these and then continue normally. To clarify, you need to run 'osmo-trx', 'osmo-bts-trx' and 'osmo-nitb'. We can't help further with this little information on your config. ~N -- - Neels Hofmeyr http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Gesch?ftsf?hrer / Managing Directors: Harald Welte -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From snehasish.cse at LIVE.COM Mon Jan 23 05:50:59 2017 From: snehasish.cse at LIVE.COM (Snehasish Kar) Date: Mon, 23 Jan 2017 05:50:59 +0000 Subject: Omsobts -osmotrx communication problem In-Reply-To: <20170120230506.GA2475@my.box> References: , <20170120230506.GA2475@my.box> Message-ID: Hi I have attached my config as requested, also in osmo-trx I am getting the following error "check_rx_md_err: An internal receive buffer has filled" and I am not able to view the network in my phone. I am using usrp x310 and os UBUNTU. BR Snehasish ________________________________ From: Neels Hofmeyr Sent: Saturday, January 21, 2017 4:35:06 AM To: Snehasish Kar Cc: openbsc at lists.osmocom.org Subject: Re: Omsobts -osmotrx communication problem On Fri, Jan 20, 2017 at 11:58:53AM +0000, Snehasish Kar wrote: > Hi > > I have installed osmobts and osmotrx with openbsc, to enable openbsc with usrp. But whenever I tried running the three applications, I gave the following error in osmobts. Please help me with it. > > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid If I remember correctly, osmo-bts-trx will at startup show a bunch of these and then continue normally. To clarify, you need to run 'osmo-trx', 'osmo-bts-trx' and 'osmo-nitb'. We can't help further with this little information on your config. ~N -- - Neels Hofmeyr http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Gesch?ftsf?hrer / Managing Directors: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: openbsc.cfg Type: application/octet-stream Size: 1997 bytes Desc: openbsc.cfg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: osmo-bts.cfg Type: application/octet-stream Size: 1853 bytes Desc: osmo-bts.cfg URL: From snehasish.cse at LIVE.COM Mon Jan 23 06:13:03 2017 From: snehasish.cse at LIVE.COM (Snehasish Kar) Date: Mon, 23 Jan 2017 06:13:03 +0000 Subject: Omsobts -osmotrx communication problem In-Reply-To: References: <20170120230506.GA2475@my.box> , Message-ID: Problem is usrp x310 doesnot support the gsmband, it works above 1.2GHz. Also if I still change the MCC and MNC I am not not able to find the network on the phone, and any clue on this error "check_rx_md_err: An internal receive buffer has filled", it comes in osmo-trx. ________________________________ From: Dhananjay kumar Sent: Monday, January 23, 2017 11:37:38 AM To: Snehasish Kar Cc: nhofmeyr at sysmocom.de Subject: Re: Omsobts -osmotrx communication problem hi, network country code 404 mobile network code 31 Change it to network country code 001 mobile network code 01 short name TESTPLMN long name TESTPLMN Try it in Band 850 . 900 and 1800 and widely used in India by commercial operates. Remove all neighbor cell list. You are using 404 31 , it might match some real network, and you will not able to see your test network. BR Dhananjay On Mon, Jan 23, 2017 at 11:20 AM, Snehasish Kar > wrote: Hi I have attached my config as requested, also in osmo-trx I am getting the following error "check_rx_md_err: An internal receive buffer has filled" and I am not able to view the network in my phone. I am using usrp x310 and os UBUNTU. BR Snehasish ________________________________ From: Neels Hofmeyr > Sent: Saturday, January 21, 2017 4:35:06 AM To: Snehasish Kar Cc: openbsc at lists.osmocom.org Subject: Re: Omsobts -osmotrx communication problem On Fri, Jan 20, 2017 at 11:58:53AM +0000, Snehasish Kar wrote: > Hi > > I have installed osmobts and osmotrx with openbsc, to enable openbsc with usrp. But whenever I tried running the three applications, I gave the following error in osmobts. Please help me with it. > > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid > > <000b> trx_if.c:490 Tx burst length 0 invalid If I remember correctly, osmo-bts-trx will at startup show a bunch of these and then continue normally. To clarify, you need to run 'osmo-trx', 'osmo-bts-trx' and 'osmo-nitb'. We can't help further with this little information on your config. ~N -- - Neels Hofmeyr > http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Gesch?ftsf?hrer / Managing Directors: Harald Welte -- Thanks & Regards Dhananjay 9686184214 Luck is what happens when preparation meets opportunity. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dhananjay.cse at gmail.com Mon Jan 23 06:17:04 2017 From: dhananjay.cse at gmail.com (Dhananjay kumar) Date: Mon, 23 Jan 2017 11:47:04 +0530 Subject: Omsobts -osmotrx communication problem In-Reply-To: References: <20170120230506.GA2475@my.box> Message-ID: try in 1900 band. For me it works fine. What all component you are running ? BR Dhananjay On Mon, Jan 23, 2017 at 11:43 AM, Snehasish Kar wrote: > Problem is usrp x310 doesnot support the gsmband, it works above 1.2GHz. > Also if I still change the MCC and MNC I am not not able to find the > network on the phone, and any clue on this error "*check_rx_md_err: An > internal receive buffer has filled"*, it comes in osmo-trx. > ------------------------------ > *From:* Dhananjay kumar > *Sent:* Monday, January 23, 2017 11:37:38 AM > *To:* Snehasish Kar > *Cc:* nhofmeyr at sysmocom.de > > *Subject:* Re: Omsobts -osmotrx communication problem > > hi, > > network country code 404 > mobile network code 31 > > Change it to > > network country code 001 > mobile network code 01 > short name TESTPLMN > long name TESTPLMN > > Try it in Band 850 . > 900 and 1800 and widely used in India by commercial operates. > Remove all neighbor cell list. > > > You are using 404 31 , it might match some real network, and you will not > able to see your test network. > > BR > Dhananjay > > On Mon, Jan 23, 2017 at 11:20 AM, Snehasish Kar > wrote: > >> Hi I have attached my config as requested, also in osmo-trx I am getting >> the following error "*check_rx_md_err: An internal receive buffer has >> filled" *and I am not able to view the network in my phone*. *I am >> using usrp x310 and os UBUNTU. >> >> >> BR >> >> Snehasish >> ------------------------------ >> *From:* Neels Hofmeyr >> *Sent:* Saturday, January 21, 2017 4:35:06 AM >> *To:* Snehasish Kar >> *Cc:* openbsc at lists.osmocom.org >> *Subject:* Re: Omsobts -osmotrx communication problem >> >> On Fri, Jan 20, 2017 at 11:58:53AM +0000, Snehasish Kar wrote: >> > Hi >> > >> > I have installed osmobts and osmotrx with openbsc, to enable openbsc >> with usrp. But whenever I tried running the three applications, I gave the >> following error in osmobts. Please help me with it. >> >> > >> > >> > <000b> trx_if.c:490 Tx burst length 0 invalid >> > > <000b> trx_if.c:490 Tx burst length 0 invalid >> > > <000b> trx_if.c:490 Tx burst length 0 invalid >> > > <000b> trx_if.c:490 Tx burst length 0 invalid >> > > <000b> trx_if.c:490 Tx burst length 0 invalid >> > > <000b> trx_if.c:490 Tx burst length 0 invalid >> > > <000b> trx_if.c:490 Tx burst length 0 invalid >> > > <000b> trx_if.c:490 Tx burst length 0 invalid >> > > <000b> trx_if.c:490 Tx burst length 0 invalid >> > > <000b> trx_if.c:490 Tx burst length 0 invalid >> > > <000b> trx_if.c:490 Tx burst length 0 invalid >> > > <000b> trx_if.c:490 Tx burst length 0 invalid >> > > <000b> trx_if.c:490 Tx burst length 0 invalid >> > > <000b> trx_if.c:490 Tx burst length 0 invalid >> > > <000b> trx_if.c:490 Tx burst length 0 invalid >> > > <000b> trx_if.c:490 Tx burst length 0 invalid >> > > <000b> trx_if.c:490 Tx burst length 0 invalid >> >> If I remember correctly, osmo-bts-trx will at startup show a bunch of >> these and >> then continue normally. >> >> To clarify, you need to run 'osmo-trx', 'osmo-bts-trx' and 'osmo-nitb'. >> We can't help further with this little information on your config. >> >> ~N >> >> >> -- >> - Neels Hofmeyr http://www.sysmocom.de/ >> ======================================================================= >> * sysmocom - systems for mobile communications GmbH >> * Alt-Moabit 93 >> * 10559 Berlin, Germany >> * Sitz / Registered office: Berlin, HRB 134158 B >> * Gesch?ftsf?hrer / Managing Directors: Harald Welte >> > > > > -- > Thanks & Regards > Dhananjay > 9686184214 > > Luck is what happens when preparation meets opportunity. > -- Thanks & Regards Dhananjay 9686184214 Luck is what happens when preparation meets opportunity. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dhananjay.cse at gmail.com Mon Jan 23 06:20:33 2017 From: dhananjay.cse at gmail.com (Dhananjay kumar) Date: Mon, 23 Jan 2017 11:50:33 +0530 Subject: Omsobts -osmotrx communication problem In-Reply-To: References: <20170120230506.GA2475@my.box> Message-ID: HI, We are using B210 , it works fine. On Mon, Jan 23, 2017 at 11:47 AM, Dhananjay kumar wrote: > try in 1900 band. For me it works fine. > > What all component you are running ? > > BR > Dhananjay > > On Mon, Jan 23, 2017 at 11:43 AM, Snehasish Kar > wrote: > >> Problem is usrp x310 doesnot support the gsmband, it works above 1.2GHz. >> Also if I still change the MCC and MNC I am not not able to find the >> network on the phone, and any clue on this error "*check_rx_md_err: An >> internal receive buffer has filled"*, it comes in osmo-trx. >> ------------------------------ >> *From:* Dhananjay kumar >> *Sent:* Monday, January 23, 2017 11:37:38 AM >> *To:* Snehasish Kar >> *Cc:* nhofmeyr at sysmocom.de >> >> *Subject:* Re: Omsobts -osmotrx communication problem >> >> hi, >> >> network country code 404 >> mobile network code 31 >> >> Change it to >> >> network country code 001 >> mobile network code 01 >> short name TESTPLMN >> long name TESTPLMN >> >> Try it in Band 850 . >> 900 and 1800 and widely used in India by commercial operates. >> Remove all neighbor cell list. >> >> >> You are using 404 31 , it might match some real network, and you will not >> able to see your test network. >> >> BR >> Dhananjay >> >> On Mon, Jan 23, 2017 at 11:20 AM, Snehasish Kar >> wrote: >> >>> Hi I have attached my config as requested, also in osmo-trx I am getting >>> the following error "*check_rx_md_err: An internal receive buffer has >>> filled" *and I am not able to view the network in my phone*. *I am >>> using usrp x310 and os UBUNTU. >>> >>> >>> BR >>> >>> Snehasish >>> ------------------------------ >>> *From:* Neels Hofmeyr >>> *Sent:* Saturday, January 21, 2017 4:35:06 AM >>> *To:* Snehasish Kar >>> *Cc:* openbsc at lists.osmocom.org >>> *Subject:* Re: Omsobts -osmotrx communication problem >>> >>> On Fri, Jan 20, 2017 at 11:58:53AM +0000, Snehasish Kar wrote: >>> > Hi >>> > >>> > I have installed osmobts and osmotrx with openbsc, to enable openbsc >>> with usrp. But whenever I tried running the three applications, I gave the >>> following error in osmobts. Please help me with it. >>> >>> > >>> > >>> > <000b> trx_if.c:490 Tx burst length 0 invalid >>> > > <000b> trx_if.c:490 Tx burst length 0 invalid >>> > > <000b> trx_if.c:490 Tx burst length 0 invalid >>> > > <000b> trx_if.c:490 Tx burst length 0 invalid >>> > > <000b> trx_if.c:490 Tx burst length 0 invalid >>> > > <000b> trx_if.c:490 Tx burst length 0 invalid >>> > > <000b> trx_if.c:490 Tx burst length 0 invalid >>> > > <000b> trx_if.c:490 Tx burst length 0 invalid >>> > > <000b> trx_if.c:490 Tx burst length 0 invalid >>> > > <000b> trx_if.c:490 Tx burst length 0 invalid >>> > > <000b> trx_if.c:490 Tx burst length 0 invalid >>> > > <000b> trx_if.c:490 Tx burst length 0 invalid >>> > > <000b> trx_if.c:490 Tx burst length 0 invalid >>> > > <000b> trx_if.c:490 Tx burst length 0 invalid >>> > > <000b> trx_if.c:490 Tx burst length 0 invalid >>> > > <000b> trx_if.c:490 Tx burst length 0 invalid >>> > > <000b> trx_if.c:490 Tx burst length 0 invalid >>> >>> If I remember correctly, osmo-bts-trx will at startup show a bunch of >>> these and >>> then continue normally. >>> >>> To clarify, you need to run 'osmo-trx', 'osmo-bts-trx' and 'osmo-nitb'. >>> We can't help further with this little information on your config. >>> >>> ~N >>> >>> >>> -- >>> - Neels Hofmeyr http://www.sysmocom.de/ >>> ======================================================================= >>> * sysmocom - systems for mobile communications GmbH >>> * Alt-Moabit 93 >>> * 10559 Berlin, Germany >>> * Sitz / Registered office: Berlin, HRB 134158 B >>> * Gesch?ftsf?hrer / Managing Directors: Harald Welte >>> >> >> >> >> -- >> Thanks & Regards >> Dhananjay >> 9686184214 >> >> Luck is what happens when preparation meets opportunity. >> > > > > -- > Thanks & Regards > Dhananjay > 9686184214 > > Luck is what happens when preparation meets opportunity. > -- Thanks & Regards Dhananjay 9686184214 Luck is what happens when preparation meets opportunity. -------------- next part -------------- An HTML attachment was scrubbed... URL: From aschultz at tpip.net Mon Jan 23 11:56:55 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Mon, 23 Jan 2017 12:56:55 +0100 Subject: [PATCH 06/17] gtp: fix cross netns recv on gtp socket In-Reply-To: <20170123115706.4354-1-aschultz@tpip.net> References: <20170123115706.4354-1-aschultz@tpip.net> Message-ID: <20170123115706.4354-7-aschultz@tpip.net> The use of the paassed through netlink src_net to check for a cross netns operation was wrong. Using the GTP socket and the GTP netdevice is always correct (even if the netdev has been moved to new netns after link creation). Remove the now obsolete net field from gtp_dev. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 7a3c5f6..bc8734b7 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -69,7 +69,6 @@ struct gtp_dev { struct socket *sock0; struct socket *sock1u; - struct net *net; struct net_device *dev; unsigned int hash_size; @@ -292,7 +291,7 @@ static int gtp_encap_recv(struct sock *sk, struct sk_buff *skb) netdev_dbg(gtp->dev, "encap_recv sk=%p\n", sk); - xnet = !net_eq(gtp->net, dev_net(gtp->dev)); + xnet = !net_eq(sock_net(sk), dev_net(gtp->dev)); switch (udp_sk(sk)->encap_type) { case UDP_ENCAP_GTP0: @@ -642,7 +641,7 @@ static void gtp_link_setup(struct net_device *dev) static int gtp_hashtable_new(struct gtp_dev *gtp, int hsize); static void gtp_hashtable_free(struct gtp_dev *gtp); static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, - struct net *src_net, struct nlattr *data[]); + struct nlattr *data[]); static void gtp_encap_disable(struct gtp_dev *gtp); static int gtp_newlink(struct net *src_net, struct net_device *dev, @@ -660,7 +659,7 @@ static int gtp_newlink(struct net *src_net, struct net_device *dev, hashsize = nla_get_u32(data[IFLA_GTP_PDP_HASHSIZE]); if (data[IFLA_GTP_FD0] || data[IFLA_GTP_FD1]) { - err = gtp_encap_enable(dev, gtp, src_net, data); + err = gtp_encap_enable(dev, gtp, data); if (err < 0) goto out_err; } @@ -839,7 +838,7 @@ static struct socket *gtp_encap_enable_socket(int fd, int type, } static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, - struct net *src_net, struct nlattr *data[]) + struct nlattr *data[]) { struct socket *sock0 = NULL; struct socket *sock1u = NULL; @@ -867,7 +866,6 @@ static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, gtp->sock0 = sock0; gtp->sock1u = sock1u; - gtp->net = src_net; return 0; } -- 2.10.2 From aschultz at tpip.net Mon Jan 23 11:57:02 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Mon, 23 Jan 2017 12:57:02 +0100 Subject: [PATCH 13/17] gtp: replace netdev_dbg and KERN_DEBUG printk with pr_debug In-Reply-To: <20170123115706.4354-1-aschultz@tpip.net> References: <20170123115706.4354-1-aschultz@tpip.net> Message-ID: <20170123115706.4354-14-aschultz@tpip.net> pr_debug is more versatile for normal debugging. Also replace netdev_dbg in in places where the network device will be remove soon. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 290c400..276cc66 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -235,7 +235,7 @@ static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb) pctx = gtp0_pdp_find(gtp, be64_to_cpu(gtp0->tid)); if (IS_ERR(pctx)) { - netdev_dbg(gtp->dev, "No PDP ctx to decap skb=%p\n", skb); + pr_debug("No PDP ctx to decap skb=%p\n", skb); return 1; } @@ -277,7 +277,7 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb) pctx = gtp1_pdp_find(gtp, ntohl(gtp1->tid)); if (IS_ERR(pctx)) { - netdev_dbg(gtp->dev, "No PDP ctx to decap skb=%p\n", skb); + pr_debug("No PDP ctx to decap skb=%p\n", skb); return 1; } @@ -296,15 +296,15 @@ static int gtp_encap_recv(struct sock *sk, struct sk_buff *skb) if (!gtp) return 1; - netdev_dbg(gtp->dev, "encap_recv sk=%p\n", sk); + pr_debug("encap_recv sk=%p\n", sk); switch (udp_sk(sk)->encap_type) { case UDP_ENCAP_GTP0: - netdev_dbg(gtp->dev, "received GTP0 packet\n"); + pr_debug("received GTP0 packet\n"); ret = gtp0_udp_encap_recv(gtp, skb); break; case UDP_ENCAP_GTP1U: - netdev_dbg(gtp->dev, "received GTP1U packet\n"); + pr_debug("received GTP1U packet\n"); ret = gtp1u_udp_encap_recv(gtp, skb); break; default: @@ -313,12 +313,12 @@ static int gtp_encap_recv(struct sock *sk, struct sk_buff *skb) switch (ret) { case 1: - netdev_dbg(gtp->dev, "pass up to the process\n"); + pr_debug("pass up to the process\n"); break; case 0: break; case -1: - netdev_dbg(gtp->dev, "GTP packet has been dropped\n"); + pr_debug("GTP packet has been dropped\n"); kfree_skb(skb); ret = 0; break; -- 2.10.2 From aschultz at tpip.net Mon Jan 23 11:56:56 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Mon, 23 Jan 2017 12:56:56 +0100 Subject: [PATCH 07/17] gtp: remove unnecessary rcu_read_lock In-Reply-To: <20170123115706.4354-1-aschultz@tpip.net> References: <20170123115706.4354-1-aschultz@tpip.net> Message-ID: <20170123115706.4354-8-aschultz@tpip.net> The rcu read lock is hold by default in the ip input path. There is no need to hold it twice in the socket recv decapsulate code path. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index bc8734b7..f434f84 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -183,7 +183,6 @@ static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, sizeof(struct gtp0_header); struct gtp0_header *gtp0; struct pdp_ctx *pctx; - int ret = 0; if (!pskb_may_pull(skb, hdrlen)) return -1; @@ -196,26 +195,19 @@ static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, if (gtp0->type != GTP_TPDU) return 1; - rcu_read_lock(); pctx = gtp0_pdp_find(gtp, be64_to_cpu(gtp0->tid)); if (IS_ERR(pctx)) { netdev_dbg(gtp->dev, "No PDP ctx to decap skb=%p\n", skb); - ret = -1; - goto out_rcu; + return -1; } if (!gtp_check_src_ms(skb, pctx, hdrlen)) { netdev_dbg(gtp->dev, "No PDP ctx for this MS\n"); - ret = -1; - goto out_rcu; + return -1; } - rcu_read_unlock(); /* Get rid of the GTP + UDP headers. */ return iptunnel_pull_header(skb, hdrlen, skb->protocol, xnet); -out_rcu: - rcu_read_unlock(); - return ret; } static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, @@ -225,7 +217,6 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, sizeof(struct gtp1_header); struct gtp1_header *gtp1; struct pdp_ctx *pctx; - int ret = 0; if (!pskb_may_pull(skb, hdrlen)) return -1; @@ -253,26 +244,19 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, gtp1 = (struct gtp1_header *)(skb->data + sizeof(struct udphdr)); - rcu_read_lock(); pctx = gtp1_pdp_find(gtp, ntohl(gtp1->tid)); if (IS_ERR(pctx)) { netdev_dbg(gtp->dev, "No PDP ctx to decap skb=%p\n", skb); - ret = -1; - goto out_rcu; + return -1; } if (!gtp_check_src_ms(skb, pctx, hdrlen)) { netdev_dbg(gtp->dev, "No PDP ctx for this MS\n"); - ret = -1; - goto out_rcu; + return -1; } - rcu_read_unlock(); /* Get rid of the GTP + UDP headers. */ return iptunnel_pull_header(skb, hdrlen, skb->protocol, xnet); -out_rcu: - rcu_read_unlock(); - return ret; } /* UDP encapsulation receive handler. See net/ipv4/udp.c. -- 2.10.2 From aschultz at tpip.net Mon Jan 23 11:57:00 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Mon, 23 Jan 2017 12:57:00 +0100 Subject: [PATCH 11/17] gtp: consolidate gtp socket rx path In-Reply-To: <20170123115706.4354-1-aschultz@tpip.net> References: <20170123115706.4354-1-aschultz@tpip.net> Message-ID: <20170123115706.4354-12-aschultz@tpip.net> Add network device to gtp context in preparation for splitting the TEID from the network device. Use this to rework the socker rx path. Move the common RX part of v0 and v1 into a helper. Also move the final rx part into that helper as well. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 92 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 47 insertions(+), 45 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 6600c92..868467d 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -58,6 +58,7 @@ struct pdp_ctx { struct in_addr ms_addr_ip4; struct in_addr sgsn_addr_ip4; + struct net_device *dev; struct sock *sk; atomic_t tx_seq; @@ -179,9 +180,42 @@ static bool gtp_check_src_ms(struct sk_buff *skb, struct pdp_ctx *pctx, return false; } +static int gtp_rx(struct sk_buff *skb, struct pdp_ctx *pctx, unsigned int hdrlen) +{ + struct pcpu_sw_netstats *stats; + + if (!gtp_check_src_ms(skb, pctx, hdrlen)) { + pr_debug("No PDP ctx for this MS\n"); + return -1; + } + + /* Get rid of the GTP + UDP headers. */ + if (iptunnel_pull_header(skb, hdrlen, skb->protocol, + !net_eq(sock_net(skb->sk), dev_net(pctx->dev)))) + return -1; + + pr_debug("forwarding packet from GGSN to uplink\n"); + + /* Now that the UDP and the GTP header have been removed, set up the + * new network header. This is required by the upper layer to + * calculate the transport header. + */ + skb_reset_network_header(skb); + + skb->dev = pctx->dev; + + stats = this_cpu_ptr(pctx->dev->tstats); + u64_stats_update_begin(&stats->syncp); + stats->rx_packets++; + stats->rx_bytes += skb->len; + u64_stats_update_end(&stats->syncp); + + netif_rx(skb); + return 0; +} + /* 1 means pass up to the stack, -1 means drop and 0 means decapsulated. */ -static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, - bool xnet) +static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb) { unsigned int hdrlen = sizeof(struct udphdr) + sizeof(struct gtp0_header); @@ -205,17 +239,10 @@ static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, return -1; } - if (!gtp_check_src_ms(skb, pctx, hdrlen)) { - netdev_dbg(gtp->dev, "No PDP ctx for this MS\n"); - return -1; - } - - /* Get rid of the GTP + UDP headers. */ - return iptunnel_pull_header(skb, hdrlen, skb->protocol, xnet); + return gtp_rx(skb, pctx, hdrlen); } -static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, - bool xnet) +static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb) { unsigned int hdrlen = sizeof(struct udphdr) + sizeof(struct gtp1_header); @@ -254,13 +281,7 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, return -1; } - if (!gtp_check_src_ms(skb, pctx, hdrlen)) { - netdev_dbg(gtp->dev, "No PDP ctx for this MS\n"); - return -1; - } - - /* Get rid of the GTP + UDP headers. */ - return iptunnel_pull_header(skb, hdrlen, skb->protocol, xnet); + return gtp_rx(skb, pctx, hdrlen); } /* UDP encapsulation receive handler. See net/ipv4/udp.c. @@ -268,10 +289,8 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, */ static int gtp_encap_recv(struct sock *sk, struct sk_buff *skb) { - struct pcpu_sw_netstats *stats; struct gtp_dev *gtp; - bool xnet; - int ret; + int ret = 0; gtp = rcu_dereference_sk_user_data(sk); if (!gtp) @@ -279,16 +298,14 @@ static int gtp_encap_recv(struct sock *sk, struct sk_buff *skb) netdev_dbg(gtp->dev, "encap_recv sk=%p\n", sk); - xnet = !net_eq(sock_net(sk), dev_net(gtp->dev)); - switch (udp_sk(sk)->encap_type) { case UDP_ENCAP_GTP0: netdev_dbg(gtp->dev, "received GTP0 packet\n"); - ret = gtp0_udp_encap_recv(gtp, skb, xnet); + ret = gtp0_udp_encap_recv(gtp, skb); break; case UDP_ENCAP_GTP1U: netdev_dbg(gtp->dev, "received GTP1U packet\n"); - ret = gtp1u_udp_encap_recv(gtp, skb, xnet); + ret = gtp1u_udp_encap_recv(gtp, skb); break; default: ret = -1; /* Shouldn't happen. */ @@ -297,33 +314,17 @@ static int gtp_encap_recv(struct sock *sk, struct sk_buff *skb) switch (ret) { case 1: netdev_dbg(gtp->dev, "pass up to the process\n"); - return 1; + break; case 0: - netdev_dbg(gtp->dev, "forwarding packet from GGSN to uplink\n"); break; case -1: netdev_dbg(gtp->dev, "GTP packet has been dropped\n"); kfree_skb(skb); - return 0; + ret = 0; + break; } - /* Now that the UDP and the GTP header have been removed, set up the - * new network header. This is required by the upper layer to - * calculate the transport header. - */ - skb_reset_network_header(skb); - - skb->dev = gtp->dev; - - stats = this_cpu_ptr(gtp->dev->tstats); - u64_stats_update_begin(&stats->syncp); - stats->rx_packets++; - stats->rx_bytes += skb->len; - u64_stats_update_end(&stats->syncp); - - netif_rx(skb); - - return 0; + return ret; } static void gtp_encap_destroy(struct sock *sk) @@ -929,6 +930,7 @@ static int ipv4_pdp_add(struct net_device *dev, struct sock *sk, sock_hold(sk); pctx->sk = sk; + pctx->dev = dev; ipv4_pdp_fill(pctx, info); atomic_set(&pctx->tx_seq, 0); -- 2.10.2 From aschultz at tpip.net Mon Jan 23 11:57:01 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Mon, 23 Jan 2017 12:57:01 +0100 Subject: [PATCH 12/17] gtp: let userspace handle packets for invalid tunnels In-Reply-To: <20170123115706.4354-1-aschultz@tpip.net> References: <20170123115706.4354-1-aschultz@tpip.net> Message-ID: <20170123115706.4354-13-aschultz@tpip.net> enable userspace to send error replies for invalid tunnels Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 868467d..290c400 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -186,7 +186,7 @@ static int gtp_rx(struct sk_buff *skb, struct pdp_ctx *pctx, unsigned int hdrlen if (!gtp_check_src_ms(skb, pctx, hdrlen)) { pr_debug("No PDP ctx for this MS\n"); - return -1; + return 1; } /* Get rid of the GTP + UDP headers. */ @@ -236,7 +236,7 @@ static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb) pctx = gtp0_pdp_find(gtp, be64_to_cpu(gtp0->tid)); if (IS_ERR(pctx)) { netdev_dbg(gtp->dev, "No PDP ctx to decap skb=%p\n", skb); - return -1; + return 1; } return gtp_rx(skb, pctx, hdrlen); @@ -278,7 +278,7 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb) pctx = gtp1_pdp_find(gtp, ntohl(gtp1->tid)); if (IS_ERR(pctx)) { netdev_dbg(gtp->dev, "No PDP ctx to decap skb=%p\n", skb); - return -1; + return 1; } return gtp_rx(skb, pctx, hdrlen); -- 2.10.2 From aschultz at tpip.net Mon Jan 23 11:56:54 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Mon, 23 Jan 2017 12:56:54 +0100 Subject: [PATCH 05/17] gtp: unify genl_find_pdp and prepare for per socket lookup In-Reply-To: <20170123115706.4354-1-aschultz@tpip.net> References: <20170123115706.4354-1-aschultz@tpip.net> Message-ID: <20170123115706.4354-6-aschultz@tpip.net> TEID are unique per socket and not per network device. Therefore the API needs to be changed here. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 99 +++++++++++++++++-------------------------------------- 1 file changed, 31 insertions(+), 68 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index e95c856..7a3c5f6 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -1044,56 +1044,61 @@ static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info) return ipv4_pdp_add(dev, info); } -static int gtp_genl_del_pdp(struct sk_buff *skb, struct genl_info *info) +static struct pdp_ctx *gtp_genl_find_pdp_by_link(struct sk_buff *skb, + struct genl_info *info) { struct net_device *dev; - struct pdp_ctx *pctx; struct gtp_dev *gtp; struct net *net; + __be32 ms_addr; - if (!info->attrs[GTPA_VERSION] || - !info->attrs[GTPA_LINK]) - return -EINVAL; + if (!info->attrs[GTPA_MS_ADDRESS]) + return ERR_PTR(-EINVAL); + ms_addr = nla_get_be32(info->attrs[GTPA_MS_ADDRESS]); net = gtp_genl_get_net(sock_net(skb->sk), info->attrs); if (IS_ERR(net)) - return PTR_ERR(net); + return ERR_PTR(PTR_ERR(net)); /* Check if there's an existing gtpX device to configure */ dev = gtp_find_dev(net, nla_get_u32(info->attrs[GTPA_LINK])); if (dev == NULL) { put_net(net); - return -ENODEV; + return ERR_PTR(-ENODEV); } put_net(net); gtp = netdev_priv(dev); - switch (nla_get_u32(info->attrs[GTPA_VERSION])) { - case GTP_V0: - if (!info->attrs[GTPA_TID]) - return -EINVAL; - pctx = gtp0_pdp_find(gtp, nla_get_u64(info->attrs[GTPA_TID])); - break; - case GTP_V1: - if (!info->attrs[GTPA_I_TEI]) - return -EINVAL; - pctx = gtp1_pdp_find(gtp, nla_get_u64(info->attrs[GTPA_I_TEI])); - break; + return ipv4_pdp_find(gtp, ms_addr); +} - default: +static struct pdp_ctx *gtp_genl_find_pdp(struct sk_buff *skb, + struct genl_info *info) +{ + if (info->attrs[GTPA_LINK]) + return gtp_genl_find_pdp_by_link(skb, info); + else + return ERR_PTR(-EINVAL); +} + +static int gtp_genl_del_pdp(struct sk_buff *skb, struct genl_info *info) +{ + struct pdp_ctx *pctx; + + if (!info->attrs[GTPA_VERSION]) return -EINVAL; - } + pctx = gtp_genl_find_pdp(skb, info); if (IS_ERR(pctx)) return PTR_ERR(pctx); if (pctx->gtp_version == GTP_V0) - netdev_dbg(dev, "GTPv0-U: deleting tunnel id = %llx (pdp %p)\n", - pctx->u.v0.tid, pctx); + pr_debug("GTPv0-U: deleting tunnel id = %llx (pdp %p)\n", + pctx->u.v0.tid, pctx); else if (pctx->gtp_version == GTP_V1) - netdev_dbg(dev, "GTPv1-U: deleting tunnel id = %x/%x (pdp %p)\n", - pctx->u.v1.i_tei, pctx->u.v1.o_tei, pctx); + pr_debug("GTPv1-U: deleting tunnel id = %x/%x (pdp %p)\n", + pctx->u.v1.i_tei, pctx->u.v1.o_tei, pctx); hlist_del_rcu(&pctx->hlist_tid); hlist_del_rcu(&pctx->hlist_addr); @@ -1143,57 +1148,15 @@ static int gtp_genl_fill_info(struct sk_buff *skb, u32 snd_portid, u32 snd_seq, static int gtp_genl_get_pdp(struct sk_buff *skb, struct genl_info *info) { struct pdp_ctx *pctx = NULL; - struct net_device *dev; struct sk_buff *skb2; - struct gtp_dev *gtp; - u32 gtp_version; - struct net *net; int err; - if (!info->attrs[GTPA_VERSION] || - !info->attrs[GTPA_LINK]) - return -EINVAL; - - gtp_version = nla_get_u32(info->attrs[GTPA_VERSION]); - switch (gtp_version) { - case GTP_V0: - case GTP_V1: - break; - default: + if (!info->attrs[GTPA_VERSION]) return -EINVAL; - } - - net = gtp_genl_get_net(sock_net(skb->sk), info->attrs); - if (IS_ERR(net)) - return PTR_ERR(net); - - /* Check if there's an existing gtpX device to configure */ - dev = gtp_find_dev(net, nla_get_u32(info->attrs[GTPA_LINK])); - if (dev == NULL) { - put_net(net); - return -ENODEV; - } - put_net(net); - - gtp = netdev_priv(dev); rcu_read_lock(); - if (gtp_version == GTP_V0 && - info->attrs[GTPA_TID]) { - u64 tid = nla_get_u64(info->attrs[GTPA_TID]); - - pctx = gtp0_pdp_find(gtp, tid); - } else if (gtp_version == GTP_V1 && - info->attrs[GTPA_I_TEI]) { - u32 tid = nla_get_u32(info->attrs[GTPA_I_TEI]); - - pctx = gtp1_pdp_find(gtp, tid); - } else if (info->attrs[GTPA_MS_ADDRESS]) { - __be32 ip = nla_get_be32(info->attrs[GTPA_MS_ADDRESS]); - - pctx = ipv4_pdp_find(gtp, ip); - } + pctx = gtp_genl_find_pdp(skb, info); if (IS_ERR(pctx)) { err = PTR_ERR(pctx); goto err_unlock; -- 2.10.2 From aschultz at tpip.net Mon Jan 23 11:57:03 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Mon, 23 Jan 2017 12:57:03 +0100 Subject: [PATCH 14/17] gtp: move TEID hash to per socket structure In-Reply-To: <20170123115706.4354-1-aschultz@tpip.net> References: <20170123115706.4354-1-aschultz@tpip.net> Message-ID: <20170123115706.4354-15-aschultz@tpip.net> Untangele the TEID information from the network device and move it into a per socket structure. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 100 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 60 insertions(+), 40 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 276cc66..019e80f 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -75,10 +75,15 @@ struct gtp_dev { struct net_device *dev; unsigned int hash_size; - struct hlist_head *tid_hash; struct hlist_head *addr_hash; }; +/* One instance of the GTP socket. */ +struct gtp_sock { + unsigned int hash_size; + struct hlist_head tid_hash[]; +}; + static unsigned int gtp_net_id __read_mostly; struct gtp_net { @@ -106,12 +111,12 @@ static inline u32 ipv4_hashfn(__be32 ip) } /* Resolve a PDP context structure based on the 64bit TID. */ -static struct pdp_ctx *gtp0_pdp_find(struct gtp_dev *gtp, u64 tid) +static struct pdp_ctx *gtp0_pdp_find(struct gtp_sock *gsk, u64 tid) { struct hlist_head *head; struct pdp_ctx *pdp; - head = >p->tid_hash[gtp0_hashfn(tid) % gtp->hash_size]; + head = &gsk->tid_hash[gtp0_hashfn(tid) % gsk->hash_size]; hlist_for_each_entry_rcu(pdp, head, hlist_tid) { if (pdp->gtp_version == GTP_V0 && @@ -122,12 +127,12 @@ static struct pdp_ctx *gtp0_pdp_find(struct gtp_dev *gtp, u64 tid) } /* Resolve a PDP context structure based on the 32bit TEI. */ -static struct pdp_ctx *gtp1_pdp_find(struct gtp_dev *gtp, u32 tid) +static struct pdp_ctx *gtp1_pdp_find(struct gtp_sock *gsk, u32 tid) { struct hlist_head *head; struct pdp_ctx *pdp; - head = >p->tid_hash[gtp1u_hashfn(tid) % gtp->hash_size]; + head = &gsk->tid_hash[gtp1u_hashfn(tid) % gsk->hash_size]; hlist_for_each_entry_rcu(pdp, head, hlist_tid) { if (pdp->gtp_version == GTP_V1 && @@ -215,7 +220,7 @@ static int gtp_rx(struct sk_buff *skb, struct pdp_ctx *pctx, unsigned int hdrlen } /* 1 means pass up to the stack, -1 means drop and 0 means decapsulated. */ -static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb) +static int gtp0_udp_encap_recv(struct gtp_sock *gsk, struct sk_buff *skb) { unsigned int hdrlen = sizeof(struct udphdr) + sizeof(struct gtp0_header); @@ -233,7 +238,7 @@ static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb) if (gtp0->type != GTP_TPDU) return 1; - pctx = gtp0_pdp_find(gtp, be64_to_cpu(gtp0->tid)); + pctx = gtp0_pdp_find(gsk, be64_to_cpu(gtp0->tid)); if (IS_ERR(pctx)) { pr_debug("No PDP ctx to decap skb=%p\n", skb); return 1; @@ -242,7 +247,7 @@ static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb) return gtp_rx(skb, pctx, hdrlen); } -static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb) +static int gtp1u_udp_encap_recv(struct gtp_sock *gsk, struct sk_buff *skb) { unsigned int hdrlen = sizeof(struct udphdr) + sizeof(struct gtp1_header); @@ -275,7 +280,7 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb) gtp1 = (struct gtp1_header *)(skb->data + sizeof(struct udphdr)); - pctx = gtp1_pdp_find(gtp, ntohl(gtp1->tid)); + pctx = gtp1_pdp_find(gsk, ntohl(gtp1->tid)); if (IS_ERR(pctx)) { pr_debug("No PDP ctx to decap skb=%p\n", skb); return 1; @@ -289,11 +294,11 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb) */ static int gtp_encap_recv(struct sock *sk, struct sk_buff *skb) { - struct gtp_dev *gtp; + struct gtp_sock *gsk; int ret = 0; - gtp = rcu_dereference_sk_user_data(sk); - if (!gtp) + gsk = rcu_dereference_sk_user_data(sk); + if (!gsk) return 1; pr_debug("encap_recv sk=%p\n", sk); @@ -301,11 +306,11 @@ static int gtp_encap_recv(struct sock *sk, struct sk_buff *skb) switch (udp_sk(sk)->encap_type) { case UDP_ENCAP_GTP0: pr_debug("received GTP0 packet\n"); - ret = gtp0_udp_encap_recv(gtp, skb); + ret = gtp0_udp_encap_recv(gsk, skb); break; case UDP_ENCAP_GTP1U: pr_debug("received GTP1U packet\n"); - ret = gtp1u_udp_encap_recv(gtp, skb); + ret = gtp1u_udp_encap_recv(gsk, skb); break; default: ret = -1; /* Shouldn't happen. */ @@ -329,12 +334,21 @@ static int gtp_encap_recv(struct sock *sk, struct sk_buff *skb) static void gtp_encap_destroy(struct sock *sk) { - struct gtp_dev *gtp; + struct gtp_sock *gsk; + struct pdp_ctx *pctx; + int i; - gtp = rcu_dereference_sk_user_data(sk); - if (gtp) { + gsk = rcu_dereference_sk_user_data(sk); + if (gsk) { udp_sk(sk)->encap_type = 0; rcu_assign_sk_user_data(sk, NULL); + + for (i = 0; i < gsk->hash_size; i++) + hlist_for_each_entry_rcu(pctx, &gsk->tid_hash[i], hlist_tid) + pdp_context_delete(pctx); + + synchronize_rcu(); + kfree(gsk); } } @@ -607,7 +621,7 @@ static void gtp_link_setup(struct net_device *dev) static int gtp_hashtable_new(struct gtp_dev *gtp, int hsize); static void gtp_hashtable_free(struct gtp_dev *gtp); static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, - struct nlattr *data[]); + int hsize, struct nlattr *data[]); static void gtp_encap_disable(struct gtp_dev *gtp); static int gtp_newlink(struct net *src_net, struct net_device *dev, @@ -625,7 +639,7 @@ static int gtp_newlink(struct net *src_net, struct net_device *dev, hashsize = nla_get_u32(data[IFLA_GTP_PDP_HASHSIZE]); if (data[IFLA_GTP_FD0] || data[IFLA_GTP_FD1]) { - err = gtp_encap_enable(dev, gtp, data); + err = gtp_encap_enable(dev, gtp, hashsize, data); if (err < 0) goto out_err; } @@ -736,20 +750,12 @@ static int gtp_hashtable_new(struct gtp_dev *gtp, int hsize) if (gtp->addr_hash == NULL) return -ENOMEM; - gtp->tid_hash = kmalloc(sizeof(struct hlist_head) * hsize, GFP_KERNEL); - if (gtp->tid_hash == NULL) - goto err1; - gtp->hash_size = hsize; - for (i = 0; i < hsize; i++) { + for (i = 0; i < hsize; i++) INIT_HLIST_HEAD(>p->addr_hash[i]); - INIT_HLIST_HEAD(>p->tid_hash[i]); - } + return 0; -err1: - kfree(gtp->addr_hash); - return -ENOMEM; } static void gtp_hashtable_free(struct gtp_dev *gtp) @@ -763,15 +769,14 @@ static void gtp_hashtable_free(struct gtp_dev *gtp) synchronize_rcu(); kfree(gtp->addr_hash); - kfree(gtp->tid_hash); } -static struct socket *gtp_encap_enable_socket(int fd, int type, - struct gtp_dev *gtp) +static struct socket *gtp_encap_enable_socket(int fd, int type, int hsize) { struct udp_tunnel_sock_cfg tuncfg = {NULL}; + struct gtp_sock *gsk; struct socket *sock; - int err; + int err, i; pr_debug("enable gtp on %d, %d\n", fd, type); @@ -787,7 +792,17 @@ static struct socket *gtp_encap_enable_socket(int fd, int type, goto out_sock; } - tuncfg.sk_user_data = gtp; + gsk = kzalloc(sizeof(*gsk) + sizeof(struct hlist_head) * hsize, GFP_KERNEL); + if (!gsk) { + err = -ENOMEM; + goto out_sock; + } + + gsk->hash_size = hsize; + for (i = 0; i < hsize; i++) + INIT_HLIST_HEAD(&gsk->tid_hash[i]); + + tuncfg.sk_user_data = gsk; tuncfg.encap_type = type; tuncfg.encap_rcv = gtp_encap_recv; tuncfg.encap_destroy = gtp_encap_destroy; @@ -801,7 +816,7 @@ static struct socket *gtp_encap_enable_socket(int fd, int type, } static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, - struct nlattr *data[]) + int hsize, struct nlattr *data[]) { struct socket *sock0 = NULL; struct socket *sock1u = NULL; @@ -809,7 +824,7 @@ static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, if (data[IFLA_GTP_FD0]) { u32 fd0 = nla_get_u32(data[IFLA_GTP_FD0]); - sock0 = gtp_encap_enable_socket(fd0, UDP_ENCAP_GTP0, gtp); + sock0 = gtp_encap_enable_socket(fd0, UDP_ENCAP_GTP0, hsize); if (IS_ERR(sock0)) return PTR_ERR(sock0); } @@ -817,7 +832,7 @@ static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, if (data[IFLA_GTP_FD1]) { u32 fd1 = nla_get_u32(data[IFLA_GTP_FD1]); - sock1u = gtp_encap_enable_socket(fd1, UDP_ENCAP_GTP1U, gtp); + sock1u = gtp_encap_enable_socket(fd1, UDP_ENCAP_GTP1U, hsize); if (IS_ERR(sock1u)) { if (sock0) sockfd_put(sock0); @@ -890,11 +905,16 @@ static int ipv4_pdp_add(struct net_device *dev, struct sock *sk, struct genl_info *info) { struct gtp_dev *gtp = netdev_priv(dev); + struct gtp_sock *gsk; u32 hash_ms, hash_tid = 0; struct pdp_ctx *pctx; bool found = false; __be32 ms_addr; + gsk = rcu_dereference_sk_user_data(sk); + if (!gsk) + return -ENODEV; + ms_addr = nla_get_be32(info->attrs[GTPA_MS_ADDRESS]); hash_ms = ipv4_hashfn(ms_addr) % gtp->hash_size; @@ -941,15 +961,15 @@ static int ipv4_pdp_add(struct net_device *dev, struct sock *sk, * situation in which this doesn't unambiguosly identify the * PDP context. */ - hash_tid = gtp0_hashfn(pctx->u.v0.tid) % gtp->hash_size; + hash_tid = gtp0_hashfn(pctx->u.v0.tid) % gsk->hash_size; break; case GTP_V1: - hash_tid = gtp1u_hashfn(pctx->u.v1.i_tei) % gtp->hash_size; + hash_tid = gtp1u_hashfn(pctx->u.v1.i_tei) % gsk->hash_size; break; } hlist_add_head_rcu(&pctx->hlist_addr, >p->addr_hash[hash_ms]); - hlist_add_head_rcu(&pctx->hlist_tid, >p->tid_hash[hash_tid]); + hlist_add_head_rcu(&pctx->hlist_tid, &gsk->tid_hash[hash_tid]); switch (pctx->gtp_version) { case GTP_V0: -- 2.10.2 From aschultz at tpip.net Mon Jan 23 11:56:58 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Mon, 23 Jan 2017 12:56:58 +0100 Subject: [PATCH 09/17] gtp: use addr_hash when traversing pdp contexts In-Reply-To: <20170123115706.4354-1-aschultz@tpip.net> References: <20170123115706.4354-1-aschultz@tpip.net> Message-ID: <20170123115706.4354-10-aschultz@tpip.net> This prepares for the removal of the tid_hash from the device. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 5b35ebb..762dd6b 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -778,7 +778,7 @@ static void gtp_hashtable_free(struct gtp_dev *gtp) int i; for (i = 0; i < gtp->hash_size; i++) - hlist_for_each_entry_rcu(pctx, >p->tid_hash[i], hlist_tid) + hlist_for_each_entry_rcu(pctx, >p->addr_hash[i], hlist_addr) pdp_context_delete(pctx); synchronize_rcu(); @@ -1188,7 +1188,7 @@ static int gtp_genl_dump_pdp(struct sk_buff *skb, last_gtp = NULL; for (i = k; i < gtp->hash_size; i++) { - hlist_for_each_entry_rcu(pctx, >p->tid_hash[i], hlist_tid) { + hlist_for_each_entry_rcu(pctx, >p->addr_hash[i], hlist_addr) { if (tid && tid != pctx->u.tid) continue; else -- 2.10.2 From aschultz at tpip.net Mon Jan 23 11:56:50 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Mon, 23 Jan 2017 12:56:50 +0100 Subject: [PATCH 01/17] gtp: add genl family modules alias In-Reply-To: <20170123115706.4354-1-aschultz@tpip.net> References: <20170123115706.4354-1-aschultz@tpip.net> Message-ID: <20170123115706.4354-2-aschultz@tpip.net> Auto-load the module when userspace asks for the gtp netlink family. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 8b6810b..7580ccc 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -1376,3 +1376,4 @@ MODULE_LICENSE("GPL"); MODULE_AUTHOR("Harald Welte "); MODULE_DESCRIPTION("Interface driver for GTP encapsulated traffic"); MODULE_ALIAS_RTNL_LINK("gtp"); +MODULE_ALIAS_GENL_FAMILY("gtp"); -- 2.10.2 From aschultz at tpip.net Mon Jan 23 11:56:57 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Mon, 23 Jan 2017 12:56:57 +0100 Subject: [PATCH 08/17] gtp: consolidate pdp context destruction into helper In-Reply-To: <20170123115706.4354-1-aschultz@tpip.net> References: <20170123115706.4354-1-aschultz@tpip.net> Message-ID: <20170123115706.4354-9-aschultz@tpip.net> Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index f434f84..5b35ebb 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -84,6 +84,8 @@ struct gtp_net { static u32 gtp_h_initval; +static void pdp_context_delete(struct pdp_ctx *pctx); + static inline u32 gtp0_hashfn(u64 tid) { u32 *tid32 = (u32 *) &tid; @@ -775,13 +777,10 @@ static void gtp_hashtable_free(struct gtp_dev *gtp) struct pdp_ctx *pctx; int i; - for (i = 0; i < gtp->hash_size; i++) { - hlist_for_each_entry_rcu(pctx, >p->tid_hash[i], hlist_tid) { - hlist_del_rcu(&pctx->hlist_tid); - hlist_del_rcu(&pctx->hlist_addr); - kfree_rcu(pctx, rcu_head); - } - } + for (i = 0; i < gtp->hash_size; i++) + hlist_for_each_entry_rcu(pctx, >p->tid_hash[i], hlist_tid) + pdp_context_delete(pctx); + synchronize_rcu(); kfree(gtp->addr_hash); kfree(gtp->tid_hash); @@ -984,6 +983,13 @@ static int ipv4_pdp_add(struct net_device *dev, struct genl_info *info) return 0; } +static void pdp_context_delete(struct pdp_ctx *pctx) +{ + hlist_del_rcu(&pctx->hlist_tid); + hlist_del_rcu(&pctx->hlist_addr); + kfree_rcu(pctx, rcu_head); +} + static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info) { struct net_device *dev; @@ -1082,10 +1088,7 @@ static int gtp_genl_del_pdp(struct sk_buff *skb, struct genl_info *info) pr_debug("GTPv1-U: deleting tunnel id = %x/%x (pdp %p)\n", pctx->u.v1.i_tei, pctx->u.v1.o_tei, pctx); - hlist_del_rcu(&pctx->hlist_tid); - hlist_del_rcu(&pctx->hlist_addr); - kfree_rcu(pctx, rcu_head); - + pdp_context_delete(pctx); return 0; } -- 2.10.2 From aschultz at tpip.net Mon Jan 23 11:57:05 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Mon, 23 Jan 2017 12:57:05 +0100 Subject: [PATCH 16/17] gtp: add genl cmd to enable GTP encapsulation on UDP socket In-Reply-To: <20170123115706.4354-1-aschultz@tpip.net> References: <20170123115706.4354-1-aschultz@tpip.net> Message-ID: <20170123115706.4354-17-aschultz@tpip.net> Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ include/uapi/linux/gtp.h | 4 ++++ 2 files changed, 52 insertions(+) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 55bf098..157cf40 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -1240,6 +1240,46 @@ static int gtp_genl_dump_pdp(struct sk_buff *skb, return skb->len; } +static int gtp_genl_enable_socket(struct sk_buff *skb, struct genl_info *info) +{ + u32 version, fd, hashsize; + struct socket *sock; + + if (!info->attrs[GTPA_VERSION] || + !info->attrs[GTPA_FD]) + return -EINVAL; + + if (!info->attrs[GTPA_PDP_HASHSIZE]) + hashsize = 1024; + else + hashsize = nla_get_u32(info->attrs[IFLA_GTP_PDP_HASHSIZE]); + + version = nla_get_u32(info->attrs[GTPA_VERSION]); + fd = nla_get_u32(info->attrs[GTPA_FD]); + + switch (version) { + case GTP_V0: + sock = gtp_encap_enable_socket(fd, UDP_ENCAP_GTP0, hashsize); + break; + + case GTP_V1: + sock = gtp_encap_enable_socket(fd, UDP_ENCAP_GTP1U, hashsize); + break; + + default: + return -EINVAL; + } + + if (!sock) + return -EINVAL; + + if (IS_ERR(sock)) + return PTR_ERR(sock); + + sockfd_put(sock); + return 0; +} + static struct nla_policy gtp_genl_policy[GTPA_MAX + 1] = { [GTPA_LINK] = { .type = NLA_U32, }, [GTPA_VERSION] = { .type = NLA_U32, }, @@ -1250,6 +1290,8 @@ static struct nla_policy gtp_genl_policy[GTPA_MAX + 1] = { [GTPA_NET_NS_FD] = { .type = NLA_U32, }, [GTPA_I_TEI] = { .type = NLA_U32, }, [GTPA_O_TEI] = { .type = NLA_U32, }, + [GTPA_PDP_HASHSIZE] = { .type = NLA_U32, }, + [GTPA_FD] = { .type = NLA_U32, }, }; static const struct genl_ops gtp_genl_ops[] = { @@ -1272,6 +1314,12 @@ static const struct genl_ops gtp_genl_ops[] = { .policy = gtp_genl_policy, .flags = GENL_ADMIN_PERM, }, + { + .cmd = GTP_CMD_ENABLE_SOCKET, + .doit = gtp_genl_enable_socket, + .policy = gtp_genl_policy, + .flags = GENL_ADMIN_PERM, + }, }; static struct genl_family gtp_genl_family __ro_after_init = { diff --git a/include/uapi/linux/gtp.h b/include/uapi/linux/gtp.h index 72a04a0..a9e9fe0 100644 --- a/include/uapi/linux/gtp.h +++ b/include/uapi/linux/gtp.h @@ -6,6 +6,8 @@ enum gtp_genl_cmds { GTP_CMD_DELPDP, GTP_CMD_GETPDP, + GTP_CMD_ENABLE_SOCKET, + GTP_CMD_MAX, }; @@ -26,6 +28,8 @@ enum gtp_attrs { GTPA_I_TEI, /* for GTPv1 only */ GTPA_O_TEI, /* for GTPv1 only */ GTPA_PAD, + GTPA_PDP_HASHSIZE, + GTPA_FD, __GTPA_MAX, }; #define GTPA_MAX (__GTPA_MAX + 1) -- 2.10.2 From aschultz at tpip.net Mon Jan 23 11:56:52 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Mon, 23 Jan 2017 12:56:52 +0100 Subject: [PATCH 03/17] gtp: make GTP sockets in gtp_newlink optional In-Reply-To: <20170123115706.4354-1-aschultz@tpip.net> References: <20170123115706.4354-1-aschultz@tpip.net> Message-ID: <20170123115706.4354-4-aschultz@tpip.net> A fixed binding of gtp enabled socket to netdevice does not make sense (GTP TEID are unique per socket and not per L3 IP device). To untangle netdevice and gtp sockets without breaking the UAPI, make per netdevice sockets optional. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 158 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 83 insertions(+), 75 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 1df54d6..60946b7 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -276,30 +276,6 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, return ret; } -static void gtp_encap_disable(struct gtp_dev *gtp) -{ - if (gtp->sock0 && gtp->sock0->sk) { - udp_sk(gtp->sock0->sk)->encap_type = 0; - rcu_assign_sk_user_data(gtp->sock0->sk, NULL); - } - if (gtp->sock1u && gtp->sock1u->sk) { - udp_sk(gtp->sock1u->sk)->encap_type = 0; - rcu_assign_sk_user_data(gtp->sock1u->sk, NULL); - } - - gtp->sock0 = NULL; - gtp->sock1u = NULL; -} - -static void gtp_encap_destroy(struct sock *sk) -{ - struct gtp_dev *gtp; - - gtp = rcu_dereference_sk_user_data(sk); - if (gtp) - gtp_encap_disable(gtp); -} - /* UDP encapsulation receive handler. See net/ipv4/udp.c. * Return codes: 0: success, <0: error, >0: pass up to userspace UDP socket. */ @@ -363,6 +339,17 @@ static int gtp_encap_recv(struct sock *sk, struct sk_buff *skb) return 0; } +static void gtp_encap_destroy(struct sock *sk) +{ + struct gtp_dev *gtp; + + gtp = rcu_dereference_sk_user_data(sk); + if (gtp) { + udp_sk(sk)->encap_type = 0; + rcu_assign_sk_user_data(sk, NULL); + } +} + static int gtp_dev_init(struct net_device *dev) { struct gtp_dev *gtp = netdev_priv(dev); @@ -378,9 +365,6 @@ static int gtp_dev_init(struct net_device *dev) static void gtp_dev_uninit(struct net_device *dev) { - struct gtp_dev *gtp = netdev_priv(dev); - - gtp_encap_disable(gtp); free_percpu(dev->tstats); } @@ -658,35 +642,32 @@ static void gtp_link_setup(struct net_device *dev) static int gtp_hashtable_new(struct gtp_dev *gtp, int hsize); static void gtp_hashtable_free(struct gtp_dev *gtp); static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, - int fd_gtp0, int fd_gtp1, struct net *src_net); + struct net *src_net, struct nlattr *data[]); +static void gtp_encap_disable(struct gtp_dev *gtp); static int gtp_newlink(struct net *src_net, struct net_device *dev, struct nlattr *tb[], struct nlattr *data[]) { - int hashsize, err, fd0, fd1; + int hashsize, err; struct gtp_dev *gtp; struct gtp_net *gn; - if (!data[IFLA_GTP_FD0] || !data[IFLA_GTP_FD1]) - return -EINVAL; - gtp = netdev_priv(dev); - fd0 = nla_get_u32(data[IFLA_GTP_FD0]); - fd1 = nla_get_u32(data[IFLA_GTP_FD1]); - - err = gtp_encap_enable(dev, gtp, fd0, fd1, src_net); - if (err < 0) - goto out_err; - if (!data[IFLA_GTP_PDP_HASHSIZE]) hashsize = 1024; else hashsize = nla_get_u32(data[IFLA_GTP_PDP_HASHSIZE]); + if (data[IFLA_GTP_FD0] || data[IFLA_GTP_FD1]) { + err = gtp_encap_enable(dev, gtp, src_net, data); + if (err < 0) + goto out_err; + } + err = gtp_hashtable_new(gtp, hashsize); if (err < 0) - goto out_encap; + goto out_socket; err = register_netdevice(dev); if (err < 0) { @@ -703,7 +684,7 @@ static int gtp_newlink(struct net *src_net, struct net_device *dev, out_hashtable: gtp_hashtable_free(gtp); -out_encap: +out_socket: gtp_encap_disable(gtp); out_err: return err; @@ -713,8 +694,11 @@ static void gtp_dellink(struct net_device *dev, struct list_head *head) { struct gtp_dev *gtp = netdev_priv(dev); - gtp_encap_disable(gtp); gtp_hashtable_free(gtp); + if (gtp->sock0) + sockfd_put(gtp->sock0); + if (gtp->sock1u) + sockfd_put(gtp->sock1u); list_del_rcu(>p->list); unregister_netdevice_queue(dev, head); } @@ -820,38 +804,63 @@ static void gtp_hashtable_free(struct gtp_dev *gtp) kfree(gtp->tid_hash); } -static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, - int fd_gtp0, int fd_gtp1, struct net *src_net) +static struct socket *gtp_encap_enable_socket(int fd, int type, + struct gtp_dev *gtp) { struct udp_tunnel_sock_cfg tuncfg = {NULL}; - struct socket *sock0, *sock1u; + struct socket *sock; int err; - netdev_dbg(dev, "enable gtp on %d, %d\n", fd_gtp0, fd_gtp1); + pr_debug("enable gtp on %d, %d\n", fd, type); - sock0 = sockfd_lookup(fd_gtp0, &err); - if (sock0 == NULL) { - netdev_dbg(dev, "socket fd=%d not found (gtp0)\n", fd_gtp0); - return -ENOENT; + sock = sockfd_lookup(fd, &err); + if (!sock) { + pr_debug("gtp socket fd=%d not found\n", fd); + return NULL; } - if (sock0->sk->sk_protocol != IPPROTO_UDP) { - netdev_dbg(dev, "socket fd=%d not UDP\n", fd_gtp0); + if (sock->sk->sk_protocol != IPPROTO_UDP) { + pr_debug("socket fd=%d not UDP\n", fd); err = -EINVAL; - goto err1; + goto out_sock; } - sock1u = sockfd_lookup(fd_gtp1, &err); - if (sock1u == NULL) { - netdev_dbg(dev, "socket fd=%d not found (gtp1u)\n", fd_gtp1); - err = -ENOENT; - goto err1; + tuncfg.sk_user_data = gtp; + tuncfg.encap_type = type; + tuncfg.encap_rcv = gtp_encap_recv; + tuncfg.encap_destroy = gtp_encap_destroy; + + setup_udp_tunnel_sock(sock_net(sock->sk), sock, &tuncfg); + return sock; + +out_sock: + sockfd_put(sock); + return ERR_PTR(err); +} + +static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, + struct net *src_net, struct nlattr *data[]) +{ + struct socket *sock0 = NULL; + struct socket *sock1u = NULL; + + if (data[IFLA_GTP_FD0]) { + u32 fd0 = nla_get_u32(data[IFLA_GTP_FD0]); + + sock0 = gtp_encap_enable_socket(fd0, UDP_ENCAP_GTP0, gtp); + if (IS_ERR(sock0)) + return PTR_ERR(sock0); } - if (sock1u->sk->sk_protocol != IPPROTO_UDP) { - netdev_dbg(dev, "socket fd=%d not UDP\n", fd_gtp1); - err = -EINVAL; - goto err2; + if (data[IFLA_GTP_FD1]) { + u32 fd1 = nla_get_u32(data[IFLA_GTP_FD1]); + + sock1u = gtp_encap_enable_socket(fd1, UDP_ENCAP_GTP1U, gtp); + if (IS_ERR(sock1u)) { + if (sock0) + sockfd_put(sock0); + return PTR_ERR(sock1u); + } } netdev_dbg(dev, "enable gtp on %p, %p\n", sock0, sock1u); @@ -860,22 +869,21 @@ static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, gtp->sock1u = sock1u; gtp->net = src_net; - tuncfg.sk_user_data = gtp; - tuncfg.encap_rcv = gtp_encap_recv; - tuncfg.encap_destroy = gtp_encap_destroy; + return 0; +} - tuncfg.encap_type = UDP_ENCAP_GTP0; - setup_udp_tunnel_sock(sock_net(gtp->sock0->sk), gtp->sock0, &tuncfg); +static void gtp_encap_disable_sock(struct socket *sock) +{ + if (!sock || !sock->sk) + return; - tuncfg.encap_type = UDP_ENCAP_GTP1U; - setup_udp_tunnel_sock(sock_net(gtp->sock1u->sk), gtp->sock1u, &tuncfg); + gtp_encap_destroy(sock->sk); +} - err = 0; -err2: - sockfd_put(sock1u); -err1: - sockfd_put(sock0); - return err; +static void gtp_encap_disable(struct gtp_dev *gtp) +{ + gtp_encap_disable_sock(gtp->sock0); + gtp_encap_disable_sock(gtp->sock1u); } static struct net_device *gtp_find_dev(struct net *net, int ifindex) -- 2.10.2 From aschultz at tpip.net Mon Jan 23 11:56:49 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Mon, 23 Jan 2017 12:56:49 +0100 Subject: [PATCH 00/17] gtp: fixes and support multiple VRF's per GTP socket Message-ID: <20170123115706.4354-1-aschultz@tpip.net> The current linking of GTP network devices and GTP enabled sockets means that we can not have multiple VRF's per GTP socket. This series seperates the sockets from network device, makes sockets attached to GTP network device optional and adds a API function to enable GTP encapsulation on socket without having to create a new GTP device. It is still possible to use the old API. The network device attached socket is then used when no socket is specified on PDP context creation. During that work some smaller problems where found and fixes for them are included. Regards Andreas -- Andreas Schultz (17): gtp: add genl family modules alias gtp: clear DF bit on GTP packet tx gtp: make GTP sockets in gtp_newlink optional gtp: return error ptr in find pdp helpers gtp: unify genl_find_pdp and prepare for per socket lookup gtp: fix cross netns recv on gtp socket gtp: remove unnecessary rcu_read_lock gtp: consolidate pdp context destruction into helper gtp: use addr_hash when traversing pdp contexts gtp: add socket to pdp context gtp: consolidate gtp socket rx path gtp: let userspace handle packets for invalid tunnels gtp: replace netdev_dbg and KERN_DEBUG printk with pr_debug gtp: move TEID hash to per socket structure gtp: rename gtp hashtable helpers gtp: add genl cmd to enable GTP encapsulation on UDP socket gtp: add support to select a GTP socket during PDP context creation drivers/net/gtp.c | 681 +++++++++++++++++++++++++++-------------------- include/uapi/linux/gtp.h | 4 + 2 files changed, 392 insertions(+), 293 deletions(-) -- 2.10.2 From aschultz at tpip.net Mon Jan 23 11:56:53 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Mon, 23 Jan 2017 12:56:53 +0100 Subject: [PATCH 04/17] gtp: return error ptr in find pdp helpers In-Reply-To: <20170123115706.4354-1-aschultz@tpip.net> References: <20170123115706.4354-1-aschultz@tpip.net> Message-ID: <20170123115706.4354-5-aschultz@tpip.net> Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 60946b7..e95c856 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -114,7 +114,7 @@ static struct pdp_ctx *gtp0_pdp_find(struct gtp_dev *gtp, u64 tid) pdp->u.v0.tid == tid) return pdp; } - return NULL; + return ERR_PTR(-ENOENT); } /* Resolve a PDP context structure based on the 32bit TEI. */ @@ -130,7 +130,7 @@ static struct pdp_ctx *gtp1_pdp_find(struct gtp_dev *gtp, u32 tid) pdp->u.v1.i_tei == tid) return pdp; } - return NULL; + return ERR_PTR(-ENOENT); } /* Resolve a PDP context based on IPv4 address of MS. */ @@ -147,7 +147,7 @@ static struct pdp_ctx *ipv4_pdp_find(struct gtp_dev *gtp, __be32 ms_addr) return pdp; } - return NULL; + return ERR_PTR(-ENOENT); } static bool gtp_check_src_ms_ipv4(struct sk_buff *skb, struct pdp_ctx *pctx, @@ -199,7 +199,7 @@ static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, rcu_read_lock(); pctx = gtp0_pdp_find(gtp, be64_to_cpu(gtp0->tid)); - if (!pctx) { + if (IS_ERR(pctx)) { netdev_dbg(gtp->dev, "No PDP ctx to decap skb=%p\n", skb); ret = -1; goto out_rcu; @@ -256,7 +256,7 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, rcu_read_lock(); pctx = gtp1_pdp_find(gtp, ntohl(gtp1->tid)); - if (!pctx) { + if (IS_ERR(pctx)) { netdev_dbg(gtp->dev, "No PDP ctx to decap skb=%p\n", skb); ret = -1; goto out_rcu; @@ -476,10 +476,10 @@ static int gtp_build_skb_ip4(struct sk_buff *skb, struct net_device *dev, */ iph = ip_hdr(skb); pctx = ipv4_pdp_find(gtp, iph->daddr); - if (!pctx) { + if (IS_ERR(pctx)) { netdev_dbg(dev, "no PDP ctx found for %pI4, skip\n", &iph->daddr); - return -ENOENT; + return PTR_ERR(pctx); } netdev_dbg(dev, "found PDP context %p\n", pctx); @@ -1085,8 +1085,8 @@ static int gtp_genl_del_pdp(struct sk_buff *skb, struct genl_info *info) return -EINVAL; } - if (pctx == NULL) - return -ENOENT; + if (IS_ERR(pctx)) + return PTR_ERR(pctx); if (pctx->gtp_version == GTP_V0) netdev_dbg(dev, "GTPv0-U: deleting tunnel id = %llx (pdp %p)\n", @@ -1194,8 +1194,8 @@ static int gtp_genl_get_pdp(struct sk_buff *skb, struct genl_info *info) pctx = ipv4_pdp_find(gtp, ip); } - if (pctx == NULL) { - err = -ENOENT; + if (IS_ERR(pctx)) { + err = PTR_ERR(pctx); goto err_unlock; } -- 2.10.2 From aschultz at tpip.net Mon Jan 23 11:57:04 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Mon, 23 Jan 2017 12:57:04 +0100 Subject: [PATCH 15/17] gtp: rename gtp hashtable helpers In-Reply-To: <20170123115706.4354-1-aschultz@tpip.net> References: <20170123115706.4354-1-aschultz@tpip.net> Message-ID: <20170123115706.4354-16-aschultz@tpip.net> The gtp_hashtable helper are now olny used for the per netdevice address hashes. Rename them to make their purpose clearer. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 019e80f..55bf098 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -618,8 +618,8 @@ static void gtp_link_setup(struct net_device *dev) sizeof(struct gtp0_header); } -static int gtp_hashtable_new(struct gtp_dev *gtp, int hsize); -static void gtp_hashtable_free(struct gtp_dev *gtp); +static int gtp_dev_hashtable_new(struct gtp_dev *gtp, int hsize); +static void gtp_dev_hashtable_free(struct gtp_dev *gtp); static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, int hsize, struct nlattr *data[]); static void gtp_encap_disable(struct gtp_dev *gtp); @@ -644,7 +644,7 @@ static int gtp_newlink(struct net *src_net, struct net_device *dev, goto out_err; } - err = gtp_hashtable_new(gtp, hashsize); + err = gtp_dev_hashtable_new(gtp, hashsize); if (err < 0) goto out_socket; @@ -662,7 +662,7 @@ static int gtp_newlink(struct net *src_net, struct net_device *dev, return 0; out_hashtable: - gtp_hashtable_free(gtp); + gtp_dev_hashtable_free(gtp); out_socket: gtp_encap_disable(gtp); out_err: @@ -673,7 +673,7 @@ static void gtp_dellink(struct net_device *dev, struct list_head *head) { struct gtp_dev *gtp = netdev_priv(dev); - gtp_hashtable_free(gtp); + gtp_dev_hashtable_free(gtp); if (gtp->sock0) sockfd_put(gtp->sock0); if (gtp->sock1u) @@ -742,7 +742,7 @@ static struct net *gtp_genl_get_net(struct net *src_net, struct nlattr *tb[]) return net; } -static int gtp_hashtable_new(struct gtp_dev *gtp, int hsize) +static int gtp_dev_hashtable_new(struct gtp_dev *gtp, int hsize) { int i; @@ -758,7 +758,7 @@ static int gtp_hashtable_new(struct gtp_dev *gtp, int hsize) return 0; } -static void gtp_hashtable_free(struct gtp_dev *gtp) +static void gtp_dev_hashtable_free(struct gtp_dev *gtp) { struct pdp_ctx *pctx; int i; -- 2.10.2 From aschultz at tpip.net Mon Jan 23 11:57:06 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Mon, 23 Jan 2017 12:57:06 +0100 Subject: [PATCH 17/17] gtp: add support to select a GTP socket during PDP context creation In-Reply-To: <20170123115706.4354-1-aschultz@tpip.net> References: <20170123115706.4354-1-aschultz@tpip.net> Message-ID: <20170123115706.4354-18-aschultz@tpip.net> Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 65 insertions(+), 3 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 157cf40..53faaa4 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -1016,6 +1016,7 @@ static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info) struct net_device *dev; struct net *net; struct socket *sock; + int err; if (!info->attrs[GTPA_VERSION] || !info->attrs[GTPA_LINK] || @@ -1053,11 +1054,19 @@ static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info) } put_net(net); - sock = gtp_genl_new_pdp_select_socket(version, dev); - if (!sock) + if (info->attrs[GTPA_FD]) + sock = sockfd_lookup(nla_get_u32(info->attrs[GTPA_FD]), &err); + else + sock = gtp_genl_new_pdp_select_socket(version, dev); + if (!sock || !sock->sk) return -ENODEV; - return ipv4_pdp_add(dev, sock->sk, info); + err = ipv4_pdp_add(dev, sock->sk, info); + + if (info->attrs[GTPA_FD]) + sockfd_put(sock); + + return err; } static struct pdp_ctx *gtp_genl_find_pdp_by_link(struct sk_buff *skb, @@ -1089,11 +1098,64 @@ static struct pdp_ctx *gtp_genl_find_pdp_by_link(struct sk_buff *skb, return ipv4_pdp_find(gtp, ms_addr); } +static struct pdp_ctx *gtp_genl_find_pdp_by_socket(struct sk_buff *skb, + struct genl_info *info) +{ + struct socket *sock; + struct gtp_sock *gsk; + struct pdp_ctx *pctx; + int fd, err = 0; + + if (!info->attrs[GTPA_FD]) + return ERR_PTR(-EINVAL); + + fd = nla_get_u32(info->attrs[GTPA_FD]); + sock = sockfd_lookup(fd, &err); + if (!sock) { + pr_debug("gtp socket fd=%d not found\n", fd); + return ERR_PTR(-EBADF); + } + + gsk = rcu_dereference_sk_user_data(sock->sk); + if (!gsk) { + pctx = ERR_PTR(-EINVAL); + goto out_sock; + } + + switch (nla_get_u32(info->attrs[GTPA_VERSION])) { + case GTP_V0: + if (!info->attrs[GTPA_TID]) { + pctx = ERR_PTR(-EINVAL); + break; + } + pctx = gtp0_pdp_find(gsk, nla_get_u64(info->attrs[GTPA_TID])); + break; + + case GTP_V1: + if (!info->attrs[GTPA_I_TEI]) { + pctx = ERR_PTR(-EINVAL); + break; + } + pctx = gtp1_pdp_find(gsk, nla_get_u64(info->attrs[GTPA_I_TEI])); + break; + + default: + pctx = ERR_PTR(-EINVAL); + break; + } + +out_sock: + sockfd_put(sock); + return pctx; +} + static struct pdp_ctx *gtp_genl_find_pdp(struct sk_buff *skb, struct genl_info *info) { if (info->attrs[GTPA_LINK]) return gtp_genl_find_pdp_by_link(skb, info); + else if (info->attrs[GTPA_FD]) + return gtp_genl_find_pdp_by_socket(skb, info); else return ERR_PTR(-EINVAL); } -- 2.10.2 From aschultz at tpip.net Mon Jan 23 11:56:59 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Mon, 23 Jan 2017 12:56:59 +0100 Subject: [PATCH 10/17] gtp: add socket to pdp context In-Reply-To: <20170123115706.4354-1-aschultz@tpip.net> References: <20170123115706.4354-1-aschultz@tpip.net> Message-ID: <20170123115706.4354-11-aschultz@tpip.net> Having the socket present in context simplifies the sending logic. It also fixes the invalid assumtion that we have to use the same sending socket for all client IP's on a specific gtp interface. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 70 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 38 insertions(+), 32 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 762dd6b..6600c92 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -58,6 +58,8 @@ struct pdp_ctx { struct in_addr ms_addr_ip4; struct in_addr sgsn_addr_ip4; + struct sock *sk; + atomic_t tx_seq; struct rcu_head rcu_head; }; @@ -353,8 +355,9 @@ static void gtp_dev_uninit(struct net_device *dev) free_percpu(dev->tstats); } -static struct rtable *ip4_route_output_gtp(struct net *net, struct flowi4 *fl4, - const struct sock *sk, __be32 daddr) +static struct rtable *ip4_route_output_gtp(struct flowi4 *fl4, + const struct sock *sk, + __be32 daddr) { memset(fl4, 0, sizeof(*fl4)); fl4->flowi4_oif = sk->sk_bound_dev_if; @@ -363,7 +366,7 @@ static struct rtable *ip4_route_output_gtp(struct net *net, struct flowi4 *fl4, fl4->flowi4_tos = RT_CONN_FLAGS(sk); fl4->flowi4_proto = sk->sk_protocol; - return ip_route_output_key(net, fl4); + return ip_route_output_key(sock_net(sk), fl4); } static inline void gtp0_push_header(struct sk_buff *skb, struct pdp_ctx *pctx) @@ -452,7 +455,6 @@ static int gtp_build_skb_ip4(struct sk_buff *skb, struct net_device *dev, struct rtable *rt; struct flowi4 fl4; struct iphdr *iph; - struct sock *sk; __be16 df; int mtu; @@ -468,30 +470,7 @@ static int gtp_build_skb_ip4(struct sk_buff *skb, struct net_device *dev, } netdev_dbg(dev, "found PDP context %p\n", pctx); - switch (pctx->gtp_version) { - case GTP_V0: - if (gtp->sock0) - sk = gtp->sock0->sk; - else - sk = NULL; - break; - case GTP_V1: - if (gtp->sock1u) - sk = gtp->sock1u->sk; - else - sk = NULL; - break; - default: - return -ENOENT; - } - - if (!sk) { - netdev_dbg(dev, "no userspace socket is available, skip\n"); - return -ENOENT; - } - - rt = ip4_route_output_gtp(sock_net(sk), &fl4, gtp->sock0->sk, - pctx->sgsn_addr_ip4.s_addr); + rt = ip4_route_output_gtp(&fl4, pctx->sk, pctx->sgsn_addr_ip4.s_addr); if (IS_ERR(rt)) { netdev_dbg(dev, "no route to SSGN %pI4\n", &pctx->sgsn_addr_ip4.s_addr); @@ -536,7 +515,7 @@ static int gtp_build_skb_ip4(struct sk_buff *skb, struct net_device *dev, goto err_rt; } - gtp_set_pktinfo_ipv4(pktinfo, sk, iph, pctx, rt, &fl4, dev); + gtp_set_pktinfo_ipv4(pktinfo, pctx->sk, iph, pctx, rt, &fl4, dev); gtp_push_header(skb, pktinfo); return 0; @@ -906,7 +885,8 @@ static void ipv4_pdp_fill(struct pdp_ctx *pctx, struct genl_info *info) } } -static int ipv4_pdp_add(struct net_device *dev, struct genl_info *info) +static int ipv4_pdp_add(struct net_device *dev, struct sock *sk, + struct genl_info *info) { struct gtp_dev *gtp = netdev_priv(dev); u32 hash_ms, hash_tid = 0; @@ -947,6 +927,8 @@ static int ipv4_pdp_add(struct net_device *dev, struct genl_info *info) if (pctx == NULL) return -ENOMEM; + sock_hold(sk); + pctx->sk = sk; ipv4_pdp_fill(pctx, info); atomic_set(&pctx->tx_seq, 0); @@ -985,15 +967,33 @@ static int ipv4_pdp_add(struct net_device *dev, struct genl_info *info) static void pdp_context_delete(struct pdp_ctx *pctx) { + sock_put(pctx->sk); hlist_del_rcu(&pctx->hlist_tid); hlist_del_rcu(&pctx->hlist_addr); kfree_rcu(pctx, rcu_head); } +static struct socket *gtp_genl_new_pdp_select_socket(int version, + struct net_device *dev) +{ + struct gtp_dev *gtp = netdev_priv(dev); + + switch (version) { + case GTP_V0: + return gtp->sock0; + case GTP_V1: + return gtp->sock1u; + default: + return NULL; + } +} + static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info) { + unsigned int version; struct net_device *dev; struct net *net; + struct socket *sock; if (!info->attrs[GTPA_VERSION] || !info->attrs[GTPA_LINK] || @@ -1001,7 +1001,9 @@ static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info) !info->attrs[GTPA_MS_ADDRESS]) return -EINVAL; - switch (nla_get_u32(info->attrs[GTPA_VERSION])) { + version = nla_get_u32(info->attrs[GTPA_VERSION]); + + switch (version) { case GTP_V0: if (!info->attrs[GTPA_TID] || !info->attrs[GTPA_FLOW]) @@ -1029,7 +1031,11 @@ static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info) } put_net(net); - return ipv4_pdp_add(dev, info); + sock = gtp_genl_new_pdp_select_socket(version, dev); + if (!sock) + return -ENODEV; + + return ipv4_pdp_add(dev, sock->sk, info); } static struct pdp_ctx *gtp_genl_find_pdp_by_link(struct sk_buff *skb, -- 2.10.2 From aschultz at tpip.net Mon Jan 23 11:56:51 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Mon, 23 Jan 2017 12:56:51 +0100 Subject: [PATCH 02/17] gtp: clear DF bit on GTP packet tx In-Reply-To: <20170123115706.4354-1-aschultz@tpip.net> References: <20170123115706.4354-1-aschultz@tpip.net> Message-ID: <20170123115706.4354-3-aschultz@tpip.net> 3GPP TS 29.281 and 3GPP TS 29.060 imply that GTP-U packets should be sent with the DF bit cleared. For example 3GPP TS 29.060, Release 8, Section 13.2.2: > Backbone router: Any router in the backbone may fragment the GTP > packet if needed, according to IPv4. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 7580ccc..1df54d6 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -612,7 +612,7 @@ static netdev_tx_t gtp_dev_xmit(struct sk_buff *skb, struct net_device *dev) pktinfo.fl4.saddr, pktinfo.fl4.daddr, pktinfo.iph->tos, ip4_dst_hoplimit(&pktinfo.rt->dst), - htons(IP_DF), + 0, pktinfo.gtph_port, pktinfo.gtph_port, true, false); break; -- 2.10.2 From msuraev at sysmocom.de Mon Jan 23 12:28:32 2017 From: msuraev at sysmocom.de (Max) Date: Mon, 23 Jan 2017 13:28:32 +0100 Subject: Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_16.04/x86_64 In-Reply-To: <20170118065940.h6gse74yjdt6qtkk@nataraja> References: <587e780d882b5_6baf4b1184917cc@build.opensuse.org> <20170118065940.h6gse74yjdt6qtkk@nataraja> Message-ID: <968fd981-f8f5-abc0-d9a2-eb218c76b6d3@sysmocom.de> Hi. That's odd: - according to https://projects.osmocom.org/projects/cellular-infrastructure/wiki/Nightly_Builds source packages made once a day by jenkins - according to https://build.opensuse.org/project/show/network:osmocom:nightly packages have not been updated in 3 days Because of that latest fixes for packaging have already landed in master but have not affected the OBS yet. Is there something wrong with jenkins? Or, contrary to what wiki says, some manual steps required? -- Max Suraev http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Geschaeftsfuehrer / Managing Director: Harald Welte From nhofmeyr at sysmocom.de Mon Jan 23 20:14:08 2017 From: nhofmeyr at sysmocom.de (Neels Hofmeyr) Date: Mon, 23 Jan 2017 21:14:08 +0100 Subject: Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_16.04/x86_64 In-Reply-To: <968fd981-f8f5-abc0-d9a2-eb218c76b6d3@sysmocom.de> References: <587e780d882b5_6baf4b1184917cc@build.opensuse.org> <20170118065940.h6gse74yjdt6qtkk@nataraja> <968fd981-f8f5-abc0-d9a2-eb218c76b6d3@sysmocom.de> Message-ID: <20170123201408.GD1736@my.box> On Mon, Jan 23, 2017 at 01:28:32PM +0100, Max wrote: > Is there something wrong with jenkins? https://jenkins.osmocom.org/jenkins/job/Osmocom_nightly_packages/ As you could have seen youself, the job has been red for the past 3 runs. [[[ + gbp buildpackage -S -uc -us --git-export-dir=/home/osmocom-build/jenkins/workspace/Osmocom_nightly_packages/osmo-bts/../data gbp:error: Can't determine upstream version from changelog Build step 'Execute shell' marked build as failure Finished: FAILURE ]]] It comes from your commit 70b71507c27f8967b0aa31cad0b3070c6780f3b4 deb: use gsm_data_shared.* from openbsc-dev because you changed the debian/source/format to "quilt". I saw that change and thought you knew what you were doing, because I certainly don't know what that does :) https://gerrit.osmocom.org/#/c/1636/1/debian/source/format If I change it back to 'native', gbp can again figure out the version number on my machine. Do you need that quilt thing for something else?? Next time maybe try to run gbp buildpackage on your machine before submitting a debian/ patch? ...should we add that to the gerrit build? ~N -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From msuraev at sysmocom.de Tue Jan 24 09:12:39 2017 From: msuraev at sysmocom.de (Max) Date: Tue, 24 Jan 2017 10:12:39 +0100 Subject: Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_16.04/x86_64 In-Reply-To: <20170123201408.GD1736@my.box> References: <587e780d882b5_6baf4b1184917cc@build.opensuse.org> <20170118065940.h6gse74yjdt6qtkk@nataraja> <968fd981-f8f5-abc0-d9a2-eb218c76b6d3@sysmocom.de> <20170123201408.GD1736@my.box> Message-ID: <90a01620-ef44-c7a5-fc44-6c16d834e4ba@sysmocom.de> Yes, it's necessary for Debian-specific patches to be applied automatically. I'll have a look into how to make gbp behave in this case. I've used dpkg-buildpackage locally and it worked well. On 23.01.2017 21:14, Neels Hofmeyr wrote: > > If I change it back to 'native', gbp can again figure out the version number on > my machine. Do you need that quilt thing for something else?? -- Max Suraev http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Geschaeftsfuehrer / Managing Director: Harald Welte From aschultz at tpip.net Tue Jan 24 15:28:32 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Tue, 24 Jan 2017 16:28:32 +0100 Subject: [PATCH v2 02/18] gtp: clear DF bit on GTP packet tx In-Reply-To: <20170124152848.6120-1-aschultz@tpip.net> References: <20170124152848.6120-1-aschultz@tpip.net> Message-ID: <20170124152848.6120-3-aschultz@tpip.net> 3GPP TS 29.281 and 3GPP TS 29.060 imply that GTP-U packets should be sent with the DF bit cleared. For example 3GPP TS 29.060, Release 8, Section 13.2.2: > Backbone router: Any router in the backbone may fragment the GTP > packet if needed, according to IPv4. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 7580ccc..1df54d6 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -612,7 +612,7 @@ static netdev_tx_t gtp_dev_xmit(struct sk_buff *skb, struct net_device *dev) pktinfo.fl4.saddr, pktinfo.fl4.daddr, pktinfo.iph->tos, ip4_dst_hoplimit(&pktinfo.rt->dst), - htons(IP_DF), + 0, pktinfo.gtph_port, pktinfo.gtph_port, true, false); break; -- 2.10.2 From aschultz at tpip.net Tue Jan 24 15:28:33 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Tue, 24 Jan 2017 16:28:33 +0100 Subject: [PATCH v2 03/18] gtp: make GTP sockets in gtp_newlink optional In-Reply-To: <20170124152848.6120-1-aschultz@tpip.net> References: <20170124152848.6120-1-aschultz@tpip.net> Message-ID: <20170124152848.6120-4-aschultz@tpip.net> A fixed binding of gtp enabled socket to netdevice does not make sense (GTP TEID are unique per socket and not per L3 IP device). To untangle netdevice and gtp sockets without breaking the UAPI, make per netdevice sockets optional. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 158 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 83 insertions(+), 75 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 1df54d6..60946b7 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -276,30 +276,6 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, return ret; } -static void gtp_encap_disable(struct gtp_dev *gtp) -{ - if (gtp->sock0 && gtp->sock0->sk) { - udp_sk(gtp->sock0->sk)->encap_type = 0; - rcu_assign_sk_user_data(gtp->sock0->sk, NULL); - } - if (gtp->sock1u && gtp->sock1u->sk) { - udp_sk(gtp->sock1u->sk)->encap_type = 0; - rcu_assign_sk_user_data(gtp->sock1u->sk, NULL); - } - - gtp->sock0 = NULL; - gtp->sock1u = NULL; -} - -static void gtp_encap_destroy(struct sock *sk) -{ - struct gtp_dev *gtp; - - gtp = rcu_dereference_sk_user_data(sk); - if (gtp) - gtp_encap_disable(gtp); -} - /* UDP encapsulation receive handler. See net/ipv4/udp.c. * Return codes: 0: success, <0: error, >0: pass up to userspace UDP socket. */ @@ -363,6 +339,17 @@ static int gtp_encap_recv(struct sock *sk, struct sk_buff *skb) return 0; } +static void gtp_encap_destroy(struct sock *sk) +{ + struct gtp_dev *gtp; + + gtp = rcu_dereference_sk_user_data(sk); + if (gtp) { + udp_sk(sk)->encap_type = 0; + rcu_assign_sk_user_data(sk, NULL); + } +} + static int gtp_dev_init(struct net_device *dev) { struct gtp_dev *gtp = netdev_priv(dev); @@ -378,9 +365,6 @@ static int gtp_dev_init(struct net_device *dev) static void gtp_dev_uninit(struct net_device *dev) { - struct gtp_dev *gtp = netdev_priv(dev); - - gtp_encap_disable(gtp); free_percpu(dev->tstats); } @@ -658,35 +642,32 @@ static void gtp_link_setup(struct net_device *dev) static int gtp_hashtable_new(struct gtp_dev *gtp, int hsize); static void gtp_hashtable_free(struct gtp_dev *gtp); static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, - int fd_gtp0, int fd_gtp1, struct net *src_net); + struct net *src_net, struct nlattr *data[]); +static void gtp_encap_disable(struct gtp_dev *gtp); static int gtp_newlink(struct net *src_net, struct net_device *dev, struct nlattr *tb[], struct nlattr *data[]) { - int hashsize, err, fd0, fd1; + int hashsize, err; struct gtp_dev *gtp; struct gtp_net *gn; - if (!data[IFLA_GTP_FD0] || !data[IFLA_GTP_FD1]) - return -EINVAL; - gtp = netdev_priv(dev); - fd0 = nla_get_u32(data[IFLA_GTP_FD0]); - fd1 = nla_get_u32(data[IFLA_GTP_FD1]); - - err = gtp_encap_enable(dev, gtp, fd0, fd1, src_net); - if (err < 0) - goto out_err; - if (!data[IFLA_GTP_PDP_HASHSIZE]) hashsize = 1024; else hashsize = nla_get_u32(data[IFLA_GTP_PDP_HASHSIZE]); + if (data[IFLA_GTP_FD0] || data[IFLA_GTP_FD1]) { + err = gtp_encap_enable(dev, gtp, src_net, data); + if (err < 0) + goto out_err; + } + err = gtp_hashtable_new(gtp, hashsize); if (err < 0) - goto out_encap; + goto out_socket; err = register_netdevice(dev); if (err < 0) { @@ -703,7 +684,7 @@ static int gtp_newlink(struct net *src_net, struct net_device *dev, out_hashtable: gtp_hashtable_free(gtp); -out_encap: +out_socket: gtp_encap_disable(gtp); out_err: return err; @@ -713,8 +694,11 @@ static void gtp_dellink(struct net_device *dev, struct list_head *head) { struct gtp_dev *gtp = netdev_priv(dev); - gtp_encap_disable(gtp); gtp_hashtable_free(gtp); + if (gtp->sock0) + sockfd_put(gtp->sock0); + if (gtp->sock1u) + sockfd_put(gtp->sock1u); list_del_rcu(>p->list); unregister_netdevice_queue(dev, head); } @@ -820,38 +804,63 @@ static void gtp_hashtable_free(struct gtp_dev *gtp) kfree(gtp->tid_hash); } -static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, - int fd_gtp0, int fd_gtp1, struct net *src_net) +static struct socket *gtp_encap_enable_socket(int fd, int type, + struct gtp_dev *gtp) { struct udp_tunnel_sock_cfg tuncfg = {NULL}; - struct socket *sock0, *sock1u; + struct socket *sock; int err; - netdev_dbg(dev, "enable gtp on %d, %d\n", fd_gtp0, fd_gtp1); + pr_debug("enable gtp on %d, %d\n", fd, type); - sock0 = sockfd_lookup(fd_gtp0, &err); - if (sock0 == NULL) { - netdev_dbg(dev, "socket fd=%d not found (gtp0)\n", fd_gtp0); - return -ENOENT; + sock = sockfd_lookup(fd, &err); + if (!sock) { + pr_debug("gtp socket fd=%d not found\n", fd); + return NULL; } - if (sock0->sk->sk_protocol != IPPROTO_UDP) { - netdev_dbg(dev, "socket fd=%d not UDP\n", fd_gtp0); + if (sock->sk->sk_protocol != IPPROTO_UDP) { + pr_debug("socket fd=%d not UDP\n", fd); err = -EINVAL; - goto err1; + goto out_sock; } - sock1u = sockfd_lookup(fd_gtp1, &err); - if (sock1u == NULL) { - netdev_dbg(dev, "socket fd=%d not found (gtp1u)\n", fd_gtp1); - err = -ENOENT; - goto err1; + tuncfg.sk_user_data = gtp; + tuncfg.encap_type = type; + tuncfg.encap_rcv = gtp_encap_recv; + tuncfg.encap_destroy = gtp_encap_destroy; + + setup_udp_tunnel_sock(sock_net(sock->sk), sock, &tuncfg); + return sock; + +out_sock: + sockfd_put(sock); + return ERR_PTR(err); +} + +static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, + struct net *src_net, struct nlattr *data[]) +{ + struct socket *sock0 = NULL; + struct socket *sock1u = NULL; + + if (data[IFLA_GTP_FD0]) { + u32 fd0 = nla_get_u32(data[IFLA_GTP_FD0]); + + sock0 = gtp_encap_enable_socket(fd0, UDP_ENCAP_GTP0, gtp); + if (IS_ERR(sock0)) + return PTR_ERR(sock0); } - if (sock1u->sk->sk_protocol != IPPROTO_UDP) { - netdev_dbg(dev, "socket fd=%d not UDP\n", fd_gtp1); - err = -EINVAL; - goto err2; + if (data[IFLA_GTP_FD1]) { + u32 fd1 = nla_get_u32(data[IFLA_GTP_FD1]); + + sock1u = gtp_encap_enable_socket(fd1, UDP_ENCAP_GTP1U, gtp); + if (IS_ERR(sock1u)) { + if (sock0) + sockfd_put(sock0); + return PTR_ERR(sock1u); + } } netdev_dbg(dev, "enable gtp on %p, %p\n", sock0, sock1u); @@ -860,22 +869,21 @@ static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, gtp->sock1u = sock1u; gtp->net = src_net; - tuncfg.sk_user_data = gtp; - tuncfg.encap_rcv = gtp_encap_recv; - tuncfg.encap_destroy = gtp_encap_destroy; + return 0; +} - tuncfg.encap_type = UDP_ENCAP_GTP0; - setup_udp_tunnel_sock(sock_net(gtp->sock0->sk), gtp->sock0, &tuncfg); +static void gtp_encap_disable_sock(struct socket *sock) +{ + if (!sock || !sock->sk) + return; - tuncfg.encap_type = UDP_ENCAP_GTP1U; - setup_udp_tunnel_sock(sock_net(gtp->sock1u->sk), gtp->sock1u, &tuncfg); + gtp_encap_destroy(sock->sk); +} - err = 0; -err2: - sockfd_put(sock1u); -err1: - sockfd_put(sock0); - return err; +static void gtp_encap_disable(struct gtp_dev *gtp) +{ + gtp_encap_disable_sock(gtp->sock0); + gtp_encap_disable_sock(gtp->sock1u); } static struct net_device *gtp_find_dev(struct net *net, int ifindex) -- 2.10.2 From aschultz at tpip.net Tue Jan 24 15:28:34 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Tue, 24 Jan 2017 16:28:34 +0100 Subject: [PATCH v2 04/18] gtp: return error ptr in find pdp helpers In-Reply-To: <20170124152848.6120-1-aschultz@tpip.net> References: <20170124152848.6120-1-aschultz@tpip.net> Message-ID: <20170124152848.6120-5-aschultz@tpip.net> Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 60946b7..e95c856 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -114,7 +114,7 @@ static struct pdp_ctx *gtp0_pdp_find(struct gtp_dev *gtp, u64 tid) pdp->u.v0.tid == tid) return pdp; } - return NULL; + return ERR_PTR(-ENOENT); } /* Resolve a PDP context structure based on the 32bit TEI. */ @@ -130,7 +130,7 @@ static struct pdp_ctx *gtp1_pdp_find(struct gtp_dev *gtp, u32 tid) pdp->u.v1.i_tei == tid) return pdp; } - return NULL; + return ERR_PTR(-ENOENT); } /* Resolve a PDP context based on IPv4 address of MS. */ @@ -147,7 +147,7 @@ static struct pdp_ctx *ipv4_pdp_find(struct gtp_dev *gtp, __be32 ms_addr) return pdp; } - return NULL; + return ERR_PTR(-ENOENT); } static bool gtp_check_src_ms_ipv4(struct sk_buff *skb, struct pdp_ctx *pctx, @@ -199,7 +199,7 @@ static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, rcu_read_lock(); pctx = gtp0_pdp_find(gtp, be64_to_cpu(gtp0->tid)); - if (!pctx) { + if (IS_ERR(pctx)) { netdev_dbg(gtp->dev, "No PDP ctx to decap skb=%p\n", skb); ret = -1; goto out_rcu; @@ -256,7 +256,7 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, rcu_read_lock(); pctx = gtp1_pdp_find(gtp, ntohl(gtp1->tid)); - if (!pctx) { + if (IS_ERR(pctx)) { netdev_dbg(gtp->dev, "No PDP ctx to decap skb=%p\n", skb); ret = -1; goto out_rcu; @@ -476,10 +476,10 @@ static int gtp_build_skb_ip4(struct sk_buff *skb, struct net_device *dev, */ iph = ip_hdr(skb); pctx = ipv4_pdp_find(gtp, iph->daddr); - if (!pctx) { + if (IS_ERR(pctx)) { netdev_dbg(dev, "no PDP ctx found for %pI4, skip\n", &iph->daddr); - return -ENOENT; + return PTR_ERR(pctx); } netdev_dbg(dev, "found PDP context %p\n", pctx); @@ -1085,8 +1085,8 @@ static int gtp_genl_del_pdp(struct sk_buff *skb, struct genl_info *info) return -EINVAL; } - if (pctx == NULL) - return -ENOENT; + if (IS_ERR(pctx)) + return PTR_ERR(pctx); if (pctx->gtp_version == GTP_V0) netdev_dbg(dev, "GTPv0-U: deleting tunnel id = %llx (pdp %p)\n", @@ -1194,8 +1194,8 @@ static int gtp_genl_get_pdp(struct sk_buff *skb, struct genl_info *info) pctx = ipv4_pdp_find(gtp, ip); } - if (pctx == NULL) { - err = -ENOENT; + if (IS_ERR(pctx)) { + err = PTR_ERR(pctx); goto err_unlock; } -- 2.10.2 From aschultz at tpip.net Tue Jan 24 15:28:35 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Tue, 24 Jan 2017 16:28:35 +0100 Subject: [PATCH v2 05/18] gtp: unify genl_find_pdp and prepare for per socket lookup In-Reply-To: <20170124152848.6120-1-aschultz@tpip.net> References: <20170124152848.6120-1-aschultz@tpip.net> Message-ID: <20170124152848.6120-6-aschultz@tpip.net> TEID are unique per socket and not per network device. Therefore the API needs to be changed here. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 99 +++++++++++++++++-------------------------------------- 1 file changed, 31 insertions(+), 68 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index e95c856..7a3c5f6 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -1044,56 +1044,61 @@ static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info) return ipv4_pdp_add(dev, info); } -static int gtp_genl_del_pdp(struct sk_buff *skb, struct genl_info *info) +static struct pdp_ctx *gtp_genl_find_pdp_by_link(struct sk_buff *skb, + struct genl_info *info) { struct net_device *dev; - struct pdp_ctx *pctx; struct gtp_dev *gtp; struct net *net; + __be32 ms_addr; - if (!info->attrs[GTPA_VERSION] || - !info->attrs[GTPA_LINK]) - return -EINVAL; + if (!info->attrs[GTPA_MS_ADDRESS]) + return ERR_PTR(-EINVAL); + ms_addr = nla_get_be32(info->attrs[GTPA_MS_ADDRESS]); net = gtp_genl_get_net(sock_net(skb->sk), info->attrs); if (IS_ERR(net)) - return PTR_ERR(net); + return ERR_PTR(PTR_ERR(net)); /* Check if there's an existing gtpX device to configure */ dev = gtp_find_dev(net, nla_get_u32(info->attrs[GTPA_LINK])); if (dev == NULL) { put_net(net); - return -ENODEV; + return ERR_PTR(-ENODEV); } put_net(net); gtp = netdev_priv(dev); - switch (nla_get_u32(info->attrs[GTPA_VERSION])) { - case GTP_V0: - if (!info->attrs[GTPA_TID]) - return -EINVAL; - pctx = gtp0_pdp_find(gtp, nla_get_u64(info->attrs[GTPA_TID])); - break; - case GTP_V1: - if (!info->attrs[GTPA_I_TEI]) - return -EINVAL; - pctx = gtp1_pdp_find(gtp, nla_get_u64(info->attrs[GTPA_I_TEI])); - break; + return ipv4_pdp_find(gtp, ms_addr); +} - default: +static struct pdp_ctx *gtp_genl_find_pdp(struct sk_buff *skb, + struct genl_info *info) +{ + if (info->attrs[GTPA_LINK]) + return gtp_genl_find_pdp_by_link(skb, info); + else + return ERR_PTR(-EINVAL); +} + +static int gtp_genl_del_pdp(struct sk_buff *skb, struct genl_info *info) +{ + struct pdp_ctx *pctx; + + if (!info->attrs[GTPA_VERSION]) return -EINVAL; - } + pctx = gtp_genl_find_pdp(skb, info); if (IS_ERR(pctx)) return PTR_ERR(pctx); if (pctx->gtp_version == GTP_V0) - netdev_dbg(dev, "GTPv0-U: deleting tunnel id = %llx (pdp %p)\n", - pctx->u.v0.tid, pctx); + pr_debug("GTPv0-U: deleting tunnel id = %llx (pdp %p)\n", + pctx->u.v0.tid, pctx); else if (pctx->gtp_version == GTP_V1) - netdev_dbg(dev, "GTPv1-U: deleting tunnel id = %x/%x (pdp %p)\n", - pctx->u.v1.i_tei, pctx->u.v1.o_tei, pctx); + pr_debug("GTPv1-U: deleting tunnel id = %x/%x (pdp %p)\n", + pctx->u.v1.i_tei, pctx->u.v1.o_tei, pctx); hlist_del_rcu(&pctx->hlist_tid); hlist_del_rcu(&pctx->hlist_addr); @@ -1143,57 +1148,15 @@ static int gtp_genl_fill_info(struct sk_buff *skb, u32 snd_portid, u32 snd_seq, static int gtp_genl_get_pdp(struct sk_buff *skb, struct genl_info *info) { struct pdp_ctx *pctx = NULL; - struct net_device *dev; struct sk_buff *skb2; - struct gtp_dev *gtp; - u32 gtp_version; - struct net *net; int err; - if (!info->attrs[GTPA_VERSION] || - !info->attrs[GTPA_LINK]) - return -EINVAL; - - gtp_version = nla_get_u32(info->attrs[GTPA_VERSION]); - switch (gtp_version) { - case GTP_V0: - case GTP_V1: - break; - default: + if (!info->attrs[GTPA_VERSION]) return -EINVAL; - } - - net = gtp_genl_get_net(sock_net(skb->sk), info->attrs); - if (IS_ERR(net)) - return PTR_ERR(net); - - /* Check if there's an existing gtpX device to configure */ - dev = gtp_find_dev(net, nla_get_u32(info->attrs[GTPA_LINK])); - if (dev == NULL) { - put_net(net); - return -ENODEV; - } - put_net(net); - - gtp = netdev_priv(dev); rcu_read_lock(); - if (gtp_version == GTP_V0 && - info->attrs[GTPA_TID]) { - u64 tid = nla_get_u64(info->attrs[GTPA_TID]); - - pctx = gtp0_pdp_find(gtp, tid); - } else if (gtp_version == GTP_V1 && - info->attrs[GTPA_I_TEI]) { - u32 tid = nla_get_u32(info->attrs[GTPA_I_TEI]); - - pctx = gtp1_pdp_find(gtp, tid); - } else if (info->attrs[GTPA_MS_ADDRESS]) { - __be32 ip = nla_get_be32(info->attrs[GTPA_MS_ADDRESS]); - - pctx = ipv4_pdp_find(gtp, ip); - } + pctx = gtp_genl_find_pdp(skb, info); if (IS_ERR(pctx)) { err = PTR_ERR(pctx); goto err_unlock; -- 2.10.2 From aschultz at tpip.net Tue Jan 24 15:28:36 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Tue, 24 Jan 2017 16:28:36 +0100 Subject: [PATCH v2 06/18] gtp: fix cross netns recv on gtp socket In-Reply-To: <20170124152848.6120-1-aschultz@tpip.net> References: <20170124152848.6120-1-aschultz@tpip.net> Message-ID: <20170124152848.6120-7-aschultz@tpip.net> The use of the paassed through netlink src_net to check for a cross netns operation was wrong. Using the GTP socket and the GTP netdevice is always correct (even if the netdev has been moved to new netns after link creation). Remove the now obsolete net field from gtp_dev. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 7a3c5f6..bc8734b7 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -69,7 +69,6 @@ struct gtp_dev { struct socket *sock0; struct socket *sock1u; - struct net *net; struct net_device *dev; unsigned int hash_size; @@ -292,7 +291,7 @@ static int gtp_encap_recv(struct sock *sk, struct sk_buff *skb) netdev_dbg(gtp->dev, "encap_recv sk=%p\n", sk); - xnet = !net_eq(gtp->net, dev_net(gtp->dev)); + xnet = !net_eq(sock_net(sk), dev_net(gtp->dev)); switch (udp_sk(sk)->encap_type) { case UDP_ENCAP_GTP0: @@ -642,7 +641,7 @@ static void gtp_link_setup(struct net_device *dev) static int gtp_hashtable_new(struct gtp_dev *gtp, int hsize); static void gtp_hashtable_free(struct gtp_dev *gtp); static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, - struct net *src_net, struct nlattr *data[]); + struct nlattr *data[]); static void gtp_encap_disable(struct gtp_dev *gtp); static int gtp_newlink(struct net *src_net, struct net_device *dev, @@ -660,7 +659,7 @@ static int gtp_newlink(struct net *src_net, struct net_device *dev, hashsize = nla_get_u32(data[IFLA_GTP_PDP_HASHSIZE]); if (data[IFLA_GTP_FD0] || data[IFLA_GTP_FD1]) { - err = gtp_encap_enable(dev, gtp, src_net, data); + err = gtp_encap_enable(dev, gtp, data); if (err < 0) goto out_err; } @@ -839,7 +838,7 @@ static struct socket *gtp_encap_enable_socket(int fd, int type, } static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, - struct net *src_net, struct nlattr *data[]) + struct nlattr *data[]) { struct socket *sock0 = NULL; struct socket *sock1u = NULL; @@ -867,7 +866,6 @@ static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, gtp->sock0 = sock0; gtp->sock1u = sock1u; - gtp->net = src_net; return 0; } -- 2.10.2 From aschultz at tpip.net Tue Jan 24 15:28:37 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Tue, 24 Jan 2017 16:28:37 +0100 Subject: [PATCH v2 07/18] gtp: remove unnecessary rcu_read_lock In-Reply-To: <20170124152848.6120-1-aschultz@tpip.net> References: <20170124152848.6120-1-aschultz@tpip.net> Message-ID: <20170124152848.6120-8-aschultz@tpip.net> The rcu read lock is hold by default in the ip input path. There is no need to hold it twice in the socket recv decapsulate code path. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index bc8734b7..f434f84 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -183,7 +183,6 @@ static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, sizeof(struct gtp0_header); struct gtp0_header *gtp0; struct pdp_ctx *pctx; - int ret = 0; if (!pskb_may_pull(skb, hdrlen)) return -1; @@ -196,26 +195,19 @@ static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, if (gtp0->type != GTP_TPDU) return 1; - rcu_read_lock(); pctx = gtp0_pdp_find(gtp, be64_to_cpu(gtp0->tid)); if (IS_ERR(pctx)) { netdev_dbg(gtp->dev, "No PDP ctx to decap skb=%p\n", skb); - ret = -1; - goto out_rcu; + return -1; } if (!gtp_check_src_ms(skb, pctx, hdrlen)) { netdev_dbg(gtp->dev, "No PDP ctx for this MS\n"); - ret = -1; - goto out_rcu; + return -1; } - rcu_read_unlock(); /* Get rid of the GTP + UDP headers. */ return iptunnel_pull_header(skb, hdrlen, skb->protocol, xnet); -out_rcu: - rcu_read_unlock(); - return ret; } static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, @@ -225,7 +217,6 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, sizeof(struct gtp1_header); struct gtp1_header *gtp1; struct pdp_ctx *pctx; - int ret = 0; if (!pskb_may_pull(skb, hdrlen)) return -1; @@ -253,26 +244,19 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, gtp1 = (struct gtp1_header *)(skb->data + sizeof(struct udphdr)); - rcu_read_lock(); pctx = gtp1_pdp_find(gtp, ntohl(gtp1->tid)); if (IS_ERR(pctx)) { netdev_dbg(gtp->dev, "No PDP ctx to decap skb=%p\n", skb); - ret = -1; - goto out_rcu; + return -1; } if (!gtp_check_src_ms(skb, pctx, hdrlen)) { netdev_dbg(gtp->dev, "No PDP ctx for this MS\n"); - ret = -1; - goto out_rcu; + return -1; } - rcu_read_unlock(); /* Get rid of the GTP + UDP headers. */ return iptunnel_pull_header(skb, hdrlen, skb->protocol, xnet); -out_rcu: - rcu_read_unlock(); - return ret; } /* UDP encapsulation receive handler. See net/ipv4/udp.c. -- 2.10.2 From aschultz at tpip.net Tue Jan 24 15:28:38 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Tue, 24 Jan 2017 16:28:38 +0100 Subject: [PATCH v2 08/18] gtp: consolidate pdp context destruction into helper In-Reply-To: <20170124152848.6120-1-aschultz@tpip.net> References: <20170124152848.6120-1-aschultz@tpip.net> Message-ID: <20170124152848.6120-9-aschultz@tpip.net> Remove duplicate code and use a rcu helper to free the structure to prepare for addition of PDP context members that need to be handled in the rcu callcack. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index f434f84..c117f63 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -84,6 +84,8 @@ struct gtp_net { static u32 gtp_h_initval; +static void pdp_context_delete(struct pdp_ctx *pctx); + static inline u32 gtp0_hashfn(u64 tid) { u32 *tid32 = (u32 *) &tid; @@ -775,13 +777,10 @@ static void gtp_hashtable_free(struct gtp_dev *gtp) struct pdp_ctx *pctx; int i; - for (i = 0; i < gtp->hash_size; i++) { - hlist_for_each_entry_rcu(pctx, >p->tid_hash[i], hlist_tid) { - hlist_del_rcu(&pctx->hlist_tid); - hlist_del_rcu(&pctx->hlist_addr); - kfree_rcu(pctx, rcu_head); - } - } + for (i = 0; i < gtp->hash_size; i++) + hlist_for_each_entry_rcu(pctx, >p->tid_hash[i], hlist_tid) + pdp_context_delete(pctx); + synchronize_rcu(); kfree(gtp->addr_hash); kfree(gtp->tid_hash); @@ -984,6 +983,20 @@ static int ipv4_pdp_add(struct net_device *dev, struct genl_info *info) return 0; } +static void pdp_context_free(struct rcu_head *head) +{ + struct pdp_ctx *pctx = container_of(head, struct pdp_ctx, rcu_head); + + kfree(pctx); +} + +static void pdp_context_delete(struct pdp_ctx *pctx) +{ + hlist_del_rcu(&pctx->hlist_tid); + hlist_del_rcu(&pctx->hlist_addr); + call_rcu(&pctx->rcu_head, pdp_context_free); +} + static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info) { struct net_device *dev; @@ -1082,10 +1095,7 @@ static int gtp_genl_del_pdp(struct sk_buff *skb, struct genl_info *info) pr_debug("GTPv1-U: deleting tunnel id = %x/%x (pdp %p)\n", pctx->u.v1.i_tei, pctx->u.v1.o_tei, pctx); - hlist_del_rcu(&pctx->hlist_tid); - hlist_del_rcu(&pctx->hlist_addr); - kfree_rcu(pctx, rcu_head); - + pdp_context_delete(pctx); return 0; } -- 2.10.2 From aschultz at tpip.net Tue Jan 24 15:28:39 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Tue, 24 Jan 2017 16:28:39 +0100 Subject: [PATCH v2 09/18] gtp: use addr_hash when traversing pdp contexts In-Reply-To: <20170124152848.6120-1-aschultz@tpip.net> References: <20170124152848.6120-1-aschultz@tpip.net> Message-ID: <20170124152848.6120-10-aschultz@tpip.net> This prepares for the removal of the tid_hash from the device. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index c117f63..c7e32a6 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -778,7 +778,7 @@ static void gtp_hashtable_free(struct gtp_dev *gtp) int i; for (i = 0; i < gtp->hash_size; i++) - hlist_for_each_entry_rcu(pctx, >p->tid_hash[i], hlist_tid) + hlist_for_each_entry_rcu(pctx, >p->addr_hash[i], hlist_addr) pdp_context_delete(pctx); synchronize_rcu(); @@ -1195,7 +1195,7 @@ static int gtp_genl_dump_pdp(struct sk_buff *skb, last_gtp = NULL; for (i = k; i < gtp->hash_size; i++) { - hlist_for_each_entry_rcu(pctx, >p->tid_hash[i], hlist_tid) { + hlist_for_each_entry_rcu(pctx, >p->addr_hash[i], hlist_addr) { if (tid && tid != pctx->u.tid) continue; else -- 2.10.2 From aschultz at tpip.net Tue Jan 24 15:28:40 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Tue, 24 Jan 2017 16:28:40 +0100 Subject: [PATCH v2 10/18] gtp: add socket to pdp context In-Reply-To: <20170124152848.6120-1-aschultz@tpip.net> References: <20170124152848.6120-1-aschultz@tpip.net> Message-ID: <20170124152848.6120-11-aschultz@tpip.net> Having the socket present in context simplifies the sending logic. It also fixes the invalid assumtion that we have to use the same sending socket for all client IP's on a specific gtp interface. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 70 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 38 insertions(+), 32 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index c7e32a6..fb93468 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -58,6 +58,8 @@ struct pdp_ctx { struct in_addr ms_addr_ip4; struct in_addr sgsn_addr_ip4; + struct sock *sk; + atomic_t tx_seq; struct rcu_head rcu_head; }; @@ -353,8 +355,9 @@ static void gtp_dev_uninit(struct net_device *dev) free_percpu(dev->tstats); } -static struct rtable *ip4_route_output_gtp(struct net *net, struct flowi4 *fl4, - const struct sock *sk, __be32 daddr) +static struct rtable *ip4_route_output_gtp(struct flowi4 *fl4, + const struct sock *sk, + __be32 daddr) { memset(fl4, 0, sizeof(*fl4)); fl4->flowi4_oif = sk->sk_bound_dev_if; @@ -363,7 +366,7 @@ static struct rtable *ip4_route_output_gtp(struct net *net, struct flowi4 *fl4, fl4->flowi4_tos = RT_CONN_FLAGS(sk); fl4->flowi4_proto = sk->sk_protocol; - return ip_route_output_key(net, fl4); + return ip_route_output_key(sock_net(sk), fl4); } static inline void gtp0_push_header(struct sk_buff *skb, struct pdp_ctx *pctx) @@ -452,7 +455,6 @@ static int gtp_build_skb_ip4(struct sk_buff *skb, struct net_device *dev, struct rtable *rt; struct flowi4 fl4; struct iphdr *iph; - struct sock *sk; __be16 df; int mtu; @@ -468,30 +470,7 @@ static int gtp_build_skb_ip4(struct sk_buff *skb, struct net_device *dev, } netdev_dbg(dev, "found PDP context %p\n", pctx); - switch (pctx->gtp_version) { - case GTP_V0: - if (gtp->sock0) - sk = gtp->sock0->sk; - else - sk = NULL; - break; - case GTP_V1: - if (gtp->sock1u) - sk = gtp->sock1u->sk; - else - sk = NULL; - break; - default: - return -ENOENT; - } - - if (!sk) { - netdev_dbg(dev, "no userspace socket is available, skip\n"); - return -ENOENT; - } - - rt = ip4_route_output_gtp(sock_net(sk), &fl4, gtp->sock0->sk, - pctx->sgsn_addr_ip4.s_addr); + rt = ip4_route_output_gtp(&fl4, pctx->sk, pctx->sgsn_addr_ip4.s_addr); if (IS_ERR(rt)) { netdev_dbg(dev, "no route to SSGN %pI4\n", &pctx->sgsn_addr_ip4.s_addr); @@ -536,7 +515,7 @@ static int gtp_build_skb_ip4(struct sk_buff *skb, struct net_device *dev, goto err_rt; } - gtp_set_pktinfo_ipv4(pktinfo, sk, iph, pctx, rt, &fl4, dev); + gtp_set_pktinfo_ipv4(pktinfo, pctx->sk, iph, pctx, rt, &fl4, dev); gtp_push_header(skb, pktinfo); return 0; @@ -906,7 +885,8 @@ static void ipv4_pdp_fill(struct pdp_ctx *pctx, struct genl_info *info) } } -static int ipv4_pdp_add(struct net_device *dev, struct genl_info *info) +static int ipv4_pdp_add(struct net_device *dev, struct sock *sk, + struct genl_info *info) { struct gtp_dev *gtp = netdev_priv(dev); u32 hash_ms, hash_tid = 0; @@ -947,6 +927,8 @@ static int ipv4_pdp_add(struct net_device *dev, struct genl_info *info) if (pctx == NULL) return -ENOMEM; + sock_hold(sk); + pctx->sk = sk; ipv4_pdp_fill(pctx, info); atomic_set(&pctx->tx_seq, 0); @@ -987,6 +969,7 @@ static void pdp_context_free(struct rcu_head *head) { struct pdp_ctx *pctx = container_of(head, struct pdp_ctx, rcu_head); + sock_put(pctx->sk); kfree(pctx); } @@ -997,10 +980,27 @@ static void pdp_context_delete(struct pdp_ctx *pctx) call_rcu(&pctx->rcu_head, pdp_context_free); } +static struct socket *gtp_genl_new_pdp_select_socket(int version, + struct net_device *dev) +{ + struct gtp_dev *gtp = netdev_priv(dev); + + switch (version) { + case GTP_V0: + return gtp->sock0; + case GTP_V1: + return gtp->sock1u; + default: + return NULL; + } +} + static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info) { + unsigned int version; struct net_device *dev; struct net *net; + struct socket *sock; if (!info->attrs[GTPA_VERSION] || !info->attrs[GTPA_LINK] || @@ -1008,7 +1008,9 @@ static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info) !info->attrs[GTPA_MS_ADDRESS]) return -EINVAL; - switch (nla_get_u32(info->attrs[GTPA_VERSION])) { + version = nla_get_u32(info->attrs[GTPA_VERSION]); + + switch (version) { case GTP_V0: if (!info->attrs[GTPA_TID] || !info->attrs[GTPA_FLOW]) @@ -1036,7 +1038,11 @@ static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info) } put_net(net); - return ipv4_pdp_add(dev, info); + sock = gtp_genl_new_pdp_select_socket(version, dev); + if (!sock) + return -ENODEV; + + return ipv4_pdp_add(dev, sock->sk, info); } static struct pdp_ctx *gtp_genl_find_pdp_by_link(struct sk_buff *skb, -- 2.10.2 From aschultz at tpip.net Tue Jan 24 15:28:41 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Tue, 24 Jan 2017 16:28:41 +0100 Subject: [PATCH v2 11/18] gtp: consolidate gtp socket rx path In-Reply-To: <20170124152848.6120-1-aschultz@tpip.net> References: <20170124152848.6120-1-aschultz@tpip.net> Message-ID: <20170124152848.6120-12-aschultz@tpip.net> Add network device to gtp context in preparation for splitting the TEID from the network device. Use this to rework the socker rx path. Move the common RX part of v0 and v1 into a helper. Also move the final rx part into that helper as well. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 92 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 47 insertions(+), 45 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index fb93468..ea97b49 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -58,6 +58,7 @@ struct pdp_ctx { struct in_addr ms_addr_ip4; struct in_addr sgsn_addr_ip4; + struct net_device *dev; struct sock *sk; atomic_t tx_seq; @@ -179,9 +180,42 @@ static bool gtp_check_src_ms(struct sk_buff *skb, struct pdp_ctx *pctx, return false; } +static int gtp_rx(struct sk_buff *skb, struct pdp_ctx *pctx, unsigned int hdrlen) +{ + struct pcpu_sw_netstats *stats; + + if (!gtp_check_src_ms(skb, pctx, hdrlen)) { + pr_debug("No PDP ctx for this MS\n"); + return -1; + } + + /* Get rid of the GTP + UDP headers. */ + if (iptunnel_pull_header(skb, hdrlen, skb->protocol, + !net_eq(sock_net(pctx->sk), dev_net(pctx->dev)))) + return -1; + + pr_debug("forwarding packet from GGSN to uplink\n"); + + /* Now that the UDP and the GTP header have been removed, set up the + * new network header. This is required by the upper layer to + * calculate the transport header. + */ + skb_reset_network_header(skb); + + skb->dev = pctx->dev; + + stats = this_cpu_ptr(pctx->dev->tstats); + u64_stats_update_begin(&stats->syncp); + stats->rx_packets++; + stats->rx_bytes += skb->len; + u64_stats_update_end(&stats->syncp); + + netif_rx(skb); + return 0; +} + /* 1 means pass up to the stack, -1 means drop and 0 means decapsulated. */ -static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, - bool xnet) +static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb) { unsigned int hdrlen = sizeof(struct udphdr) + sizeof(struct gtp0_header); @@ -205,17 +239,10 @@ static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, return -1; } - if (!gtp_check_src_ms(skb, pctx, hdrlen)) { - netdev_dbg(gtp->dev, "No PDP ctx for this MS\n"); - return -1; - } - - /* Get rid of the GTP + UDP headers. */ - return iptunnel_pull_header(skb, hdrlen, skb->protocol, xnet); + return gtp_rx(skb, pctx, hdrlen); } -static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, - bool xnet) +static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb) { unsigned int hdrlen = sizeof(struct udphdr) + sizeof(struct gtp1_header); @@ -254,13 +281,7 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, return -1; } - if (!gtp_check_src_ms(skb, pctx, hdrlen)) { - netdev_dbg(gtp->dev, "No PDP ctx for this MS\n"); - return -1; - } - - /* Get rid of the GTP + UDP headers. */ - return iptunnel_pull_header(skb, hdrlen, skb->protocol, xnet); + return gtp_rx(skb, pctx, hdrlen); } /* UDP encapsulation receive handler. See net/ipv4/udp.c. @@ -268,10 +289,8 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, */ static int gtp_encap_recv(struct sock *sk, struct sk_buff *skb) { - struct pcpu_sw_netstats *stats; struct gtp_dev *gtp; - bool xnet; - int ret; + int ret = 0; gtp = rcu_dereference_sk_user_data(sk); if (!gtp) @@ -279,16 +298,14 @@ static int gtp_encap_recv(struct sock *sk, struct sk_buff *skb) netdev_dbg(gtp->dev, "encap_recv sk=%p\n", sk); - xnet = !net_eq(sock_net(sk), dev_net(gtp->dev)); - switch (udp_sk(sk)->encap_type) { case UDP_ENCAP_GTP0: netdev_dbg(gtp->dev, "received GTP0 packet\n"); - ret = gtp0_udp_encap_recv(gtp, skb, xnet); + ret = gtp0_udp_encap_recv(gtp, skb); break; case UDP_ENCAP_GTP1U: netdev_dbg(gtp->dev, "received GTP1U packet\n"); - ret = gtp1u_udp_encap_recv(gtp, skb, xnet); + ret = gtp1u_udp_encap_recv(gtp, skb); break; default: ret = -1; /* Shouldn't happen. */ @@ -297,33 +314,17 @@ static int gtp_encap_recv(struct sock *sk, struct sk_buff *skb) switch (ret) { case 1: netdev_dbg(gtp->dev, "pass up to the process\n"); - return 1; + break; case 0: - netdev_dbg(gtp->dev, "forwarding packet from GGSN to uplink\n"); break; case -1: netdev_dbg(gtp->dev, "GTP packet has been dropped\n"); kfree_skb(skb); - return 0; + ret = 0; + break; } - /* Now that the UDP and the GTP header have been removed, set up the - * new network header. This is required by the upper layer to - * calculate the transport header. - */ - skb_reset_network_header(skb); - - skb->dev = gtp->dev; - - stats = this_cpu_ptr(gtp->dev->tstats); - u64_stats_update_begin(&stats->syncp); - stats->rx_packets++; - stats->rx_bytes += skb->len; - u64_stats_update_end(&stats->syncp); - - netif_rx(skb); - - return 0; + return ret; } static void gtp_encap_destroy(struct sock *sk) @@ -929,6 +930,7 @@ static int ipv4_pdp_add(struct net_device *dev, struct sock *sk, sock_hold(sk); pctx->sk = sk; + pctx->dev = dev; ipv4_pdp_fill(pctx, info); atomic_set(&pctx->tx_seq, 0); -- 2.10.2 From aschultz at tpip.net Tue Jan 24 15:28:31 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Tue, 24 Jan 2017 16:28:31 +0100 Subject: [PATCH v2 01/18] gtp: add genl family modules alias In-Reply-To: <20170124152848.6120-1-aschultz@tpip.net> References: <20170124152848.6120-1-aschultz@tpip.net> Message-ID: <20170124152848.6120-2-aschultz@tpip.net> Auto-load the module when userspace asks for the gtp netlink family. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 8b6810b..7580ccc 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -1376,3 +1376,4 @@ MODULE_LICENSE("GPL"); MODULE_AUTHOR("Harald Welte "); MODULE_DESCRIPTION("Interface driver for GTP encapsulated traffic"); MODULE_ALIAS_RTNL_LINK("gtp"); +MODULE_ALIAS_GENL_FAMILY("gtp"); -- 2.10.2 From aschultz at tpip.net Tue Jan 24 15:28:42 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Tue, 24 Jan 2017 16:28:42 +0100 Subject: [PATCH v2 12/18] gtp: let userspace handle packets for invalid tunnels In-Reply-To: <20170124152848.6120-1-aschultz@tpip.net> References: <20170124152848.6120-1-aschultz@tpip.net> Message-ID: <20170124152848.6120-13-aschultz@tpip.net> enable userspace to send error replies for invalid tunnels Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index ea97b49..8d74b7d 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -186,7 +186,7 @@ static int gtp_rx(struct sk_buff *skb, struct pdp_ctx *pctx, unsigned int hdrlen if (!gtp_check_src_ms(skb, pctx, hdrlen)) { pr_debug("No PDP ctx for this MS\n"); - return -1; + return 1; } /* Get rid of the GTP + UDP headers. */ @@ -236,7 +236,7 @@ static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb) pctx = gtp0_pdp_find(gtp, be64_to_cpu(gtp0->tid)); if (IS_ERR(pctx)) { netdev_dbg(gtp->dev, "No PDP ctx to decap skb=%p\n", skb); - return -1; + return 1; } return gtp_rx(skb, pctx, hdrlen); @@ -278,7 +278,7 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb) pctx = gtp1_pdp_find(gtp, ntohl(gtp1->tid)); if (IS_ERR(pctx)) { netdev_dbg(gtp->dev, "No PDP ctx to decap skb=%p\n", skb); - return -1; + return 1; } return gtp_rx(skb, pctx, hdrlen); -- 2.10.2 From aschultz at tpip.net Tue Jan 24 15:28:43 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Tue, 24 Jan 2017 16:28:43 +0100 Subject: [PATCH v2 13/18] gtp: replace netdev_dbg and KERN_DEBUG printk with pr_debug In-Reply-To: <20170124152848.6120-1-aschultz@tpip.net> References: <20170124152848.6120-1-aschultz@tpip.net> Message-ID: <20170124152848.6120-14-aschultz@tpip.net> pr_debug is more versatile for normal debugging. Also replace netdev_dbg in in places where the network device will be remove soon. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 8d74b7d..7d82252 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -235,7 +235,7 @@ static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb) pctx = gtp0_pdp_find(gtp, be64_to_cpu(gtp0->tid)); if (IS_ERR(pctx)) { - netdev_dbg(gtp->dev, "No PDP ctx to decap skb=%p\n", skb); + pr_debug("No PDP ctx to decap skb=%p\n", skb); return 1; } @@ -277,7 +277,7 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb) pctx = gtp1_pdp_find(gtp, ntohl(gtp1->tid)); if (IS_ERR(pctx)) { - netdev_dbg(gtp->dev, "No PDP ctx to decap skb=%p\n", skb); + pr_debug("No PDP ctx to decap skb=%p\n", skb); return 1; } @@ -296,15 +296,15 @@ static int gtp_encap_recv(struct sock *sk, struct sk_buff *skb) if (!gtp) return 1; - netdev_dbg(gtp->dev, "encap_recv sk=%p\n", sk); + pr_debug("encap_recv sk=%p\n", sk); switch (udp_sk(sk)->encap_type) { case UDP_ENCAP_GTP0: - netdev_dbg(gtp->dev, "received GTP0 packet\n"); + pr_debug("received GTP0 packet\n"); ret = gtp0_udp_encap_recv(gtp, skb); break; case UDP_ENCAP_GTP1U: - netdev_dbg(gtp->dev, "received GTP1U packet\n"); + pr_debug("received GTP1U packet\n"); ret = gtp1u_udp_encap_recv(gtp, skb); break; default: @@ -313,12 +313,12 @@ static int gtp_encap_recv(struct sock *sk, struct sk_buff *skb) switch (ret) { case 1: - netdev_dbg(gtp->dev, "pass up to the process\n"); + pr_debug("pass up to the process\n"); break; case 0: break; case -1: - netdev_dbg(gtp->dev, "GTP packet has been dropped\n"); + pr_debug("GTP packet has been dropped\n"); kfree_skb(skb); ret = 0; break; -- 2.10.2 From aschultz at tpip.net Tue Jan 24 15:28:30 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Tue, 24 Jan 2017 16:28:30 +0100 Subject: [PATCH v2 00/18] gtp: fixes and support multiple VRF's per GTP socket Message-ID: <20170124152848.6120-1-aschultz@tpip.net> The current linking of GTP network devices and GTP enabled sockets means that we can not have multiple VRF's per GTP socket. This series seperates the sockets from network device, makes sockets attached to GTP network device optional and adds a API function to enable GTP encapsulation on socket without having to create a new GTP device. It is still possible to use the old API. The network device attached socket is then used when no socket is specified on PDP context creation. During that work some smaller problems where found and fixes for them are included. v2 changes: * the socket that is hold by the pdp context has to be release in a rcu callback. Otherwise a stray GTP rx could end uo with an invalid socket. * accessing the skb->sk field in gtp_rx is invalid, that field has no been populated at that point * add dst_cache to speed up the routing Regards Andreas -- Andreas Schultz (18): gtp: add genl family modules alias gtp: clear DF bit on GTP packet tx gtp: make GTP sockets in gtp_newlink optional gtp: return error ptr in find pdp helpers gtp: unify genl_find_pdp and prepare for per socket lookup gtp: fix cross netns recv on gtp socket gtp: remove unnecessary rcu_read_lock gtp: consolidate pdp context destruction into helper gtp: use addr_hash when traversing pdp contexts gtp: add socket to pdp context gtp: consolidate gtp socket rx path gtp: let userspace handle packets for invalid tunnels gtp: replace netdev_dbg and KERN_DEBUG printk with pr_debug gtp: move TEID hash to per socket structure gtp: rename gtp hashtable helpers gtp: add genl cmd to enable GTP encapsulation on UDP socket gtp: add support to select a GTP socket during PDP context creation gtp: add dst_cache support drivers/net/gtp.c | 714 +++++++++++++++++++++++++++-------------------- include/uapi/linux/gtp.h | 4 + 2 files changed, 422 insertions(+), 296 deletions(-) -- 2.10.2 From aschultz at tpip.net Tue Jan 24 15:28:44 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Tue, 24 Jan 2017 16:28:44 +0100 Subject: [PATCH v2 14/18] gtp: move TEID hash to per socket structure In-Reply-To: <20170124152848.6120-1-aschultz@tpip.net> References: <20170124152848.6120-1-aschultz@tpip.net> Message-ID: <20170124152848.6120-15-aschultz@tpip.net> Untangele the TEID information from the network device and move it into a per socket structure. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 100 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 60 insertions(+), 40 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 7d82252..d2ba943 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -75,10 +75,15 @@ struct gtp_dev { struct net_device *dev; unsigned int hash_size; - struct hlist_head *tid_hash; struct hlist_head *addr_hash; }; +/* One instance of the GTP socket. */ +struct gtp_sock { + unsigned int hash_size; + struct hlist_head tid_hash[]; +}; + static unsigned int gtp_net_id __read_mostly; struct gtp_net { @@ -106,12 +111,12 @@ static inline u32 ipv4_hashfn(__be32 ip) } /* Resolve a PDP context structure based on the 64bit TID. */ -static struct pdp_ctx *gtp0_pdp_find(struct gtp_dev *gtp, u64 tid) +static struct pdp_ctx *gtp0_pdp_find(struct gtp_sock *gsk, u64 tid) { struct hlist_head *head; struct pdp_ctx *pdp; - head = >p->tid_hash[gtp0_hashfn(tid) % gtp->hash_size]; + head = &gsk->tid_hash[gtp0_hashfn(tid) % gsk->hash_size]; hlist_for_each_entry_rcu(pdp, head, hlist_tid) { if (pdp->gtp_version == GTP_V0 && @@ -122,12 +127,12 @@ static struct pdp_ctx *gtp0_pdp_find(struct gtp_dev *gtp, u64 tid) } /* Resolve a PDP context structure based on the 32bit TEI. */ -static struct pdp_ctx *gtp1_pdp_find(struct gtp_dev *gtp, u32 tid) +static struct pdp_ctx *gtp1_pdp_find(struct gtp_sock *gsk, u32 tid) { struct hlist_head *head; struct pdp_ctx *pdp; - head = >p->tid_hash[gtp1u_hashfn(tid) % gtp->hash_size]; + head = &gsk->tid_hash[gtp1u_hashfn(tid) % gsk->hash_size]; hlist_for_each_entry_rcu(pdp, head, hlist_tid) { if (pdp->gtp_version == GTP_V1 && @@ -215,7 +220,7 @@ static int gtp_rx(struct sk_buff *skb, struct pdp_ctx *pctx, unsigned int hdrlen } /* 1 means pass up to the stack, -1 means drop and 0 means decapsulated. */ -static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb) +static int gtp0_udp_encap_recv(struct gtp_sock *gsk, struct sk_buff *skb) { unsigned int hdrlen = sizeof(struct udphdr) + sizeof(struct gtp0_header); @@ -233,7 +238,7 @@ static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb) if (gtp0->type != GTP_TPDU) return 1; - pctx = gtp0_pdp_find(gtp, be64_to_cpu(gtp0->tid)); + pctx = gtp0_pdp_find(gsk, be64_to_cpu(gtp0->tid)); if (IS_ERR(pctx)) { pr_debug("No PDP ctx to decap skb=%p\n", skb); return 1; @@ -242,7 +247,7 @@ static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb) return gtp_rx(skb, pctx, hdrlen); } -static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb) +static int gtp1u_udp_encap_recv(struct gtp_sock *gsk, struct sk_buff *skb) { unsigned int hdrlen = sizeof(struct udphdr) + sizeof(struct gtp1_header); @@ -275,7 +280,7 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb) gtp1 = (struct gtp1_header *)(skb->data + sizeof(struct udphdr)); - pctx = gtp1_pdp_find(gtp, ntohl(gtp1->tid)); + pctx = gtp1_pdp_find(gsk, ntohl(gtp1->tid)); if (IS_ERR(pctx)) { pr_debug("No PDP ctx to decap skb=%p\n", skb); return 1; @@ -289,11 +294,11 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb) */ static int gtp_encap_recv(struct sock *sk, struct sk_buff *skb) { - struct gtp_dev *gtp; + struct gtp_sock *gsk; int ret = 0; - gtp = rcu_dereference_sk_user_data(sk); - if (!gtp) + gsk = rcu_dereference_sk_user_data(sk); + if (!gsk) return 1; pr_debug("encap_recv sk=%p\n", sk); @@ -301,11 +306,11 @@ static int gtp_encap_recv(struct sock *sk, struct sk_buff *skb) switch (udp_sk(sk)->encap_type) { case UDP_ENCAP_GTP0: pr_debug("received GTP0 packet\n"); - ret = gtp0_udp_encap_recv(gtp, skb); + ret = gtp0_udp_encap_recv(gsk, skb); break; case UDP_ENCAP_GTP1U: pr_debug("received GTP1U packet\n"); - ret = gtp1u_udp_encap_recv(gtp, skb); + ret = gtp1u_udp_encap_recv(gsk, skb); break; default: ret = -1; /* Shouldn't happen. */ @@ -329,12 +334,21 @@ static int gtp_encap_recv(struct sock *sk, struct sk_buff *skb) static void gtp_encap_destroy(struct sock *sk) { - struct gtp_dev *gtp; + struct gtp_sock *gsk; + struct pdp_ctx *pctx; + int i; - gtp = rcu_dereference_sk_user_data(sk); - if (gtp) { + gsk = rcu_dereference_sk_user_data(sk); + if (gsk) { udp_sk(sk)->encap_type = 0; rcu_assign_sk_user_data(sk, NULL); + + for (i = 0; i < gsk->hash_size; i++) + hlist_for_each_entry_rcu(pctx, &gsk->tid_hash[i], hlist_tid) + pdp_context_delete(pctx); + + synchronize_rcu(); + kfree(gsk); } } @@ -607,7 +621,7 @@ static void gtp_link_setup(struct net_device *dev) static int gtp_hashtable_new(struct gtp_dev *gtp, int hsize); static void gtp_hashtable_free(struct gtp_dev *gtp); static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, - struct nlattr *data[]); + int hsize, struct nlattr *data[]); static void gtp_encap_disable(struct gtp_dev *gtp); static int gtp_newlink(struct net *src_net, struct net_device *dev, @@ -625,7 +639,7 @@ static int gtp_newlink(struct net *src_net, struct net_device *dev, hashsize = nla_get_u32(data[IFLA_GTP_PDP_HASHSIZE]); if (data[IFLA_GTP_FD0] || data[IFLA_GTP_FD1]) { - err = gtp_encap_enable(dev, gtp, data); + err = gtp_encap_enable(dev, gtp, hashsize, data); if (err < 0) goto out_err; } @@ -736,20 +750,12 @@ static int gtp_hashtable_new(struct gtp_dev *gtp, int hsize) if (gtp->addr_hash == NULL) return -ENOMEM; - gtp->tid_hash = kmalloc(sizeof(struct hlist_head) * hsize, GFP_KERNEL); - if (gtp->tid_hash == NULL) - goto err1; - gtp->hash_size = hsize; - for (i = 0; i < hsize; i++) { + for (i = 0; i < hsize; i++) INIT_HLIST_HEAD(>p->addr_hash[i]); - INIT_HLIST_HEAD(>p->tid_hash[i]); - } + return 0; -err1: - kfree(gtp->addr_hash); - return -ENOMEM; } static void gtp_hashtable_free(struct gtp_dev *gtp) @@ -763,15 +769,14 @@ static void gtp_hashtable_free(struct gtp_dev *gtp) synchronize_rcu(); kfree(gtp->addr_hash); - kfree(gtp->tid_hash); } -static struct socket *gtp_encap_enable_socket(int fd, int type, - struct gtp_dev *gtp) +static struct socket *gtp_encap_enable_socket(int fd, int type, int hsize) { struct udp_tunnel_sock_cfg tuncfg = {NULL}; + struct gtp_sock *gsk; struct socket *sock; - int err; + int err, i; pr_debug("enable gtp on %d, %d\n", fd, type); @@ -787,7 +792,17 @@ static struct socket *gtp_encap_enable_socket(int fd, int type, goto out_sock; } - tuncfg.sk_user_data = gtp; + gsk = kzalloc(sizeof(*gsk) + sizeof(struct hlist_head) * hsize, GFP_KERNEL); + if (!gsk) { + err = -ENOMEM; + goto out_sock; + } + + gsk->hash_size = hsize; + for (i = 0; i < hsize; i++) + INIT_HLIST_HEAD(&gsk->tid_hash[i]); + + tuncfg.sk_user_data = gsk; tuncfg.encap_type = type; tuncfg.encap_rcv = gtp_encap_recv; tuncfg.encap_destroy = gtp_encap_destroy; @@ -801,7 +816,7 @@ static struct socket *gtp_encap_enable_socket(int fd, int type, } static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, - struct nlattr *data[]) + int hsize, struct nlattr *data[]) { struct socket *sock0 = NULL; struct socket *sock1u = NULL; @@ -809,7 +824,7 @@ static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, if (data[IFLA_GTP_FD0]) { u32 fd0 = nla_get_u32(data[IFLA_GTP_FD0]); - sock0 = gtp_encap_enable_socket(fd0, UDP_ENCAP_GTP0, gtp); + sock0 = gtp_encap_enable_socket(fd0, UDP_ENCAP_GTP0, hsize); if (IS_ERR(sock0)) return PTR_ERR(sock0); } @@ -817,7 +832,7 @@ static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, if (data[IFLA_GTP_FD1]) { u32 fd1 = nla_get_u32(data[IFLA_GTP_FD1]); - sock1u = gtp_encap_enable_socket(fd1, UDP_ENCAP_GTP1U, gtp); + sock1u = gtp_encap_enable_socket(fd1, UDP_ENCAP_GTP1U, hsize); if (IS_ERR(sock1u)) { if (sock0) sockfd_put(sock0); @@ -890,11 +905,16 @@ static int ipv4_pdp_add(struct net_device *dev, struct sock *sk, struct genl_info *info) { struct gtp_dev *gtp = netdev_priv(dev); + struct gtp_sock *gsk; u32 hash_ms, hash_tid = 0; struct pdp_ctx *pctx; bool found = false; __be32 ms_addr; + gsk = rcu_dereference_sk_user_data(sk); + if (!gsk) + return -ENODEV; + ms_addr = nla_get_be32(info->attrs[GTPA_MS_ADDRESS]); hash_ms = ipv4_hashfn(ms_addr) % gtp->hash_size; @@ -941,15 +961,15 @@ static int ipv4_pdp_add(struct net_device *dev, struct sock *sk, * situation in which this doesn't unambiguosly identify the * PDP context. */ - hash_tid = gtp0_hashfn(pctx->u.v0.tid) % gtp->hash_size; + hash_tid = gtp0_hashfn(pctx->u.v0.tid) % gsk->hash_size; break; case GTP_V1: - hash_tid = gtp1u_hashfn(pctx->u.v1.i_tei) % gtp->hash_size; + hash_tid = gtp1u_hashfn(pctx->u.v1.i_tei) % gsk->hash_size; break; } hlist_add_head_rcu(&pctx->hlist_addr, >p->addr_hash[hash_ms]); - hlist_add_head_rcu(&pctx->hlist_tid, >p->tid_hash[hash_tid]); + hlist_add_head_rcu(&pctx->hlist_tid, &gsk->tid_hash[hash_tid]); switch (pctx->gtp_version) { case GTP_V0: -- 2.10.2 From aschultz at tpip.net Tue Jan 24 15:28:45 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Tue, 24 Jan 2017 16:28:45 +0100 Subject: [PATCH v2 15/18] gtp: rename gtp hashtable helpers In-Reply-To: <20170124152848.6120-1-aschultz@tpip.net> References: <20170124152848.6120-1-aschultz@tpip.net> Message-ID: <20170124152848.6120-16-aschultz@tpip.net> The gtp_hashtable helper are now olny used for the per netdevice address hashes. Rename them to make their purpose clearer. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index d2ba943..9e5f858 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -618,8 +618,8 @@ static void gtp_link_setup(struct net_device *dev) sizeof(struct gtp0_header); } -static int gtp_hashtable_new(struct gtp_dev *gtp, int hsize); -static void gtp_hashtable_free(struct gtp_dev *gtp); +static int gtp_dev_hashtable_new(struct gtp_dev *gtp, int hsize); +static void gtp_dev_hashtable_free(struct gtp_dev *gtp); static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, int hsize, struct nlattr *data[]); static void gtp_encap_disable(struct gtp_dev *gtp); @@ -644,7 +644,7 @@ static int gtp_newlink(struct net *src_net, struct net_device *dev, goto out_err; } - err = gtp_hashtable_new(gtp, hashsize); + err = gtp_dev_hashtable_new(gtp, hashsize); if (err < 0) goto out_socket; @@ -662,7 +662,7 @@ static int gtp_newlink(struct net *src_net, struct net_device *dev, return 0; out_hashtable: - gtp_hashtable_free(gtp); + gtp_dev_hashtable_free(gtp); out_socket: gtp_encap_disable(gtp); out_err: @@ -673,7 +673,7 @@ static void gtp_dellink(struct net_device *dev, struct list_head *head) { struct gtp_dev *gtp = netdev_priv(dev); - gtp_hashtable_free(gtp); + gtp_dev_hashtable_free(gtp); if (gtp->sock0) sockfd_put(gtp->sock0); if (gtp->sock1u) @@ -742,7 +742,7 @@ static struct net *gtp_genl_get_net(struct net *src_net, struct nlattr *tb[]) return net; } -static int gtp_hashtable_new(struct gtp_dev *gtp, int hsize) +static int gtp_dev_hashtable_new(struct gtp_dev *gtp, int hsize) { int i; @@ -758,7 +758,7 @@ static int gtp_hashtable_new(struct gtp_dev *gtp, int hsize) return 0; } -static void gtp_hashtable_free(struct gtp_dev *gtp) +static void gtp_dev_hashtable_free(struct gtp_dev *gtp) { struct pdp_ctx *pctx; int i; -- 2.10.2 From aschultz at tpip.net Tue Jan 24 15:28:47 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Tue, 24 Jan 2017 16:28:47 +0100 Subject: [PATCH v2 17/18] gtp: add support to select a GTP socket during PDP context creation In-Reply-To: <20170124152848.6120-1-aschultz@tpip.net> References: <20170124152848.6120-1-aschultz@tpip.net> Message-ID: <20170124152848.6120-18-aschultz@tpip.net> Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 65 insertions(+), 3 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index c6c1f0d..4637ce7 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -1023,6 +1023,7 @@ static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info) struct net_device *dev; struct net *net; struct socket *sock; + int err; if (!info->attrs[GTPA_VERSION] || !info->attrs[GTPA_LINK] || @@ -1060,11 +1061,19 @@ static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info) } put_net(net); - sock = gtp_genl_new_pdp_select_socket(version, dev); - if (!sock) + if (info->attrs[GTPA_FD]) + sock = sockfd_lookup(nla_get_u32(info->attrs[GTPA_FD]), &err); + else + sock = gtp_genl_new_pdp_select_socket(version, dev); + if (!sock || !sock->sk) return -ENODEV; - return ipv4_pdp_add(dev, sock->sk, info); + err = ipv4_pdp_add(dev, sock->sk, info); + + if (info->attrs[GTPA_FD]) + sockfd_put(sock); + + return err; } static struct pdp_ctx *gtp_genl_find_pdp_by_link(struct sk_buff *skb, @@ -1096,11 +1105,64 @@ static struct pdp_ctx *gtp_genl_find_pdp_by_link(struct sk_buff *skb, return ipv4_pdp_find(gtp, ms_addr); } +static struct pdp_ctx *gtp_genl_find_pdp_by_socket(struct sk_buff *skb, + struct genl_info *info) +{ + struct socket *sock; + struct gtp_sock *gsk; + struct pdp_ctx *pctx; + int fd, err = 0; + + if (!info->attrs[GTPA_FD]) + return ERR_PTR(-EINVAL); + + fd = nla_get_u32(info->attrs[GTPA_FD]); + sock = sockfd_lookup(fd, &err); + if (!sock) { + pr_debug("gtp socket fd=%d not found\n", fd); + return ERR_PTR(-EBADF); + } + + gsk = rcu_dereference_sk_user_data(sock->sk); + if (!gsk) { + pctx = ERR_PTR(-EINVAL); + goto out_sock; + } + + switch (nla_get_u32(info->attrs[GTPA_VERSION])) { + case GTP_V0: + if (!info->attrs[GTPA_TID]) { + pctx = ERR_PTR(-EINVAL); + break; + } + pctx = gtp0_pdp_find(gsk, nla_get_u64(info->attrs[GTPA_TID])); + break; + + case GTP_V1: + if (!info->attrs[GTPA_I_TEI]) { + pctx = ERR_PTR(-EINVAL); + break; + } + pctx = gtp1_pdp_find(gsk, nla_get_u64(info->attrs[GTPA_I_TEI])); + break; + + default: + pctx = ERR_PTR(-EINVAL); + break; + } + +out_sock: + sockfd_put(sock); + return pctx; +} + static struct pdp_ctx *gtp_genl_find_pdp(struct sk_buff *skb, struct genl_info *info) { if (info->attrs[GTPA_LINK]) return gtp_genl_find_pdp_by_link(skb, info); + else if (info->attrs[GTPA_FD]) + return gtp_genl_find_pdp_by_socket(skb, info); else return ERR_PTR(-EINVAL); } -- 2.10.2 From aschultz at tpip.net Tue Jan 24 15:28:46 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Tue, 24 Jan 2017 16:28:46 +0100 Subject: [PATCH v2 16/18] gtp: add genl cmd to enable GTP encapsulation on UDP socket In-Reply-To: <20170124152848.6120-1-aschultz@tpip.net> References: <20170124152848.6120-1-aschultz@tpip.net> Message-ID: <20170124152848.6120-17-aschultz@tpip.net> Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ include/uapi/linux/gtp.h | 4 ++++ 2 files changed, 52 insertions(+) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 9e5f858..c6c1f0d 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -1247,6 +1247,46 @@ static int gtp_genl_dump_pdp(struct sk_buff *skb, return skb->len; } +static int gtp_genl_enable_socket(struct sk_buff *skb, struct genl_info *info) +{ + u32 version, fd, hashsize; + struct socket *sock; + + if (!info->attrs[GTPA_VERSION] || + !info->attrs[GTPA_FD]) + return -EINVAL; + + if (!info->attrs[GTPA_PDP_HASHSIZE]) + hashsize = 1024; + else + hashsize = nla_get_u32(info->attrs[IFLA_GTP_PDP_HASHSIZE]); + + version = nla_get_u32(info->attrs[GTPA_VERSION]); + fd = nla_get_u32(info->attrs[GTPA_FD]); + + switch (version) { + case GTP_V0: + sock = gtp_encap_enable_socket(fd, UDP_ENCAP_GTP0, hashsize); + break; + + case GTP_V1: + sock = gtp_encap_enable_socket(fd, UDP_ENCAP_GTP1U, hashsize); + break; + + default: + return -EINVAL; + } + + if (!sock) + return -EINVAL; + + if (IS_ERR(sock)) + return PTR_ERR(sock); + + sockfd_put(sock); + return 0; +} + static struct nla_policy gtp_genl_policy[GTPA_MAX + 1] = { [GTPA_LINK] = { .type = NLA_U32, }, [GTPA_VERSION] = { .type = NLA_U32, }, @@ -1257,6 +1297,8 @@ static struct nla_policy gtp_genl_policy[GTPA_MAX + 1] = { [GTPA_NET_NS_FD] = { .type = NLA_U32, }, [GTPA_I_TEI] = { .type = NLA_U32, }, [GTPA_O_TEI] = { .type = NLA_U32, }, + [GTPA_PDP_HASHSIZE] = { .type = NLA_U32, }, + [GTPA_FD] = { .type = NLA_U32, }, }; static const struct genl_ops gtp_genl_ops[] = { @@ -1279,6 +1321,12 @@ static const struct genl_ops gtp_genl_ops[] = { .policy = gtp_genl_policy, .flags = GENL_ADMIN_PERM, }, + { + .cmd = GTP_CMD_ENABLE_SOCKET, + .doit = gtp_genl_enable_socket, + .policy = gtp_genl_policy, + .flags = GENL_ADMIN_PERM, + }, }; static struct genl_family gtp_genl_family __ro_after_init = { diff --git a/include/uapi/linux/gtp.h b/include/uapi/linux/gtp.h index 72a04a0..a9e9fe0 100644 --- a/include/uapi/linux/gtp.h +++ b/include/uapi/linux/gtp.h @@ -6,6 +6,8 @@ enum gtp_genl_cmds { GTP_CMD_DELPDP, GTP_CMD_GETPDP, + GTP_CMD_ENABLE_SOCKET, + GTP_CMD_MAX, }; @@ -26,6 +28,8 @@ enum gtp_attrs { GTPA_I_TEI, /* for GTPv1 only */ GTPA_O_TEI, /* for GTPv1 only */ GTPA_PAD, + GTPA_PDP_HASHSIZE, + GTPA_FD, __GTPA_MAX, }; #define GTPA_MAX (__GTPA_MAX + 1) -- 2.10.2 From aschultz at tpip.net Tue Jan 24 15:28:48 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Tue, 24 Jan 2017 16:28:48 +0100 Subject: [PATCH v2 18/18] gtp: add dst_cache support In-Reply-To: <20170124152848.6120-1-aschultz@tpip.net> References: <20170124152848.6120-1-aschultz@tpip.net> Message-ID: <20170124152848.6120-19-aschultz@tpip.net> Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 4637ce7..c3e40cc 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -61,6 +61,10 @@ struct pdp_ctx { struct net_device *dev; struct sock *sk; +#ifdef CONFIG_DST_CACHE + struct dst_cache dst_cache; +#endif + atomic_t tx_seq; struct rcu_head rcu_head; }; @@ -485,12 +489,18 @@ static int gtp_build_skb_ip4(struct sk_buff *skb, struct net_device *dev, } netdev_dbg(dev, "found PDP context %p\n", pctx); - rt = ip4_route_output_gtp(&fl4, pctx->sk, pctx->sgsn_addr_ip4.s_addr); - if (IS_ERR(rt)) { - netdev_dbg(dev, "no route to SSGN %pI4\n", - &pctx->sgsn_addr_ip4.s_addr); - dev->stats.tx_carrier_errors++; - goto err; + rt = dst_cache_get_ip4(&pctx->dst_cache, &pctx->sgsn_addr_ip4.s_addr); + if (!rt) { + rt = ip4_route_output_gtp(&fl4, pctx->sk, pctx->sgsn_addr_ip4.s_addr); + if (IS_ERR(rt)) { + netdev_dbg(dev, "no route to SSGN %pI4\n", + &pctx->sgsn_addr_ip4.s_addr); + dev->stats.tx_carrier_errors++; + goto err; + } + + dst_cache_set_ip4(&pctx->dst_cache, &rt->dst, + pctx->sgsn_addr_ip4.s_addr); } if (rt->dst.dev == dev) { @@ -883,6 +893,8 @@ static void ipv4_pdp_fill(struct pdp_ctx *pctx, struct genl_info *info) pctx->ms_addr_ip4.s_addr = nla_get_be32(info->attrs[GTPA_MS_ADDRESS]); + dst_cache_reset(&pctx->dst_cache); + switch (pctx->gtp_version) { case GTP_V0: /* According to TS 09.60, sections 7.5.1 and 7.5.2, the flow @@ -910,6 +922,7 @@ static int ipv4_pdp_add(struct net_device *dev, struct sock *sk, struct pdp_ctx *pctx; bool found = false; __be32 ms_addr; + int err; gsk = rcu_dereference_sk_user_data(sk); if (!gsk) @@ -948,6 +961,12 @@ static int ipv4_pdp_add(struct net_device *dev, struct sock *sk, if (pctx == NULL) return -ENOMEM; + err = dst_cache_init(&pctx->dst_cache, GFP_KERNEL); + if (err) { + kfree(pctx); + return err; + } + sock_hold(sk); pctx->sk = sk; pctx->dev = dev; @@ -992,6 +1011,7 @@ static void pdp_context_free(struct rcu_head *head) struct pdp_ctx *pctx = container_of(head, struct pdp_ctx, rcu_head); sock_put(pctx->sk); + dst_cache_destroy(&pctx->dst_cache); kfree(pctx); } -- 2.10.2 From laforge at netfilter.org Tue Jan 24 15:39:19 2017 From: laforge at netfilter.org (Harald Welte) Date: Tue, 24 Jan 2017 16:39:19 +0100 Subject: [PATCH v2 00/18] gtp: fixes and support multiple VRF's per GTP socket In-Reply-To: <20170124152848.6120-1-aschultz@tpip.net> References: <20170124152848.6120-1-aschultz@tpip.net> Message-ID: <20170124153919.zkigaq55kykyrfq5@nataraja> Hi Andreas, On Tue, Jan 24, 2017 at 04:28:30PM +0100, Andreas Schultz wrote: > During that work some smaller problems where found and fixes for them are > included. As this is a rather large patch-set, and I think it might be better to split it in clear bugfixes of the existing code (or no-brainers like the module alias) and in introducing new featur regarding socket/netdev. However, that's just my comment "from the side", I'm not the one who needs to be convinced in terms of merging them :) I would just assume that the clear fixes + no-brainers could go in right away without any further review... -- - Harald Welte http://netfilter.org/ ============================================================================ "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie From davem at davemloft.net Tue Jan 24 16:46:55 2017 From: davem at davemloft.net (David Miller) Date: Tue, 24 Jan 2017 11:46:55 -0500 (EST) Subject: [PATCH v2 00/18] gtp: fixes and support multiple VRF's per GTP socket In-Reply-To: <20170124153919.zkigaq55kykyrfq5@nataraja> References: <20170124152848.6120-1-aschultz@tpip.net> <20170124153919.zkigaq55kykyrfq5@nataraja> Message-ID: <20170124.114655.1282086171761676213.davem@davemloft.net> From: Harald Welte Date: Tue, 24 Jan 2017 16:39:19 +0100 > Hi Andreas, > > On Tue, Jan 24, 2017 at 04:28:30PM +0100, Andreas Schultz wrote: >> During that work some smaller problems where found and fixes for them are >> included. > > As this is a rather large patch-set, and I think it might be better to > split it in clear bugfixes of the existing code (or no-brainers like the > module alias) and in introducing new featur regarding socket/netdev. > However, that's just my comment "from the side", I'm not the one who > needs to be convinced in terms of merging them :) > > I would just assume that the clear fixes + no-brainers could go in right > away without any further review... Yes, please split this stuff up, the patch series is _way_ too large. Anything more than a dozen patches is way too much to burdon reviewers with at one time. From aschultz at tpip.net Tue Jan 24 17:23:58 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Tue, 24 Jan 2017 18:23:58 +0100 Subject: [PATCH 1/5] gtp: add genl family modules alias In-Reply-To: <20170124172402.12096-1-aschultz@tpip.net> References: <20170124172402.12096-1-aschultz@tpip.net> Message-ID: <20170124172402.12096-2-aschultz@tpip.net> Auto-load the module when userspace asks for the gtp netlink family. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 8b6810b..7580ccc 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -1376,3 +1376,4 @@ MODULE_LICENSE("GPL"); MODULE_AUTHOR("Harald Welte "); MODULE_DESCRIPTION("Interface driver for GTP encapsulated traffic"); MODULE_ALIAS_RTNL_LINK("gtp"); +MODULE_ALIAS_GENL_FAMILY("gtp"); -- 2.10.2 From aschultz at tpip.net Tue Jan 24 17:23:59 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Tue, 24 Jan 2017 18:23:59 +0100 Subject: [PATCH 2/5] gtp: clear DF bit on GTP packet tx In-Reply-To: <20170124172402.12096-1-aschultz@tpip.net> References: <20170124172402.12096-1-aschultz@tpip.net> Message-ID: <20170124172402.12096-3-aschultz@tpip.net> 3GPP TS 29.281 and 3GPP TS 29.060 imply that GTP-U packets should be sent with the DF bit cleared. For example 3GPP TS 29.060, Release 8, Section 13.2.2: > Backbone router: Any router in the backbone may fragment the GTP > packet if needed, according to IPv4. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 7580ccc..1df54d6 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -612,7 +612,7 @@ static netdev_tx_t gtp_dev_xmit(struct sk_buff *skb, struct net_device *dev) pktinfo.fl4.saddr, pktinfo.fl4.daddr, pktinfo.iph->tos, ip4_dst_hoplimit(&pktinfo.rt->dst), - htons(IP_DF), + 0, pktinfo.gtph_port, pktinfo.gtph_port, true, false); break; -- 2.10.2 From aschultz at tpip.net Tue Jan 24 17:23:57 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Tue, 24 Jan 2017 18:23:57 +0100 Subject: [PATCH 0/5] simple gtp improvements Message-ID: <20170124172402.12096-1-aschultz@tpip.net> As requested are here the simple and most obvious changes from the larger GTP changeset. I'll break down the rest and send them out separately. The module alias addition and the rcu_lock removal are just small convenience changes. The other changes are needed to correctly implement one of the 3GPP GW functions, userspace needs to see invalid T-PDU's in order to generate the proper error messages, GTP fragmentation rules need the cleared DF bit. Andreas -- Andreas Schultz (5): gtp: add genl family modules alias gtp: clear DF bit on GTP packet tx gtp: fix cross netns recv on gtp socket gtp: remove unnecessary rcu_read_lock gtp: let userspace handle packets for invalid tunnels drivers/net/gtp.c | 33 ++++++++------------------------- 1 file changed, 8 insertions(+), 25 deletions(-) -- 2.10.2 From aschultz at tpip.net Tue Jan 24 17:24:00 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Tue, 24 Jan 2017 18:24:00 +0100 Subject: [PATCH 3/5] gtp: fix cross netns recv on gtp socket In-Reply-To: <20170124172402.12096-1-aschultz@tpip.net> References: <20170124172402.12096-1-aschultz@tpip.net> Message-ID: <20170124172402.12096-4-aschultz@tpip.net> The use of the passed through netlink src_net to check for a cross netns operation was wrong. Using the GTP socket and the GTP netdevice is always correct (even if the netdev has been moved to new netns after link creation). Remove the now obsolete net field from gtp_dev. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 1df54d6..72dd1ba 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -69,7 +69,6 @@ struct gtp_dev { struct socket *sock0; struct socket *sock1u; - struct net *net; struct net_device *dev; unsigned int hash_size; @@ -316,7 +315,7 @@ static int gtp_encap_recv(struct sock *sk, struct sk_buff *skb) netdev_dbg(gtp->dev, "encap_recv sk=%p\n", sk); - xnet = !net_eq(gtp->net, dev_net(gtp->dev)); + xnet = !net_eq(sock_net(sk), dev_net(gtp->dev)); switch (udp_sk(sk)->encap_type) { case UDP_ENCAP_GTP0: @@ -658,7 +657,7 @@ static void gtp_link_setup(struct net_device *dev) static int gtp_hashtable_new(struct gtp_dev *gtp, int hsize); static void gtp_hashtable_free(struct gtp_dev *gtp); static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, - int fd_gtp0, int fd_gtp1, struct net *src_net); + int fd_gtp0, int fd_gtp1); static int gtp_newlink(struct net *src_net, struct net_device *dev, struct nlattr *tb[], struct nlattr *data[]) @@ -858,7 +857,6 @@ static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, gtp->sock0 = sock0; gtp->sock1u = sock1u; - gtp->net = src_net; tuncfg.sk_user_data = gtp; tuncfg.encap_rcv = gtp_encap_recv; -- 2.10.2 From aschultz at tpip.net Tue Jan 24 17:24:01 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Tue, 24 Jan 2017 18:24:01 +0100 Subject: [PATCH 4/5] gtp: remove unnecessary rcu_read_lock In-Reply-To: <20170124172402.12096-1-aschultz@tpip.net> References: <20170124172402.12096-1-aschultz@tpip.net> Message-ID: <20170124172402.12096-5-aschultz@tpip.net> The rcu read lock is hold by default in the ip input path. There is no need to hold it twice in the socket recv decapsulate code path. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 72dd1ba..912721e 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -183,7 +183,6 @@ static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, sizeof(struct gtp0_header); struct gtp0_header *gtp0; struct pdp_ctx *pctx; - int ret = 0; if (!pskb_may_pull(skb, hdrlen)) return -1; @@ -196,26 +195,19 @@ static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, if (gtp0->type != GTP_TPDU) return 1; - rcu_read_lock(); pctx = gtp0_pdp_find(gtp, be64_to_cpu(gtp0->tid)); if (!pctx) { netdev_dbg(gtp->dev, "No PDP ctx to decap skb=%p\n", skb); - ret = -1; - goto out_rcu; + return -1; } if (!gtp_check_src_ms(skb, pctx, hdrlen)) { netdev_dbg(gtp->dev, "No PDP ctx for this MS\n"); - ret = -1; - goto out_rcu; + return -1; } - rcu_read_unlock(); /* Get rid of the GTP + UDP headers. */ return iptunnel_pull_header(skb, hdrlen, skb->protocol, xnet); -out_rcu: - rcu_read_unlock(); - return ret; } static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, @@ -225,7 +217,6 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, sizeof(struct gtp1_header); struct gtp1_header *gtp1; struct pdp_ctx *pctx; - int ret = 0; if (!pskb_may_pull(skb, hdrlen)) return -1; @@ -253,26 +244,19 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, gtp1 = (struct gtp1_header *)(skb->data + sizeof(struct udphdr)); - rcu_read_lock(); pctx = gtp1_pdp_find(gtp, ntohl(gtp1->tid)); if (!pctx) { netdev_dbg(gtp->dev, "No PDP ctx to decap skb=%p\n", skb); - ret = -1; - goto out_rcu; + return -1; } if (!gtp_check_src_ms(skb, pctx, hdrlen)) { netdev_dbg(gtp->dev, "No PDP ctx for this MS\n"); - ret = -1; - goto out_rcu; + return -1; } - rcu_read_unlock(); /* Get rid of the GTP + UDP headers. */ return iptunnel_pull_header(skb, hdrlen, skb->protocol, xnet); -out_rcu: - rcu_read_unlock(); - return ret; } static void gtp_encap_disable(struct gtp_dev *gtp) -- 2.10.2 From aschultz at tpip.net Tue Jan 24 17:24:02 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Tue, 24 Jan 2017 18:24:02 +0100 Subject: [PATCH 5/5] gtp: let userspace handle packets for invalid tunnels In-Reply-To: <20170124172402.12096-1-aschultz@tpip.net> References: <20170124172402.12096-1-aschultz@tpip.net> Message-ID: <20170124172402.12096-6-aschultz@tpip.net> enable userspace to send error replies for invalid tunnels Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 912721e..c607333 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -198,12 +198,12 @@ static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, pctx = gtp0_pdp_find(gtp, be64_to_cpu(gtp0->tid)); if (!pctx) { netdev_dbg(gtp->dev, "No PDP ctx to decap skb=%p\n", skb); - return -1; + return 1; } if (!gtp_check_src_ms(skb, pctx, hdrlen)) { netdev_dbg(gtp->dev, "No PDP ctx for this MS\n"); - return -1; + return 1; } /* Get rid of the GTP + UDP headers. */ @@ -247,12 +247,12 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, pctx = gtp1_pdp_find(gtp, ntohl(gtp1->tid)); if (!pctx) { netdev_dbg(gtp->dev, "No PDP ctx to decap skb=%p\n", skb); - return -1; + return 1; } if (!gtp_check_src_ms(skb, pctx, hdrlen)) { netdev_dbg(gtp->dev, "No PDP ctx for this MS\n"); - return -1; + return 1; } /* Get rid of the GTP + UDP headers. */ -- 2.10.2 From laforge at netfilter.org Tue Jan 24 18:26:11 2017 From: laforge at netfilter.org (Harald Welte) Date: Tue, 24 Jan 2017 19:26:11 +0100 Subject: [PATCH 0/5] simple gtp improvements In-Reply-To: <20170124172402.12096-1-aschultz@tpip.net> References: <20170124172402.12096-1-aschultz@tpip.net> Message-ID: <20170124182611.vqi3erhxcw45yhjt@nataraja> Hi Andreas, I agree with your changes (particularly those related to 3GPP specs) like 2/5 and 5/5. Also, 1/5 is of course obvious. For kernel topics like 3/5 and 4/5 I trust Pablo and the general netdev crew to have better judgement than me. -- - Harald Welte http://netfilter.org/ ============================================================================ "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie From pablo at netfilter.org Tue Jan 24 19:03:49 2017 From: pablo at netfilter.org (Pablo Neira Ayuso) Date: Tue, 24 Jan 2017 20:03:49 +0100 Subject: [PATCH 5/5] gtp: let userspace handle packets for invalid tunnels In-Reply-To: <20170124172402.12096-6-aschultz@tpip.net> References: <20170124172402.12096-1-aschultz@tpip.net> <20170124172402.12096-6-aschultz@tpip.net> Message-ID: <20170124190349.GA9757@salvia> Hi Andreas, On Tue, Jan 24, 2017 at 06:24:02PM +0100, Andreas Schultz wrote: > enable userspace to send error replies for invalid tunnels > > Signed-off-by: Andreas Schultz > --- > drivers/net/gtp.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c > index 912721e..c607333 100644 > --- a/drivers/net/gtp.c > +++ b/drivers/net/gtp.c > @@ -198,12 +198,12 @@ static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, > pctx = gtp0_pdp_find(gtp, be64_to_cpu(gtp0->tid)); > if (!pctx) { > netdev_dbg(gtp->dev, "No PDP ctx to decap skb=%p\n", skb); > - return -1; > + return 1; > } > > if (!gtp_check_src_ms(skb, pctx, hdrlen)) { > netdev_dbg(gtp->dev, "No PDP ctx for this MS\n"); > - return -1; > + return 1; So userspace gets the packet that we cannot forward. I guess your userspace codebase performs this sanity checks again so you can send the appropriate error reply? > } > > /* Get rid of the GTP + UDP headers. */ > @@ -247,12 +247,12 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, > pctx = gtp1_pdp_find(gtp, ntohl(gtp1->tid)); > if (!pctx) { > netdev_dbg(gtp->dev, "No PDP ctx to decap skb=%p\n", skb); > - return -1; > + return 1; > } > > if (!gtp_check_src_ms(skb, pctx, hdrlen)) { > netdev_dbg(gtp->dev, "No PDP ctx for this MS\n"); > - return -1; > + return 1; > } > > /* Get rid of the GTP + UDP headers. */ > -- > 2.10.2 > From pablo at netfilter.org Tue Jan 24 19:15:40 2017 From: pablo at netfilter.org (Pablo Neira Ayuso) Date: Tue, 24 Jan 2017 20:15:40 +0100 Subject: [PATCH 3/5] gtp: fix cross netns recv on gtp socket In-Reply-To: <20170124172402.12096-4-aschultz@tpip.net> References: <20170124172402.12096-1-aschultz@tpip.net> <20170124172402.12096-4-aschultz@tpip.net> Message-ID: <20170124191540.GB9757@salvia> On Tue, Jan 24, 2017 at 06:24:00PM +0100, Andreas Schultz wrote: > The use of the passed through netlink src_net to check for a > cross netns operation was wrong. Using the GTP socket and the > GTP netdevice is always correct (even if the netdev has been > moved to new netns after link creation). > > Remove the now obsolete net field from gtp_dev. The net tree can take fixes anytime, so if you target this patch to [PATCH net] this speeds up integration into mainline kernels. Note, as soon as this patch hits Linus tree, we can request -stable submission so older -stable kernels can get this. If this follows the net-next path, then this fix is going to take several weeks (sometimes months) to show in mainline kernels. So please add [PATCH net] or [PATCH net-next] so it's clear to everyone what is your target, David usually requests this. BTW, probably you can target this small fix to net, then you can request David to pull net into net-next so the fix propagates onwards. Sorry for this bureaucratic stuff, but given the workload we deal with, you will really helps us if you deal with these nitpicks. Thanks Andreas! From pablo at netfilter.org Tue Jan 24 19:16:14 2017 From: pablo at netfilter.org (Pablo Neira Ayuso) Date: Tue, 24 Jan 2017 20:16:14 +0100 Subject: [PATCH 1/5] gtp: add genl family modules alias In-Reply-To: <20170124172402.12096-2-aschultz@tpip.net> References: <20170124172402.12096-1-aschultz@tpip.net> <20170124172402.12096-2-aschultz@tpip.net> Message-ID: <20170124191614.GA9897@salvia> On Tue, Jan 24, 2017 at 06:23:58PM +0100, Andreas Schultz wrote: > Auto-load the module when userspace asks for the gtp netlink > family. This qualifies as fix, since autoload is broken. You may send a batch including this for David's net tree. From pablo at netfilter.org Tue Jan 24 19:17:03 2017 From: pablo at netfilter.org (Pablo Neira Ayuso) Date: Tue, 24 Jan 2017 20:17:03 +0100 Subject: [PATCH 2/5] gtp: clear DF bit on GTP packet tx In-Reply-To: <20170124172402.12096-3-aschultz@tpip.net> References: <20170124172402.12096-1-aschultz@tpip.net> <20170124172402.12096-3-aschultz@tpip.net> Message-ID: <20170124191703.GB9897@salvia> On Tue, Jan 24, 2017 at 06:23:59PM +0100, Andreas Schultz wrote: > 3GPP TS 29.281 and 3GPP TS 29.060 imply that GTP-U packets should be > sent with the DF bit cleared. For example 3GPP TS 29.060, Release 8, > Section 13.2.2: > > > Backbone router: Any router in the backbone may fragment the GTP > > packet if needed, according to IPv4. Given this is fixing a broken implementation with regards to standards, please target this to net. From pablo at netfilter.org Tue Jan 24 19:17:32 2017 From: pablo at netfilter.org (Pablo Neira Ayuso) Date: Tue, 24 Jan 2017 20:17:32 +0100 Subject: [PATCH 4/5] gtp: remove unnecessary rcu_read_lock In-Reply-To: <20170124172402.12096-5-aschultz@tpip.net> References: <20170124172402.12096-1-aschultz@tpip.net> <20170124172402.12096-5-aschultz@tpip.net> Message-ID: <20170124191732.GC9897@salvia> On Tue, Jan 24, 2017 at 06:24:01PM +0100, Andreas Schultz wrote: > The rcu read lock is hold by default in the ip input path. There > is no need to hold it twice in the socket recv decapsulate code path. I think this is net-next material since it is not essencial. From aschultz at tpip.net Tue Jan 24 20:02:31 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Tue, 24 Jan 2017 21:02:31 +0100 (CET) Subject: [PATCH 5/5] gtp: let userspace handle packets for invalid tunnels In-Reply-To: <20170124190349.GA9757@salvia> References: <20170124172402.12096-1-aschultz@tpip.net> <20170124172402.12096-6-aschultz@tpip.net> <20170124190349.GA9757@salvia> Message-ID: <1060167008.597625.1485288151511.JavaMail.zimbra@tpip.net> Hi Pablo, ----- On Jan 24, 2017, at 8:03 PM, pablo pablo at netfilter.org wrote: > Hi Andreas, > > On Tue, Jan 24, 2017 at 06:24:02PM +0100, Andreas Schultz wrote: >> enable userspace to send error replies for invalid tunnels >> >> Signed-off-by: Andreas Schultz >> --- >> drivers/net/gtp.c | 8 ++++---- >> 1 file changed, 4 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c >> index 912721e..c607333 100644 >> --- a/drivers/net/gtp.c >> +++ b/drivers/net/gtp.c >> @@ -198,12 +198,12 @@ static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct >> sk_buff *skb, >> pctx = gtp0_pdp_find(gtp, be64_to_cpu(gtp0->tid)); >> if (!pctx) { >> netdev_dbg(gtp->dev, "No PDP ctx to decap skb=%p\n", skb); >> - return -1; >> + return 1; >> } >> >> if (!gtp_check_src_ms(skb, pctx, hdrlen)) { >> netdev_dbg(gtp->dev, "No PDP ctx for this MS\n"); >> - return -1; >> + return 1; > > So userspace gets the packet that we cannot forward. I guess your > userspace codebase performs this sanity checks again so you can send > the appropriate error reply? For TEID /= 0, the only reply is a T-PDU of type error indication. There is no cause specified. So I don't actually have to repeat the check. TEID == 0 is more interesting, this tells userspace that it tried to send on an invalid tunnel and should tear it down. If you like, you can have a look at the userspace code. The relevant piece is at https://github.com/travelping/gtp_u_kmod/blob/master/src/gtp_u_kmod_port.erl#L231 But be warned, it's written in Erlang ;-) Andreas > >> } >> >> /* Get rid of the GTP + UDP headers. */ >> @@ -247,12 +247,12 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, >> struct sk_buff *skb, >> pctx = gtp1_pdp_find(gtp, ntohl(gtp1->tid)); >> if (!pctx) { >> netdev_dbg(gtp->dev, "No PDP ctx to decap skb=%p\n", skb); >> - return -1; >> + return 1; >> } >> >> if (!gtp_check_src_ms(skb, pctx, hdrlen)) { >> netdev_dbg(gtp->dev, "No PDP ctx for this MS\n"); >> - return -1; >> + return 1; >> } >> >> /* Get rid of the GTP + UDP headers. */ >> -- >> 2.10.2 From pablo at netfilter.org Tue Jan 24 20:19:28 2017 From: pablo at netfilter.org (Pablo Neira Ayuso) Date: Tue, 24 Jan 2017 21:19:28 +0100 Subject: [PATCH 5/5] gtp: let userspace handle packets for invalid tunnels In-Reply-To: <1060167008.597625.1485288151511.JavaMail.zimbra@tpip.net> References: <20170124172402.12096-1-aschultz@tpip.net> <20170124172402.12096-6-aschultz@tpip.net> <20170124190349.GA9757@salvia> <1060167008.597625.1485288151511.JavaMail.zimbra@tpip.net> Message-ID: <20170124201928.GA11999@salvia> On Tue, Jan 24, 2017 at 09:02:31PM +0100, Andreas Schultz wrote: > Hi Pablo, > > ----- On Jan 24, 2017, at 8:03 PM, pablo pablo at netfilter.org wrote: > > > Hi Andreas, > > > > On Tue, Jan 24, 2017 at 06:24:02PM +0100, Andreas Schultz wrote: > >> enable userspace to send error replies for invalid tunnels > >> > >> Signed-off-by: Andreas Schultz > >> --- > >> drivers/net/gtp.c | 8 ++++---- > >> 1 file changed, 4 insertions(+), 4 deletions(-) > >> > >> diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c > >> index 912721e..c607333 100644 > >> --- a/drivers/net/gtp.c > >> +++ b/drivers/net/gtp.c > >> @@ -198,12 +198,12 @@ static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct > >> sk_buff *skb, > >> pctx = gtp0_pdp_find(gtp, be64_to_cpu(gtp0->tid)); > >> if (!pctx) { > >> netdev_dbg(gtp->dev, "No PDP ctx to decap skb=%p\n", skb); > >> - return -1; > >> + return 1; > >> } > >> > >> if (!gtp_check_src_ms(skb, pctx, hdrlen)) { > >> netdev_dbg(gtp->dev, "No PDP ctx for this MS\n"); > >> - return -1; > >> + return 1; > > > > So userspace gets the packet that we cannot forward. I guess your > > userspace codebase performs this sanity checks again so you can send > > the appropriate error reply? > > For TEID /= 0, the only reply is a T-PDU of type error indication. There > is no cause specified. So I don't actually have to repeat the check. > TEID == 0 is more interesting, this tells userspace that it tried to > send on an invalid tunnel and should tear it down. Ah, I see, thanks for explaining, I guess this is good to debug misconfigurations. > If you like, you can have a look at the userspace code. The relevant piece > is at https://github.com/travelping/gtp_u_kmod/blob/master/src/gtp_u_kmod_port.erl#L231 > > But be warned, it's written in Erlang ;-) Will have a look, but you taking me away from my usual domains :). From nhofmeyr at sysmocom.de Wed Jan 25 11:23:40 2017 From: nhofmeyr at sysmocom.de (Neels Hofmeyr) Date: Wed, 25 Jan 2017 12:23:40 +0100 Subject: test error analysis on build services Message-ID: <20170125112340.GA20798@my.box> On jenkins and opensuse, we have builds where we cannot easily analyse the testsuite.dir after a build failed. So we only see which tests failed and not why. On jenkins I have in most places added a script invocation that prints all testsuite.dir/*/*.log in case of build failure, so we can see it in the jenkins log right away. On opensuse.org, IIUC, the 'make check' is run by dh or something, so it's not trivial (to me) to make it output the test logs in case of failure. I'm thinking now, don't we always want to see these failures anyway? We could include in our Makefile.am a tweak to print the test logs in case of testsuite failure. Sometimes this output can become fairly large though; e.g. when a long test fails early and prints "nothing", the test log shows a huge diff with all expected output as minus-lines. My main goal right now is to see why/how the libosmo-netif OBS build failed (osmux test fails) without further local reproduction effort. This situation will certainly repeat over and over, for all of the other projects as well. What do you think? Can we get that easily? ~N -- - Neels Hofmeyr http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Gesch?ftsf?hrer / Managing Directors: Harald Welte -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From holger at freyther.de Wed Jan 25 12:14:40 2017 From: holger at freyther.de (Holger Freyther) Date: Wed, 25 Jan 2017 13:14:40 +0100 Subject: test error analysis on build services In-Reply-To: <20170125112340.GA20798@my.box> References: <20170125112340.GA20798@my.box> Message-ID: > On 25 Jan 2017, at 12:23, Neels Hofmeyr wrote: > > On jenkins and opensuse, we have builds where we cannot easily analyse the > testsuite.dir after a build failed. So we only see which tests failed and not > why. > > On jenkins I have in most places added a script invocation that prints all > testsuite.dir/*/*.log in case of build failure, so we can see it in the jenkins > log right away. dh_override_auto_test: make check || (cat ... && false)? into the debian/rules or such? > My main goal right now is to see why/how the libosmo-netif OBS build failed > (osmux test fails) without further local reproduction effort. This situation > will certainly repeat over and over, for all of the other projects as well. most likely timing... the test is using realtime... we should consider mocking gettimeofday in some way? holger From omar.ramadan at berkeley.edu Wed Jan 25 17:06:30 2017 From: omar.ramadan at berkeley.edu (OMAR RAMADAN) Date: Wed, 25 Jan 2017 09:06:30 -0800 Subject: osmo-sip-connector in bad state Message-ID: If the SIP server dies in the middle of a call, osmo-sip-connector is in a bad state and generates a never ending stream of error messages: 58): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f258): zero length packettport(0xb7e9f25 It looks like the messages are generated from sofia-sip and I have managed to suppress the messages by setting the environment variable SU_DEBUG < 3: http://sofia-sip.sourcearchive.com/documentation/1.12.7/tport__internal_8h_e540a66790cd6f3122cd3590200b5429.html However, it looks like osmo-sip-connector is clearly in a bad state when this happens and we need a way to detect and release these ghosted calls. -------------- next part -------------- An HTML attachment was scrubbed... URL: From holger at freyther.de Wed Jan 25 20:06:25 2017 From: holger at freyther.de (Holger Freyther) Date: Wed, 25 Jan 2017 21:06:25 +0100 Subject: osmo-sip-connector in bad state In-Reply-To: References: Message-ID: <4514C195-4509-416D-A3A2-97C17C682CED@freyther.de> > On 25 Jan 2017, at 18:06, OMAR RAMADAN wrote: > > If the SIP server dies in the middle of a call, osmo-sip-connector is in a bad state and generates a never ending stream of error messages: Can you reliable reproduce it? It seems sofia-sip is struggling with some input to it and goes crazy after that. I lack a stable way to reproduce it. The lack of \n in that message is annoying too. :( holger From omar.ramadan at berkeley.edu Wed Jan 25 23:31:07 2017 From: omar.ramadan at berkeley.edu (OMAR RAMADAN) Date: Wed, 25 Jan 2017 15:31:07 -0800 Subject: osmo-sip-connector in bad state In-Reply-To: <4514C195-4509-416D-A3A2-97C17C682CED@freyther.de> References: <4514C195-4509-416D-A3A2-97C17C682CED@freyther.de> Message-ID: I've seen it a few times in production already and it filled the disk. You should be able to reproduce it by killing an active RTP stream. I have been using freeswitch, but I don't imagine it is limited to this SIP server. It looks like sofia-sip is driven to continue to receiving media and gets nothing back while the call should be terminated. On Wed, Jan 25, 2017 at 12:06 PM, Holger Freyther wrote: > > > On 25 Jan 2017, at 18:06, OMAR RAMADAN > wrote: > > > > If the SIP server dies in the middle of a call, osmo-sip-connector is in > a bad state and generates a never ending stream of error messages: > > > Can you reliable reproduce it? It seems sofia-sip is struggling with some > input to it and goes crazy after that. I lack a stable way to reproduce it. > The lack of \n in that message is annoying too. :( > > holger -------------- next part -------------- An HTML attachment was scrubbed... URL: From nhofmeyr at sysmocom.de Thu Jan 26 01:57:24 2017 From: nhofmeyr at sysmocom.de (Neels Hofmeyr) Date: Thu, 26 Jan 2017 02:57:24 +0100 Subject: jenkins nr of executors Message-ID: <20170126015724.GB20798@my.box> FYI, no "Broken Pipe" errors in a long time, so today I increased the OsmocomBuild1 nr of executors from 3 to 4 ... and immediately got two subsequent openbsc builds hitting the "Broken Pipe" again. https://jenkins.osmocom.org/jenkins/job/OpenBSC-gerrit/1716/IU=--enable-iu,MGCP=--disable-mgcp-transcoding,SMPP=--enable-smpp,label=linux_amd64_debian8/console https://jenkins.osmocom.org/jenkins/job/OpenBSC-gerrit/1717/IU=--disable-iu,MGCP=--disable-mgcp-transcoding,SMPP=--disable-smpp,label=linux_amd64_debian8/console This time I tried something else: lower the "make -j 9" to "make -j 3" and leave the nr of executors at 4... Just dabbling, would be nicer to pinpoint the real cause. ~N -- - Neels Hofmeyr http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Gesch?ftsf?hrer / Managing Directors: Harald Welte -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From alexander.chemeris at gmail.com Thu Jan 26 04:30:17 2017 From: alexander.chemeris at gmail.com (Alexander Chemeris) Date: Thu, 26 Jan 2017 08:30:17 +0400 Subject: osmo-sip-connector in bad state In-Reply-To: References: <4514C195-4509-416D-A3A2-97C17C682CED@freyther.de> Message-ID: Omar, Just curious - is there any reason you're running RTP through the osmo-sip-connector instead of directly to FreeSWITCH? Please excuse typos. Written with a touchscreen keyboard. -- Regards, Alexander Chemeris CEO Fairwaves, Inc. https://fairwaves.co On Jan 26, 2017 02:31, "OMAR RAMADAN" wrote: > I've seen it a few times in production already and it filled the disk. You > should be able to reproduce it by killing an active RTP stream. I have been > using freeswitch, but I don't imagine it is limited to this SIP server. It > looks like sofia-sip is driven to continue to receiving media and gets > nothing back while the call should be terminated. > > On Wed, Jan 25, 2017 at 12:06 PM, Holger Freyther > wrote: > >> >> > On 25 Jan 2017, at 18:06, OMAR RAMADAN >> wrote: >> > >> > If the SIP server dies in the middle of a call, osmo-sip-connector is >> in a bad state and generates a never ending stream of error messages: >> >> >> Can you reliable reproduce it? It seems sofia-sip is struggling with some >> input to it and goes crazy after that. I lack a stable way to reproduce it. >> The lack of \n in that message is annoying too. :( >> >> holger > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nhofmeyr at sysmocom.de Thu Jan 26 13:29:28 2017 From: nhofmeyr at sysmocom.de (Neels Hofmeyr) Date: Thu, 26 Jan 2017 14:29:28 +0100 Subject: test error analysis on build services In-Reply-To: References: <20170125112340.GA20798@my.box> Message-ID: <20170126132928.GA1714@ass40.sysmocom.de> On Wed, Jan 25, 2017 at 01:14:40PM +0100, Holger Freyther wrote: > > > On 25 Jan 2017, at 12:23, Neels Hofmeyr wrote: > > > > On jenkins and opensuse, we have builds where we cannot easily analyse the > > testsuite.dir after a build failed. So we only see which tests failed and not > > why. > > > > On jenkins I have in most places added a script invocation that prints all > > testsuite.dir/*/*.log in case of build failure, so we can see it in the jenkins > > log right away. > > dh_override_auto_test: > make check || (cat ... && false)? > > into the debian/rules or such? (and this in all of our source trees) Thanks! Now someone has to still write the patches and test them... > most likely timing... the test is using realtime... we should consider mocking > gettimeofday in some way? Related: https://git.osmocom.org/libosmocore/commit/?id=8e2f7e87f4d854e697c40545326a16e50614dd5c and its first and so far only caller https://git.osmocom.org/libosmocore/commit/?id=7b4d727ec5debc3d057686a0a3f0f5f14260a282 from http://osmocom.org/issues/1809. ~N -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From omar.ramadan at berkeley.edu Thu Jan 26 14:15:11 2017 From: omar.ramadan at berkeley.edu (OMAR RAMADAN) Date: Thu, 26 Jan 2017 06:15:11 -0800 Subject: osmo-sip-connector in bad state In-Reply-To: References: <4514C195-4509-416D-A3A2-97C17C682CED@freyther.de> Message-ID: Good point Alexander, I just realized that the connector is only handling the signaling. What probably is happened is a call is trying to be established to a dead SIP server. But we should still terminate the call cleanly On Jan 25, 2017 8:30 PM, "Alexander Chemeris" wrote: > Omar, > > Just curious - is there any reason you're running RTP through the > osmo-sip-connector instead of directly to FreeSWITCH? > > Please excuse typos. Written with a touchscreen keyboard. > > -- > Regards, > Alexander Chemeris > CEO Fairwaves, Inc. > https://fairwaves.co > > On Jan 26, 2017 02:31, "OMAR RAMADAN" wrote: > >> I've seen it a few times in production already and it filled the disk. >> You should be able to reproduce it by killing an active RTP stream. I have >> been using freeswitch, but I don't imagine it is limited to this SIP >> server. It looks like sofia-sip is driven to continue to receiving media >> and gets nothing back while the call should be terminated. >> >> On Wed, Jan 25, 2017 at 12:06 PM, Holger Freyther >> wrote: >> >>> >>> > On 25 Jan 2017, at 18:06, OMAR RAMADAN >>> wrote: >>> > >>> > If the SIP server dies in the middle of a call, osmo-sip-connector is >>> in a bad state and generates a never ending stream of error messages: >>> >>> >>> Can you reliable reproduce it? It seems sofia-sip is struggling with >>> some input to it and goes crazy after that. I lack a stable way to >>> reproduce it. The lack of \n in that message is annoying too. :( >>> >>> holger >> >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From holger at freyther.de Thu Jan 26 14:18:23 2017 From: holger at freyther.de (Holger Freyther) Date: Thu, 26 Jan 2017 15:18:23 +0100 Subject: osmo-sip-connector in bad state In-Reply-To: References: <4514C195-4509-416D-A3A2-97C17C682CED@freyther.de> Message-ID: <26031043-CBF8-4602-BCDA-AB8C28C4F0E4@freyther.de> > On 26 Jan 2017, at 00:31, OMAR RAMADAN wrote: > > I've seen it a few times in production already and it filled the disk. You should be able to reproduce it by killing an active RTP stream. I have been using freeswitch, but I don't imagine it is limited to this SIP server. It looks like sofia-sip is driven to continue to receiving media and gets nothing back while the call should be terminated. that sucks. I intend to look at early media in the connector and try to reproduce the issue as well, I have seen it once when a NAT was involved too.. holger From aschultz at tpip.net Thu Jan 26 15:11:33 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Thu, 26 Jan 2017 16:11:33 +0100 Subject: [PATCH net v2 2/3] gtp: clear DF bit on GTP packet tx In-Reply-To: <20170126151134.2892-1-aschultz@tpip.net> References: <20170126151134.2892-1-aschultz@tpip.net> Message-ID: <20170126151134.2892-3-aschultz@tpip.net> 3GPP TS 29.281 and 3GPP TS 29.060 imply that GTP-U packets should be sent with the DF bit cleared. For example 3GPP TS 29.060, Release 8, Section 13.2.2: > Backbone router: Any router in the backbone may fragment the GTP > packet if needed, according to IPv4. Acked-by: Harald Welte Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 7580ccc..1df54d6 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -612,7 +612,7 @@ static netdev_tx_t gtp_dev_xmit(struct sk_buff *skb, struct net_device *dev) pktinfo.fl4.saddr, pktinfo.fl4.daddr, pktinfo.iph->tos, ip4_dst_hoplimit(&pktinfo.rt->dst), - htons(IP_DF), + 0, pktinfo.gtph_port, pktinfo.gtph_port, true, false); break; -- 2.10.2 From aschultz at tpip.net Thu Jan 26 15:11:31 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Thu, 26 Jan 2017 16:11:31 +0100 Subject: [PATCH net v2 0/3] various gtp fixes Message-ID: <20170126151134.2892-1-aschultz@tpip.net> This is the part of the previous "simple gtp improvements" series that Pablo indicated should go into net. The addition of the module alias fixes genl family autoloading, clearing the DF bit fixes a protocol violation in regard to the specification and the netns comparison fixes a corner case of cross netns recv. I'm not sure if Pablos comments on the previous version qualify as ACK, so I left that out. -- Andreas Schultz (3): gtp: add genl family modules alias gtp: clear DF bit on GTP packet tx gtp: fix cross netns recv on gtp socket drivers/net/gtp.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) -- 2.10.2 From aschultz at tpip.net Thu Jan 26 15:11:34 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Thu, 26 Jan 2017 16:11:34 +0100 Subject: [PATCH net v2 3/3] gtp: fix cross netns recv on gtp socket In-Reply-To: <20170126151134.2892-1-aschultz@tpip.net> References: <20170126151134.2892-1-aschultz@tpip.net> Message-ID: <20170126151134.2892-4-aschultz@tpip.net> The use of the passed through netlink src_net to check for a cross netns operation was wrong. Using the GTP socket and the GTP netdevice is always correct (even if the netdev has been moved to new netns after link creation). Remove the now obsolete net field from gtp_dev. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 1df54d6..72dd1ba 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -69,7 +69,6 @@ struct gtp_dev { struct socket *sock0; struct socket *sock1u; - struct net *net; struct net_device *dev; unsigned int hash_size; @@ -316,7 +315,7 @@ static int gtp_encap_recv(struct sock *sk, struct sk_buff *skb) netdev_dbg(gtp->dev, "encap_recv sk=%p\n", sk); - xnet = !net_eq(gtp->net, dev_net(gtp->dev)); + xnet = !net_eq(sock_net(sk), dev_net(gtp->dev)); switch (udp_sk(sk)->encap_type) { case UDP_ENCAP_GTP0: @@ -658,7 +657,7 @@ static void gtp_link_setup(struct net_device *dev) static int gtp_hashtable_new(struct gtp_dev *gtp, int hsize); static void gtp_hashtable_free(struct gtp_dev *gtp); static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, - int fd_gtp0, int fd_gtp1, struct net *src_net); + int fd_gtp0, int fd_gtp1); static int gtp_newlink(struct net *src_net, struct net_device *dev, struct nlattr *tb[], struct nlattr *data[]) @@ -858,7 +857,6 @@ static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, gtp->sock0 = sock0; gtp->sock1u = sock1u; - gtp->net = src_net; tuncfg.sk_user_data = gtp; tuncfg.encap_rcv = gtp_encap_recv; -- 2.10.2 From aschultz at tpip.net Thu Jan 26 15:11:32 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Thu, 26 Jan 2017 16:11:32 +0100 Subject: [PATCH net v2 1/3] gtp: add genl family modules alias In-Reply-To: <20170126151134.2892-1-aschultz@tpip.net> References: <20170126151134.2892-1-aschultz@tpip.net> Message-ID: <20170126151134.2892-2-aschultz@tpip.net> Auto-load the module when userspace asks for the gtp netlink family. Acked-by: Harald Welte Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 8b6810b..7580ccc 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -1376,3 +1376,4 @@ MODULE_LICENSE("GPL"); MODULE_AUTHOR("Harald Welte "); MODULE_DESCRIPTION("Interface driver for GTP encapsulated traffic"); MODULE_ALIAS_RTNL_LINK("gtp"); +MODULE_ALIAS_GENL_FAMILY("gtp"); -- 2.10.2 From aschultz at tpip.net Thu Jan 26 15:21:47 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Thu, 26 Jan 2017 16:21:47 +0100 Subject: [PATCH net-next v2 0/2] gtp: simple gtp improvements Message-ID: <20170126152149.3284-1-aschultz@tpip.net> This is the part of the previous "simple gtp improvements" series that Pablo indicated should go into net-next. The rcu_lock removal is small correctness changes. Passing invalid to user space allows for more standards compliant handling of invalid tunnels. -- Andreas Schultz (2): gtp: remove unnecessary rcu_read_lock gtp: let userspace handle packets for invalid tunnels drivers/net/gtp.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) -- 2.10.2 From aschultz at tpip.net Thu Jan 26 15:21:48 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Thu, 26 Jan 2017 16:21:48 +0100 Subject: [PATCH net-next v2 1/2] gtp: remove unnecessary rcu_read_lock In-Reply-To: <20170126152149.3284-1-aschultz@tpip.net> References: <20170126152149.3284-1-aschultz@tpip.net> Message-ID: <20170126152149.3284-2-aschultz@tpip.net> The rcu read lock is hold by default in the ip input path. There is no need to hold it twice in the socket recv decapsulate code path. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 8b6810b..5c63a37 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -184,7 +184,6 @@ static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, sizeof(struct gtp0_header); struct gtp0_header *gtp0; struct pdp_ctx *pctx; - int ret = 0; if (!pskb_may_pull(skb, hdrlen)) return -1; @@ -197,26 +196,19 @@ static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, if (gtp0->type != GTP_TPDU) return 1; - rcu_read_lock(); pctx = gtp0_pdp_find(gtp, be64_to_cpu(gtp0->tid)); if (!pctx) { netdev_dbg(gtp->dev, "No PDP ctx to decap skb=%p\n", skb); - ret = -1; - goto out_rcu; + return -1; } if (!gtp_check_src_ms(skb, pctx, hdrlen)) { netdev_dbg(gtp->dev, "No PDP ctx for this MS\n"); - ret = -1; - goto out_rcu; + return -1; } - rcu_read_unlock(); /* Get rid of the GTP + UDP headers. */ return iptunnel_pull_header(skb, hdrlen, skb->protocol, xnet); -out_rcu: - rcu_read_unlock(); - return ret; } static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, @@ -226,7 +218,6 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, sizeof(struct gtp1_header); struct gtp1_header *gtp1; struct pdp_ctx *pctx; - int ret = 0; if (!pskb_may_pull(skb, hdrlen)) return -1; @@ -254,26 +245,19 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, gtp1 = (struct gtp1_header *)(skb->data + sizeof(struct udphdr)); - rcu_read_lock(); pctx = gtp1_pdp_find(gtp, ntohl(gtp1->tid)); if (!pctx) { netdev_dbg(gtp->dev, "No PDP ctx to decap skb=%p\n", skb); - ret = -1; - goto out_rcu; + return -1; } if (!gtp_check_src_ms(skb, pctx, hdrlen)) { netdev_dbg(gtp->dev, "No PDP ctx for this MS\n"); - ret = -1; - goto out_rcu; + return -1; } - rcu_read_unlock(); /* Get rid of the GTP + UDP headers. */ return iptunnel_pull_header(skb, hdrlen, skb->protocol, xnet); -out_rcu: - rcu_read_unlock(); - return ret; } static void gtp_encap_disable(struct gtp_dev *gtp) -- 2.10.2 From aschultz at tpip.net Thu Jan 26 15:21:49 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Thu, 26 Jan 2017 16:21:49 +0100 Subject: [PATCH net-next v2 2/2] gtp: let userspace handle packets for invalid tunnels In-Reply-To: <20170126152149.3284-1-aschultz@tpip.net> References: <20170126152149.3284-1-aschultz@tpip.net> Message-ID: <20170126152149.3284-3-aschultz@tpip.net> enable userspace to send error replies for invalid tunnels Acked-by: Harald Welte Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 5c63a37..5dd7de6 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -199,12 +199,12 @@ static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, pctx = gtp0_pdp_find(gtp, be64_to_cpu(gtp0->tid)); if (!pctx) { netdev_dbg(gtp->dev, "No PDP ctx to decap skb=%p\n", skb); - return -1; + return 1; } if (!gtp_check_src_ms(skb, pctx, hdrlen)) { netdev_dbg(gtp->dev, "No PDP ctx for this MS\n"); - return -1; + return 1; } /* Get rid of the GTP + UDP headers. */ @@ -248,12 +248,12 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, pctx = gtp1_pdp_find(gtp, ntohl(gtp1->tid)); if (!pctx) { netdev_dbg(gtp->dev, "No PDP ctx to decap skb=%p\n", skb); - return -1; + return 1; } if (!gtp_check_src_ms(skb, pctx, hdrlen)) { netdev_dbg(gtp->dev, "No PDP ctx for this MS\n"); - return -1; + return 1; } /* Get rid of the GTP + UDP headers. */ -- 2.10.2 From pablo at netfilter.org Thu Jan 26 15:34:08 2017 From: pablo at netfilter.org (Pablo Neira Ayuso) Date: Thu, 26 Jan 2017 16:34:08 +0100 Subject: [PATCH net v2 1/3] gtp: add genl family modules alias In-Reply-To: <20170126151134.2892-2-aschultz@tpip.net> References: <20170126151134.2892-1-aschultz@tpip.net> <20170126151134.2892-2-aschultz@tpip.net> Message-ID: <20170126153408.GA1763@salvia> On Thu, Jan 26, 2017 at 04:11:32PM +0100, Andreas Schultz wrote: > Auto-load the module when userspace asks for the gtp netlink > family. > > Acked-by: Harald Welte > Signed-off-by: Andreas Schultz Acked-by: Pablo Neira Ayuso From pablo at netfilter.org Thu Jan 26 15:34:19 2017 From: pablo at netfilter.org (Pablo Neira Ayuso) Date: Thu, 26 Jan 2017 16:34:19 +0100 Subject: [PATCH net v2 2/3] =?iso-8859-1?Q?gtp?= =?iso-8859-1?Q?=3A_clear_DF_bit_on_GTP_packet_tx=E7?= In-Reply-To: <20170126151134.2892-3-aschultz@tpip.net> References: <20170126151134.2892-1-aschultz@tpip.net> <20170126151134.2892-3-aschultz@tpip.net> Message-ID: <20170126153419.GB1763@salvia> On Thu, Jan 26, 2017 at 04:11:33PM +0100, Andreas Schultz wrote: > 3GPP TS 29.281 and 3GPP TS 29.060 imply that GTP-U packets should be > sent with the DF bit cleared. For example 3GPP TS 29.060, Release 8, > Section 13.2.2: > > > Backbone router: Any router in the backbone may fragment the GTP > > packet if needed, according to IPv4. > > Acked-by: Harald Welte > Signed-off-by: Andreas Schultz Acked-by: Pablo Neira Ayuso From pablo at netfilter.org Thu Jan 26 15:34:40 2017 From: pablo at netfilter.org (Pablo Neira Ayuso) Date: Thu, 26 Jan 2017 16:34:40 +0100 Subject: [PATCH net v2 3/3] gtp: fix cross netns recv on gtp socket In-Reply-To: <20170126151134.2892-4-aschultz@tpip.net> References: <20170126151134.2892-1-aschultz@tpip.net> <20170126151134.2892-4-aschultz@tpip.net> Message-ID: <20170126153440.GC1763@salvia> On Thu, Jan 26, 2017 at 04:11:34PM +0100, Andreas Schultz wrote: > The use of the passed through netlink src_net to check for a > cross netns operation was wrong. Using the GTP socket and the > GTP netdevice is always correct (even if the netdev has been > moved to new netns after link creation). > > Remove the now obsolete net field from gtp_dev. > > Signed-off-by: Andreas Schultz Acked-by: Pablo Neira Ayuso From nhofmeyr at sysmocom.de Thu Jan 26 15:46:13 2017 From: nhofmeyr at sysmocom.de (Neels Hofmeyr) Date: Thu, 26 Jan 2017 16:46:13 +0100 Subject: [MERGED] osmo-trx[master]: Do not embed sqlite3 when building In-Reply-To: <20170125194254.C0A51298B9@lists.osmocom.org> References: <20170125194254.C0A51298B9@lists.osmocom.org> Message-ID: <20170126154613.GF1714@ass40.sysmocom.de> Looks related to this osmo-trx nightly package build breakage? https://osmocom.org/issues/1928 ~N On Wed, Jan 25, 2017 at 07:42:53PM +0000, Harald Welte wrote: > Harald Welte has submitted this change and it was merged. > > Change subject: Do not embed sqlite3 when building > ...................................................................... > > > Do not embed sqlite3 when building > > Change-Id: If5edadc04c3ff953b451676e55ad3d00d4e43c82 > --- > M Makefile.am > M Makefile.common > 2 files changed, 1 insertion(+), 2 deletions(-) > > Approvals: > Tom Tsou: Looks good to me, approved > Harald Welte: Looks good to me, but someone else must approve > Jenkins Builder: Verified > > > > diff --git a/Makefile.am b/Makefile.am > index 06251f0..f9f5a5c 100644 > --- a/Makefile.am > +++ b/Makefile.am > @@ -28,7 +28,6 @@ > > # Order must be preserved > SUBDIRS = \ > - sqlite3 \ > CommonLibs \ > GSM \ > Transceiver52M > diff --git a/Makefile.common b/Makefile.common > index 734ab3a..d7927a5 100644 > --- a/Makefile.common > +++ b/Makefile.common > @@ -33,6 +33,6 @@ > > COMMON_LA = $(top_builddir)/CommonLibs/libcommon.la > GSM_LA = $(top_builddir)/GSM/libGSM.la > -SQLITE_LA = $(top_builddir)/sqlite3/libsqlite.la -ldl > +SQLITE_LA = -lsqlite3 > > MOSTLYCLEANFILES = *~ > > -- > To view, visit https://gerrit.osmocom.org/1484 > To unsubscribe, visit https://gerrit.osmocom.org/settings > > Gerrit-MessageType: merged > Gerrit-Change-Id: If5edadc04c3ff953b451676e55ad3d00d4e43c82 > Gerrit-PatchSet: 2 > Gerrit-Project: osmo-trx > Gerrit-Branch: master > Gerrit-Owner: Max > Gerrit-Reviewer: Harald Welte > Gerrit-Reviewer: Jenkins Builder > Gerrit-Reviewer: Ruben Undheim > Gerrit-Reviewer: Tom Tsou -- - Neels Hofmeyr http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Gesch?ftsf?hrer / Managing Directors: Harald Welte -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From alexander.chemeris at gmail.com Thu Jan 26 15:53:24 2017 From: alexander.chemeris at gmail.com (Alexander Chemeris) Date: Thu, 26 Jan 2017 19:53:24 +0400 Subject: [MERGED] osmo-trx[master]: Do not embed sqlite3 when building In-Reply-To: <20170126154613.GF1714@ass40.sysmocom.de> References: <20170125194254.C0A51298B9@lists.osmocom.org> <20170126154613.GF1714@ass40.sysmocom.de> Message-ID: Hi Harald, Thomas, I think it also makes sense to remove sqlite3 subdirectory, since it's no longer used. Any reason it's kept in the repository? Please excuse typos. Written with a touchscreen keyboard. -- Regards, Alexander Chemeris CEO Fairwaves, Inc. https://fairwaves.co On Jan 26, 2017 18:46, "Neels Hofmeyr" wrote: > Looks related to this osmo-trx nightly package build breakage? > https://osmocom.org/issues/1928 > > ~N > > On Wed, Jan 25, 2017 at 07:42:53PM +0000, Harald Welte wrote: > > Harald Welte has submitted this change and it was merged. > > > > Change subject: Do not embed sqlite3 when building > > ...................................................................... > > > > > > Do not embed sqlite3 when building > > > > Change-Id: If5edadc04c3ff953b451676e55ad3d00d4e43c82 > > --- > > M Makefile.am > > M Makefile.common > > 2 files changed, 1 insertion(+), 2 deletions(-) > > > > Approvals: > > Tom Tsou: Looks good to me, approved > > Harald Welte: Looks good to me, but someone else must approve > > Jenkins Builder: Verified > > > > > > > > diff --git a/Makefile.am b/Makefile.am > > index 06251f0..f9f5a5c 100644 > > --- a/Makefile.am > > +++ b/Makefile.am > > @@ -28,7 +28,6 @@ > > > > # Order must be preserved > > SUBDIRS = \ > > - sqlite3 \ > > CommonLibs \ > > GSM \ > > Transceiver52M > > diff --git a/Makefile.common b/Makefile.common > > index 734ab3a..d7927a5 100644 > > --- a/Makefile.common > > +++ b/Makefile.common > > @@ -33,6 +33,6 @@ > > > > COMMON_LA = $(top_builddir)/CommonLibs/libcommon.la > > GSM_LA = $(top_builddir)/GSM/libGSM.la > > -SQLITE_LA = $(top_builddir)/sqlite3/libsqlite.la -ldl > > +SQLITE_LA = -lsqlite3 > > > > MOSTLYCLEANFILES = *~ > > > > -- > > To view, visit https://gerrit.osmocom.org/1484 > > To unsubscribe, visit https://gerrit.osmocom.org/settings > > > > Gerrit-MessageType: merged > > Gerrit-Change-Id: If5edadc04c3ff953b451676e55ad3d00d4e43c82 > > Gerrit-PatchSet: 2 > > Gerrit-Project: osmo-trx > > Gerrit-Branch: master > > Gerrit-Owner: Max > > Gerrit-Reviewer: Harald Welte > > Gerrit-Reviewer: Jenkins Builder > > Gerrit-Reviewer: Ruben Undheim > > Gerrit-Reviewer: Tom Tsou > > -- > - Neels Hofmeyr http://www.sysmocom.de/ > ======================================================================= > * sysmocom - systems for mobile communications GmbH > * Alt-Moabit 93 > * 10559 Berlin, Germany > * Sitz / Registered office: Berlin, HRB 134158 B > * Gesch?ftsf?hrer / Managing Directors: Harald Welte > -------------- next part -------------- An HTML attachment was scrubbed... URL: From msuraev at sysmocom.de Thu Jan 26 16:10:01 2017 From: msuraev at sysmocom.de (Max) Date: Thu, 26 Jan 2017 17:10:01 +0100 Subject: [MERGED] osmo-trx[master]: Do not embed sqlite3 when building In-Reply-To: References: <20170125194254.C0A51298B9@lists.osmocom.org> <20170126154613.GF1714@ass40.sysmocom.de> Message-ID: It should have been removed with gerrit 1485 . See also gerrit 1691 for follow-up fixes. On 26.01.2017 16:53, Alexander Chemeris wrote: > Hi Harald, Thomas, > > I think it also makes sense to remove sqlite3 subdirectory, since it's > no longer used. Any reason it's kept in the repository? -- Max Suraev http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Geschaeftsfuehrer / Managing Director: Harald Welte From alexander.chemeris at gmail.com Thu Jan 26 16:53:07 2017 From: alexander.chemeris at gmail.com (Alexander Chemeris) Date: Thu, 26 Jan 2017 20:53:07 +0400 Subject: [MERGED] osmo-trx[master]: Do not embed sqlite3 when building In-Reply-To: References: <20170125194254.C0A51298B9@lists.osmocom.org> <20170126154613.GF1714@ass40.sysmocom.de> Message-ID: Great. I was also going to ask about debian contrl files, etc. Glad this is already fixed. Is there a way to subscribe to gerrit patches for a particular project? On Thu, Jan 26, 2017 at 8:10 PM, Max wrote: > It should have been removed with gerrit 1485 > . See also gerrit 1691 > for follow-up fixes. > > > On 26.01.2017 16:53, Alexander Chemeris wrote: >> >> Hi Harald, Thomas, >> >> I think it also makes sense to remove sqlite3 subdirectory, since it's no >> longer used. Any reason it's kept in the repository? > > > -- > Max Suraev http://www.sysmocom.de/ > ======================================================================= > * sysmocom - systems for mobile communications GmbH > * Alt-Moabit 93 > * 10559 Berlin, Germany > * Sitz / Registered office: Berlin, HRB 134158 B > * Geschaeftsfuehrer / Managing Director: Harald Welte > -- Regards, Alexander Chemeris. CEO, Fairwaves, Inc. https://fairwaves.co From davem at davemloft.net Thu Jan 26 19:22:47 2017 From: davem at davemloft.net (David Miller) Date: Thu, 26 Jan 2017 14:22:47 -0500 (EST) Subject: [PATCH net v2 3/3] gtp: fix cross netns recv on gtp socket In-Reply-To: <20170126151134.2892-4-aschultz@tpip.net> References: <20170126151134.2892-1-aschultz@tpip.net> <20170126151134.2892-4-aschultz@tpip.net> Message-ID: <20170126.142247.527598780818100974.davem@davemloft.net> From: Andreas Schultz Date: Thu, 26 Jan 2017 16:11:34 +0100 > The use of the passed through netlink src_net to check for a > cross netns operation was wrong. Using the GTP socket and the > GTP netdevice is always correct (even if the netdev has been > moved to new netns after link creation). > > Remove the now obsolete net field from gtp_dev. > > Signed-off-by: Andreas Schultz Please at least compile test your submissions: drivers/net/gtp.c: In function ?gtp_newlink?: drivers/net/gtp.c:677:8: error: too many arguments to function ?gtp_encap_enable? err = gtp_encap_enable(dev, gtp, fd0, fd1, src_net); ^ drivers/net/gtp.c:659:12: note: declared here static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, ^ drivers/net/gtp.c: At top level: drivers/net/gtp.c:822:12: error: conflicting types for ?gtp_encap_enable? static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, ^ drivers/net/gtp.c:659:12: note: previous declaration of ?gtp_encap_enable? was here static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, ^ drivers/net/gtp.c:659:12: warning: ?gtp_encap_enable? used but never defined drivers/net/gtp.c:822:12: warning: ?gtp_encap_enable? defined but not used [-Wunused-function] static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, ^ scripts/Makefile.build:299: recipe for target 'drivers/net/gtp.o' failed From nhofmeyr at sysmocom.de Thu Jan 26 20:40:27 2017 From: nhofmeyr at sysmocom.de (Neels Hofmeyr) Date: Thu, 26 Jan 2017 21:40:27 +0100 Subject: [MERGED] osmo-trx[master]: Do not embed sqlite3 when building In-Reply-To: References: <20170125194254.C0A51298B9@lists.osmocom.org> <20170126154613.GF1714@ass40.sysmocom.de> Message-ID: <20170126204027.GA7681@my.box> On Thu, Jan 26, 2017 at 08:53:07PM +0400, Alexander Chemeris wrote: > Great. I was also going to ask about debian contrl files, etc. Glad > this is already fixed. > > Is there a way to subscribe to gerrit patches for a particular project? I'm not sure, but I guess not. We have our gerrit-log mailing list that catches all changes https://lists.osmocom.org/mailman/listinfo/gerrit-log -- otherwise take a look at your user's settings, maybe there's such a feature hidden there? ~N -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From nhofmeyr at sysmocom.de Fri Jan 27 02:36:14 2017 From: nhofmeyr at sysmocom.de (Neels Hofmeyr) Date: Fri, 27 Jan 2017 03:36:14 +0100 Subject: HEADS UP: jenkins DOWN Message-ID: <20170127023614.GA13650@my.box> While I was waiting for jenkins just now, I noticed that it was getting impossibly slow despite an idle CPU. An attempt to restart resulted in failure to launch jenkins due to "Disk quota exceeded". There are things happening that I don't understand (file system is shrinking as I remove files). I need help from Holger (or Harald?), to understand and probably fix with a simple command making more space for the jail... Until then our jenkins will be DOWN :/ ~N -- - Neels Hofmeyr http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Gesch?ftsf?hrer / Managing Directors: Harald Welte -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From nhofmeyr at sysmocom.de Fri Jan 27 02:57:59 2017 From: nhofmeyr at sysmocom.de (Neels Hofmeyr) Date: Fri, 27 Jan 2017 03:57:59 +0100 Subject: HEADS DOWN: jenkins UP In-Reply-To: <20170127023614.GA13650@my.box> References: <20170127023614.GA13650@my.box> Message-ID: <20170127025759.GB13650@my.box> Just after I gave up and sent the mail, I found the point: we have three daily and three weekly backup snapshots taken of the jenkins jail, which *shares* disk quota with the actively used file system. Removing files doesn't remove them from the snapshots, so the only way short of discarding snapshots (?) is to increase the overall quota. I set it from 40G up to 60G, and sure enough jenkins runs again. We should probably set a refquota so that the live file system's quota is somewhat independent from the quota used for snapshots. I'll not do this before consulting with the experts though. ~N On Fri, Jan 27, 2017 at 03:36:14AM +0100, Neels Hofmeyr wrote: > While I was waiting for jenkins just now, I noticed that it was getting > impossibly slow despite an idle CPU. An attempt to restart resulted in failure > to launch jenkins due to "Disk quota exceeded". > > There are things happening that I don't understand (file system is shrinking as > I remove files). I need help from Holger (or Harald?), to understand and > probably fix with a simple command making more space for the jail... > > Until then our jenkins will be DOWN :/ > > ~N -- - Neels Hofmeyr http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Gesch?ftsf?hrer / Managing Directors: Harald Welte -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From holger at freyther.de Fri Jan 27 08:13:09 2017 From: holger at freyther.de (Holger Freyther) Date: Fri, 27 Jan 2017 09:13:09 +0100 Subject: HEADS DOWN: jenkins UP In-Reply-To: <20170127025759.GB13650@my.box> References: <20170127023614.GA13650@my.box> <20170127025759.GB13650@my.box> Message-ID: > On 27 Jan 2017, at 03:57, Neels Hofmeyr wrote: > > Just after I gave up and sent the mail, I found the point: we have three daily > and three weekly backup snapshots taken of the jenkins jail, which *shares* > disk quota with the actively used file system. Removing files doesn't remove > them from the snapshots, so the only way short of discarding snapshots (?) is > to increase the overall quota. I set it from 40G up to 60G, and sure enough > jenkins runs again. > We should probably set a refquota so that the live file system's quota is > somewhat independent from the quota used for snapshots. I'll not do this before > consulting with the experts though. good analysis. Not using refquota is a historic mistake. I have changed that for the jenkins.osmocom.org jail. holger From aschultz at tpip.net Fri Jan 27 09:40:55 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Fri, 27 Jan 2017 10:40:55 +0100 Subject: [PATCH net v3 0/3] various gtp fixes Message-ID: <20170127094058.7899-1-aschultz@tpip.net> I'm sorry for the compile error mess up in the last version. It's no excuse for not test compiling, but the hunks got lost in a rebase. This is the part of the previous "simple gtp improvements" series that Pablo indicated should go into net. The addition of the module alias fixes genl family autoloading, clearing the DF bit fixes a protocol violation in regard to the specification and the netns comparison fixes a corner case of cross netns recv. Andreas v2->v3: fix compiler error introduced in rebase -- Andreas Schultz (3): gtp: add genl family modules alias gtp: clear DF bit on GTP packet tx gtp: fix cross netns recv on gtp socket drivers/net/gtp.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) -- 2.10.2 From aschultz at tpip.net Fri Jan 27 09:40:57 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Fri, 27 Jan 2017 10:40:57 +0100 Subject: [PATCH net v3 2/3] gtp: clear DF bit on GTP packet tx In-Reply-To: <20170127094058.7899-1-aschultz@tpip.net> References: <20170127094058.7899-1-aschultz@tpip.net> Message-ID: <20170127094058.7899-3-aschultz@tpip.net> 3GPP TS 29.281 and 3GPP TS 29.060 imply that GTP-U packets should be sent with the DF bit cleared. For example 3GPP TS 29.060, Release 8, Section 13.2.2: > Backbone router: Any router in the backbone may fragment the GTP > packet if needed, according to IPv4. Signed-off-by: Andreas Schultz Acked-by: Harald Welte Acked-by: Pablo Neira Ayuso --- drivers/net/gtp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 7580ccc..1df54d6 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -612,7 +612,7 @@ static netdev_tx_t gtp_dev_xmit(struct sk_buff *skb, struct net_device *dev) pktinfo.fl4.saddr, pktinfo.fl4.daddr, pktinfo.iph->tos, ip4_dst_hoplimit(&pktinfo.rt->dst), - htons(IP_DF), + 0, pktinfo.gtph_port, pktinfo.gtph_port, true, false); break; -- 2.10.2 From aschultz at tpip.net Fri Jan 27 09:40:58 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Fri, 27 Jan 2017 10:40:58 +0100 Subject: [PATCH net v3 3/3] gtp: fix cross netns recv on gtp socket In-Reply-To: <20170127094058.7899-1-aschultz@tpip.net> References: <20170127094058.7899-1-aschultz@tpip.net> Message-ID: <20170127094058.7899-4-aschultz@tpip.net> The use of the passed through netlink src_net to check for a cross netns operation was wrong. Using the GTP socket and the GTP netdevice is always correct (even if the netdev has been moved to new netns after link creation). Remove the now obsolete net field from gtp_dev. Signed-off-by: Andreas Schultz Acked-by: Pablo Neira Ayuso --- drivers/net/gtp.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 1df54d6..99d3df7 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -69,7 +69,6 @@ struct gtp_dev { struct socket *sock0; struct socket *sock1u; - struct net *net; struct net_device *dev; unsigned int hash_size; @@ -316,7 +315,7 @@ static int gtp_encap_recv(struct sock *sk, struct sk_buff *skb) netdev_dbg(gtp->dev, "encap_recv sk=%p\n", sk); - xnet = !net_eq(gtp->net, dev_net(gtp->dev)); + xnet = !net_eq(sock_net(sk), dev_net(gtp->dev)); switch (udp_sk(sk)->encap_type) { case UDP_ENCAP_GTP0: @@ -658,7 +657,7 @@ static void gtp_link_setup(struct net_device *dev) static int gtp_hashtable_new(struct gtp_dev *gtp, int hsize); static void gtp_hashtable_free(struct gtp_dev *gtp); static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, - int fd_gtp0, int fd_gtp1, struct net *src_net); + int fd_gtp0, int fd_gtp1); static int gtp_newlink(struct net *src_net, struct net_device *dev, struct nlattr *tb[], struct nlattr *data[]) @@ -675,7 +674,7 @@ static int gtp_newlink(struct net *src_net, struct net_device *dev, fd0 = nla_get_u32(data[IFLA_GTP_FD0]); fd1 = nla_get_u32(data[IFLA_GTP_FD1]); - err = gtp_encap_enable(dev, gtp, fd0, fd1, src_net); + err = gtp_encap_enable(dev, gtp, fd0, fd1); if (err < 0) goto out_err; @@ -821,7 +820,7 @@ static void gtp_hashtable_free(struct gtp_dev *gtp) } static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, - int fd_gtp0, int fd_gtp1, struct net *src_net) + int fd_gtp0, int fd_gtp1) { struct udp_tunnel_sock_cfg tuncfg = {NULL}; struct socket *sock0, *sock1u; @@ -858,7 +857,6 @@ static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, gtp->sock0 = sock0; gtp->sock1u = sock1u; - gtp->net = src_net; tuncfg.sk_user_data = gtp; tuncfg.encap_rcv = gtp_encap_recv; -- 2.10.2 From aschultz at tpip.net Fri Jan 27 09:40:56 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Fri, 27 Jan 2017 10:40:56 +0100 Subject: [PATCH net v3 1/3] gtp: add genl family modules alias In-Reply-To: <20170127094058.7899-1-aschultz@tpip.net> References: <20170127094058.7899-1-aschultz@tpip.net> Message-ID: <20170127094058.7899-2-aschultz@tpip.net> Auto-load the module when userspace asks for the gtp netlink family. Signed-off-by: Andreas Schultz Acked-by: Harald Welte Acked-by: Pablo Neira Ayuso --- drivers/net/gtp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 8b6810b..7580ccc 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -1376,3 +1376,4 @@ MODULE_LICENSE("GPL"); MODULE_AUTHOR("Harald Welte "); MODULE_DESCRIPTION("Interface driver for GTP encapsulated traffic"); MODULE_ALIAS_RTNL_LINK("gtp"); +MODULE_ALIAS_GENL_FAMILY("gtp"); -- 2.10.2 From davem at davemloft.net Fri Jan 27 15:40:12 2017 From: davem at davemloft.net (David Miller) Date: Fri, 27 Jan 2017 10:40:12 -0500 (EST) Subject: [PATCH net v3 0/3] various gtp fixes In-Reply-To: <20170127094058.7899-1-aschultz@tpip.net> References: <20170127094058.7899-1-aschultz@tpip.net> Message-ID: <20170127.104012.823264164422411860.davem@davemloft.net> From: Andreas Schultz Date: Fri, 27 Jan 2017 10:40:55 +0100 > I'm sorry for the compile error mess up in the last version. > It's no excuse for not test compiling, but the hunks got lost in > a rebase. > > This is the part of the previous "simple gtp improvements" series > that Pablo indicated should go into net. > > The addition of the module alias fixes genl family autoloading, > clearing the DF bit fixes a protocol violation in regard to the > specification and the netns comparison fixes a corner case of > cross netns recv. > > Andreas > > v2->v3: fix compiler error introduced in rebase Looks better, series applied, thanks. From davem at davemloft.net Sun Jan 29 18:56:05 2017 From: davem at davemloft.net (David Miller) Date: Sun, 29 Jan 2017 13:56:05 -0500 (EST) Subject: [PATCH net-next v2 0/2] gtp: simple gtp improvements In-Reply-To: <20170126152149.3284-1-aschultz@tpip.net> References: <20170126152149.3284-1-aschultz@tpip.net> Message-ID: <20170129.135605.1273656353031937944.davem@davemloft.net> From: Andreas Schultz Date: Thu, 26 Jan 2017 16:21:47 +0100 > This is the part of the previous "simple gtp improvements" series > that Pablo indicated should go into net-next. > > The rcu_lock removal is small correctness changes. Passing invalid > to user space allows for more standards compliant handling of invalid > tunnels. Series applied, thanks. From hosseinamini2578 at gmail.com Mon Jan 30 16:29:36 2017 From: hosseinamini2578 at gmail.com (Hossein Amini) Date: Mon, 30 Jan 2017 19:59:36 +0330 Subject: Channel release error when osmo-nitb want execute location update Message-ID: hi dear I install openbsc, osmosgsn, ggsn, osmo-trx, osmo-bts-trx, osmo-pcu and dependency from master branch step by step from this link. but when run osmo-nitb, osmo-trx and osmo-bts-trx, mobile connect to network but no access to network. (I used USRP N210 and B210.) osmo-nitb log: 20170130041914525 DRLL <0000> chan_alloc.c:352 (bts=0,trx=0,ts=0,pchan=CCCH+SDCCH4) Allocating lchan=0 as SDCCH 20170130041914525 DRSL <0004> abis_rsl.c:1819 (bts=0,trx=0,ts=0,ss=0) Activating ARFCN(0) SS(0) lctype SDCCH r=LOCATION_UPDATE ra=0x05 ta=0 20170130041914525 DRSL <0004> abis_rsl.c:580 (bts=0,trx=0,ts=0,pchan=CCCH+SDCCH4) Tx RSL Channel Activate with act_type=INITIAL 20170130041914525 DRSL <0004> abis_rsl.c:1189 (bts=0,trx=0,ts=0,ss=0) state NONE -> ACTIVATION REQUESTED 20170130041914525 DRSL <0004> abis_rsl.c:1546 (bts=0,trx=0,ts=0,ss=0) CHANNEL ACTIVATE ACK 20170130041914525 DRSL <0004> abis_rsl.c:1189 (bts=0,trx=0,ts=0,ss=0) state ACTIVATION REQUESTED -> ACTIVE 20170130041924529 DRSL <0004> abis_rsl.c:852 (bts=0,trx=0,ts=0,ss=0) RF Channel Release due to error: 1 20170130041924529 DRSL <0004> abis_rsl.c:762 (bts=0,trx=0,ts=0,ss=0) DEACTivate SACCH CMD 20170130041924529 DRSL <0004> abis_rsl.c:1189 (bts=0,trx=0,ts=0,ss=0) state ACTIVE -> RELEASE DUE ERROR 20170130041924530 DRSL <0004> abis_rsl.c:925 (bts=0,trx=0,ts=0,ss=0) RF CHANNEL RELEASE ACK 20170130041926530 DRSL <0004> abis_rsl.c:811 (bts=0,trx=0,ts=0,ss=0) is back in operation. 20170130041926531 DRSL <0004> abis_rsl.c:1189 (bts=0,trx=0,ts=0,ss=0) state RELEASE DUE ERROR -> NONE NITB config: ! ! OpenBSC (0.15.0.646-f1886-dirty) configuration saved from vty !! password foo ! log stderr logging filter all 1 logging color 1 logging print category 1 logging print extended-timestamp 1 logging level all everything logging level rll debug logging level cc debug logging level mm info logging level rr info logging level rsl debug logging level nm debug logging level mncc debug logging level pag debug logging level meas notice logging level sccp notice logging level msc notice logging level mgcp notice logging level ho notice logging level db notice logging level ref notice logging level gprs notice logging level ns info logging level bssgp notice logging level llc notice logging level sndcp notice logging level nat notice logging level ctrl notice logging level smpp notice logging level filter notice logging level ranap debug logging level sua debug logging level lglobal notice logging level llapd notice logging level linp notice logging level lmux notice logging level lmi notice logging level lmib notice logging level lsms notice logging level lctrl notice logging level lgtp notice logging level lstats notice logging level lgsup notice logging level loap notice ! stats interval 5 ! line vty no login ! e1_input e1_line 0 driver ipa e1_line 0 port 0 no e1_line 0 keepalive ipa bind 127.0.0.1 network network country code 432 mobile network code 70 short name dynch long name dynch auth policy accept-all authorized-regexp .* location updating reject cause 13 encryption a5 0 neci 1 paging any use tch 0 rrlp mode none mm info 1 handover 0 handover window rxlev averaging 10 handover window rxqual averaging 1 handover window rxlev neighbor averaging 10 handover power budget interval 6 handover power budget hysteresis 3 handover maximum distance 9999 timer t3101 10 timer t3103 0 timer t3105 0 timer t3107 0 timer t3109 4 timer t3111 0 timer t3113 60 timer t3115 0 timer t3117 0 timer t3119 0 timer t3122 10 timer t3141 0 subscriber-keep-in-ram 0 bts 0 type sysmobts band GSM900 cell_identity 0 location_area_code 1 base_station_id_code 63 ms max power 15 cell reselection hysteresis 4 rxlev access min 0 periodic location update 30 radio-link-timeout 32 channel allocator ascending rach tx integer 9 rach max transmission 7 channel-descrption attach 1 channel-descrption bs-pa-mfrms 5 channel-descrption bs-ag-blks-res 1 early-classmark-sending forbidden ip.access unit_id 1800 0 oml ip.access stream_id 255 line 0 neighbor-list mode automatic codec-support fr gprs mode gprs gprs 11bit_rach_support_for_egprs 0 gprs routing area 0 gprs network-control-order nc1 gprs cell bvci 1800 gprs cell timer blocking-timer 3 gprs cell timer blocking-retries 3 gprs cell timer unblocking-retries 3 gprs cell timer reset-timer 3 gprs cell timer reset-retries 3 gprs cell timer suspend-timer 10 gprs cell timer suspend-retries 3 gprs cell timer resume-timer 10 gprs cell timer resume-retries 3 gprs cell timer capability-update-timer 10 gprs cell timer capability-update-retries 3 gprs nsei 1800 gprs ns timer tns-block 3 gprs ns timer tns-block-retries 3 gprs ns timer tns-reset 3 gprs ns timer tns-reset-retries 3 gprs ns timer tns-test 30 gprs ns timer tns-alive 3 gprs ns timer tns-alive-retries 10 gprs nsvc 0 nsvci 1800 gprs nsvc 0 local udp port 23000 gprs nsvc 0 remote udp port 23000 gprs nsvc 0 remote ip 127.0.0.1 gprs nsvc 1 nsvci 0 gprs nsvc 1 local udp port 0 gprs nsvc 1 remote udp port 0 gprs nsvc 1 remote ip 0.0.0.0 no force-combined-si trx 0 rf_locked 0 arfcn 0 nominal power 23 max_power_red 0 rsl e1 tei 0 timeslot 0 phys_chan_config CCCH+SDCCH4 hopping enabled 0 timeslot 1 phys_chan_config TCH/F hopping enabled 0 timeslot 2 phys_chan_config TCH/F hopping enabled 0 timeslot 3 phys_chan_config TCH/F hopping enabled 0 timeslot 4 phys_chan_config PDCH hopping enabled 0 timeslot 5 phys_chan_config PDCH hopping enabled 0 timeslot 6 phys_chan_config PDCH hopping enabled 0 timeslot 7 phys_chan_config PDCH hopping enabled 0 mncc-int default-codec tch-f fr default-codec tch-h hr nitb subscriber-create-on-demand assign-tmsi OSMO-BTS-TRX Config file ! ! OsmoBTS (0.4.0.372-f65b) configuration saved from vty !! ! log stderr logging filter all 1 logging color 0 logging print category 1 logging print extended-timestamp 1 logging level all everything logging level rsl debug logging level oml debug logging level rll notice logging level rr notice logging level meas notice logging level pag info logging level l1c debug logging level l1p info logging level dsp debug logging level pcu notice logging level ho notice logging level trx notice logging level loop notice logging level abis notice logging level rtp notice logging level sum notice logging level lglobal notice logging level llapd debug logging level linp notice logging level lmux notice logging level lmi notice logging level lmib notice logging level lsms notice logging level lctrl notice logging level lgtp notice logging level lstats notice logging level lgsup notice logging level loap notice ! line vty no login ! e1_input e1_line 0 driver ipa e1_line 0 port 0 no e1_line 0 keepalive phy 0 osmotrx ip 127.0.0.1 osmotrx fn-advance 20 osmotrx rts-advance 5 osmotrx tx-attenuation oml instance 0 bts 0 band GSM900 ipa unit-id 1800 0 oml remote-ip 127.0.0.1 rtp jitter-buffer 100 paging queue-size 200 paging lifetime 0 uplink-power-target -75 min-qual-rach 50 min-qual-norm -5 no ms-power-loop timing-advance-loop trx 0 power-ramp max-initial 23000 mdBm power-ramp step-size 2000 mdB power-ramp step-interval 1 ms-power-control dsp phy 0 instance 0 Regards! -------------- next part -------------- An HTML attachment was scrubbed... URL: From aschultz at tpip.net Mon Jan 30 16:31:54 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Mon, 30 Jan 2017 17:31:54 +0100 Subject: [PATCH 0/6] gtp: misc improvements Message-ID: <20170130163200.17070-1-aschultz@tpip.net> Hi Pablo, This series lays the groundwork for removing the socket references from the GTP netdevice by removing duplicate code and simplifying the logic on some code paths. It slighly changes the GTP genl API by making the socket parameters optional (though one of them is still required). The removal of the socket references will break the 1:1 releation between GTP netdevice and GTP socket that prevents us to support multiple VRFs with overlaping IP addresse spaces attached to the same GTP socket (needed for multi APN support). Regards Andreas -- Andreas Schultz (6): gtp: make GTP sockets in gtp_newlink optional gtp: merge gtp_get_net and gtp_genl_find_dev gtp: unify genl_find_pdp and prepare for per socket lookup gtp: consolidate pdp context destruction into helper gtp: add socket to pdp context gtp: consolidate gtp socket rx path drivers/net/gtp.c | 564 +++++++++++++++++++++++++++--------------------------- 1 file changed, 280 insertions(+), 284 deletions(-) -- 2.10.2 From aschultz at tpip.net Mon Jan 30 16:31:55 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Mon, 30 Jan 2017 17:31:55 +0100 Subject: [PATCH 1/6] gtp: make GTP sockets in gtp_newlink optional In-Reply-To: <20170130163200.17070-1-aschultz@tpip.net> References: <20170130163200.17070-1-aschultz@tpip.net> Message-ID: <20170130163200.17070-2-aschultz@tpip.net> Having both GTPv0-U and GTPv1-U is not always desirable. Fallback from GTPv1-U to GTPv0-U was depreciated from 3GPP Rel-8 onwards. Post Rel-8 implementation are discuraged from listening on the v0 port (see 3GPP TS 29.281, Sect. 1). A future change will completely decouple the sockets from the network device. Till then, at least one of the sockets needs to be specified (either v0 or v1), the other is optional. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 142 +++++++++++++++++++++++++++++------------------------- 1 file changed, 76 insertions(+), 66 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index bda0c64..18944f4 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -259,28 +259,30 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, return iptunnel_pull_header(skb, hdrlen, skb->protocol, xnet); } -static void gtp_encap_disable(struct gtp_dev *gtp) -{ - if (gtp->sock0 && gtp->sock0->sk) { - udp_sk(gtp->sock0->sk)->encap_type = 0; - rcu_assign_sk_user_data(gtp->sock0->sk, NULL); - } - if (gtp->sock1u && gtp->sock1u->sk) { - udp_sk(gtp->sock1u->sk)->encap_type = 0; - rcu_assign_sk_user_data(gtp->sock1u->sk, NULL); - } - - gtp->sock0 = NULL; - gtp->sock1u = NULL; -} - static void gtp_encap_destroy(struct sock *sk) { struct gtp_dev *gtp; gtp = rcu_dereference_sk_user_data(sk); - if (gtp) - gtp_encap_disable(gtp); + if (gtp) { + udp_sk(sk)->encap_type = 0; + rcu_assign_sk_user_data(sk, NULL); + } +} + +static void gtp_encap_disable_sock(struct socket *sock) +{ + if (!sock || !sock->sk) + return; + + gtp_encap_destroy(sock->sk); + sockfd_put(sock); +} + +static void gtp_encap_disable(struct gtp_dev *gtp) +{ + gtp_encap_disable_sock(gtp->sock0); + gtp_encap_disable_sock(gtp->sock1u); } /* UDP encapsulation receive handler. See net/ipv4/udp.c. @@ -640,27 +642,24 @@ static void gtp_link_setup(struct net_device *dev) static int gtp_hashtable_new(struct gtp_dev *gtp, int hsize); static void gtp_hashtable_free(struct gtp_dev *gtp); -static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, - int fd_gtp0, int fd_gtp1); +static int gtp_encap_enable(struct gtp_dev *gtp, struct nlattr *data[]); +static void gtp_encap_disable(struct gtp_dev *gtp); static int gtp_newlink(struct net *src_net, struct net_device *dev, struct nlattr *tb[], struct nlattr *data[]) { - int hashsize, err, fd0, fd1; + int hashsize, err; struct gtp_dev *gtp; struct gtp_net *gn; - if (!data[IFLA_GTP_FD0] || !data[IFLA_GTP_FD1]) + if (!data[IFLA_GTP_FD0] && !data[IFLA_GTP_FD1]) return -EINVAL; gtp = netdev_priv(dev); - fd0 = nla_get_u32(data[IFLA_GTP_FD0]); - fd1 = nla_get_u32(data[IFLA_GTP_FD1]); - - err = gtp_encap_enable(dev, gtp, fd0, fd1); + err = gtp_encap_enable(gtp, data); if (err < 0) - goto out_err; + return err; if (!data[IFLA_GTP_PDP_HASHSIZE]) hashsize = 1024; @@ -688,7 +687,6 @@ static int gtp_newlink(struct net *src_net, struct net_device *dev, gtp_hashtable_free(gtp); out_encap: gtp_encap_disable(gtp); -out_err: return err; } @@ -803,61 +801,73 @@ static void gtp_hashtable_free(struct gtp_dev *gtp) kfree(gtp->tid_hash); } -static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, - int fd_gtp0, int fd_gtp1) +static struct socket *gtp_encap_enable_socket(int fd, int type, + struct gtp_dev *gtp) { struct udp_tunnel_sock_cfg tuncfg = {NULL}; - struct socket *sock0, *sock1u; + struct socket *sock; int err; - netdev_dbg(dev, "enable gtp on %d, %d\n", fd_gtp0, fd_gtp1); + pr_debug("enable gtp on %d, %d\n", fd, type); - sock0 = sockfd_lookup(fd_gtp0, &err); - if (sock0 == NULL) { - netdev_dbg(dev, "socket fd=%d not found (gtp0)\n", fd_gtp0); - return -ENOENT; + sock = sockfd_lookup(fd, &err); + if (!sock) { + pr_debug("gtp socket fd=%d not found\n", fd); + return NULL; } - if (sock0->sk->sk_protocol != IPPROTO_UDP) { - netdev_dbg(dev, "socket fd=%d not UDP\n", fd_gtp0); + if (sock->sk->sk_protocol != IPPROTO_UDP) { + pr_debug("socket fd=%d not UDP\n", fd); err = -EINVAL; - goto err1; + goto out_sock; } - sock1u = sockfd_lookup(fd_gtp1, &err); - if (sock1u == NULL) { - netdev_dbg(dev, "socket fd=%d not found (gtp1u)\n", fd_gtp1); - err = -ENOENT; - goto err1; + if (rcu_dereference_sk_user_data(sock->sk)) { + err = -EBUSY; + goto out_sock; } - if (sock1u->sk->sk_protocol != IPPROTO_UDP) { - netdev_dbg(dev, "socket fd=%d not UDP\n", fd_gtp1); - err = -EINVAL; - goto err2; - } - - netdev_dbg(dev, "enable gtp on %p, %p\n", sock0, sock1u); - - gtp->sock0 = sock0; - gtp->sock1u = sock1u; - tuncfg.sk_user_data = gtp; + tuncfg.encap_type = type; tuncfg.encap_rcv = gtp_encap_recv; tuncfg.encap_destroy = gtp_encap_destroy; - tuncfg.encap_type = UDP_ENCAP_GTP0; - setup_udp_tunnel_sock(sock_net(gtp->sock0->sk), gtp->sock0, &tuncfg); - - tuncfg.encap_type = UDP_ENCAP_GTP1U; - setup_udp_tunnel_sock(sock_net(gtp->sock1u->sk), gtp->sock1u, &tuncfg); - - err = 0; -err2: - sockfd_put(sock1u); -err1: - sockfd_put(sock0); - return err; + setup_udp_tunnel_sock(sock_net(sock->sk), sock, &tuncfg); + return sock; + +out_sock: + sockfd_put(sock); + return ERR_PTR(err); +} + +static int gtp_encap_enable(struct gtp_dev *gtp, struct nlattr *data[]) +{ + struct socket *sock0 = NULL; + struct socket *sock1u = NULL; + + if (data[IFLA_GTP_FD0]) { + u32 fd0 = nla_get_u32(data[IFLA_GTP_FD0]); + + sock0 = gtp_encap_enable_socket(fd0, UDP_ENCAP_GTP0, gtp); + if (IS_ERR(sock0)) + return PTR_ERR(sock0); + } + + if (data[IFLA_GTP_FD1]) { + u32 fd1 = nla_get_u32(data[IFLA_GTP_FD1]); + + sock1u = gtp_encap_enable_socket(fd1, UDP_ENCAP_GTP1U, gtp); + if (IS_ERR(sock1u)) { + if (sock0) + sockfd_put(sock0); + return PTR_ERR(sock1u); + } + } + + gtp->sock0 = sock0; + gtp->sock1u = sock1u; + + return 0; } static struct net_device *gtp_find_dev(struct net *net, int ifindex) -- 2.10.2 From aschultz at tpip.net Mon Jan 30 16:31:57 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Mon, 30 Jan 2017 17:31:57 +0100 Subject: [PATCH 3/6] gtp: unify genl_find_pdp and prepare for per socket lookup In-Reply-To: <20170130163200.17070-1-aschultz@tpip.net> References: <20170130163200.17070-1-aschultz@tpip.net> Message-ID: <20170130163200.17070-4-aschultz@tpip.net> This unifies duplicate code into a helper. It also prepares the groundwork to add a lookup version that uses the socket to find attache pdp contexts. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 120 +++++++++++++++++++++++------------------------------- 1 file changed, 51 insertions(+), 69 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index c96c71f..6b7a3c2 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -1027,47 +1027,62 @@ static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info) return err; } +static struct pdp_ctx *gtp_genl_find_pdp_by_link(struct sk_buff *skb, + struct genl_info *info) +{ + struct gtp_dev *gtp; + + gtp = gtp_genl_find_dev(sock_net(skb->sk), info->attrs); + if (!gtp) + return ERR_PTR(-ENODEV); + + if (info->attrs[GTPA_MS_ADDRESS]) { + __be32 ip = nla_get_be32(info->attrs[GTPA_MS_ADDRESS]); + + return ipv4_pdp_find(gtp, ip); + } else if (info->attrs[GTPA_VERSION]) { + u32 gtp_version = nla_get_u32(info->attrs[GTPA_VERSION]); + + if (gtp_version == GTP_V0 && info->attrs[GTPA_TID]) + return gtp0_pdp_find(gtp, nla_get_u64( + info->attrs[GTPA_TID])); + else if (gtp_version == GTP_V1 && info->attrs[GTPA_I_TEI]) + return gtp1_pdp_find(gtp, nla_get_u32( + info->attrs[GTPA_I_TEI])); + } + + return ERR_PTR(-EINVAL); +} + +static struct pdp_ctx *gtp_genl_find_pdp(struct sk_buff *skb, + struct genl_info *info) +{ + struct pdp_ctx *pctx; + + if (info->attrs[GTPA_LINK]) + pctx = gtp_genl_find_pdp_by_link(skb, info); + else + pctx = ERR_PTR(-EINVAL); + + if (!pctx) + pctx = ERR_PTR(-ENOENT); + + return pctx; +} + static int gtp_genl_del_pdp(struct sk_buff *skb, struct genl_info *info) { struct pdp_ctx *pctx; - struct gtp_dev *gtp; int err = 0; - if (!info->attrs[GTPA_VERSION] || - !info->attrs[GTPA_LINK]) + if (!info->attrs[GTPA_VERSION]) return -EINVAL; rcu_read_lock(); - gtp = gtp_genl_find_dev(sock_net(skb->sk), info->attrs); - if (!gtp) { - err = -ENODEV; - goto out_unlock; - } - - switch (nla_get_u32(info->attrs[GTPA_VERSION])) { - case GTP_V0: - if (!info->attrs[GTPA_TID]) { - err = -EINVAL; - goto out_unlock; - } - pctx = gtp0_pdp_find(gtp, nla_get_u64(info->attrs[GTPA_TID])); - break; - case GTP_V1: - if (!info->attrs[GTPA_I_TEI]) { - err = -EINVAL; - goto out_unlock; - } - pctx = gtp1_pdp_find(gtp, nla_get_u64(info->attrs[GTPA_I_TEI])); - break; - - default: - err = -EINVAL; - goto out_unlock; - } - - if (!pctx) { - err = -ENOENT; + pctx = gtp_genl_find_pdp(skb, info); + if (IS_ERR(pctx)) { + err = PTR_ERR(pctx); goto out_unlock; } @@ -1129,49 +1144,16 @@ static int gtp_genl_get_pdp(struct sk_buff *skb, struct genl_info *info) { struct pdp_ctx *pctx = NULL; struct sk_buff *skb2; - struct gtp_dev *gtp; - u32 gtp_version; int err; - if (!info->attrs[GTPA_VERSION] || - !info->attrs[GTPA_LINK]) + if (!info->attrs[GTPA_VERSION]) return -EINVAL; - gtp_version = nla_get_u32(info->attrs[GTPA_VERSION]); - switch (gtp_version) { - case GTP_V0: - case GTP_V1: - break; - default: - return -EINVAL; - } - rcu_read_lock(); - gtp = gtp_genl_find_dev(sock_net(skb->sk), info->attrs); - if (!gtp) { - err = -ENODEV; - goto err_unlock; - } - - if (gtp_version == GTP_V0 && - info->attrs[GTPA_TID]) { - u64 tid = nla_get_u64(info->attrs[GTPA_TID]); - - pctx = gtp0_pdp_find(gtp, tid); - } else if (gtp_version == GTP_V1 && - info->attrs[GTPA_I_TEI]) { - u32 tid = nla_get_u32(info->attrs[GTPA_I_TEI]); - - pctx = gtp1_pdp_find(gtp, tid); - } else if (info->attrs[GTPA_MS_ADDRESS]) { - __be32 ip = nla_get_be32(info->attrs[GTPA_MS_ADDRESS]); - - pctx = ipv4_pdp_find(gtp, ip); - } - - if (pctx == NULL) { - err = -ENOENT; + pctx = gtp_genl_find_pdp(skb, info); + if (IS_ERR(pctx)) { + err = PTR_ERR(pctx); goto err_unlock; } -- 2.10.2 From aschultz at tpip.net Mon Jan 30 16:31:56 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Mon, 30 Jan 2017 17:31:56 +0100 Subject: [PATCH 2/6] gtp: merge gtp_get_net and gtp_genl_find_dev In-Reply-To: <20170130163200.17070-1-aschultz@tpip.net> References: <20170130163200.17070-1-aschultz@tpip.net> Message-ID: <20170130163200.17070-3-aschultz@tpip.net> Both function are always used together with the final goal to get the gtp_dev. This simplifies the code by merging them together. The netdevice lookup is changed to use the regular dev_get_by_index. The gtp netdevice list is now only used to find the PDP contexts for imcomming packets. It can be completely eliminated Once the TEID hash is moved into the GTP socket. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 170 ++++++++++++++++++++++++++---------------------------- 1 file changed, 81 insertions(+), 89 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 18944f4..c96c71f 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -745,21 +745,6 @@ static struct rtnl_link_ops gtp_link_ops __read_mostly = { .fill_info = gtp_fill_info, }; -static struct net *gtp_genl_get_net(struct net *src_net, struct nlattr *tb[]) -{ - struct net *net; - - /* Examine the link attributes and figure out which network namespace - * we are talking about. - */ - if (tb[GTPA_NET_NS_FD]) - net = get_net_ns_by_fd(nla_get_u32(tb[GTPA_NET_NS_FD])); - else - net = get_net(src_net); - - return net; -} - static int gtp_hashtable_new(struct gtp_dev *gtp, int hsize) { int i; @@ -870,16 +855,31 @@ static int gtp_encap_enable(struct gtp_dev *gtp, struct nlattr *data[]) return 0; } -static struct net_device *gtp_find_dev(struct net *net, int ifindex) +static struct gtp_dev *gtp_genl_find_dev(struct net *src_net, + struct nlattr *tb[]) { - struct gtp_net *gn = net_generic(net, gtp_net_id); - struct gtp_dev *gtp; - - list_for_each_entry_rcu(gtp, &gn->gtp_dev_list, list) { - if (ifindex == gtp->dev->ifindex) - return gtp->dev; - } - return NULL; + struct net *net; + struct net_device *dev; + struct gtp_dev *gtp = NULL; + + /* Examine the link attributes and figure out which network namespace + * we are talking about. + */ + if (tb[GTPA_NET_NS_FD]) + net = get_net_ns_by_fd(nla_get_u32(tb[GTPA_NET_NS_FD])); + else + net = get_net(src_net); + + if (IS_ERR(net)) + return NULL; + + /* Check if there's an existing gtpX device to configure */ + dev = dev_get_by_index_rcu(net, nla_get_u32(tb[GTPA_LINK])); + if (dev->netdev_ops == >p_netdev_ops) + gtp = netdev_priv(dev); + + put_net(net); + return gtp; } static void ipv4_pdp_fill(struct pdp_ctx *pctx, struct genl_info *info) @@ -909,9 +909,8 @@ static void ipv4_pdp_fill(struct pdp_ctx *pctx, struct genl_info *info) } } -static int ipv4_pdp_add(struct net_device *dev, struct genl_info *info) +static int ipv4_pdp_add(struct gtp_dev *gtp, struct genl_info *info) { - struct gtp_dev *gtp = netdev_priv(dev); u32 hash_ms, hash_tid = 0; struct pdp_ctx *pctx; bool found = false; @@ -936,11 +935,11 @@ static int ipv4_pdp_add(struct net_device *dev, struct genl_info *info) ipv4_pdp_fill(pctx, info); if (pctx->gtp_version == GTP_V0) - netdev_dbg(dev, "GTPv0-U: update tunnel id = %llx (pdp %p)\n", - pctx->u.v0.tid, pctx); + pr_debug("GTPv0-U: update tunnel id = %llx (pdp %p)\n", + pctx->u.v0.tid, pctx); else if (pctx->gtp_version == GTP_V1) - netdev_dbg(dev, "GTPv1-U: update tunnel id = %x/%x (pdp %p)\n", - pctx->u.v1.i_tei, pctx->u.v1.o_tei, pctx); + pr_debug("GTPv1-U: update tunnel id = %x/%x (pdp %p)\n", + pctx->u.v1.i_tei, pctx->u.v1.o_tei, pctx); return 0; @@ -972,14 +971,14 @@ static int ipv4_pdp_add(struct net_device *dev, struct genl_info *info) switch (pctx->gtp_version) { case GTP_V0: - netdev_dbg(dev, "GTPv0-U: new PDP ctx id=%llx ssgn=%pI4 ms=%pI4 (pdp=%p)\n", - pctx->u.v0.tid, &pctx->sgsn_addr_ip4, - &pctx->ms_addr_ip4, pctx); + pr_debug("GTPv0-U: new PDP ctx id=%llx ssgn=%pI4 ms=%pI4 (pdp=%p)\n", + pctx->u.v0.tid, &pctx->sgsn_addr_ip4, + &pctx->ms_addr_ip4, pctx); break; case GTP_V1: - netdev_dbg(dev, "GTPv1-U: new PDP ctx id=%x/%x ssgn=%pI4 ms=%pI4 (pdp=%p)\n", - pctx->u.v1.i_tei, pctx->u.v1.o_tei, - &pctx->sgsn_addr_ip4, &pctx->ms_addr_ip4, pctx); + pr_debug("GTPv1-U: new PDP ctx id=%x/%x ssgn=%pI4 ms=%pI4 (pdp=%p)\n", + pctx->u.v1.i_tei, pctx->u.v1.o_tei, + &pctx->sgsn_addr_ip4, &pctx->ms_addr_ip4, pctx); break; } @@ -988,8 +987,8 @@ static int ipv4_pdp_add(struct net_device *dev, struct genl_info *info) static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info) { - struct net_device *dev; - struct net *net; + struct gtp_dev *gtp; + int err; if (!info->attrs[GTPA_VERSION] || !info->attrs[GTPA_LINK] || @@ -1013,77 +1012,79 @@ static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info) return -EINVAL; } - net = gtp_genl_get_net(sock_net(skb->sk), info->attrs); - if (IS_ERR(net)) - return PTR_ERR(net); + rcu_read_lock(); - /* Check if there's an existing gtpX device to configure */ - dev = gtp_find_dev(net, nla_get_u32(info->attrs[GTPA_LINK])); - if (dev == NULL) { - put_net(net); - return -ENODEV; + gtp = gtp_genl_find_dev(sock_net(skb->sk), info->attrs); + if (!gtp) { + err = -ENODEV; + goto out_unlock; } - put_net(net); - return ipv4_pdp_add(dev, info); + err = ipv4_pdp_add(gtp, info); + +out_unlock: + rcu_read_unlock(); + return err; } static int gtp_genl_del_pdp(struct sk_buff *skb, struct genl_info *info) { - struct net_device *dev; struct pdp_ctx *pctx; struct gtp_dev *gtp; - struct net *net; + int err = 0; if (!info->attrs[GTPA_VERSION] || !info->attrs[GTPA_LINK]) return -EINVAL; - net = gtp_genl_get_net(sock_net(skb->sk), info->attrs); - if (IS_ERR(net)) - return PTR_ERR(net); + rcu_read_lock(); - /* Check if there's an existing gtpX device to configure */ - dev = gtp_find_dev(net, nla_get_u32(info->attrs[GTPA_LINK])); - if (dev == NULL) { - put_net(net); - return -ENODEV; + gtp = gtp_genl_find_dev(sock_net(skb->sk), info->attrs); + if (!gtp) { + err = -ENODEV; + goto out_unlock; } - put_net(net); - - gtp = netdev_priv(dev); switch (nla_get_u32(info->attrs[GTPA_VERSION])) { case GTP_V0: - if (!info->attrs[GTPA_TID]) - return -EINVAL; + if (!info->attrs[GTPA_TID]) { + err = -EINVAL; + goto out_unlock; + } pctx = gtp0_pdp_find(gtp, nla_get_u64(info->attrs[GTPA_TID])); break; case GTP_V1: - if (!info->attrs[GTPA_I_TEI]) - return -EINVAL; + if (!info->attrs[GTPA_I_TEI]) { + err = -EINVAL; + goto out_unlock; + } pctx = gtp1_pdp_find(gtp, nla_get_u64(info->attrs[GTPA_I_TEI])); break; default: - return -EINVAL; + err = -EINVAL; + goto out_unlock; } - if (pctx == NULL) - return -ENOENT; + if (!pctx) { + err = -ENOENT; + goto out_unlock; + } if (pctx->gtp_version == GTP_V0) - netdev_dbg(dev, "GTPv0-U: deleting tunnel id = %llx (pdp %p)\n", - pctx->u.v0.tid, pctx); + pr_debug("GTPv0-U: deleting tunnel id = %llx (pdp %p)\n", + pctx->u.v0.tid, pctx); else if (pctx->gtp_version == GTP_V1) - netdev_dbg(dev, "GTPv1-U: deleting tunnel id = %x/%x (pdp %p)\n", - pctx->u.v1.i_tei, pctx->u.v1.o_tei, pctx); + pr_debug("GTPv1-U: deleting tunnel id = %x/%x (pdp %p)\n", + pctx->u.v1.i_tei, pctx->u.v1.o_tei, pctx); hlist_del_rcu(&pctx->hlist_tid); hlist_del_rcu(&pctx->hlist_addr); kfree_rcu(pctx, rcu_head); - return 0; +out_unlock: + rcu_read_unlock(); + return err; } static struct genl_family gtp_genl_family; @@ -1127,11 +1128,9 @@ static int gtp_genl_fill_info(struct sk_buff *skb, u32 snd_portid, u32 snd_seq, static int gtp_genl_get_pdp(struct sk_buff *skb, struct genl_info *info) { struct pdp_ctx *pctx = NULL; - struct net_device *dev; struct sk_buff *skb2; struct gtp_dev *gtp; u32 gtp_version; - struct net *net; int err; if (!info->attrs[GTPA_VERSION] || @@ -1147,21 +1146,14 @@ static int gtp_genl_get_pdp(struct sk_buff *skb, struct genl_info *info) return -EINVAL; } - net = gtp_genl_get_net(sock_net(skb->sk), info->attrs); - if (IS_ERR(net)) - return PTR_ERR(net); - - /* Check if there's an existing gtpX device to configure */ - dev = gtp_find_dev(net, nla_get_u32(info->attrs[GTPA_LINK])); - if (dev == NULL) { - put_net(net); - return -ENODEV; - } - put_net(net); - - gtp = netdev_priv(dev); - rcu_read_lock(); + + gtp = gtp_genl_find_dev(sock_net(skb->sk), info->attrs); + if (!gtp) { + err = -ENODEV; + goto err_unlock; + } + if (gtp_version == GTP_V0 && info->attrs[GTPA_TID]) { u64 tid = nla_get_u64(info->attrs[GTPA_TID]); -- 2.10.2 From aschultz at tpip.net Mon Jan 30 16:31:58 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Mon, 30 Jan 2017 17:31:58 +0100 Subject: [PATCH 4/6] gtp: consolidate pdp context destruction into helper In-Reply-To: <20170130163200.17070-1-aschultz@tpip.net> References: <20170130163200.17070-1-aschultz@tpip.net> Message-ID: <20170130163200.17070-5-aschultz@tpip.net> Consolidate duplicate code into helper. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 6b7a3c2..68c6c9b 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -84,6 +84,8 @@ struct gtp_net { static u32 gtp_h_initval; +static void pdp_context_delete(struct pdp_ctx *pctx); + static inline u32 gtp0_hashfn(u64 tid) { u32 *tid32 = (u32 *) &tid; @@ -774,13 +776,10 @@ static void gtp_hashtable_free(struct gtp_dev *gtp) struct pdp_ctx *pctx; int i; - for (i = 0; i < gtp->hash_size; i++) { - hlist_for_each_entry_rcu(pctx, >p->tid_hash[i], hlist_tid) { - hlist_del_rcu(&pctx->hlist_tid); - hlist_del_rcu(&pctx->hlist_addr); - kfree_rcu(pctx, rcu_head); - } - } + for (i = 0; i < gtp->hash_size; i++) + hlist_for_each_entry_rcu(pctx, >p->tid_hash[i], hlist_tid) + pdp_context_delete(pctx); + synchronize_rcu(); kfree(gtp->addr_hash); kfree(gtp->tid_hash); @@ -985,6 +984,13 @@ static int ipv4_pdp_add(struct gtp_dev *gtp, struct genl_info *info) return 0; } +static void pdp_context_delete(struct pdp_ctx *pctx) +{ + hlist_del_rcu(&pctx->hlist_tid); + hlist_del_rcu(&pctx->hlist_addr); + kfree(pctx); +} + static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info) { struct gtp_dev *gtp; @@ -1093,9 +1099,7 @@ static int gtp_genl_del_pdp(struct sk_buff *skb, struct genl_info *info) pr_debug("GTPv1-U: deleting tunnel id = %x/%x (pdp %p)\n", pctx->u.v1.i_tei, pctx->u.v1.o_tei, pctx); - hlist_del_rcu(&pctx->hlist_tid); - hlist_del_rcu(&pctx->hlist_addr); - kfree_rcu(pctx, rcu_head); + pdp_context_delete(pctx); out_unlock: rcu_read_unlock(); -- 2.10.2 From aschultz at tpip.net Mon Jan 30 16:31:59 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Mon, 30 Jan 2017 17:31:59 +0100 Subject: [PATCH 5/6] gtp: add socket to pdp context In-Reply-To: <20170130163200.17070-1-aschultz@tpip.net> References: <20170130163200.17070-1-aschultz@tpip.net> Message-ID: <20170130163200.17070-6-aschultz@tpip.net> Having the socket present in context simplifies the sending logic. It also fixes the invalid assumption that we have to use the same sending socket for all client IP's on a specific gtp interface. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 72 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 39 insertions(+), 33 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 68c6c9b..ff00597 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -58,6 +58,8 @@ struct pdp_ctx { struct in_addr ms_addr_ip4; struct in_addr sgsn_addr_ip4; + struct sock *sk; + atomic_t tx_seq; struct rcu_head rcu_head; }; @@ -371,8 +373,9 @@ static void gtp_dev_uninit(struct net_device *dev) free_percpu(dev->tstats); } -static struct rtable *ip4_route_output_gtp(struct net *net, struct flowi4 *fl4, - const struct sock *sk, __be32 daddr) +static struct rtable *ip4_route_output_gtp(struct flowi4 *fl4, + const struct sock *sk, + __be32 daddr) { memset(fl4, 0, sizeof(*fl4)); fl4->flowi4_oif = sk->sk_bound_dev_if; @@ -381,7 +384,7 @@ static struct rtable *ip4_route_output_gtp(struct net *net, struct flowi4 *fl4, fl4->flowi4_tos = RT_CONN_FLAGS(sk); fl4->flowi4_proto = sk->sk_protocol; - return ip_route_output_key(net, fl4); + return ip_route_output_key(sock_net(sk), fl4); } static inline void gtp0_push_header(struct sk_buff *skb, struct pdp_ctx *pctx) @@ -470,7 +473,6 @@ static int gtp_build_skb_ip4(struct sk_buff *skb, struct net_device *dev, struct rtable *rt; struct flowi4 fl4; struct iphdr *iph; - struct sock *sk; __be16 df; int mtu; @@ -486,30 +488,7 @@ static int gtp_build_skb_ip4(struct sk_buff *skb, struct net_device *dev, } netdev_dbg(dev, "found PDP context %p\n", pctx); - switch (pctx->gtp_version) { - case GTP_V0: - if (gtp->sock0) - sk = gtp->sock0->sk; - else - sk = NULL; - break; - case GTP_V1: - if (gtp->sock1u) - sk = gtp->sock1u->sk; - else - sk = NULL; - break; - default: - return -ENOENT; - } - - if (!sk) { - netdev_dbg(dev, "no userspace socket is available, skip\n"); - return -ENOENT; - } - - rt = ip4_route_output_gtp(sock_net(sk), &fl4, gtp->sock0->sk, - pctx->sgsn_addr_ip4.s_addr); + rt = ip4_route_output_gtp(&fl4, pctx->sk, pctx->sgsn_addr_ip4.s_addr); if (IS_ERR(rt)) { netdev_dbg(dev, "no route to SSGN %pI4\n", &pctx->sgsn_addr_ip4.s_addr); @@ -554,7 +533,7 @@ static int gtp_build_skb_ip4(struct sk_buff *skb, struct net_device *dev, goto err_rt; } - gtp_set_pktinfo_ipv4(pktinfo, sk, iph, pctx, rt, &fl4, dev); + gtp_set_pktinfo_ipv4(pktinfo, pctx->sk, iph, pctx, rt, &fl4, dev); gtp_push_header(skb, pktinfo); return 0; @@ -908,7 +887,8 @@ static void ipv4_pdp_fill(struct pdp_ctx *pctx, struct genl_info *info) } } -static int ipv4_pdp_add(struct gtp_dev *gtp, struct genl_info *info) +static int ipv4_pdp_add(struct gtp_dev *gtp, struct sock *sk, + struct genl_info *info) { u32 hash_ms, hash_tid = 0; struct pdp_ctx *pctx; @@ -948,6 +928,8 @@ static int ipv4_pdp_add(struct gtp_dev *gtp, struct genl_info *info) if (pctx == NULL) return -ENOMEM; + sock_hold(sk); + pctx->sk = sk; ipv4_pdp_fill(pctx, info); atomic_set(&pctx->tx_seq, 0); @@ -984,16 +966,26 @@ static int ipv4_pdp_add(struct gtp_dev *gtp, struct genl_info *info) return 0; } +static void pdp_context_free(struct rcu_head *head) +{ + struct pdp_ctx *pctx = container_of(head, struct pdp_ctx, rcu_head); + + sock_put(pctx->sk); + kfree(pctx); +} + static void pdp_context_delete(struct pdp_ctx *pctx) { hlist_del_rcu(&pctx->hlist_tid); hlist_del_rcu(&pctx->hlist_addr); - kfree(pctx); + call_rcu(&pctx->rcu_head, pdp_context_free); } static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info) { + unsigned int version; struct gtp_dev *gtp; + struct socket *sock; int err; if (!info->attrs[GTPA_VERSION] || @@ -1002,7 +994,9 @@ static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info) !info->attrs[GTPA_MS_ADDRESS]) return -EINVAL; - switch (nla_get_u32(info->attrs[GTPA_VERSION])) { + version = nla_get_u32(info->attrs[GTPA_VERSION]); + + switch (version) { case GTP_V0: if (!info->attrs[GTPA_TID] || !info->attrs[GTPA_FLOW]) @@ -1026,7 +1020,19 @@ static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info) goto out_unlock; } - err = ipv4_pdp_add(gtp, info); + if (version == GTP_V0) + sock = gtp->sock0; + else if (version == GTP_V1) + sock = gtp->sock1u; + else + sock = NULL; + + if (!sock || !sock->sk) { + err = -ENODEV; + goto out_unlock; + } + + err = ipv4_pdp_add(gtp, sock->sk, info); out_unlock: rcu_read_unlock(); -- 2.10.2 From aschultz at tpip.net Mon Jan 30 16:32:00 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Mon, 30 Jan 2017 17:32:00 +0100 Subject: [PATCH 6/6] gtp: consolidate gtp socket rx path In-Reply-To: <20170130163200.17070-1-aschultz@tpip.net> References: <20170130163200.17070-1-aschultz@tpip.net> Message-ID: <20170130163200.17070-7-aschultz@tpip.net> Add network device to gtp context in preparation for splitting the TEID from the network device. Use this to rework the socker rx path. Move the common RX part of v0 and v1 into a helper. Also move the final rx part into that helper as well. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 92 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 47 insertions(+), 45 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index ff00597..9c31e83 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -58,6 +58,7 @@ struct pdp_ctx { struct in_addr ms_addr_ip4; struct in_addr sgsn_addr_ip4; + struct net_device *dev; struct sock *sk; atomic_t tx_seq; @@ -179,9 +180,42 @@ static bool gtp_check_src_ms(struct sk_buff *skb, struct pdp_ctx *pctx, return false; } +static int gtp_rx(struct sk_buff *skb, struct pdp_ctx *pctx, unsigned int hdrlen) +{ + struct pcpu_sw_netstats *stats; + + if (!gtp_check_src_ms(skb, pctx, hdrlen)) { + pr_debug("No PDP ctx for this MS\n"); + return 1; + } + + /* Get rid of the GTP + UDP headers. */ + if (iptunnel_pull_header(skb, hdrlen, skb->protocol, + !net_eq(sock_net(pctx->sk), dev_net(pctx->dev)))) + return -1; + + pr_debug("forwarding packet from GGSN to uplink\n"); + + /* Now that the UDP and the GTP header have been removed, set up the + * new network header. This is required by the upper layer to + * calculate the transport header. + */ + skb_reset_network_header(skb); + + skb->dev = pctx->dev; + + stats = this_cpu_ptr(pctx->dev->tstats); + u64_stats_update_begin(&stats->syncp); + stats->rx_packets++; + stats->rx_bytes += skb->len; + u64_stats_update_end(&stats->syncp); + + netif_rx(skb); + return 0; +} + /* 1 means pass up to the stack, -1 means drop and 0 means decapsulated. */ -static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, - bool xnet) +static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb) { unsigned int hdrlen = sizeof(struct udphdr) + sizeof(struct gtp0_header); @@ -205,17 +239,10 @@ static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, return 1; } - if (!gtp_check_src_ms(skb, pctx, hdrlen)) { - netdev_dbg(gtp->dev, "No PDP ctx for this MS\n"); - return 1; - } - - /* Get rid of the GTP + UDP headers. */ - return iptunnel_pull_header(skb, hdrlen, skb->protocol, xnet); + return gtp_rx(skb, pctx, hdrlen); } -static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, - bool xnet) +static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb) { unsigned int hdrlen = sizeof(struct udphdr) + sizeof(struct gtp1_header); @@ -254,13 +281,7 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, return 1; } - if (!gtp_check_src_ms(skb, pctx, hdrlen)) { - netdev_dbg(gtp->dev, "No PDP ctx for this MS\n"); - return 1; - } - - /* Get rid of the GTP + UDP headers. */ - return iptunnel_pull_header(skb, hdrlen, skb->protocol, xnet); + return gtp_rx(skb, pctx, hdrlen); } static void gtp_encap_destroy(struct sock *sk) @@ -294,10 +315,8 @@ static void gtp_encap_disable(struct gtp_dev *gtp) */ static int gtp_encap_recv(struct sock *sk, struct sk_buff *skb) { - struct pcpu_sw_netstats *stats; struct gtp_dev *gtp; - bool xnet; - int ret; + int ret = 0; gtp = rcu_dereference_sk_user_data(sk); if (!gtp) @@ -305,16 +324,14 @@ static int gtp_encap_recv(struct sock *sk, struct sk_buff *skb) netdev_dbg(gtp->dev, "encap_recv sk=%p\n", sk); - xnet = !net_eq(sock_net(sk), dev_net(gtp->dev)); - switch (udp_sk(sk)->encap_type) { case UDP_ENCAP_GTP0: netdev_dbg(gtp->dev, "received GTP0 packet\n"); - ret = gtp0_udp_encap_recv(gtp, skb, xnet); + ret = gtp0_udp_encap_recv(gtp, skb); break; case UDP_ENCAP_GTP1U: netdev_dbg(gtp->dev, "received GTP1U packet\n"); - ret = gtp1u_udp_encap_recv(gtp, skb, xnet); + ret = gtp1u_udp_encap_recv(gtp, skb); break; default: ret = -1; /* Shouldn't happen. */ @@ -323,33 +340,17 @@ static int gtp_encap_recv(struct sock *sk, struct sk_buff *skb) switch (ret) { case 1: netdev_dbg(gtp->dev, "pass up to the process\n"); - return 1; + break; case 0: - netdev_dbg(gtp->dev, "forwarding packet from GGSN to uplink\n"); break; case -1: netdev_dbg(gtp->dev, "GTP packet has been dropped\n"); kfree_skb(skb); - return 0; + ret = 0; + break; } - /* Now that the UDP and the GTP header have been removed, set up the - * new network header. This is required by the upper layer to - * calculate the transport header. - */ - skb_reset_network_header(skb); - - skb->dev = gtp->dev; - - stats = this_cpu_ptr(gtp->dev->tstats); - u64_stats_update_begin(&stats->syncp); - stats->rx_packets++; - stats->rx_bytes += skb->len; - u64_stats_update_end(&stats->syncp); - - netif_rx(skb); - - return 0; + return ret; } static int gtp_dev_init(struct net_device *dev) @@ -930,6 +931,7 @@ static int ipv4_pdp_add(struct gtp_dev *gtp, struct sock *sk, sock_hold(sk); pctx->sk = sk; + pctx->dev = gtp->dev; ipv4_pdp_fill(pctx, info); atomic_set(&pctx->tx_seq, 0); -- 2.10.2 From aschultz at tpip.net Mon Jan 30 16:37:07 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Mon, 30 Jan 2017 17:37:07 +0100 Subject: [PATCH net-next v2 0/6] gtp: misc improvements Message-ID: <20170130163713.17524-1-aschultz@tpip.net> Hi Pablo, Resent as v2, because I forgot the net-next target. Sorry for noise, I promise I won't forget it again. This series lays the groundwork for removing the socket references from the GTP netdevice by removing duplicate code and simplifying the logic on some code paths. It slighly changes the GTP genl API by making the socket parameters optional (though one of them is still required). The removal of the socket references will break the 1:1 releation between GTP netdevice and GTP socket that prevents us to support multiple VRFs with overlaping IP addresse spaces attached to the same GTP socket (needed for multi APN support). Regards Andreas Andreas Schultz (6): gtp: make GTP sockets in gtp_newlink optional gtp: merge gtp_get_net and gtp_genl_find_dev gtp: unify genl_find_pdp and prepare for per socket lookup gtp: consolidate pdp context destruction into helper gtp: add socket to pdp context gtp: consolidate gtp socket rx path drivers/net/gtp.c | 564 +++++++++++++++++++++++++++--------------------------- 1 file changed, 280 insertions(+), 284 deletions(-) -- 2.10.2 From aschultz at tpip.net Mon Jan 30 16:37:08 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Mon, 30 Jan 2017 17:37:08 +0100 Subject: [PATCH net-next v2 1/6] gtp: make GTP sockets in gtp_newlink optional In-Reply-To: <20170130163713.17524-1-aschultz@tpip.net> References: <20170130163713.17524-1-aschultz@tpip.net> Message-ID: <20170130163713.17524-2-aschultz@tpip.net> Having both GTPv0-U and GTPv1-U is not always desirable. Fallback from GTPv1-U to GTPv0-U was depreciated from 3GPP Rel-8 onwards. Post Rel-8 implementation are discuraged from listening on the v0 port (see 3GPP TS 29.281, Sect. 1). A future change will completely decouple the sockets from the network device. Till then, at least one of the sockets needs to be specified (either v0 or v1), the other is optional. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 142 +++++++++++++++++++++++++++++------------------------- 1 file changed, 76 insertions(+), 66 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index bda0c64..18944f4 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -259,28 +259,30 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, return iptunnel_pull_header(skb, hdrlen, skb->protocol, xnet); } -static void gtp_encap_disable(struct gtp_dev *gtp) -{ - if (gtp->sock0 && gtp->sock0->sk) { - udp_sk(gtp->sock0->sk)->encap_type = 0; - rcu_assign_sk_user_data(gtp->sock0->sk, NULL); - } - if (gtp->sock1u && gtp->sock1u->sk) { - udp_sk(gtp->sock1u->sk)->encap_type = 0; - rcu_assign_sk_user_data(gtp->sock1u->sk, NULL); - } - - gtp->sock0 = NULL; - gtp->sock1u = NULL; -} - static void gtp_encap_destroy(struct sock *sk) { struct gtp_dev *gtp; gtp = rcu_dereference_sk_user_data(sk); - if (gtp) - gtp_encap_disable(gtp); + if (gtp) { + udp_sk(sk)->encap_type = 0; + rcu_assign_sk_user_data(sk, NULL); + } +} + +static void gtp_encap_disable_sock(struct socket *sock) +{ + if (!sock || !sock->sk) + return; + + gtp_encap_destroy(sock->sk); + sockfd_put(sock); +} + +static void gtp_encap_disable(struct gtp_dev *gtp) +{ + gtp_encap_disable_sock(gtp->sock0); + gtp_encap_disable_sock(gtp->sock1u); } /* UDP encapsulation receive handler. See net/ipv4/udp.c. @@ -640,27 +642,24 @@ static void gtp_link_setup(struct net_device *dev) static int gtp_hashtable_new(struct gtp_dev *gtp, int hsize); static void gtp_hashtable_free(struct gtp_dev *gtp); -static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, - int fd_gtp0, int fd_gtp1); +static int gtp_encap_enable(struct gtp_dev *gtp, struct nlattr *data[]); +static void gtp_encap_disable(struct gtp_dev *gtp); static int gtp_newlink(struct net *src_net, struct net_device *dev, struct nlattr *tb[], struct nlattr *data[]) { - int hashsize, err, fd0, fd1; + int hashsize, err; struct gtp_dev *gtp; struct gtp_net *gn; - if (!data[IFLA_GTP_FD0] || !data[IFLA_GTP_FD1]) + if (!data[IFLA_GTP_FD0] && !data[IFLA_GTP_FD1]) return -EINVAL; gtp = netdev_priv(dev); - fd0 = nla_get_u32(data[IFLA_GTP_FD0]); - fd1 = nla_get_u32(data[IFLA_GTP_FD1]); - - err = gtp_encap_enable(dev, gtp, fd0, fd1); + err = gtp_encap_enable(gtp, data); if (err < 0) - goto out_err; + return err; if (!data[IFLA_GTP_PDP_HASHSIZE]) hashsize = 1024; @@ -688,7 +687,6 @@ static int gtp_newlink(struct net *src_net, struct net_device *dev, gtp_hashtable_free(gtp); out_encap: gtp_encap_disable(gtp); -out_err: return err; } @@ -803,61 +801,73 @@ static void gtp_hashtable_free(struct gtp_dev *gtp) kfree(gtp->tid_hash); } -static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, - int fd_gtp0, int fd_gtp1) +static struct socket *gtp_encap_enable_socket(int fd, int type, + struct gtp_dev *gtp) { struct udp_tunnel_sock_cfg tuncfg = {NULL}; - struct socket *sock0, *sock1u; + struct socket *sock; int err; - netdev_dbg(dev, "enable gtp on %d, %d\n", fd_gtp0, fd_gtp1); + pr_debug("enable gtp on %d, %d\n", fd, type); - sock0 = sockfd_lookup(fd_gtp0, &err); - if (sock0 == NULL) { - netdev_dbg(dev, "socket fd=%d not found (gtp0)\n", fd_gtp0); - return -ENOENT; + sock = sockfd_lookup(fd, &err); + if (!sock) { + pr_debug("gtp socket fd=%d not found\n", fd); + return NULL; } - if (sock0->sk->sk_protocol != IPPROTO_UDP) { - netdev_dbg(dev, "socket fd=%d not UDP\n", fd_gtp0); + if (sock->sk->sk_protocol != IPPROTO_UDP) { + pr_debug("socket fd=%d not UDP\n", fd); err = -EINVAL; - goto err1; + goto out_sock; } - sock1u = sockfd_lookup(fd_gtp1, &err); - if (sock1u == NULL) { - netdev_dbg(dev, "socket fd=%d not found (gtp1u)\n", fd_gtp1); - err = -ENOENT; - goto err1; + if (rcu_dereference_sk_user_data(sock->sk)) { + err = -EBUSY; + goto out_sock; } - if (sock1u->sk->sk_protocol != IPPROTO_UDP) { - netdev_dbg(dev, "socket fd=%d not UDP\n", fd_gtp1); - err = -EINVAL; - goto err2; - } - - netdev_dbg(dev, "enable gtp on %p, %p\n", sock0, sock1u); - - gtp->sock0 = sock0; - gtp->sock1u = sock1u; - tuncfg.sk_user_data = gtp; + tuncfg.encap_type = type; tuncfg.encap_rcv = gtp_encap_recv; tuncfg.encap_destroy = gtp_encap_destroy; - tuncfg.encap_type = UDP_ENCAP_GTP0; - setup_udp_tunnel_sock(sock_net(gtp->sock0->sk), gtp->sock0, &tuncfg); - - tuncfg.encap_type = UDP_ENCAP_GTP1U; - setup_udp_tunnel_sock(sock_net(gtp->sock1u->sk), gtp->sock1u, &tuncfg); - - err = 0; -err2: - sockfd_put(sock1u); -err1: - sockfd_put(sock0); - return err; + setup_udp_tunnel_sock(sock_net(sock->sk), sock, &tuncfg); + return sock; + +out_sock: + sockfd_put(sock); + return ERR_PTR(err); +} + +static int gtp_encap_enable(struct gtp_dev *gtp, struct nlattr *data[]) +{ + struct socket *sock0 = NULL; + struct socket *sock1u = NULL; + + if (data[IFLA_GTP_FD0]) { + u32 fd0 = nla_get_u32(data[IFLA_GTP_FD0]); + + sock0 = gtp_encap_enable_socket(fd0, UDP_ENCAP_GTP0, gtp); + if (IS_ERR(sock0)) + return PTR_ERR(sock0); + } + + if (data[IFLA_GTP_FD1]) { + u32 fd1 = nla_get_u32(data[IFLA_GTP_FD1]); + + sock1u = gtp_encap_enable_socket(fd1, UDP_ENCAP_GTP1U, gtp); + if (IS_ERR(sock1u)) { + if (sock0) + sockfd_put(sock0); + return PTR_ERR(sock1u); + } + } + + gtp->sock0 = sock0; + gtp->sock1u = sock1u; + + return 0; } static struct net_device *gtp_find_dev(struct net *net, int ifindex) -- 2.10.2 From aschultz at tpip.net Mon Jan 30 16:37:09 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Mon, 30 Jan 2017 17:37:09 +0100 Subject: [PATCH net-next v2 2/6] gtp: merge gtp_get_net and gtp_genl_find_dev In-Reply-To: <20170130163713.17524-1-aschultz@tpip.net> References: <20170130163713.17524-1-aschultz@tpip.net> Message-ID: <20170130163713.17524-3-aschultz@tpip.net> Both function are always used together with the final goal to get the gtp_dev. This simplifies the code by merging them together. The netdevice lookup is changed to use the regular dev_get_by_index. The gtp netdevice list is now only used to find the PDP contexts for imcomming packets. It can be completely eliminated Once the TEID hash is moved into the GTP socket. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 170 ++++++++++++++++++++++++++---------------------------- 1 file changed, 81 insertions(+), 89 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 18944f4..c96c71f 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -745,21 +745,6 @@ static struct rtnl_link_ops gtp_link_ops __read_mostly = { .fill_info = gtp_fill_info, }; -static struct net *gtp_genl_get_net(struct net *src_net, struct nlattr *tb[]) -{ - struct net *net; - - /* Examine the link attributes and figure out which network namespace - * we are talking about. - */ - if (tb[GTPA_NET_NS_FD]) - net = get_net_ns_by_fd(nla_get_u32(tb[GTPA_NET_NS_FD])); - else - net = get_net(src_net); - - return net; -} - static int gtp_hashtable_new(struct gtp_dev *gtp, int hsize) { int i; @@ -870,16 +855,31 @@ static int gtp_encap_enable(struct gtp_dev *gtp, struct nlattr *data[]) return 0; } -static struct net_device *gtp_find_dev(struct net *net, int ifindex) +static struct gtp_dev *gtp_genl_find_dev(struct net *src_net, + struct nlattr *tb[]) { - struct gtp_net *gn = net_generic(net, gtp_net_id); - struct gtp_dev *gtp; - - list_for_each_entry_rcu(gtp, &gn->gtp_dev_list, list) { - if (ifindex == gtp->dev->ifindex) - return gtp->dev; - } - return NULL; + struct net *net; + struct net_device *dev; + struct gtp_dev *gtp = NULL; + + /* Examine the link attributes and figure out which network namespace + * we are talking about. + */ + if (tb[GTPA_NET_NS_FD]) + net = get_net_ns_by_fd(nla_get_u32(tb[GTPA_NET_NS_FD])); + else + net = get_net(src_net); + + if (IS_ERR(net)) + return NULL; + + /* Check if there's an existing gtpX device to configure */ + dev = dev_get_by_index_rcu(net, nla_get_u32(tb[GTPA_LINK])); + if (dev->netdev_ops == >p_netdev_ops) + gtp = netdev_priv(dev); + + put_net(net); + return gtp; } static void ipv4_pdp_fill(struct pdp_ctx *pctx, struct genl_info *info) @@ -909,9 +909,8 @@ static void ipv4_pdp_fill(struct pdp_ctx *pctx, struct genl_info *info) } } -static int ipv4_pdp_add(struct net_device *dev, struct genl_info *info) +static int ipv4_pdp_add(struct gtp_dev *gtp, struct genl_info *info) { - struct gtp_dev *gtp = netdev_priv(dev); u32 hash_ms, hash_tid = 0; struct pdp_ctx *pctx; bool found = false; @@ -936,11 +935,11 @@ static int ipv4_pdp_add(struct net_device *dev, struct genl_info *info) ipv4_pdp_fill(pctx, info); if (pctx->gtp_version == GTP_V0) - netdev_dbg(dev, "GTPv0-U: update tunnel id = %llx (pdp %p)\n", - pctx->u.v0.tid, pctx); + pr_debug("GTPv0-U: update tunnel id = %llx (pdp %p)\n", + pctx->u.v0.tid, pctx); else if (pctx->gtp_version == GTP_V1) - netdev_dbg(dev, "GTPv1-U: update tunnel id = %x/%x (pdp %p)\n", - pctx->u.v1.i_tei, pctx->u.v1.o_tei, pctx); + pr_debug("GTPv1-U: update tunnel id = %x/%x (pdp %p)\n", + pctx->u.v1.i_tei, pctx->u.v1.o_tei, pctx); return 0; @@ -972,14 +971,14 @@ static int ipv4_pdp_add(struct net_device *dev, struct genl_info *info) switch (pctx->gtp_version) { case GTP_V0: - netdev_dbg(dev, "GTPv0-U: new PDP ctx id=%llx ssgn=%pI4 ms=%pI4 (pdp=%p)\n", - pctx->u.v0.tid, &pctx->sgsn_addr_ip4, - &pctx->ms_addr_ip4, pctx); + pr_debug("GTPv0-U: new PDP ctx id=%llx ssgn=%pI4 ms=%pI4 (pdp=%p)\n", + pctx->u.v0.tid, &pctx->sgsn_addr_ip4, + &pctx->ms_addr_ip4, pctx); break; case GTP_V1: - netdev_dbg(dev, "GTPv1-U: new PDP ctx id=%x/%x ssgn=%pI4 ms=%pI4 (pdp=%p)\n", - pctx->u.v1.i_tei, pctx->u.v1.o_tei, - &pctx->sgsn_addr_ip4, &pctx->ms_addr_ip4, pctx); + pr_debug("GTPv1-U: new PDP ctx id=%x/%x ssgn=%pI4 ms=%pI4 (pdp=%p)\n", + pctx->u.v1.i_tei, pctx->u.v1.o_tei, + &pctx->sgsn_addr_ip4, &pctx->ms_addr_ip4, pctx); break; } @@ -988,8 +987,8 @@ static int ipv4_pdp_add(struct net_device *dev, struct genl_info *info) static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info) { - struct net_device *dev; - struct net *net; + struct gtp_dev *gtp; + int err; if (!info->attrs[GTPA_VERSION] || !info->attrs[GTPA_LINK] || @@ -1013,77 +1012,79 @@ static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info) return -EINVAL; } - net = gtp_genl_get_net(sock_net(skb->sk), info->attrs); - if (IS_ERR(net)) - return PTR_ERR(net); + rcu_read_lock(); - /* Check if there's an existing gtpX device to configure */ - dev = gtp_find_dev(net, nla_get_u32(info->attrs[GTPA_LINK])); - if (dev == NULL) { - put_net(net); - return -ENODEV; + gtp = gtp_genl_find_dev(sock_net(skb->sk), info->attrs); + if (!gtp) { + err = -ENODEV; + goto out_unlock; } - put_net(net); - return ipv4_pdp_add(dev, info); + err = ipv4_pdp_add(gtp, info); + +out_unlock: + rcu_read_unlock(); + return err; } static int gtp_genl_del_pdp(struct sk_buff *skb, struct genl_info *info) { - struct net_device *dev; struct pdp_ctx *pctx; struct gtp_dev *gtp; - struct net *net; + int err = 0; if (!info->attrs[GTPA_VERSION] || !info->attrs[GTPA_LINK]) return -EINVAL; - net = gtp_genl_get_net(sock_net(skb->sk), info->attrs); - if (IS_ERR(net)) - return PTR_ERR(net); + rcu_read_lock(); - /* Check if there's an existing gtpX device to configure */ - dev = gtp_find_dev(net, nla_get_u32(info->attrs[GTPA_LINK])); - if (dev == NULL) { - put_net(net); - return -ENODEV; + gtp = gtp_genl_find_dev(sock_net(skb->sk), info->attrs); + if (!gtp) { + err = -ENODEV; + goto out_unlock; } - put_net(net); - - gtp = netdev_priv(dev); switch (nla_get_u32(info->attrs[GTPA_VERSION])) { case GTP_V0: - if (!info->attrs[GTPA_TID]) - return -EINVAL; + if (!info->attrs[GTPA_TID]) { + err = -EINVAL; + goto out_unlock; + } pctx = gtp0_pdp_find(gtp, nla_get_u64(info->attrs[GTPA_TID])); break; case GTP_V1: - if (!info->attrs[GTPA_I_TEI]) - return -EINVAL; + if (!info->attrs[GTPA_I_TEI]) { + err = -EINVAL; + goto out_unlock; + } pctx = gtp1_pdp_find(gtp, nla_get_u64(info->attrs[GTPA_I_TEI])); break; default: - return -EINVAL; + err = -EINVAL; + goto out_unlock; } - if (pctx == NULL) - return -ENOENT; + if (!pctx) { + err = -ENOENT; + goto out_unlock; + } if (pctx->gtp_version == GTP_V0) - netdev_dbg(dev, "GTPv0-U: deleting tunnel id = %llx (pdp %p)\n", - pctx->u.v0.tid, pctx); + pr_debug("GTPv0-U: deleting tunnel id = %llx (pdp %p)\n", + pctx->u.v0.tid, pctx); else if (pctx->gtp_version == GTP_V1) - netdev_dbg(dev, "GTPv1-U: deleting tunnel id = %x/%x (pdp %p)\n", - pctx->u.v1.i_tei, pctx->u.v1.o_tei, pctx); + pr_debug("GTPv1-U: deleting tunnel id = %x/%x (pdp %p)\n", + pctx->u.v1.i_tei, pctx->u.v1.o_tei, pctx); hlist_del_rcu(&pctx->hlist_tid); hlist_del_rcu(&pctx->hlist_addr); kfree_rcu(pctx, rcu_head); - return 0; +out_unlock: + rcu_read_unlock(); + return err; } static struct genl_family gtp_genl_family; @@ -1127,11 +1128,9 @@ static int gtp_genl_fill_info(struct sk_buff *skb, u32 snd_portid, u32 snd_seq, static int gtp_genl_get_pdp(struct sk_buff *skb, struct genl_info *info) { struct pdp_ctx *pctx = NULL; - struct net_device *dev; struct sk_buff *skb2; struct gtp_dev *gtp; u32 gtp_version; - struct net *net; int err; if (!info->attrs[GTPA_VERSION] || @@ -1147,21 +1146,14 @@ static int gtp_genl_get_pdp(struct sk_buff *skb, struct genl_info *info) return -EINVAL; } - net = gtp_genl_get_net(sock_net(skb->sk), info->attrs); - if (IS_ERR(net)) - return PTR_ERR(net); - - /* Check if there's an existing gtpX device to configure */ - dev = gtp_find_dev(net, nla_get_u32(info->attrs[GTPA_LINK])); - if (dev == NULL) { - put_net(net); - return -ENODEV; - } - put_net(net); - - gtp = netdev_priv(dev); - rcu_read_lock(); + + gtp = gtp_genl_find_dev(sock_net(skb->sk), info->attrs); + if (!gtp) { + err = -ENODEV; + goto err_unlock; + } + if (gtp_version == GTP_V0 && info->attrs[GTPA_TID]) { u64 tid = nla_get_u64(info->attrs[GTPA_TID]); -- 2.10.2 From aschultz at tpip.net Mon Jan 30 16:37:10 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Mon, 30 Jan 2017 17:37:10 +0100 Subject: [PATCH net-next v2 3/6] gtp: unify genl_find_pdp and prepare for per socket lookup In-Reply-To: <20170130163713.17524-1-aschultz@tpip.net> References: <20170130163713.17524-1-aschultz@tpip.net> Message-ID: <20170130163713.17524-4-aschultz@tpip.net> This unifies duplicate code into a helper. It also prepares the groundwork to add a lookup version that uses the socket to find attache pdp contexts. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 120 +++++++++++++++++++++++------------------------------- 1 file changed, 51 insertions(+), 69 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index c96c71f..6b7a3c2 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -1027,47 +1027,62 @@ static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info) return err; } +static struct pdp_ctx *gtp_genl_find_pdp_by_link(struct sk_buff *skb, + struct genl_info *info) +{ + struct gtp_dev *gtp; + + gtp = gtp_genl_find_dev(sock_net(skb->sk), info->attrs); + if (!gtp) + return ERR_PTR(-ENODEV); + + if (info->attrs[GTPA_MS_ADDRESS]) { + __be32 ip = nla_get_be32(info->attrs[GTPA_MS_ADDRESS]); + + return ipv4_pdp_find(gtp, ip); + } else if (info->attrs[GTPA_VERSION]) { + u32 gtp_version = nla_get_u32(info->attrs[GTPA_VERSION]); + + if (gtp_version == GTP_V0 && info->attrs[GTPA_TID]) + return gtp0_pdp_find(gtp, nla_get_u64( + info->attrs[GTPA_TID])); + else if (gtp_version == GTP_V1 && info->attrs[GTPA_I_TEI]) + return gtp1_pdp_find(gtp, nla_get_u32( + info->attrs[GTPA_I_TEI])); + } + + return ERR_PTR(-EINVAL); +} + +static struct pdp_ctx *gtp_genl_find_pdp(struct sk_buff *skb, + struct genl_info *info) +{ + struct pdp_ctx *pctx; + + if (info->attrs[GTPA_LINK]) + pctx = gtp_genl_find_pdp_by_link(skb, info); + else + pctx = ERR_PTR(-EINVAL); + + if (!pctx) + pctx = ERR_PTR(-ENOENT); + + return pctx; +} + static int gtp_genl_del_pdp(struct sk_buff *skb, struct genl_info *info) { struct pdp_ctx *pctx; - struct gtp_dev *gtp; int err = 0; - if (!info->attrs[GTPA_VERSION] || - !info->attrs[GTPA_LINK]) + if (!info->attrs[GTPA_VERSION]) return -EINVAL; rcu_read_lock(); - gtp = gtp_genl_find_dev(sock_net(skb->sk), info->attrs); - if (!gtp) { - err = -ENODEV; - goto out_unlock; - } - - switch (nla_get_u32(info->attrs[GTPA_VERSION])) { - case GTP_V0: - if (!info->attrs[GTPA_TID]) { - err = -EINVAL; - goto out_unlock; - } - pctx = gtp0_pdp_find(gtp, nla_get_u64(info->attrs[GTPA_TID])); - break; - case GTP_V1: - if (!info->attrs[GTPA_I_TEI]) { - err = -EINVAL; - goto out_unlock; - } - pctx = gtp1_pdp_find(gtp, nla_get_u64(info->attrs[GTPA_I_TEI])); - break; - - default: - err = -EINVAL; - goto out_unlock; - } - - if (!pctx) { - err = -ENOENT; + pctx = gtp_genl_find_pdp(skb, info); + if (IS_ERR(pctx)) { + err = PTR_ERR(pctx); goto out_unlock; } @@ -1129,49 +1144,16 @@ static int gtp_genl_get_pdp(struct sk_buff *skb, struct genl_info *info) { struct pdp_ctx *pctx = NULL; struct sk_buff *skb2; - struct gtp_dev *gtp; - u32 gtp_version; int err; - if (!info->attrs[GTPA_VERSION] || - !info->attrs[GTPA_LINK]) + if (!info->attrs[GTPA_VERSION]) return -EINVAL; - gtp_version = nla_get_u32(info->attrs[GTPA_VERSION]); - switch (gtp_version) { - case GTP_V0: - case GTP_V1: - break; - default: - return -EINVAL; - } - rcu_read_lock(); - gtp = gtp_genl_find_dev(sock_net(skb->sk), info->attrs); - if (!gtp) { - err = -ENODEV; - goto err_unlock; - } - - if (gtp_version == GTP_V0 && - info->attrs[GTPA_TID]) { - u64 tid = nla_get_u64(info->attrs[GTPA_TID]); - - pctx = gtp0_pdp_find(gtp, tid); - } else if (gtp_version == GTP_V1 && - info->attrs[GTPA_I_TEI]) { - u32 tid = nla_get_u32(info->attrs[GTPA_I_TEI]); - - pctx = gtp1_pdp_find(gtp, tid); - } else if (info->attrs[GTPA_MS_ADDRESS]) { - __be32 ip = nla_get_be32(info->attrs[GTPA_MS_ADDRESS]); - - pctx = ipv4_pdp_find(gtp, ip); - } - - if (pctx == NULL) { - err = -ENOENT; + pctx = gtp_genl_find_pdp(skb, info); + if (IS_ERR(pctx)) { + err = PTR_ERR(pctx); goto err_unlock; } -- 2.10.2 From aschultz at tpip.net Mon Jan 30 16:37:11 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Mon, 30 Jan 2017 17:37:11 +0100 Subject: [PATCH net-next v2 4/6] gtp: consolidate pdp context destruction into helper In-Reply-To: <20170130163713.17524-1-aschultz@tpip.net> References: <20170130163713.17524-1-aschultz@tpip.net> Message-ID: <20170130163713.17524-5-aschultz@tpip.net> Consolidate duplicate code into helper. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 6b7a3c2..68c6c9b 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -84,6 +84,8 @@ struct gtp_net { static u32 gtp_h_initval; +static void pdp_context_delete(struct pdp_ctx *pctx); + static inline u32 gtp0_hashfn(u64 tid) { u32 *tid32 = (u32 *) &tid; @@ -774,13 +776,10 @@ static void gtp_hashtable_free(struct gtp_dev *gtp) struct pdp_ctx *pctx; int i; - for (i = 0; i < gtp->hash_size; i++) { - hlist_for_each_entry_rcu(pctx, >p->tid_hash[i], hlist_tid) { - hlist_del_rcu(&pctx->hlist_tid); - hlist_del_rcu(&pctx->hlist_addr); - kfree_rcu(pctx, rcu_head); - } - } + for (i = 0; i < gtp->hash_size; i++) + hlist_for_each_entry_rcu(pctx, >p->tid_hash[i], hlist_tid) + pdp_context_delete(pctx); + synchronize_rcu(); kfree(gtp->addr_hash); kfree(gtp->tid_hash); @@ -985,6 +984,13 @@ static int ipv4_pdp_add(struct gtp_dev *gtp, struct genl_info *info) return 0; } +static void pdp_context_delete(struct pdp_ctx *pctx) +{ + hlist_del_rcu(&pctx->hlist_tid); + hlist_del_rcu(&pctx->hlist_addr); + kfree(pctx); +} + static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info) { struct gtp_dev *gtp; @@ -1093,9 +1099,7 @@ static int gtp_genl_del_pdp(struct sk_buff *skb, struct genl_info *info) pr_debug("GTPv1-U: deleting tunnel id = %x/%x (pdp %p)\n", pctx->u.v1.i_tei, pctx->u.v1.o_tei, pctx); - hlist_del_rcu(&pctx->hlist_tid); - hlist_del_rcu(&pctx->hlist_addr); - kfree_rcu(pctx, rcu_head); + pdp_context_delete(pctx); out_unlock: rcu_read_unlock(); -- 2.10.2 From aschultz at tpip.net Mon Jan 30 16:37:12 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Mon, 30 Jan 2017 17:37:12 +0100 Subject: [PATCH net-next v2 5/6] gtp: add socket to pdp context In-Reply-To: <20170130163713.17524-1-aschultz@tpip.net> References: <20170130163713.17524-1-aschultz@tpip.net> Message-ID: <20170130163713.17524-6-aschultz@tpip.net> Having the socket present in context simplifies the sending logic. It also fixes the invalid assumption that we have to use the same sending socket for all client IP's on a specific gtp interface. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 72 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 39 insertions(+), 33 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 68c6c9b..ff00597 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -58,6 +58,8 @@ struct pdp_ctx { struct in_addr ms_addr_ip4; struct in_addr sgsn_addr_ip4; + struct sock *sk; + atomic_t tx_seq; struct rcu_head rcu_head; }; @@ -371,8 +373,9 @@ static void gtp_dev_uninit(struct net_device *dev) free_percpu(dev->tstats); } -static struct rtable *ip4_route_output_gtp(struct net *net, struct flowi4 *fl4, - const struct sock *sk, __be32 daddr) +static struct rtable *ip4_route_output_gtp(struct flowi4 *fl4, + const struct sock *sk, + __be32 daddr) { memset(fl4, 0, sizeof(*fl4)); fl4->flowi4_oif = sk->sk_bound_dev_if; @@ -381,7 +384,7 @@ static struct rtable *ip4_route_output_gtp(struct net *net, struct flowi4 *fl4, fl4->flowi4_tos = RT_CONN_FLAGS(sk); fl4->flowi4_proto = sk->sk_protocol; - return ip_route_output_key(net, fl4); + return ip_route_output_key(sock_net(sk), fl4); } static inline void gtp0_push_header(struct sk_buff *skb, struct pdp_ctx *pctx) @@ -470,7 +473,6 @@ static int gtp_build_skb_ip4(struct sk_buff *skb, struct net_device *dev, struct rtable *rt; struct flowi4 fl4; struct iphdr *iph; - struct sock *sk; __be16 df; int mtu; @@ -486,30 +488,7 @@ static int gtp_build_skb_ip4(struct sk_buff *skb, struct net_device *dev, } netdev_dbg(dev, "found PDP context %p\n", pctx); - switch (pctx->gtp_version) { - case GTP_V0: - if (gtp->sock0) - sk = gtp->sock0->sk; - else - sk = NULL; - break; - case GTP_V1: - if (gtp->sock1u) - sk = gtp->sock1u->sk; - else - sk = NULL; - break; - default: - return -ENOENT; - } - - if (!sk) { - netdev_dbg(dev, "no userspace socket is available, skip\n"); - return -ENOENT; - } - - rt = ip4_route_output_gtp(sock_net(sk), &fl4, gtp->sock0->sk, - pctx->sgsn_addr_ip4.s_addr); + rt = ip4_route_output_gtp(&fl4, pctx->sk, pctx->sgsn_addr_ip4.s_addr); if (IS_ERR(rt)) { netdev_dbg(dev, "no route to SSGN %pI4\n", &pctx->sgsn_addr_ip4.s_addr); @@ -554,7 +533,7 @@ static int gtp_build_skb_ip4(struct sk_buff *skb, struct net_device *dev, goto err_rt; } - gtp_set_pktinfo_ipv4(pktinfo, sk, iph, pctx, rt, &fl4, dev); + gtp_set_pktinfo_ipv4(pktinfo, pctx->sk, iph, pctx, rt, &fl4, dev); gtp_push_header(skb, pktinfo); return 0; @@ -908,7 +887,8 @@ static void ipv4_pdp_fill(struct pdp_ctx *pctx, struct genl_info *info) } } -static int ipv4_pdp_add(struct gtp_dev *gtp, struct genl_info *info) +static int ipv4_pdp_add(struct gtp_dev *gtp, struct sock *sk, + struct genl_info *info) { u32 hash_ms, hash_tid = 0; struct pdp_ctx *pctx; @@ -948,6 +928,8 @@ static int ipv4_pdp_add(struct gtp_dev *gtp, struct genl_info *info) if (pctx == NULL) return -ENOMEM; + sock_hold(sk); + pctx->sk = sk; ipv4_pdp_fill(pctx, info); atomic_set(&pctx->tx_seq, 0); @@ -984,16 +966,26 @@ static int ipv4_pdp_add(struct gtp_dev *gtp, struct genl_info *info) return 0; } +static void pdp_context_free(struct rcu_head *head) +{ + struct pdp_ctx *pctx = container_of(head, struct pdp_ctx, rcu_head); + + sock_put(pctx->sk); + kfree(pctx); +} + static void pdp_context_delete(struct pdp_ctx *pctx) { hlist_del_rcu(&pctx->hlist_tid); hlist_del_rcu(&pctx->hlist_addr); - kfree(pctx); + call_rcu(&pctx->rcu_head, pdp_context_free); } static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info) { + unsigned int version; struct gtp_dev *gtp; + struct socket *sock; int err; if (!info->attrs[GTPA_VERSION] || @@ -1002,7 +994,9 @@ static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info) !info->attrs[GTPA_MS_ADDRESS]) return -EINVAL; - switch (nla_get_u32(info->attrs[GTPA_VERSION])) { + version = nla_get_u32(info->attrs[GTPA_VERSION]); + + switch (version) { case GTP_V0: if (!info->attrs[GTPA_TID] || !info->attrs[GTPA_FLOW]) @@ -1026,7 +1020,19 @@ static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info) goto out_unlock; } - err = ipv4_pdp_add(gtp, info); + if (version == GTP_V0) + sock = gtp->sock0; + else if (version == GTP_V1) + sock = gtp->sock1u; + else + sock = NULL; + + if (!sock || !sock->sk) { + err = -ENODEV; + goto out_unlock; + } + + err = ipv4_pdp_add(gtp, sock->sk, info); out_unlock: rcu_read_unlock(); -- 2.10.2 From aschultz at tpip.net Mon Jan 30 16:37:13 2017 From: aschultz at tpip.net (Andreas Schultz) Date: Mon, 30 Jan 2017 17:37:13 +0100 Subject: [PATCH net-next v2 6/6] gtp: consolidate gtp socket rx path In-Reply-To: <20170130163713.17524-1-aschultz@tpip.net> References: <20170130163713.17524-1-aschultz@tpip.net> Message-ID: <20170130163713.17524-7-aschultz@tpip.net> Add network device to gtp context in preparation for splitting the TEID from the network device. Use this to rework the socker rx path. Move the common RX part of v0 and v1 into a helper. Also move the final rx part into that helper as well. Signed-off-by: Andreas Schultz --- drivers/net/gtp.c | 92 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 47 insertions(+), 45 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index ff00597..9c31e83 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -58,6 +58,7 @@ struct pdp_ctx { struct in_addr ms_addr_ip4; struct in_addr sgsn_addr_ip4; + struct net_device *dev; struct sock *sk; atomic_t tx_seq; @@ -179,9 +180,42 @@ static bool gtp_check_src_ms(struct sk_buff *skb, struct pdp_ctx *pctx, return false; } +static int gtp_rx(struct sk_buff *skb, struct pdp_ctx *pctx, unsigned int hdrlen) +{ + struct pcpu_sw_netstats *stats; + + if (!gtp_check_src_ms(skb, pctx, hdrlen)) { + pr_debug("No PDP ctx for this MS\n"); + return 1; + } + + /* Get rid of the GTP + UDP headers. */ + if (iptunnel_pull_header(skb, hdrlen, skb->protocol, + !net_eq(sock_net(pctx->sk), dev_net(pctx->dev)))) + return -1; + + pr_debug("forwarding packet from GGSN to uplink\n"); + + /* Now that the UDP and the GTP header have been removed, set up the + * new network header. This is required by the upper layer to + * calculate the transport header. + */ + skb_reset_network_header(skb); + + skb->dev = pctx->dev; + + stats = this_cpu_ptr(pctx->dev->tstats); + u64_stats_update_begin(&stats->syncp); + stats->rx_packets++; + stats->rx_bytes += skb->len; + u64_stats_update_end(&stats->syncp); + + netif_rx(skb); + return 0; +} + /* 1 means pass up to the stack, -1 means drop and 0 means decapsulated. */ -static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, - bool xnet) +static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb) { unsigned int hdrlen = sizeof(struct udphdr) + sizeof(struct gtp0_header); @@ -205,17 +239,10 @@ static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, return 1; } - if (!gtp_check_src_ms(skb, pctx, hdrlen)) { - netdev_dbg(gtp->dev, "No PDP ctx for this MS\n"); - return 1; - } - - /* Get rid of the GTP + UDP headers. */ - return iptunnel_pull_header(skb, hdrlen, skb->protocol, xnet); + return gtp_rx(skb, pctx, hdrlen); } -static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, - bool xnet) +static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb) { unsigned int hdrlen = sizeof(struct udphdr) + sizeof(struct gtp1_header); @@ -254,13 +281,7 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, return 1; } - if (!gtp_check_src_ms(skb, pctx, hdrlen)) { - netdev_dbg(gtp->dev, "No PDP ctx for this MS\n"); - return 1; - } - - /* Get rid of the GTP + UDP headers. */ - return iptunnel_pull_header(skb, hdrlen, skb->protocol, xnet); + return gtp_rx(skb, pctx, hdrlen); } static void gtp_encap_destroy(struct sock *sk) @@ -294,10 +315,8 @@ static void gtp_encap_disable(struct gtp_dev *gtp) */ static int gtp_encap_recv(struct sock *sk, struct sk_buff *skb) { - struct pcpu_sw_netstats *stats; struct gtp_dev *gtp; - bool xnet; - int ret; + int ret = 0; gtp = rcu_dereference_sk_user_data(sk); if (!gtp) @@ -305,16 +324,14 @@ static int gtp_encap_recv(struct sock *sk, struct sk_buff *skb) netdev_dbg(gtp->dev, "encap_recv sk=%p\n", sk); - xnet = !net_eq(sock_net(sk), dev_net(gtp->dev)); - switch (udp_sk(sk)->encap_type) { case UDP_ENCAP_GTP0: netdev_dbg(gtp->dev, "received GTP0 packet\n"); - ret = gtp0_udp_encap_recv(gtp, skb, xnet); + ret = gtp0_udp_encap_recv(gtp, skb); break; case UDP_ENCAP_GTP1U: netdev_dbg(gtp->dev, "received GTP1U packet\n"); - ret = gtp1u_udp_encap_recv(gtp, skb, xnet); + ret = gtp1u_udp_encap_recv(gtp, skb); break; default: ret = -1; /* Shouldn't happen. */ @@ -323,33 +340,17 @@ static int gtp_encap_recv(struct sock *sk, struct sk_buff *skb) switch (ret) { case 1: netdev_dbg(gtp->dev, "pass up to the process\n"); - return 1; + break; case 0: - netdev_dbg(gtp->dev, "forwarding packet from GGSN to uplink\n"); break; case -1: netdev_dbg(gtp->dev, "GTP packet has been dropped\n"); kfree_skb(skb); - return 0; + ret = 0; + break; } - /* Now that the UDP and the GTP header have been removed, set up the - * new network header. This is required by the upper layer to - * calculate the transport header. - */ - skb_reset_network_header(skb); - - skb->dev = gtp->dev; - - stats = this_cpu_ptr(gtp->dev->tstats); - u64_stats_update_begin(&stats->syncp); - stats->rx_packets++; - stats->rx_bytes += skb->len; - u64_stats_update_end(&stats->syncp); - - netif_rx(skb); - - return 0; + return ret; } static int gtp_dev_init(struct net_device *dev) @@ -930,6 +931,7 @@ static int ipv4_pdp_add(struct gtp_dev *gtp, struct sock *sk, sock_hold(sk); pctx->sk = sk; + pctx->dev = gtp->dev; ipv4_pdp_fill(pctx, info); atomic_set(&pctx->tx_seq, 0); -- 2.10.2 From hosseinamini2578 at gmail.com Mon Jan 30 21:59:03 2017 From: hosseinamini2578 at gmail.com (Hossein Amini) Date: Tue, 31 Jan 2017 01:29:03 +0330 Subject: Channel release error when osmo-nitb want execute location update Message-ID: hi dear I install openbsc, osmosgsn, ggsn, osmo-trx, osmo-bts-trx, osmo-pcu and dependency from master branch step by step from this link. but when run osmo-nitb, osmo-trx and osmo-bts-trx, mobile connect to network but no access to network. (I used USRP N210 and B210, Ubuntu 15.10/16.10 x64) osmo-nitb log: 20170130041914525 DRLL <0000> chan_alloc.c:352 (bts=0,trx=0,ts=0,pchan=CCCH+SDCCH4) Allocating lchan=0 as SDCCH 20170130041914525 DRSL <0004> abis_rsl.c:1819 (bts=0,trx=0,ts=0,ss=0) Activating ARFCN(0) SS(0) lctype SDCCH r=LOCATION_UPDATE ra=0x05 ta=0 20170130041914525 DRSL <0004> abis_rsl.c:580 (bts=0,trx=0,ts=0,pchan=CCCH+SDCCH4) Tx RSL Channel Activate with act_type=INITIAL 20170130041914525 DRSL <0004> abis_rsl.c:1189 (bts=0,trx=0,ts=0,ss=0) state NONE -> ACTIVATION REQUESTED 20170130041914525 DRSL <0004> abis_rsl.c:1546 (bts=0,trx=0,ts=0,ss=0) CHANNEL ACTIVATE ACK 20170130041914525 DRSL <0004> abis_rsl.c:1189 (bts=0,trx=0,ts=0,ss=0) state ACTIVATION REQUESTED -> ACTIVE 20170130041924529 DRSL <0004> abis_rsl.c:852 (bts=0,trx=0,ts=0,ss=0) RF Channel Release due to error: 1 20170130041924529 DRSL <0004> abis_rsl.c:762 (bts=0,trx=0,ts=0,ss=0) DEACTivate SACCH CMD 20170130041924529 DRSL <0004> abis_rsl.c:1189 (bts=0,trx=0,ts=0,ss=0) state ACTIVE -> RELEASE DUE ERROR 20170130041924530 DRSL <0004> abis_rsl.c:925 (bts=0,trx=0,ts=0,ss=0) RF CHANNEL RELEASE ACK 20170130041926530 DRSL <0004> abis_rsl.c:811 (bts=0,trx=0,ts=0,ss=0) is back in operation. 20170130041926531 DRSL <0004> abis_rsl.c:1189 (bts=0,trx=0,ts=0,ss=0) state RELEASE DUE ERROR -> NONE NITB config: ! ! OpenBSC (0.15.0.646-f1886-dirty) configuration saved from vty !! password foo ! log stderr logging filter all 1 logging color 1 logging print category 1 logging print extended-timestamp 1 logging level all everything logging level rll debug logging level cc debug logging level mm info logging level rr info logging level rsl debug logging level nm debug logging level mncc debug logging level pag debug logging level meas notice logging level sccp notice logging level msc notice logging level mgcp notice logging level ho notice logging level db notice logging level ref notice logging level gprs notice logging level ns info logging level bssgp notice logging level llc notice logging level sndcp notice logging level nat notice logging level ctrl notice logging level smpp notice logging level filter notice logging level ranap debug logging level sua debug logging level lglobal notice logging level llapd notice logging level linp notice logging level lmux notice logging level lmi notice logging level lmib notice logging level lsms notice logging level lctrl notice logging level lgtp notice logging level lstats notice logging level lgsup notice logging level loap notice ! stats interval 5 ! line vty no login ! e1_input e1_line 0 driver ipa e1_line 0 port 0 no e1_line 0 keepalive ipa bind 127.0.0.1 network network country code 432 mobile network code 70 short name dynch long name dynch auth policy accept-all authorized-regexp .* location updating reject cause 13 encryption a5 0 neci 1 paging any use tch 0 rrlp mode none mm info 1 handover 0 handover window rxlev averaging 10 handover window rxqual averaging 1 handover window rxlev neighbor averaging 10 handover power budget interval 6 handover power budget hysteresis 3 handover maximum distance 9999 timer t3101 10 timer t3103 0 timer t3105 0 timer t3107 0 timer t3109 4 timer t3111 0 timer t3113 60 timer t3115 0 timer t3117 0 timer t3119 0 timer t3122 10 timer t3141 0 subscriber-keep-in-ram 0 bts 0 type sysmobts band GSM900 cell_identity 0 location_area_code 1 base_station_id_code 63 ms max power 15 cell reselection hysteresis 4 rxlev access min 0 periodic location update 30 radio-link-timeout 32 channel allocator ascending rach tx integer 9 rach max transmission 7 channel-descrption attach 1 channel-descrption bs-pa-mfrms 5 channel-descrption bs-ag-blks-res 1 early-classmark-sending forbidden ip.access unit_id 1800 0 oml ip.access stream_id 255 line 0 neighbor-list mode automatic codec-support fr gprs mode gprs gprs 11bit_rach_support_for_egprs 0 gprs routing area 0 gprs network-control-order nc1 gprs cell bvci 1800 gprs cell timer blocking-timer 3 gprs cell timer blocking-retries 3 gprs cell timer unblocking-retries 3 gprs cell timer reset-timer 3 gprs cell timer reset-retries 3 gprs cell timer suspend-timer 10 gprs cell timer suspend-retries 3 gprs cell timer resume-timer 10 gprs cell timer resume-retries 3 gprs cell timer capability-update-timer 10 gprs cell timer capability-update-retries 3 gprs nsei 1800 gprs ns timer tns-block 3 gprs ns timer tns-block-retries 3 gprs ns timer tns-reset 3 gprs ns timer tns-reset-retries 3 gprs ns timer tns-test 30 gprs ns timer tns-alive 3 gprs ns timer tns-alive-retries 10 gprs nsvc 0 nsvci 1800 gprs nsvc 0 local udp port 23000 gprs nsvc 0 remote udp port 23000 gprs nsvc 0 remote ip 127.0.0.1 gprs nsvc 1 nsvci 0 gprs nsvc 1 local udp port 0 gprs nsvc 1 remote udp port 0 gprs nsvc 1 remote ip 0.0.0.0 no force-combined-si trx 0 rf_locked 0 arfcn 0 nominal power 23 max_power_red 0 rsl e1 tei 0 timeslot 0 phys_chan_config CCCH+SDCCH4 hopping enabled 0 timeslot 1 phys_chan_config TCH/F hopping enabled 0 timeslot 2 phys_chan_config TCH/F hopping enabled 0 timeslot 3 phys_chan_config TCH/F hopping enabled 0 timeslot 4 phys_chan_config PDCH hopping enabled 0 timeslot 5 phys_chan_config PDCH hopping enabled 0 timeslot 6 phys_chan_config PDCH hopping enabled 0 timeslot 7 phys_chan_config PDCH hopping enabled 0 mncc-int default-codec tch-f fr default-codec tch-h hr nitb subscriber-create-on-demand assign-tmsi OSMO-BTS-TRX Config file ! ! OsmoBTS (0.4.0.372-f65b) configuration saved from vty !! ! log stderr logging filter all 1 logging color 0 logging print category 1 logging print extended-timestamp 1 logging level all everything logging level rsl debug logging level oml debug logging level rll notice logging level rr notice logging level meas notice logging level pag info logging level l1c debug logging level l1p info logging level dsp debug logging level pcu notice logging level ho notice logging level trx notice logging level loop notice logging level abis notice logging level rtp notice logging level sum notice logging level lglobal notice logging level llapd debug logging level linp notice logging level lmux notice logging level lmi notice logging level lmib notice logging level lsms notice logging level lctrl notice logging level lgtp notice logging level lstats notice logging level lgsup notice logging level loap notice ! line vty no login ! e1_input e1_line 0 driver ipa e1_line 0 port 0 no e1_line 0 keepalive phy 0 osmotrx ip 127.0.0.1 osmotrx fn-advance 20 osmotrx rts-advance 5 osmotrx tx-attenuation oml instance 0 bts 0 band GSM900 ipa unit-id 1800 0 oml remote-ip 127.0.0.1 rtp jitter-buffer 100 paging queue-size 200 paging lifetime 0 uplink-power-target -75 min-qual-rach 50 min-qual-norm -5 no ms-power-loop timing-advance-loop trx 0 power-ramp max-initial 23000 mdBm power-ramp step-size 2000 mdB power-ramp step-interval 1 ms-power-control dsp phy 0 instance 0 Regards! openbsc at lists.osmocom.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From hosseinamini2578 at gmail.com Mon Jan 30 22:06:08 2017 From: hosseinamini2578 at gmail.com (Hossein Amini) Date: Tue, 31 Jan 2017 01:36:08 +0330 Subject: Channel release error when osmo-nitb want execute location update Message-ID: hi dear I install openbsc, osmosgsn, ggsn, osmo-trx, osmo-bts-trx, osmo-pcu and dependency from master branch step by step from this link. but when run osmo-nitb, osmo-trx and osmo-bts-trx, mobile connect to network but no access to network. (I used USRP N210/B210, ubuntu 15.10/16.10 64x) osmo-nitb log: 20170130041914525 DRLL <0000> chan_alloc.c:352 (bts=0,trx=0,ts=0,pchan=CCCH+SDCCH4) Allocating lchan=0 as SDCCH 20170130041914525 DRSL <0004> abis_rsl.c:1819 (bts=0,trx=0,ts=0,ss=0) Activating ARFCN(0) SS(0) lctype SDCCH r=LOCATION_UPDATE ra=0x05 ta=0 20170130041914525 DRSL <0004> abis_rsl.c:580 (bts=0,trx=0,ts=0,pchan=CCCH+SDCCH4) Tx RSL Channel Activate with act_type=INITIAL 20170130041914525 DRSL <0004> abis_rsl.c:1189 (bts=0,trx=0,ts=0,ss=0) state NONE -> ACTIVATION REQUESTED 20170130041914525 DRSL <0004> abis_rsl.c:1546 (bts=0,trx=0,ts=0,ss=0) CHANNEL ACTIVATE ACK 20170130041914525 DRSL <0004> abis_rsl.c:1189 (bts=0,trx=0,ts=0,ss=0) state ACTIVATION REQUESTED -> ACTIVE 20170130041924529 DRSL <0004> abis_rsl.c:852 (bts=0,trx=0,ts=0,ss=0) RF Channel Release due to error: 1 20170130041924529 DRSL <0004> abis_rsl.c:762 (bts=0,trx=0,ts=0,ss=0) DEACTivate SACCH CMD 20170130041924529 DRSL <0004> abis_rsl.c:1189 (bts=0,trx=0,ts=0,ss=0) state ACTIVE -> RELEASE DUE ERROR 20170130041924530 DRSL <0004> abis_rsl.c:925 (bts=0,trx=0,ts=0,ss=0) RF CHANNEL RELEASE ACK 20170130041926530 DRSL <0004> abis_rsl.c:811 (bts=0,trx=0,ts=0,ss=0) is back in operation. 20170130041926531 DRSL <0004> abis_rsl.c:1189 (bts=0,trx=0,ts=0,ss=0) state RELEASE DUE ERROR -> NONE NITB config: ! ! OpenBSC (0.15.0.646-f1886-dirty) configuration saved from vty !! password foo ! log stderr logging filter all 1 logging color 1 logging print category 1 logging print extended-timestamp 1 logging level all everything logging level rll debug logging level cc debug logging level mm info logging level rr info logging level rsl debug logging level nm debug logging level mncc debug logging level pag debug logging level meas notice logging level sccp notice logging level msc notice logging level mgcp notice logging level ho notice logging level db notice logging level ref notice logging level gprs notice logging level ns info logging level bssgp notice logging level llc notice logging level sndcp notice logging level nat notice logging level ctrl notice logging level smpp notice logging level filter notice logging level ranap debug logging level sua debug logging level lglobal notice logging level llapd notice logging level linp notice logging level lmux notice logging level lmi notice logging level lmib notice logging level lsms notice logging level lctrl notice logging level lgtp notice logging level lstats notice logging level lgsup notice logging level loap notice ! stats interval 5 ! line vty no login ! e1_input e1_line 0 driver ipa e1_line 0 port 0 no e1_line 0 keepalive ipa bind 127.0.0.1 network network country code 432 mobile network code 70 short name dynch long name dynch auth policy accept-all authorized-regexp .* location updating reject cause 13 encryption a5 0 neci 1 paging any use tch 0 rrlp mode none mm info 1 handover 0 handover window rxlev averaging 10 handover window rxqual averaging 1 handover window rxlev neighbor averaging 10 handover power budget interval 6 handover power budget hysteresis 3 handover maximum distance 9999 timer t3101 10 timer t3103 0 timer t3105 0 timer t3107 0 timer t3109 4 timer t3111 0 timer t3113 60 timer t3115 0 timer t3117 0 timer t3119 0 timer t3122 10 timer t3141 0 subscriber-keep-in-ram 0 bts 0 type sysmobts band GSM900 cell_identity 0 location_area_code 1 base_station_id_code 63 ms max power 15 cell reselection hysteresis 4 rxlev access min 0 periodic location update 30 radio-link-timeout 32 channel allocator ascending rach tx integer 9 rach max transmission 7 channel-descrption attach 1 channel-descrption bs-pa-mfrms 5 channel-descrption bs-ag-blks-res 1 early-classmark-sending forbidden ip.access unit_id 1800 0 oml ip.access stream_id 255 line 0 neighbor-list mode automatic codec-support fr gprs mode gprs gprs 11bit_rach_support_for_egprs 0 gprs routing area 0 gprs network-control-order nc1 gprs cell bvci 1800 gprs cell timer blocking-timer 3 gprs cell timer blocking-retries 3 gprs cell timer unblocking-retries 3 gprs cell timer reset-timer 3 gprs cell timer reset-retries 3 gprs cell timer suspend-timer 10 gprs cell timer suspend-retries 3 gprs cell timer resume-timer 10 gprs cell timer resume-retries 3 gprs cell timer capability-update-timer 10 gprs cell timer capability-update-retries 3 gprs nsei 1800 gprs ns timer tns-block 3 gprs ns timer tns-block-retries 3 gprs ns timer tns-reset 3 gprs ns timer tns-reset-retries 3 gprs ns timer tns-test 30 gprs ns timer tns-alive 3 gprs ns timer tns-alive-retries 10 gprs nsvc 0 nsvci 1800 gprs nsvc 0 local udp port 23000 gprs nsvc 0 remote udp port 23000 gprs nsvc 0 remote ip 127.0.0.1 gprs nsvc 1 nsvci 0 gprs nsvc 1 local udp port 0 gprs nsvc 1 remote udp port 0 gprs nsvc 1 remote ip 0.0.0.0 no force-combined-si trx 0 rf_locked 0 arfcn 0 nominal power 23 max_power_red 0 rsl e1 tei 0 timeslot 0 phys_chan_config CCCH+SDCCH4 hopping enabled 0 timeslot 1 phys_chan_config TCH/F hopping enabled 0 timeslot 2 phys_chan_config TCH/F hopping enabled 0 timeslot 3 phys_chan_config TCH/F hopping enabled 0 timeslot 4 phys_chan_config PDCH hopping enabled 0 timeslot 5 phys_chan_config PDCH hopping enabled 0 timeslot 6 phys_chan_config PDCH hopping enabled 0 timeslot 7 phys_chan_config PDCH hopping enabled 0 mncc-int default-codec tch-f fr default-codec tch-h hr nitb subscriber-create-on-demand assign-tmsi OSMO-BTS-TRX Config file ! ! OsmoBTS (0.4.0.372-f65b) configuration saved from vty !! ! log stderr logging filter all 1 logging color 0 logging print category 1 logging print extended-timestamp 1 logging level all everything logging level rsl debug logging level oml debug logging level rll notice logging level rr notice logging level meas notice logging level pag info logging level l1c debug logging level l1p info logging level dsp debug logging level pcu notice logging level ho notice logging level trx notice logging level loop notice logging level abis notice logging level rtp notice logging level sum notice logging level lglobal notice logging level llapd debug logging level linp notice logging level lmux notice logging level lmi notice logging level lmib notice logging level lsms notice logging level lctrl notice logging level lgtp notice logging level lstats notice logging level lgsup notice logging level loap notice ! line vty no login ! e1_input e1_line 0 driver ipa e1_line 0 port 0 no e1_line 0 keepalive phy 0 osmotrx ip 127.0.0.1 osmotrx fn-advance 20 osmotrx rts-advance 5 osmotrx tx-attenuation oml instance 0 bts 0 band GSM900 ipa unit-id 1800 0 oml remote-ip 127.0.0.1 rtp jitter-buffer 100 paging queue-size 200 paging lifetime 0 uplink-power-target -75 min-qual-rach 50 min-qual-norm -5 no ms-power-loop timing-advance-loop trx 0 power-ramp max-initial 23000 mdBm power-ramp step-size 2000 mdB power-ramp step-interval 1 ms-power-control dsp phy 0 instance 0 Regards -------------- next part -------------- An HTML attachment was scrubbed... URL: From raji.oshin at hotmail.com Tue Jan 31 08:11:32 2017 From: raji.oshin at hotmail.com (Rajitha peiris) Date: Tue, 31 Jan 2017 08:11:32 +0000 Subject: Pcs1900 cant make calls ...only messages In-Reply-To: References: Message-ID: Hello all I have installed openbsc with pcs1900 nano bts but I can't make voice calls only the messages. It's telling network busy Thanks Regards Rajitha Sri Lanka Sent from my iPhone On Jan 27, 2017, at 3:11 PM, "openbsc-request at lists.osmocom.org" > wrote: Send OpenBSC mailing list submissions to openbsc at lists.osmocom.org To subscribe or unsubscribe via the World Wide Web, visit https://lists.osmocom.org/mailman/listinfo/openbsc or, via email, send a message with subject or body 'help' to openbsc-request at lists.osmocom.org You can reach the person managing the list at openbsc-owner at lists.osmocom.org When replying, please edit your Subject line so it is more specific than "Re: Contents of OpenBSC digest..." Today's Topics: 1. Re: [MERGED] osmo-trx[master]: Do not embed sqlite3 when building (Alexander Chemeris) 2. Re: [PATCH net v2 3/3] gtp: fix cross netns recv on gtp socket (David Miller) 3. Re: [MERGED] osmo-trx[master]: Do not embed sqlite3 when building (Neels Hofmeyr) 4. HEADS UP: jenkins DOWN (Neels Hofmeyr) 5. HEADS DOWN: jenkins UP (Neels Hofmeyr) 6. Re: HEADS DOWN: jenkins UP (Holger Freyther) 7. [PATCH net v3 0/3] various gtp fixes (Andreas Schultz) 8. [PATCH net v3 2/3] gtp: clear DF bit on GTP packet tx (Andreas Schultz) ---------------------------------------------------------------------- Message: 1 Date: Thu, 26 Jan 2017 20:53:07 +0400 From: Alexander Chemeris > To: Max > Cc: OpenBSC Mailing List > Subject: Re: [MERGED] osmo-trx[master]: Do not embed sqlite3 when building Message-ID: > Content-Type: text/plain; charset=UTF-8 Great. I was also going to ask about debian contrl files, etc. Glad this is already fixed. Is there a way to subscribe to gerrit patches for a particular project? On Thu, Jan 26, 2017 at 8:10 PM, Max > wrote: It should have been removed with gerrit 1485 . See also gerrit 1691 for follow-up fixes. On 26.01.2017 16:53, Alexander Chemeris wrote: Hi Harald, Thomas, I think it also makes sense to remove sqlite3 subdirectory, since it's no longer used. Any reason it's kept in the repository? -- Max Suraev > http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Geschaeftsfuehrer / Managing Director: Harald Welte -- Regards, Alexander Chemeris. CEO, Fairwaves, Inc. https://fairwaves.co ------------------------------ Message: 2 Date: Thu, 26 Jan 2017 14:22:47 -0500 (EST) From: David Miller > To: aschultz at tpip.net Cc: pablo at netfilter.org, netdev at vger.kernel.org, Lionel.Gauthier at eurecom.fr, openbsc at lists.osmocom.org, laforge at gnumonks.org Subject: Re: [PATCH net v2 3/3] gtp: fix cross netns recv on gtp socket Message-ID: <20170126.142247.527598780818100974.davem at davemloft.net> Content-Type: Text/Plain; charset=iso-8859-7 From: Andreas Schultz > Date: Thu, 26 Jan 2017 16:11:34 +0100 The use of the passed through netlink src_net to check for a cross netns operation was wrong. Using the GTP socket and the GTP netdevice is always correct (even if the netdev has been moved to new netns after link creation). Remove the now obsolete net field from gtp_dev. Signed-off-by: Andreas Schultz > Please at least compile test your submissions: drivers/net/gtp.c: In function ?gtp_newlink?: drivers/net/gtp.c:677:8: error: too many arguments to function ?gtp_encap_enable? err = gtp_encap_enable(dev, gtp, fd0, fd1, src_net); ^ drivers/net/gtp.c:659:12: note: declared here static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, ^ drivers/net/gtp.c: At top level: drivers/net/gtp.c:822:12: error: conflicting types for ?gtp_encap_enable? static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, ^ drivers/net/gtp.c:659:12: note: previous declaration of ?gtp_encap_enable? was here static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, ^ drivers/net/gtp.c:659:12: warning: ?gtp_encap_enable? used but never defined drivers/net/gtp.c:822:12: warning: ?gtp_encap_enable? defined but not used [-Wunused-function] static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, ^ scripts/Makefile.build:299: recipe for target 'drivers/net/gtp.o' failed ------------------------------ Message: 3 Date: Thu, 26 Jan 2017 21:40:27 +0100 From: Neels Hofmeyr > To: Alexander Chemeris > Cc: Max >, OpenBSC Mailing List > Subject: Re: [MERGED] osmo-trx[master]: Do not embed sqlite3 when building Message-ID: <20170126204027.GA7681 at my.box> Content-Type: text/plain; charset="us-ascii" On Thu, Jan 26, 2017 at 08:53:07PM +0400, Alexander Chemeris wrote: Great. I was also going to ask about debian contrl files, etc. Glad this is already fixed. Is there a way to subscribe to gerrit patches for a particular project? I'm not sure, but I guess not. We have our gerrit-log mailing list that catches all changes https://lists.osmocom.org/mailman/listinfo/gerrit-log -- otherwise take a look at your user's settings, maybe there's such a feature hidden there? ~N -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: ------------------------------ Message: 4 Date: Fri, 27 Jan 2017 03:36:14 +0100 From: Neels Hofmeyr > To: openbsc at lists.osmocom.org Subject: HEADS UP: jenkins DOWN Message-ID: <20170127023614.GA13650 at my.box> Content-Type: text/plain; charset="iso-8859-1" While I was waiting for jenkins just now, I noticed that it was getting impossibly slow despite an idle CPU. An attempt to restart resulted in failure to launch jenkins due to "Disk quota exceeded". There are things happening that I don't understand (file system is shrinking as I remove files). I need help from Holger (or Harald?), to understand and probably fix with a simple command making more space for the jail... Until then our jenkins will be DOWN :/ ~N -- - Neels Hofmeyr > http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Gesch?ftsf?hrer / Managing Directors: Harald Welte -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: ------------------------------ Message: 5 Date: Fri, 27 Jan 2017 03:57:59 +0100 From: Neels Hofmeyr > To: openbsc at lists.osmocom.org Subject: HEADS DOWN: jenkins UP Message-ID: <20170127025759.GB13650 at my.box> Content-Type: text/plain; charset="iso-8859-1" Just after I gave up and sent the mail, I found the point: we have three daily and three weekly backup snapshots taken of the jenkins jail, which *shares* disk quota with the actively used file system. Removing files doesn't remove them from the snapshots, so the only way short of discarding snapshots (?) is to increase the overall quota. I set it from 40G up to 60G, and sure enough jenkins runs again. We should probably set a refquota so that the live file system's quota is somewhat independent from the quota used for snapshots. I'll not do this before consulting with the experts though. ~N On Fri, Jan 27, 2017 at 03:36:14AM +0100, Neels Hofmeyr wrote: While I was waiting for jenkins just now, I noticed that it was getting impossibly slow despite an idle CPU. An attempt to restart resulted in failure to launch jenkins due to "Disk quota exceeded". There are things happening that I don't understand (file system is shrinking as I remove files). I need help from Holger (or Harald?), to understand and probably fix with a simple command making more space for the jail... Until then our jenkins will be DOWN :/ ~N -- - Neels Hofmeyr > http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Gesch?ftsf?hrer / Managing Directors: Harald Welte -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: ------------------------------ Message: 6 Date: Fri, 27 Jan 2017 09:13:09 +0100 From: Holger Freyther > To: Neels Hofmeyr > Cc: openbsc at lists.osmocom.org Subject: Re: HEADS DOWN: jenkins UP Message-ID: > Content-Type: text/plain; charset=us-ascii On 27 Jan 2017, at 03:57, Neels Hofmeyr > wrote: Just after I gave up and sent the mail, I found the point: we have three daily and three weekly backup snapshots taken of the jenkins jail, which *shares* disk quota with the actively used file system. Removing files doesn't remove them from the snapshots, so the only way short of discarding snapshots (?) is to increase the overall quota. I set it from 40G up to 60G, and sure enough jenkins runs again. We should probably set a refquota so that the live file system's quota is somewhat independent from the quota used for snapshots. I'll not do this before consulting with the experts though. good analysis. Not using refquota is a historic mistake. I have changed that for the jenkins.osmocom.org jail. holger ------------------------------ Message: 7 Date: Fri, 27 Jan 2017 10:40:55 +0100 From: Andreas Schultz > To: Pablo Neira > Cc: netdev at vger.kernel.org, Lionel Gauthier >, openbsc at lists.osmocom.org, Harald Welte >, SF Markus Elfring > Subject: [PATCH net v3 0/3] various gtp fixes Message-ID: <20170127094058.7899-1-aschultz at tpip.net> I'm sorry for the compile error mess up in the last version. It's no excuse for not test compiling, but the hunks got lost in a rebase. This is the part of the previous "simple gtp improvements" series that Pablo indicated should go into net. The addition of the module alias fixes genl family autoloading, clearing the DF bit fixes a protocol violation in regard to the specification and the netns comparison fixes a corner case of cross netns recv. Andreas v2->v3: fix compiler error introduced in rebase -- Andreas Schultz (3): gtp: add genl family modules alias gtp: clear DF bit on GTP packet tx gtp: fix cross netns recv on gtp socket drivers/net/gtp.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) -- 2.10.2 ------------------------------ Message: 8 Date: Fri, 27 Jan 2017 10:40:57 +0100 From: Andreas Schultz > To: Pablo Neira > Cc: netdev at vger.kernel.org, Lionel Gauthier >, openbsc at lists.osmocom.org, Harald Welte >, SF Markus Elfring > Subject: [PATCH net v3 2/3] gtp: clear DF bit on GTP packet tx Message-ID: <20170127094058.7899-3-aschultz at tpip.net> 3GPP TS 29.281 and 3GPP TS 29.060 imply that GTP-U packets should be sent with the DF bit cleared. For example 3GPP TS 29.060, Release 8, Section 13.2.2: Backbone router: Any router in the backbone may fragment the GTP packet if needed, according to IPv4. Signed-off-by: Andreas Schultz > Acked-by: Harald Welte > Acked-by: Pablo Neira Ayuso > --- drivers/net/gtp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 7580ccc..1df54d6 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -612,7 +612,7 @@ static netdev_tx_t gtp_dev_xmit(struct sk_buff *skb, struct net_device *dev) pktinfo.fl4.saddr, pktinfo.fl4.daddr, pktinfo.iph->tos, ip4_dst_hoplimit(&pktinfo.rt->dst), - htons(IP_DF), + 0, pktinfo.gtph_port, pktinfo.gtph_port, true, false); break; -- 2.10.2 ------------------------------ Subject: Digest Footer _______________________________________________ OpenBSC mailing list OpenBSC at lists.osmocom.org https://lists.osmocom.org/mailman/listinfo/openbsc ------------------------------ End of OpenBSC Digest, Vol 27, Issue 29 *************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From lkp at intel.com Tue Jan 24 23:48:09 2017 From: lkp at intel.com (kbuild test robot) Date: Wed, 25 Jan 2017 07:48:09 +0800 Subject: [PATCH 3/5] gtp: fix cross netns recv on gtp socket In-Reply-To: <20170124172402.12096-4-aschultz@tpip.net> Message-ID: <201701250758.Li9CCYD9%fengguang.wu@intel.com> Hi Andreas, [auto build test ERROR on net-next/master] [also build test ERROR on v4.10-rc5 next-20170124] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Andreas-Schultz/simple-gtp-improvements/20170125-051754 config: i386-allmodconfig (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: # save the attached .config to linux build tree make ARCH=i386 All error/warnings (new ones prefixed by >>): drivers/net/gtp.c: In function 'gtp_newlink': >> drivers/net/gtp.c:677:8: error: too many arguments to function 'gtp_encap_enable' err = gtp_encap_enable(dev, gtp, fd0, fd1, src_net); ^~~~~~~~~~~~~~~~ drivers/net/gtp.c:659:12: note: declared here static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, ^~~~~~~~~~~~~~~~ drivers/net/gtp.c: At top level: >> drivers/net/gtp.c:822:12: error: conflicting types for 'gtp_encap_enable' static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, ^~~~~~~~~~~~~~~~ drivers/net/gtp.c:659:12: note: previous declaration of 'gtp_encap_enable' was here static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, ^~~~~~~~~~~~~~~~ >> drivers/net/gtp.c:659:12: warning: 'gtp_encap_enable' used but never defined drivers/net/gtp.c:822:12: warning: 'gtp_encap_enable' defined but not used [-Wunused-function] static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, ^~~~~~~~~~~~~~~~ vim +/gtp_encap_enable +677 drivers/net/gtp.c 459aa660 Pablo Neira 2016-05-09 653 sizeof(struct udphdr) + 459aa660 Pablo Neira 2016-05-09 654 sizeof(struct gtp0_header); 459aa660 Pablo Neira 2016-05-09 655 } 459aa660 Pablo Neira 2016-05-09 656 459aa660 Pablo Neira 2016-05-09 657 static int gtp_hashtable_new(struct gtp_dev *gtp, int hsize); 459aa660 Pablo Neira 2016-05-09 658 static void gtp_hashtable_free(struct gtp_dev *gtp); 459aa660 Pablo Neira 2016-05-09 @659 static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, 0e9ed139 Andreas Schultz 2017-01-24 660 int fd_gtp0, int fd_gtp1); 459aa660 Pablo Neira 2016-05-09 661 459aa660 Pablo Neira 2016-05-09 662 static int gtp_newlink(struct net *src_net, struct net_device *dev, 459aa660 Pablo Neira 2016-05-09 663 struct nlattr *tb[], struct nlattr *data[]) 459aa660 Pablo Neira 2016-05-09 664 { 459aa660 Pablo Neira 2016-05-09 665 int hashsize, err, fd0, fd1; 459aa660 Pablo Neira 2016-05-09 666 struct gtp_dev *gtp; 459aa660 Pablo Neira 2016-05-09 667 struct gtp_net *gn; 459aa660 Pablo Neira 2016-05-09 668 459aa660 Pablo Neira 2016-05-09 669 if (!data[IFLA_GTP_FD0] || !data[IFLA_GTP_FD1]) 459aa660 Pablo Neira 2016-05-09 670 return -EINVAL; 459aa660 Pablo Neira 2016-05-09 671 459aa660 Pablo Neira 2016-05-09 672 gtp = netdev_priv(dev); 459aa660 Pablo Neira 2016-05-09 673 459aa660 Pablo Neira 2016-05-09 674 fd0 = nla_get_u32(data[IFLA_GTP_FD0]); 459aa660 Pablo Neira 2016-05-09 675 fd1 = nla_get_u32(data[IFLA_GTP_FD1]); 459aa660 Pablo Neira 2016-05-09 676 459aa660 Pablo Neira 2016-05-09 @677 err = gtp_encap_enable(dev, gtp, fd0, fd1, src_net); 459aa660 Pablo Neira 2016-05-09 678 if (err < 0) 459aa660 Pablo Neira 2016-05-09 679 goto out_err; 459aa660 Pablo Neira 2016-05-09 680 459aa660 Pablo Neira 2016-05-09 681 if (!data[IFLA_GTP_PDP_HASHSIZE]) 459aa660 Pablo Neira 2016-05-09 682 hashsize = 1024; 459aa660 Pablo Neira 2016-05-09 683 else 459aa660 Pablo Neira 2016-05-09 684 hashsize = nla_get_u32(data[IFLA_GTP_PDP_HASHSIZE]); 459aa660 Pablo Neira 2016-05-09 685 459aa660 Pablo Neira 2016-05-09 686 err = gtp_hashtable_new(gtp, hashsize); 459aa660 Pablo Neira 2016-05-09 687 if (err < 0) 459aa660 Pablo Neira 2016-05-09 688 goto out_encap; 459aa660 Pablo Neira 2016-05-09 689 459aa660 Pablo Neira 2016-05-09 690 err = register_netdevice(dev); 459aa660 Pablo Neira 2016-05-09 691 if (err < 0) { 459aa660 Pablo Neira 2016-05-09 692 netdev_dbg(dev, "failed to register new netdev %d\n", err); 459aa660 Pablo Neira 2016-05-09 693 goto out_hashtable; 459aa660 Pablo Neira 2016-05-09 694 } 459aa660 Pablo Neira 2016-05-09 695 459aa660 Pablo Neira 2016-05-09 696 gn = net_generic(dev_net(dev), gtp_net_id); 459aa660 Pablo Neira 2016-05-09 697 list_add_rcu(>p->list, &gn->gtp_dev_list); 459aa660 Pablo Neira 2016-05-09 698 459aa660 Pablo Neira 2016-05-09 699 netdev_dbg(dev, "registered new GTP interface\n"); 459aa660 Pablo Neira 2016-05-09 700 459aa660 Pablo Neira 2016-05-09 701 return 0; 459aa660 Pablo Neira 2016-05-09 702 459aa660 Pablo Neira 2016-05-09 703 out_hashtable: 459aa660 Pablo Neira 2016-05-09 704 gtp_hashtable_free(gtp); 459aa660 Pablo Neira 2016-05-09 705 out_encap: 459aa660 Pablo Neira 2016-05-09 706 gtp_encap_disable(gtp); 459aa660 Pablo Neira 2016-05-09 707 out_err: 459aa660 Pablo Neira 2016-05-09 708 return err; 459aa660 Pablo Neira 2016-05-09 709 } 459aa660 Pablo Neira 2016-05-09 710 459aa660 Pablo Neira 2016-05-09 711 static void gtp_dellink(struct net_device *dev, struct list_head *head) 459aa660 Pablo Neira 2016-05-09 712 { 459aa660 Pablo Neira 2016-05-09 713 struct gtp_dev *gtp = netdev_priv(dev); 459aa660 Pablo Neira 2016-05-09 714 459aa660 Pablo Neira 2016-05-09 715 gtp_encap_disable(gtp); 459aa660 Pablo Neira 2016-05-09 716 gtp_hashtable_free(gtp); 459aa660 Pablo Neira 2016-05-09 717 list_del_rcu(>p->list); 459aa660 Pablo Neira 2016-05-09 718 unregister_netdevice_queue(dev, head); 459aa660 Pablo Neira 2016-05-09 719 } 459aa660 Pablo Neira 2016-05-09 720 459aa660 Pablo Neira 2016-05-09 721 static const struct nla_policy gtp_policy[IFLA_GTP_MAX + 1] = { 459aa660 Pablo Neira 2016-05-09 722 [IFLA_GTP_FD0] = { .type = NLA_U32 }, 459aa660 Pablo Neira 2016-05-09 723 [IFLA_GTP_FD1] = { .type = NLA_U32 }, 459aa660 Pablo Neira 2016-05-09 724 [IFLA_GTP_PDP_HASHSIZE] = { .type = NLA_U32 }, 459aa660 Pablo Neira 2016-05-09 725 }; 459aa660 Pablo Neira 2016-05-09 726 459aa660 Pablo Neira 2016-05-09 727 static int gtp_validate(struct nlattr *tb[], struct nlattr *data[]) 459aa660 Pablo Neira 2016-05-09 728 { 459aa660 Pablo Neira 2016-05-09 729 if (!data) 459aa660 Pablo Neira 2016-05-09 730 return -EINVAL; 459aa660 Pablo Neira 2016-05-09 731 459aa660 Pablo Neira 2016-05-09 732 return 0; 459aa660 Pablo Neira 2016-05-09 733 } 459aa660 Pablo Neira 2016-05-09 734 459aa660 Pablo Neira 2016-05-09 735 static size_t gtp_get_size(const struct net_device *dev) 459aa660 Pablo Neira 2016-05-09 736 { 459aa660 Pablo Neira 2016-05-09 737 return nla_total_size(sizeof(__u32)); /* IFLA_GTP_PDP_HASHSIZE */ 459aa660 Pablo Neira 2016-05-09 738 } 459aa660 Pablo Neira 2016-05-09 739 459aa660 Pablo Neira 2016-05-09 740 static int gtp_fill_info(struct sk_buff *skb, const struct net_device *dev) 459aa660 Pablo Neira 2016-05-09 741 { 459aa660 Pablo Neira 2016-05-09 742 struct gtp_dev *gtp = netdev_priv(dev); 459aa660 Pablo Neira 2016-05-09 743 459aa660 Pablo Neira 2016-05-09 744 if (nla_put_u32(skb, IFLA_GTP_PDP_HASHSIZE, gtp->hash_size)) 459aa660 Pablo Neira 2016-05-09 745 goto nla_put_failure; 459aa660 Pablo Neira 2016-05-09 746 459aa660 Pablo Neira 2016-05-09 747 return 0; 459aa660 Pablo Neira 2016-05-09 748 459aa660 Pablo Neira 2016-05-09 749 nla_put_failure: 459aa660 Pablo Neira 2016-05-09 750 return -EMSGSIZE; 459aa660 Pablo Neira 2016-05-09 751 } 459aa660 Pablo Neira 2016-05-09 752 459aa660 Pablo Neira 2016-05-09 753 static struct rtnl_link_ops gtp_link_ops __read_mostly = { 459aa660 Pablo Neira 2016-05-09 754 .kind = "gtp", 459aa660 Pablo Neira 2016-05-09 755 .maxtype = IFLA_GTP_MAX, 459aa660 Pablo Neira 2016-05-09 756 .policy = gtp_policy, 459aa660 Pablo Neira 2016-05-09 757 .priv_size = sizeof(struct gtp_dev), 459aa660 Pablo Neira 2016-05-09 758 .setup = gtp_link_setup, 459aa660 Pablo Neira 2016-05-09 759 .validate = gtp_validate, 459aa660 Pablo Neira 2016-05-09 760 .newlink = gtp_newlink, 459aa660 Pablo Neira 2016-05-09 761 .dellink = gtp_dellink, 459aa660 Pablo Neira 2016-05-09 762 .get_size = gtp_get_size, 459aa660 Pablo Neira 2016-05-09 763 .fill_info = gtp_fill_info, 459aa660 Pablo Neira 2016-05-09 764 }; 459aa660 Pablo Neira 2016-05-09 765 459aa660 Pablo Neira 2016-05-09 766 static struct net *gtp_genl_get_net(struct net *src_net, struct nlattr *tb[]) 459aa660 Pablo Neira 2016-05-09 767 { 459aa660 Pablo Neira 2016-05-09 768 struct net *net; 459aa660 Pablo Neira 2016-05-09 769 459aa660 Pablo Neira 2016-05-09 770 /* Examine the link attributes and figure out which network namespace 459aa660 Pablo Neira 2016-05-09 771 * we are talking about. 459aa660 Pablo Neira 2016-05-09 772 */ 459aa660 Pablo Neira 2016-05-09 773 if (tb[GTPA_NET_NS_FD]) 459aa660 Pablo Neira 2016-05-09 774 net = get_net_ns_by_fd(nla_get_u32(tb[GTPA_NET_NS_FD])); 459aa660 Pablo Neira 2016-05-09 775 else 459aa660 Pablo Neira 2016-05-09 776 net = get_net(src_net); 459aa660 Pablo Neira 2016-05-09 777 459aa660 Pablo Neira 2016-05-09 778 return net; 459aa660 Pablo Neira 2016-05-09 779 } 459aa660 Pablo Neira 2016-05-09 780 459aa660 Pablo Neira 2016-05-09 781 static int gtp_hashtable_new(struct gtp_dev *gtp, int hsize) 459aa660 Pablo Neira 2016-05-09 782 { 459aa660 Pablo Neira 2016-05-09 783 int i; 459aa660 Pablo Neira 2016-05-09 784 459aa660 Pablo Neira 2016-05-09 785 gtp->addr_hash = kmalloc(sizeof(struct hlist_head) * hsize, GFP_KERNEL); 459aa660 Pablo Neira 2016-05-09 786 if (gtp->addr_hash == NULL) 459aa660 Pablo Neira 2016-05-09 787 return -ENOMEM; 459aa660 Pablo Neira 2016-05-09 788 459aa660 Pablo Neira 2016-05-09 789 gtp->tid_hash = kmalloc(sizeof(struct hlist_head) * hsize, GFP_KERNEL); 459aa660 Pablo Neira 2016-05-09 790 if (gtp->tid_hash == NULL) 459aa660 Pablo Neira 2016-05-09 791 goto err1; 459aa660 Pablo Neira 2016-05-09 792 459aa660 Pablo Neira 2016-05-09 793 gtp->hash_size = hsize; 459aa660 Pablo Neira 2016-05-09 794 459aa660 Pablo Neira 2016-05-09 795 for (i = 0; i < hsize; i++) { 459aa660 Pablo Neira 2016-05-09 796 INIT_HLIST_HEAD(>p->addr_hash[i]); 459aa660 Pablo Neira 2016-05-09 797 INIT_HLIST_HEAD(>p->tid_hash[i]); 459aa660 Pablo Neira 2016-05-09 798 } 459aa660 Pablo Neira 2016-05-09 799 return 0; 459aa660 Pablo Neira 2016-05-09 800 err1: 459aa660 Pablo Neira 2016-05-09 801 kfree(gtp->addr_hash); 459aa660 Pablo Neira 2016-05-09 802 return -ENOMEM; 459aa660 Pablo Neira 2016-05-09 803 } 459aa660 Pablo Neira 2016-05-09 804 459aa660 Pablo Neira 2016-05-09 805 static void gtp_hashtable_free(struct gtp_dev *gtp) 459aa660 Pablo Neira 2016-05-09 806 { 459aa660 Pablo Neira 2016-05-09 807 struct pdp_ctx *pctx; 459aa660 Pablo Neira 2016-05-09 808 int i; 459aa660 Pablo Neira 2016-05-09 809 459aa660 Pablo Neira 2016-05-09 810 for (i = 0; i < gtp->hash_size; i++) { 459aa660 Pablo Neira 2016-05-09 811 hlist_for_each_entry_rcu(pctx, >p->tid_hash[i], hlist_tid) { 459aa660 Pablo Neira 2016-05-09 812 hlist_del_rcu(&pctx->hlist_tid); 459aa660 Pablo Neira 2016-05-09 813 hlist_del_rcu(&pctx->hlist_addr); 459aa660 Pablo Neira 2016-05-09 814 kfree_rcu(pctx, rcu_head); 459aa660 Pablo Neira 2016-05-09 815 } 459aa660 Pablo Neira 2016-05-09 816 } 459aa660 Pablo Neira 2016-05-09 817 synchronize_rcu(); 459aa660 Pablo Neira 2016-05-09 818 kfree(gtp->addr_hash); 459aa660 Pablo Neira 2016-05-09 819 kfree(gtp->tid_hash); 459aa660 Pablo Neira 2016-05-09 820 } 459aa660 Pablo Neira 2016-05-09 821 459aa660 Pablo Neira 2016-05-09 @822 static int gtp_encap_enable(struct net_device *dev, struct gtp_dev *gtp, 459aa660 Pablo Neira 2016-05-09 823 int fd_gtp0, int fd_gtp1, struct net *src_net) 459aa660 Pablo Neira 2016-05-09 824 { 459aa660 Pablo Neira 2016-05-09 825 struct udp_tunnel_sock_cfg tuncfg = {NULL}; :::::: The code at line 677 was first introduced by commit :::::: 459aa660eb1d8ce67080da1983bb81d716aa5a69 gtp: add initial driver for datapath of GPRS Tunneling Protocol (GTP-U) :::::: TO: Pablo Neira :::::: CC: David S. Miller --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation -------------- next part -------------- A non-text attachment was scrubbed... Name: .config.gz Type: application/gzip Size: 57922 bytes Desc: not available URL: From davem at davemloft.net Tue Jan 31 18:05:43 2017 From: davem at davemloft.net (David Miller) Date: Tue, 31 Jan 2017 13:05:43 -0500 (EST) Subject: [PATCH net-next v2 0/6] gtp: misc improvements In-Reply-To: <20170130163713.17524-1-aschultz@tpip.net> References: <20170130163713.17524-1-aschultz@tpip.net> Message-ID: <20170131.130543.246760553501896069.davem@davemloft.net> From: Andreas Schultz Date: Mon, 30 Jan 2017 17:37:07 +0100 > Resent as v2, because I forgot the net-next target. Sorry for noise, > I promise I won't forget it again. > > This series lays the groundwork for removing the socket references from > the GTP netdevice by removing duplicate code and simplifying the logic on > some code paths. > > It slighly changes the GTP genl API by making the socket parameters optional > (though one of them is still required). > > The removal of the socket references will break the 1:1 releation between > GTP netdevice and GTP socket that prevents us to support multiple VRFs with > overlaping IP addresse spaces attached to the same GTP socket (needed for > multi APN support). This series is being held up it is not being reviewed. Please someone with GTP knowledge properly review this series. Thank you.