From: Tom Parkin <tparkin@katalix.com>
To: netdev@vger.kernel.org
Cc: gnault@redhat.com, jchapman@katalix.com,
Tom Parkin <tparkin@katalix.com>
Subject: [PATCH v3 net-next 0/2] add ppp_generic ioctl(s) to bridge channels
Date: Fri, 4 Dec 2020 16:36:54 +0000 [thread overview]
Message-ID: <20201204163656.1623-1-tparkin@katalix.com> (raw)
Following on from my previous RFC[1], this series adds two ioctl calls
to the ppp code to implement "channel bridging".
When two ppp channels are bridged, frames presented to ppp_input() on
one channel are passed to the other channel's ->start_xmit function for
transmission.
The primary use-case for this functionality is in an L2TP Access
Concentrator where PPP frames are typically presented in a PPPoE session
(e.g. from a home broadband user) and are forwarded to the ISP network in
a PPPoL2TP session.
The two new ioctls, PPPIOCBRIDGECHAN and PPPIOCUNBRIDGECHAN form a
symmetric pair.
Userspace code testing and illustrating use of the ioctl calls is
available in the go-l2tp[2] and l2tp-ktest[3] repositories.
[1]. Previous RFC series:
https://lore.kernel.org/netdev/20201106181647.16358-1-tparkin@katalix.com/
[2]. go-l2tp: a Go library for building L2TP applications on Linux
systems. Support for the PPPIOCBRIDGECHAN ioctl is on a branch:
https://github.com/katalix/go-l2tp/tree/tp_002_pppoe_2
[3]. l2tp-ktest: a test suite for the Linux Kernel L2TP subsystem.
Support for the PPPIOCBRIDGECHAN ioctl is on a branch:
https://github.com/katalix/l2tp-ktest/tree/tp_ac_pppoe_tests_2
Changelog:
v3:
* Use rcu_dereference_protected for accessing struct channel
'bridge' field during updates with lock 'upl' held.
* Avoid race in ppp_unbridge_channels by ensuring that each channel
in the bridge points to it's peer before decrementing refcounts.
v2:
* Add missing __rcu annotation to struct channel 'bridge' field in
order to squash a sparse warning from a C=1 build
* Integrate review comments from gnault@redhat.com
* Have ppp_unbridge_channels return -EINVAL if the channel isn't
part of a bridge: this better aligns with the return code from
ppp_disconnect_channel.
* Improve docs update by including information on ioctl arguments
and error return codes.
Tom Parkin (2):
ppp: add PPPIOCBRIDGECHAN and PPPIOCUNBRIDGECHAN ioctls
docs: update ppp_generic.rst to document new ioctls
Documentation/networking/ppp_generic.rst | 16 +++
drivers/net/ppp/ppp_generic.c | 145 ++++++++++++++++++++++-
include/uapi/linux/ppp-ioctl.h | 2 +
3 files changed, 160 insertions(+), 3 deletions(-)
--
2.17.1
next reply other threads:[~2020-12-04 16:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-04 16:36 Tom Parkin [this message]
2020-12-04 16:36 ` [PATCH v3 net-next 1/2] ppp: add PPPIOCBRIDGECHAN and PPPIOCUNBRIDGECHAN ioctls Tom Parkin
2020-12-07 16:22 ` Guillaume Nault
2020-12-10 14:46 ` Tom Parkin
2020-12-10 15:05 ` Guillaume Nault
2020-12-04 16:36 ` [PATCH v3 net-next 2/2] docs: update ppp_generic.rst to document new ioctls Tom Parkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201204163656.1623-1-tparkin@katalix.com \
--to=tparkin@katalix.com \
--cc=gnault@redhat.com \
--cc=jchapman@katalix.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).