net: hdlc_x25: Queue outgoing LAPB frames
Subsystems (5)
RFC PATCH v4 1/1 net: hdlc_x25: Queue outgoing LAPB frames
When sending packets, we will first hand over the (L3) packets to the LAPB module. The LAPB module will then hand over the corresponding LAPB (L2) frames back to us for us to transmit.
The LAPB module can also emit LAPB (L2) frames at any time, even without an (L3) packet currently being sent on the device. This happens when the LAPB module tries to send (L3) packets queued up in its internal queue, or when the LAPB module decides to send some (L2) control frame.
This means we need to have a queue for these outgoing LAPB (L2) frames, otherwise frames can be dropped if sent when the hardware driver is already busy in transmitting. The queue needs to be controlled by the hardware driver's netif_stop_queue and netif_wake_queue calls. Therefore, we need to use the device's qdisc TX queue for this purpose. However, currently outgoing LAPB (L2) frames are not queued.
On the other hand, outgoing (L3) packets (before they are handed over to the LAPB module) don't need to be queued, because the LAPB module already has an internal queue for them, and is able to queue new outgoing (L3) packets at any time. However, currently outgoing (L3) packets are being queued in the device's qdisc TX queue, which is controlled by the hardware driver's netif_stop_queue and netif_wake_queue calls. This is unnecessary and meaningless.
To fix these issues, we can split the HDLC device into two devices - a virtual X.25 device and the actual HDLC device, use the virtual X.25 device to send (L3) packets and then use the actual HDLC device to queue LAPB (L2) frames. The outgoing (L2) LAPB queue will be controlled by the hardware driver's netif_stop_queue and netif_wake_queue calls, while outgoing (L3) packets will not be affected by these calls.
---
Change from RFC v3:
Call netif_carrier_off in x25_hdlc_open before calling register_netdevice.
Change from RFC v2:
Simplified the commit message.
Dropped the x25_open fix which is already merged into net-next now. Use HDLC_MAX_MTU as the mtu of the X.25 virtual device.
Add an explanation to the documentation about the X.25 virtual device.
Change from RFC v1:
Properly initialize state(hdlc)->x25_dev and state(hdlc)->x25_dev_lock.
--- Documentation/networking/generic-hdlc.rst | 3 + drivers/net/wan/hdlc_x25.c | 156 ++++++++++++++++++---- 2 files changed, 133 insertions(+), 26 deletions(-)
Documentation/networking/generic-hdlc.rst +3 -0
@@ -59,6 +59,9 @@ or:: In Frame Relay mode, ifconfig master hdlc device up (without assigning any IP address to it) before using pvc devices. +In X.25 mode, ifconfig the hdlc device up, then a virtual X.25 device +would appear for use. + Setting interface:
drivers/net/wan/hdlc_x25.c +130 -26
216 lines not on this page · raw message
Signature · 1 line
2.27.0
Quoted 34 lines · Xie He
When sending packets, we will first hand over the (L3) packets to the LAPB module. The LAPB module will then hand over the corresponding LAPB (L2) frames back to us for us to transmit.
The LAPB module can also emit LAPB (L2) frames at any time, even without an (L3) packet currently being sent on the device. This happens when the LAPB module tries to send (L3) packets queued up in its internal queue, or when the LAPB module decides to send some (L2) control frame.
This means we need to have a queue for these outgoing LAPB (L2) frames, otherwise frames can be dropped if sent when the hardware driver is already busy in transmitting. The queue needs to be controlled by the hardware driver's
netif_stop_queueandnetif_wake_queuecalls. Therefore, we need to use the device's qdisc TX queue for this purpose. However, currently outgoing LAPB (L2) frames are not queued.On the other hand, outgoing (L3) packets (before they are handed over to the LAPB module) don't need to be queued, because the LAPB module already has an internal queue for them, and is able to queue new outgoing (L3) packets at any time. However, currently outgoing (L3) packets are being queued in the device's qdisc TX queue, which is controlled by the hardware driver's
netif_stop_queueandnetif_wake_queuecalls. This is unnecessary and meaningless.To fix these issues, we can split the HDLC device into two devices - a virtual X.25 device and the actual HDLC device, use the virtual X.25 device to send (L3) packets and then use the actual HDLC device to queue LAPB (L2) frames. The outgoing (L2) LAPB queue will be controlled by the hardware driver's
netif_stop_queueandnetif_wake_queuecalls, while outgoing (L3) packets will not be affected by these calls.Cc Martin Schiller <[email protected]>Signed-off-by Xie He <[email protected]>---
<...>
drivers/net/wan/hdlc_x25.c static int x25_open(struct net_device *dev) · line 230
Quoted 13 lines
drivers/net/wan/hdlc_x25.c +13
-0+static void x25_setup_virtual_dev (struct net_device *dev) +{ + dev->netdev_ops = &hdlc_x25_netdev_ops; + dev->type =ARPHRD_X25 ; + dev->addr_len =0 ; + dev->hard_header_len =0 ; + dev->mtu =HDLC_MAX_MTU ; + +/* When transmitting data: +* first we'll remove a pseudo header of 1 byte, +* then the LAPB module will prepend an LAPB header of at most 3 bytes. +*/ + dev->needed_headroom =3 -1 ;
It is nice that you are resending your patch without the resolution. However it will be awesome if you don't ignore review comments and fix this "3 - 1" by writing solid comment above.
Thanks and good luck.
Quoted 4 lines · Leon Romanovsky
It is nice that you are resending your patch without the resolution. However it will be awesome if you don't ignore review comments and fix this "3 - 1" by writing solid comment above.
I thought you already agreed with me? It looks like you didn't?
I still don't think there is any problem with my current way.
I still don't understand your point. What problem do you think is there? Why is your way better than my way? I've already given multiple reasons about why my way is better than yours. But you didn't explain clearly why yours is better than mine.
Quoted 6 lines · Xie He
Quoted 4 lines · Leon Romanovsky
It is nice that you are resending your patch without the resolution. However it will be awesome if you don't ignore review comments and fix this "3 - 1" by writing solid comment above.
Quoted 8 lines
I thought you already agreed with me? It looks like you didn't?
I still don't think there is any problem with my current way.
I still don't understand your point. What problem do you think is there? Why is your way better than my way? I've already given multiple reasons about why my way is better than yours. But you didn't explain clearly why yours is better than mine.
It is not me who didn't explain, it is you who didn't want to write clear comment that describes the headroom size without need of "3 - 1".
So in current situation, you added two things: comment and assignment. Both of them aren't serve their goals. Your comment doesn't explain enough and needs extra help and your assignment is useless without comment.
Thanks
Quoted 3 lines · Leon Romanovsky
It is not me who didn't explain, it is you who didn't want to write clear comment that describes the headroom size without need of "3 - 1".
Why do I need to write unnecessary comments when "3 - 1" and the current comment already explains everything?
Quoted 2 lines
So in current situation, you added two things: comment and assignment. Both of them aren't serve their goals.
Why?
Quoted 2 lines
Your comment doesn't explain
enough and needs extra help
Why? My comment already explains everything.
Quoted 2 lines
and your assignment is useless without
comment.
My assignment is already very clear with my current comment. My comment explains very clearly what this assignment means.
Quoted 7 lines · Xie He
Quoted 3 lines · Leon Romanovsky
It is not me who didn't explain, it is you who didn't want to write clear comment that describes the headroom size without need of "3 - 1".
Why do I need to write unnecessary comments when "3 - 1" and the current comment already explains everything?
This is how we write code, we use defines instead of constant numbers, comments to describe tricky parts and assign already preprocessed result.
There is nothing I can do If you don't like or don't want to use Linux kernel style.
Thanks
Quoted 6 lines · Leon Romanovsky
This is how we write code, we use defines instead of constant numbers, comments to describe tricky parts and assign already preprocessed result.
There is nothing I can do If you don't like or don't want to use Linux kernel style.
So what is your suggestion exactly? Use defines or write comments?
As I understand, you want to replace the "3 - 1" with "2", and then write comments to explain that this "2" is the result of "3 - 1".
Why do you want to do this? You are doing useless things and you force readers of this code to think about useless things.
You said this was "Linux kernel style"? Why? Which sentence of the Linux kernel style guide suggests your way is better than my way?
Quoted 11 lines · Xie He
Quoted 6 lines · Leon Romanovsky
This is how we write code, we use defines instead of constant numbers, comments to describe tricky parts and assign already preprocessed result.
There is nothing I can do If you don't like or don't want to use Linux kernel style.
So what is your suggestion exactly? Use defines or write comments?
Quoted 8 lines
As I understand, you want to replace the "3 - 1" with "2", and then write comments to explain that this "2" is the result of "3 - 1".
Why do you want to do this? You are doing useless things and you force readers of this code to think about useless things.
You said this was "Linux kernel style"? Why? Which sentence of the Linux kernel style guide suggests your way is better than my way?
Nevermind, if you *really* want me to replace this "3 - 1" with "2" and explain in the comment that the "2" is a result of "3 - 1". I'll do this. I admit this is a style issue. So it is hard to argue and reach an agreement. Just reply with a request and I'll make the change. However I'm not able to agree with you in my heart.
Quoted 19 lines · Xie He
Quoted 6 lines · Leon Romanovsky
This is how we write code, we use defines instead of constant numbers, comments to describe tricky parts and assign already preprocessed result.
There is nothing I can do If you don't like or don't want to use Linux kernel style.
So what is your suggestion exactly? Use defines or write comments?
As I understand, you want to replace the "3 - 1" with "2", and then write comments to explain that this "2" is the result of "3 - 1".
Why do you want to do this? You are doing useless things and you force readers of this code to think about useless things.
You said this was "Linux kernel style"? Why? Which sentence of the Linux kernel style guide suggests your way is better than my way?
Jakub Kicinski
maintainerQuoted 18 lines · On Thu, 18 Feb 2021 12:23:28 -0800 Xie He wrote:
Quoted 17 lines · Xie He
Quoted 6 lines · Leon Romanovsky
This is how we write code, we use defines instead of constant numbers, comments to describe tricky parts and assign already preprocessed result.
There is nothing I can do If you don't like or don't want to use Linux kernel style.
So what is your suggestion exactly? Use defines or write comments?
As I understand, you want to replace the "3 - 1" with "2", and then write comments to explain that this "2" is the result of "3 - 1".
Why do you want to do this? You are doing useless things and you force readers of this code to think about useless things.
Quoted 8 lines
Quoted 2 lines
You said this was "Linux kernel style"? Why? Which sentence of the Linux kernel style guide suggests your way is better than my way?
Nevermind, if you *really* want me to replace this "3 - 1" with "2" and explain in the comment that the "2" is a result of "3 - 1". I'll do this. I admit this is a style issue. So it is hard to argue and reach an agreement. Just reply with a request and I'll make the change. However I'm not able to agree with you in my heart.
Not entirely sure what the argument is about but adding constants would certainly help.
More fundamentally IDK if we can make such a fundamental change here. When users upgrade from older kernel are all their scripts going to work the same? Won't they have to bring the new netdev up?
Quoted 3 lines · Jakub Kicinski
Not entirely sure what the argument is about but adding constants would certainly help.
Leon wants me to replace this:
dev->needed_headroom = 3 - 1;
with this:
/* 2 is the result of 3 - 1 */dev->needed_headroom = 2;
But I don't feel his way is better than my way.
Quoted 3 lines
More fundamentally IDK if we can make such a fundamental change here. When users upgrade from older kernel are all their scripts going to work the same? Won't they have to bring the new netdev up?
Yes, this patch will break backward compatibility. Users with old scripts will find them no longer working.
However, it's hard for me to find a better way to solve the problem described in the commit message.
So I sent this as an RFC to see what people think about this. (Martin Schiller seems to be OK with this.)
I think users who don't use scripts can adapt quickly and users who use scripts can also trivally fix their scripts.
Actually many existing commits in the kernel also (more or less) cause some user-visible changes. But I admit this patch is a really big change.
Quoted 11 lines · Xie He
Quoted 3 lines · Jakub Kicinski
Not entirely sure what the argument is about but adding constants would certainly help.
Leon wants me to replace this:
dev->needed_headroom= 3 - 1;with this:
Leon wants this line to be written good enough:
Quoted 1 line
/* 2 is the result of 3 - 1 */
And this line like you wrote here:
Quoted 1 line
dev->needed_headroom= 2;
<...>
Quoted 2 lines
Yes, this patch will break backward compatibility. Users with old scripts will find them no longer working.
Did you search in debian/fedora code repositories to see if such scripts exist as part of any distro package?
Thanks
Quoted 6 lines · Leon Romanovsky
Quoted 3 lines
Yes, this patch will break backward compatibility. Users with old scripts will find them no longer working.
Did you search in debian/fedora code repositories to see if such scripts exist as part of any distro package?
I just tried to search in Debian and Fedora packages but didn't seem to find anything related.
I searched "hdlc" and "x25". The only things I can find are "AX.25" related things. But "AX.25" is not related to "X.25".
I guess a script that brings a network interface up might not be very useful? So we might not be able to find it in public repositories.
Martin Schiller
maintainerQuoted 20 lines · Xie He
Quoted 3 lines · Jakub Kicinski
Not entirely sure what the argument is about but adding constants would certainly help.
Leon wants me to replace this:
dev->needed_headroom= 3 - 1;with this:
/* 2 is the result of 3 - 1 */
dev->needed_headroom= 2;But I don't feel his way is better than my way.
Quoted 3 lines
More fundamentally IDK if we can make such a fundamental change here. When users upgrade from older kernel are all their scripts going to work the same? Won't they have to bring the new netdev up?
Quoted 8 lines
Yes, this patch will break backward compatibility. Users with old scripts will find them no longer working.
However, it's hard for me to find a better way to solve the problem described in the commit message.
So I sent this as an RFC to see what people think about this. (Martin Schiller seems to be OK with this.)
Well, I said I would like to test it.
I'm not really happy with this change because it breaks compatibility. We then suddenly have 2 interfaces; the X.25 routings are to be set via the "new" hdlc<x>_x25 interfaces instead of the hdlc<x> interfaces.
I currently just don't have a nicer solution to fix this queueing problem either. On the other hand, since the many years we have been using the current state, I have never noticed any problems with discarded frames. So it might be more a theoretical problem than a practical one.
Quoted 7 lines
I think users who don't use scripts can adapt quickly and users who use scripts can also trivally fix their scripts.
Actually many existing commits in the kernel also (more or less) cause some user-visible changes. But I admit this patch is a really big change.
Quoted 10 lines · Martin Schiller
I'm not really happy with this change because it breaks compatibility. We then suddenly have 2 interfaces; the X.25 routings are to be set via the "new" hdlc<x>_x25 interfaces instead of the hdlc<x> interfaces.
I currently just don't have a nicer solution to fix this queueing problem either. On the other hand, since the many years we have been using the current state, I have never noticed any problems with discarded frames. So it might be more a theoretical problem than a practical one.
This problem becomes very serious when we use AF_PACKET sockets, because the majority of frames would be dropped by the hardware driver, which significantly impacts transmission speed. What I am really doing is to enable adequate support for AF_PACKET sockets, allowing users to use the bare (raw) LAPB protocol. If we take this into consideration, this problem is no longer just a theoretical problem, but a real practical issue.
If we don't want to break backward compatibility, there is another option:
We can create a new API for the HDLC subsystem for stopping/restarting the TX queue, and replace all HDLC hardware drivers' netif_stop_queue and netif_wake_queue calls with calls to this new API. This new API would then call hdlc_x25 to stop/restart its internal queue.
But this option would require modifying all HDLC hardware drivers' code, and frankly, not all HDLC hardware drivers' developers care about running X.25 protocols on their hardware. So this would cause both hardware driver instabilities and confusion for hardware driver developers.
Martin Schiller
maintainerQuoted 12 lines · Xie He
Quoted 10 lines · Martin Schiller
I'm not really happy with this change because it breaks compatibility. We then suddenly have 2 interfaces; the X.25 routings are to be set via the "new" hdlc<x>_x25 interfaces instead of the hdlc<x> interfaces.
I currently just don't have a nicer solution to fix this queueing problem either. On the other hand, since the many years we have been using the current state, I have never noticed any problems with discarded frames. So it might be more a theoretical problem than a practical one.
Quoted 7 lines
This problem becomes very serious when we use
AF_PACKETsockets, because the majority of frames would be dropped by the hardware driver, which significantly impacts transmission speed. What I am really doing is to enable adequate support forAF_PACKETsockets, allowing users to use the bare (raw) LAPB protocol. If we take this into consideration, this problem is no longer just a theoretical problem, but a real practical issue.
I have now had a look at it. It works as expected.
I just wonder if it would not be more appropriate to call the lapb_register() already in x25_hdlc_open(), so that the layer2 (lapb) can already "work" before the hdlc<x>_x25 interface is up.
Also, I have a hard time assessing if such a wrap is really enforceable. Unfortunately I have no idea how many users there actually are.
Quoted 12 lines
If we don't want to break backward compatibility, there is another option:
We can create a new API for the HDLC subsystem for stopping/restarting the TX queue, and replace all HDLC hardware drivers'netif_stop_queueandnetif_wake_queuecalls with calls to this new API. This new API would then callhdlc_x25to stop/restart its internal queue.But this option would require modifying all HDLC hardware drivers' code, and frankly, not all HDLC hardware drivers' developers care about running X.25 protocols on their hardware. So this would cause both hardware driver instabilities and confusion for hardware driver developers.
Quoted 5 lines · Martin Schiller
I have now had a look at it. It works as expected.
I just wonder if it would not be more appropriate to call thelapb_register()already inx25_hdlc_open(), so that the layer2 (lapb) can already "work" before the hdlc<x>_x25 interface is up.
I think it's better not to keep LAPB running unless hdlc<x>_x25 is up. If I am the user, I would expect that when I change the X.25 interface to the DOWN state, the LAPB protocol would be completely stopped and the LAPB layer would not generate any new frames anymore (even if the other side wants to connect), and when I change the X.25 interface back to the UP state, it would be a fresh new start for the LAPB protocol.
Quoted 1 line
Also, I have a hard time assessing if such a wrap is really enforceable.
Sorry. I don't understand what you mean. What "wrap" are you referring to?
Quoted 1 line
Unfortunately I have no idea how many users there actually are.
Martin Schiller
maintainerQuoted 15 lines · Xie He
Quoted 5 lines · Martin Schiller
I have now had a look at it. It works as expected.
I just wonder if it would not be more appropriate to call thelapb_register()already inx25_hdlc_open(), so that the layer2 (lapb) can already "work" before the hdlc<x>_x25 interface is up.I think it's better not to keep LAPB running unless hdlc<x>_x25 is up. If I am the user, I would expect that when I change the X.25 interface to the DOWN state, the LAPB protocol would be completely stopped and the LAPB layer would not generate any new frames anymore (even if the other side wants to connect), and when I change the X.25 interface back to the UP state, it would be a fresh new start for the LAPB protocol.
Quoted 3 lines
Quoted 1 line
Also, I have a hard time assessing if such a wrap is really enforceable.
Sorry. I don't understand what you mean. What "wrap" are you referring to?
I mean the change from only one hdlc<x> interface to both hdlc<x> and hdlc<x>_x25.
I can't estimate how many users are out there and how their setup looks like.
Quoted 2 lines
Quoted 2 lines
Unfortunately I have no idea how many users there actually are.
Quoted 4 lines · Martin Schiller
Quoted 4 lines
Quoted 3 lines
Also, I have a hard time assessing if such a wrap is really enforceable.
Quoted 8 lines
Quoted 2 lines
Sorry. I don't understand what you mean. What "wrap" are you referring to?
I mean the change from only one hdlc<x> interface to both hdlc<x> and hdlc<x>_x25.
I can't estimate how many users are out there and how their setup looks like.
I'm also thinking about solving this issue by adding new APIs to the HDLC subsystem (hdlc_stop_queue / hdlc_wake_queue) for hardware drivers to call instead of netif_stop_queue / netif_wake_queue. This way we can preserve backward compatibility.
However I'm reluctant to change the code of all the hardware drivers because I'm afraid of introducing bugs, etc. When I look at the code of "wan/lmc/lmc_main.c", I feel I'm not able to make sure there are no bugs (related to stop_queue / wake_queue) after my change (and even before my change, actually). There are even serious style problems:
the majority of its lines are indented by spaces.
So I don't want to mess with all the hardware drivers. Hardware driver developers (if they wish to properly support hdlc_x25) should do the change themselves. This is not a problem for me, because I use my own out-of-tree hardware driver. However if I add APIs with no user code in the kernel, other developers may think these APIs are not necessary.
Martin Schiller
maintainerQuoted 26 lines · Xie He
Quoted 4 lines · Martin Schiller
Quoted 4 lines
Quoted 3 lines
Also, I have a hard time assessing if such a wrap is really enforceable.
Quoted 8 lines
Quoted 2 lines
Sorry. I don't understand what you mean. What "wrap" are you referring to?
I mean the change from only one hdlc<x> interface to both hdlc<x> and hdlc<x>_x25.
I can't estimate how many users are out there and how their setup looks like.
I'm also thinking about solving this issue by adding new APIs to the HDLC subsystem (
hdlc_stop_queue/hdlc_wake_queue) for hardware drivers to call instead ofnetif_stop_queue/netif_wake_queue. This way we can preserve backward compatibility.However I'm reluctant to change the code of all the hardware drivers because I'm afraid of introducing bugs, etc. When I look at the code of "
wan/lmc/lmc_main.c", I feel I'm not able to make sure there are no bugs (related tostop_queue/wake_queue) after my change (and even before my change, actually). There are even serious style problems:
the majority of its lines are indented by spaces.
Quoted 6 lines
So I don't want to mess with all the hardware drivers. Hardware driver developers (if they wish to properly support
hdlc_x25) should do the change themselves. This is not a problem for me, because I use my own out-of-tree hardware driver. However if I add APIs with no user code in the kernel, other developers may think these APIs are not necessary.
I don't think a change that affects the entire HDLC subsystem is justified, since the actual problem only affects the hdlc_x25 area.
The approach with the additional hdlc<x>_x25 is clean and purposeful and I personally could live with it.
I just don't see myself in the position to decide such a change at the moment.
@Jakub: What is your opinion on this.
Jakub Kicinski
maintainerQuoted 31 lines · On Tue, 02 Mar 2021 08:04:20 +0100 Martin Schiller wrote:
Quoted 20 lines · Xie He
Quoted 6 lines · Martin Schiller
I mean the change from only one hdlc<x> interface to both hdlc<x> and hdlc<x>_x25.
I can't estimate how many users are out there and how their setup looks
like.I'm also thinking about solving this issue by adding new APIs to the HDLC subsystem (
hdlc_stop_queue/hdlc_wake_queue) for hardware drivers to call instead ofnetif_stop_queue/netif_wake_queue. This way we can preserve backward compatibility.However I'm reluctant to change the code of all the hardware drivers because I'm afraid of introducing bugs, etc. When I look at the code of "
wan/lmc/lmc_main.c", I feel I'm not able to make sure there are no bugs (related tostop_queue/wake_queue) after my change (and even before my change, actually). There are even serious style problems:
the majority of its lines are indented by spaces.Quoted 6 lines
So I don't want to mess with all the hardware drivers. Hardware driver developers (if they wish to properly support
hdlc_x25) should do the change themselves. This is not a problem for me, because I use my own out-of-tree hardware driver. However if I add APIs with no user code in the kernel, other developers may think these APIs are not necessary.I don't think a change that affects the entire HDLC subsystem is justified, since the actual problem only affects the
hdlc_x25area.
Quoted 7 lines
The approach with the additional hdlc<x>_x25 is clean and purposeful and I personally could live with it.
I just don't see myself in the position to decide such a change at the moment.
@Jakub: What is your opinion on this.
Hard question to answer, existing users seem happy and Xie's driver isn't upstream, so the justification for potentially breaking backward compatibility isn't exactly "strong".
Can we cop out and add a knob somewhere to control spawning the extra netdev? Let people who just want a newer kernel carry on without distractions and those who want the extra layer can flip the switch?
Martin Schiller
maintainerQuoted 40 lines · Jakub Kicinski
Quoted 31 lines · On Tue, 02 Mar 2021 08:04:20 +0100 Martin Schiller wrote:
Quoted 20 lines · Xie He
Quoted 6 lines · Martin Schiller
I mean the change from only one hdlc<x> interface to both hdlc<x> and hdlc<x>_x25.
I can't estimate how many users are out there and how their setup looks
like.I'm also thinking about solving this issue by adding new APIs to the HDLC subsystem (
hdlc_stop_queue/hdlc_wake_queue) for hardware drivers to call instead ofnetif_stop_queue/netif_wake_queue. This way we can preserve backward compatibility.However I'm reluctant to change the code of all the hardware drivers because I'm afraid of introducing bugs, etc. When I look at the code of "
wan/lmc/lmc_main.c", I feel I'm not able to make sure there are no bugs (related tostop_queue/wake_queue) after my change (and even before my change, actually). There are even serious style problems:
the majority of its lines are indented by spaces.Quoted 6 lines
So I don't want to mess with all the hardware drivers. Hardware driver developers (if they wish to properly support
hdlc_x25) should do the change themselves. This is not a problem for me, because I use my own out-of-tree hardware driver. However if I add APIs with no user code in the kernel, other developers may think these APIs are not necessary.I don't think a change that affects the entire HDLC subsystem is justified, since the actual problem only affects the
hdlc_x25area.Quoted 7 lines
The approach with the additional hdlc<x>_x25 is clean and purposeful and I personally could live with it.
I just don't see myself in the position to decide such a change at the moment.
@Jakub: What is your opinion on this.
Quoted 7 lines
Hard question to answer, existing users seem happy and Xie's driver isn't upstream, so the justification for potentially breaking backward compatibility isn't exactly "strong".
Can we cop out and add a knob somewhere to control spawning the extra netdev? Let people who just want a newer kernel carry on without distractions and those who want the extra layer can flip the switch?
Yes, that would be a good compromise.
I think a compile time selection option is enough here.
We could introduce a new config option CONFIG_HDLC_X25_LEGACY (or something like that) and then implement the new or the old behavior in the driver accordingly.
A switch that can be toggled at runtime (e.g. via sethdlc) would also be conceivable, but I don't think this is necessary.
Quoted 11 lines · Martin Schiller
Quoted 8 lines · Jakub Kicinski
Hard question to answer, existing users seem happy and Xie's driver isn't upstream, so the justification for potentially breaking backward compatibility isn't exactly "strong".
Can we cop out and add a knob somewhere to control spawning the extra netdev? Let people who just want a newer kernel carry on without distractions and those who want the extra layer can flip the switch?
Quoted 8 lines
Yes, that would be a good compromise.
I think a compile time selection option is enough here.
We could introduce a new config optionCONFIG_HDLC_X25_LEGACY(or something like that) and then implement the new or the old behavior in the driver accordingly.A switch that can be toggled at runtime (e.g. via sethdlc) would also be conceivable, but I don't think this is necessary.
Yes, I think adding a new config option would be a good way. Thank you both!!