Re: [PATCH net-next v7 2/5] net/lapb: support netdev events

2020-11-26 Thread Xie He
Acked-by: Xie He

Re: [PATCH net-next v6 2/5] net/lapb: support netdev events

2020-11-25 Thread Xie He
Hi Martin, Since we are going to assume lapb->state would remain in LAPB_STATE_0 when the carrier is down (as understood by me. Right?), could we add a check in lapb_connect_request to reject the upper layer's "connect" instruction when the carrier is down? Like this: diff --git a/include/linux/l

Re: [PATCH net-next v6 2/5] net/lapb: support netdev events

2020-11-24 Thread Xie He
ATE_1 and start > sending SABM(E). > > Signed-off-by: Martin Schiller Acked-by: Xie He Thanks!

Re: [PATCH net-next v4 2/5] net/lapb: support netdev events

2020-11-23 Thread Xie He
On Mon, Nov 23, 2020 at 11:36 AM Jakub Kicinski wrote: > > > > From this point of view it will be the best to handle the NETDEV_UP in > > > the lapb event handler and establish the link analog to the > > > NETDEV_CHANGE event if the carrier is UP. > > > > Thanks! This way we can make sure LAPB wo

Re: [PATCH net-next v4 2/5] net/lapb: support netdev events

2020-11-23 Thread Xie He
On Mon, Nov 23, 2020 at 2:38 AM Martin Schiller wrote: > > Well, one could argue that we would have to repair these drivers, but I > don't think that will get us anywhere. Yeah... One problem I see with the Linux project is the lack of docs/specs. Often we don't know what is right and what is wro

Re: [PATCH net-next v4 2/5] net/lapb: support netdev events

2020-11-23 Thread Xie He
On Mon, Nov 23, 2020 at 1:36 AM Xie He wrote: > > Some drivers don't support carrier status and will never change it. > Their carrier status will always be UP. There will not be a > NETDEV_CHANGE event. > > lapbether doesn't change carrier status. I also have my own vi

Re: [PATCH net-next v4 2/5] net/lapb: support netdev events

2020-11-23 Thread Xie He
On Mon, Nov 23, 2020 at 1:00 AM Martin Schiller wrote: > > AFAIK the carrier can't be up before the device is up. Therefore, there > will be a NETDEV_CHANGE event after the NETDEV_UP event. > > This is what I can see in my tests (with the HDLC interface). > > Is the behaviour different for e.g. la

Re: [PATCH net-next v4 2/5] net/lapb: support netdev events

2020-11-23 Thread Xie He
On Sun, Nov 22, 2020 at 10:55 PM Martin Schiller wrote: > > No, they aren't independent. The carrier can only be up if the device / > interface is UP. And as far as I can see a NETDEV_CHANGE event will also > only be generated on interfaces that are UP. > > So you can be sure, that if there is a N

Re: [PATCH net-next v4 2/5] net/lapb: support netdev events

2020-11-20 Thread Xie He
On Fri, Nov 20, 2020 at 3:11 PM Xie He wrote: > > Should we also handle the NETDEV_UP event here? In previous versions > of this patch series you seemed to want to establish the L2 connection > on device-up. But in this patch, you didn't handle NETDEV_UP. > > Maybe on devi

Re: [PATCH net-next v4 2/5] net/lapb: support netdev events

2020-11-20 Thread Xie He
Should we also handle the NETDEV_UP event here? In previous versions of this patch series you seemed to want to establish the L2 connection on device-up. But in this patch, you didn't handle NETDEV_UP. Maybe on device-up, we need to check if the carrier is up, and if it is, we do the same thing as

Re: [PATCH net-next v4 0/5] net/x25: netdev event handling

2020-11-20 Thread Xie He
On Thu, Nov 19, 2020 at 9:40 PM Martin Schiller wrote: > > Changes to v3: > o another complete rework of the patch-set to split event handling > for layer2 (LAPB) and layer3 (X.25) Thanks for your work!!

Re: [PATCH net-next v3 0/6] net/x25: netdev event handling

2020-11-19 Thread Xie He
On Wed, Nov 18, 2020 at 11:02 PM Martin Schiller wrote: > > On 2020-11-18 15:47, Xie He wrote: > > > > But... Won't it be better to handle L2 connections in L2 code? > > > > For example, if we are running X.25 over XOT, we can decide in the XOT > > layer

Re: [PATCH net-next v3 0/6] net/x25: netdev event handling

2020-11-18 Thread Xie He
On Wed, Nov 18, 2020 at 5:59 AM Martin Schiller wrote: > > --- > Changes to v2: > o restructure complete patch-set > o keep netdev event handling in layer3 (X.25) But... Won't it be better to handle L2 connections in L2 code? For example, if we are running X.25 over XOT, we can decide in the XOT

Re: [PATCH net-next v2 5/6] net/lapb: support netdev events

2020-11-18 Thread Xie He
On Wed, Nov 18, 2020 at 5:03 AM Xie He wrote: > > On Wed, Nov 18, 2020 at 12:49 AM Martin Schiller wrote: > > > > I also have a patch here that implements an "on demand" link feature, > > which we used for ISDN dialing connections. > > As ISDN is de facto

Re: [PATCH net-next v2 5/6] net/lapb: support netdev events

2020-11-18 Thread Xie He
On Wed, Nov 18, 2020 at 12:49 AM Martin Schiller wrote: > > Ah, ok. Now I see what you mean. > Yes, we should check the lapb->mode in lapb_connect_request(). ... > I also have a patch here that implements an "on demand" link feature, > which we used for ISDN dialing connections. > As ISDN is de fa

Re: linux-next: build warning after merge of the net-next tree

2020-11-18 Thread Xie He
On Tue, Nov 17, 2020 at 9:20 PM Stephen Rothwell wrote: > > After merging the net-next tree, today's linux-next build (htmldocs) > produced this warning: > > Documentation/networking/index.rst:6: WARNING: toctree contains reference to > nonexisting document 'networking/framerelay' > > Introduced

[PATCH net-next] Documentation: Remove the deleted "framerelay" document from the index

2020-11-18 Thread Xie He
commit f73659192b0b ("net: wan: Delete the DLCI / SDLA drivers") deleted "Documentation/networking/framerelay.rst". However, it is still referenced in "Documentation/networking/index.rst". We need to remove the reference, too. Reported-by: Stephen R

Re: [PATCH net-next v2 3/6] net/x25: replace x25_kill_by_device with x25_kill_by_neigh

2020-11-17 Thread Xie He
On Mon, Nov 16, 2020 at 6:00 AM Martin Schiller wrote: > > Remove unnecessary function x25_kill_by_device. > -/* > - * Kill all bound sockets on a dropped device. > - */ > -static void x25_kill_by_device(struct net_device *dev) > -{ > - struct sock *s; > - > - write_lock_bh(&x25_l

Re: [PATCH net-next v2 5/6] net/lapb: support netdev events

2020-11-17 Thread Xie He
On Tue, Nov 17, 2020 at 5:26 AM Martin Schiller wrote: > > On 2020-11-17 12:32, Xie He wrote: > > > > I think for a DCE, it doesn't need to initiate the L2 > > connection on device-up. It just needs to wait for a connection to > > come. But L3 seems to be stil

Re: [PATCH net-next v2 4/6] net/x25: support NETDEV_CHANGE notifier

2020-11-17 Thread Xie He
On Mon, Nov 16, 2020 at 6:00 AM Martin Schiller wrote: > > This makes it possible to handle carrier lost and detection. > In case of carrier lost, we shutdown layer 3 and flush all sessions. > > @@ -275,6 +275,19 @@ static int x25_device_event(struct notifier_block *this, > unsigned long event, >

Re: [PATCH net-next v2 5/6] net/lapb: support netdev events

2020-11-17 Thread Xie He
On Tue, Nov 17, 2020 at 1:53 AM Martin Schiller wrote: > > On 2020-11-16 21:16, Xie He wrote: > > Do you mean we will now automatically establish LAPB connections > > without upper layers instructing us to do so? > > Yes, as soon as the physical link is established, the L2

Re: [PATCH net-next v2 5/6] net/lapb: support netdev events

2020-11-16 Thread Xie He
On Mon, Nov 16, 2020 at 6:01 AM Martin Schiller wrote: > > This makes it possible to handle carrier loss and detection. > In case of Carrier Loss, layer 2 is terminated > In case of Carrier Detection, we start timer t1 on a DCE interface, > and on a DTE interface we change to state LAPB_STATE_1 an

Re: [PATCH net-next] MAINTAINERS: Add Martin Schiller as a maintainer for the X.25 stack

2020-11-16 Thread Xie He
On Sat, Nov 14, 2020 at 3:10 AM Xie He wrote: > > Martin Schiller is an active developer and reviewer for the X.25 code. > His company is providing products based on the Linux X.25 stack. > So he is a good candidate for maintainers of the X.25 code. Hi Martin, Could you ack to i

Re: [PATCH 1/6] net/x25: add/remove x25_link_device by NETDEV_REGISTER/UNREGISTER

2020-11-16 Thread Xie He
Hi Martin, Thanks for the series. To get the series applied faster, could you address the warnings and failures shown on this page? https://patchwork.kernel.org/project/netdevbpf/list/?submitter=174539 Thanks! To let the netdev robot know which tree this series should be applied, we can use [PATC

Re: [PATCH net] net: x25: Correct locking for x25_kill_by_device and x25_kill_by_neigh

2020-11-14 Thread Xie He
On Sat, Nov 14, 2020 at 2:36 AM Xie He wrote: > > This patch adds correct locking for x25_kill_by_device and > x25_kill_by_neigh, and removes the incorrect locking in x25_connect and > x25_disconnect. I see if I do this change, I need to make sure the sock lock is not held

[PATCH net-next RFC] net: wan: Delete the DLCI / SDLA drivers

2020-11-14 Thread Xie He
vided WANPIPE driver instead. (The WANPIPE driver was even once in the kernel, but was deleted in commit 8db60bcf3021 ("[WAN]: Remove broken and unmaintained Sangoma drivers.") because the vendor no longer updated the in-kernel WANPIPE driver.) Cc: Mike McLagan Signed-off-by: Xie H

[PATCH net-next] MAINTAINERS: Add Martin Schiller as a maintainer for the X.25 stack

2020-11-14 Thread Xie He
netdev mail list since 2013. So he is probably inactive now. Cc: Martin Schiller Cc: Andrew Hendry Signed-off-by: Xie He --- MAINTAINERS | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index af9f6a3ab100..ab8b2c9ad00e 100644 --- a

[PATCH net] net: x25: Correct locking for x25_kill_by_device and x25_kill_by_neigh

2020-11-14 Thread Xie He
in x25_device_event()") Cc: Martin Schiller Signed-off-by: Xie He --- net/x25/af_x25.c | 12 net/x25/x25_subr.c | 2 -- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c index a10487e7574c..50f043f0c1d0 100644 --- a/net/x2

Re: linux-x25 mail list not working

2020-11-13 Thread Xie He
On Thu, Nov 12, 2020 at 9:28 PM Martin Schiller wrote: > > On 2020-11-13 03:17, John 'Warthog9' Hawley wrote: > > Give it a try now, there was a little wonkiness with the alias setup > > for it, and I have no historical context for a 'why', but I adjusted a > > couple of things and I was able to s

[PATCH net-next RFC v2] MAINTAINERS: Add Martin Schiller as a maintainer for the X.25 stack

2020-11-12 Thread Xie He
netdev mail list since 2013. So he is probably inactive now. Cc: Martin Schiller Cc: Andrew Hendry Signed-off-by: Xie He --- MAINTAINERS | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 2a0fde12b650..5adb78cb0d92 100644 --- a

linux-x25 mail list not working

2020-11-12 Thread Xie He
e the last email in the archive was in 2009. It's likely that this mail list has stopped working since 2009. Can you please help fix this mail list. Thanks! Xie He

[PATCH net v2] net: x25: Increase refcnt of "struct x25_neigh" in x25_rx_call_request

2020-11-12 Thread Xie He
en it assigns the pointer. Fix this issue by increasing the refcount of "struct x25_neigh" in x25_rx_call_request. This patch fixes frequent kernel crashes when using AF_X25 sockets. Fixes: 4becb7ee5b3d ("net/x25: Fix x25_neigh refcnt leak when x25 disconnect") Cc: Marti

[PATCH net] net: x25: Increase refcnt of "struct x25_neigh" in x25_rx_call_request

2020-11-12 Thread Xie He
count when it assigns the pointer. Fix this issue by increasing the refcount of "struct x25_neigh" in x25_rx_call_request. This patch fixes frequent kernel crashes when using AF_X25 sockets. Fixes: 4becb7ee5b3d ("net/x25: Fix x25_neigh refcnt leak when x25 disconnect") Cc: Marti

Re: [PATCH net-next RFC] MAINTAINERS: Add Martin Schiller as a maintainer for the X.25 stack

2020-11-12 Thread Xie He
On Wed, Nov 11, 2020 at 11:06 PM Martin Schiller wrote: > > About 1 year ago I was asked by Arnd Bergmann if I would like to become > the maintainer for the X.25 stack: > > https://patchwork.ozlabs.org/project/netdev/patch/20191209151256.2497534-4-a...@arndb.de/#2320767 > > Yes, I would agree to b

[PATCH net-next RFC] MAINTAINERS: Add Martin Schiller as a maintainer for the X.25 stack

2020-11-11 Thread Xie He
ndrew Hendry) has stopped sending emails to the netdev mail list since 2013. So there is practically no maintainer for X.25 code currently. Cc: Martin Schiller Cc: Andrew Hendry Signed-off-by: Xie He --- MAINTAINERS | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff

Re: [PATCH net] net: x25: Fix kernel crashes due to x25_disconnect releasing x25_neigh

2020-11-11 Thread Xie He
On Wed, Nov 11, 2020 at 3:41 AM Martin Schiller wrote: > > > 1) When we receive a connection, the x25_rx_call_request function in > > af_x25.c does not increase the refcount when it assigns the pointer. > > When we disconnect, x25_disconnect is called and the struct's refcount > > is decreased wit

Re: [RESEND PATCH v2] net/x25: Fix null-ptr-deref in x25_connect

2020-11-11 Thread Xie He
t_lock); > x25_neigh_put(x25->neighbour); > x25->neighbour = NULL; Thanks! It's amazing to see we are trying to fix the same issue. Reviewed-by: Xie He

Re: [RESEND PATCH v2] net/x25: Fix null-ptr-deref in x25_connect

2020-11-11 Thread Xie He
> This fixes a regression for blocking connects introduced by commit > 4becb7ee5b3d ("net/x25: Fix x25_neigh refcnt leak when x25 disconnect"). > The x25->neighbour is already set to "NULL" by x25_disconnect() now, > while a blocking connect is waiting in > x25_wait_for_connection_establishment().

[PATCH net] net: x25: Fix kernel crashes due to x25_disconnect releasing x25_neigh

2020-11-11 Thread Xie He
kernel every time a connection is refused by the remote side. Fixes: 4becb7ee5b3d ("net/x25: Fix x25_neigh refcnt leak when x25 disconnect") Cc: Martin Schiller Signed-off-by: Xie He --- net/x25/af_x25.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git

Re: [PATCH net-next] net: dlci: Deprecate the DLCI driver (aka the Frame Relay layer)

2020-11-07 Thread Xie He
On Sat, Oct 31, 2020 at 3:04 PM Jakub Kicinski wrote: > > On Sat, 31 Oct 2020 22:41:30 +0100 Arnd Bergmann wrote: > > > > I think it can just go in the bin directly. > > Ack, fine by me. > > > I actually submitted a couple of patches to clean up drivers/net/wan > > last year but didn't follow up w

Re: [PATCH net-next v7 0/5] net: hdlc_fr: Improve fr_rx and add support for any Ethertype

2020-11-07 Thread Xie He
On Tue, Nov 3, 2020 at 6:03 PM Xie He wrote: > > On Tue, Nov 3, 2020 at 3:22 PM Jakub Kicinski wrote: > > > > Applied, but going forward please limit any refactoring and extensions > > to the HDLC code. I thought you are actually using it. If that's not > > the

Re: [PATCH net-next] net: x25_asy: Delete the x25_asy driver

2020-11-06 Thread Xie He
On Fri, Nov 6, 2020 at 1:03 AM David Laight wrote: > > Hmmm LAPB would expect to have an X.25 level 3 and maybe ISO > transport (class 0, 2 or 3) sat on top of it. I actually used AF_PACKET sockets to transport data directly over LAPB and it worked. LAPB doesn't need anything from layer 3. I

Re: [PATCH net-next] net: x25_asy: Delete the x25_asy driver

2020-11-05 Thread Xie He
On Thu, Nov 5, 2020 at 12:40 PM Arnd Bergmann wrote: > > > I think this driver never worked. Looking at the original code in > > Linux 2.1.31, it already has the problems I fixed in commit > > 8fdcabeac398. > > > > I guess when people (or bots) say they "tested", they have not > > necessarily used

Re: [PATCH net-next] net: x25_asy: Delete the x25_asy driver

2020-11-05 Thread Xie He
On Thu, Nov 5, 2020 at 7:07 AM Arnd Bergmann wrote: > > Adding Martin Schiller and Andrew Hendry, plus the linux-x25 mailing > list to Cc. The linux-x25 mail list has stopped working for a long time. > When I last looked at the wan drivers, I think I concluded > that this should still be kept ar

Re: [PATCH net-next] net: x25_asy: Delete the x25_asy driver

2020-11-05 Thread Xie He
On Thu, Nov 5, 2020 at 1:10 AM David Laight wrote: > > > This driver transports LAPB (X.25 link layer) frames over TTY links. > > I don't remember any requests to run LAPB over anything other > than synchronous links when I was writing LAPB implementation(s) > back in the mid 1980's. > > If you ne

[PATCH net-next] net: x25_asy: Delete the x25_asy driver

2020-11-04 Thread Xie He
completely received. And there may also be other problems. I was planning to fix these problems but after recent discussions about deleting other old networking code, I think we may just delete this driver, too. Signed-off-by: Xie He --- Documentation/process/magic-number.rst| 1 -

Re: [PATCH net-next v7 0/5] net: hdlc_fr: Improve fr_rx and add support for any Ethertype

2020-11-03 Thread Xie He
On Tue, Nov 3, 2020 at 3:22 PM Jakub Kicinski wrote: > > Applied, but going forward please limit any refactoring and extensions > to the HDLC code. I thought you are actually using it. If that's not > the case let's leave the code be, it's likely going to be removed in > a few years time. OK. I u

Re: [PATCH net-next] net: dlci: Deprecate the DLCI driver (aka the Frame Relay layer)

2020-10-31 Thread Xie He
On Sat, Oct 31, 2020 at 2:41 PM Arnd Bergmann wrote: > > I think it can just go in the bin directly. I actually submitted a couple of > patches to clean up drivers/net/wan last year but didn't follow up > with a new version after we decided that x.25 is still needed, see > https://lore.kernel.org/

Re: [PATCH net-next v6 1/5] net: hdlc_fr: Simpify fr_rx by using "goto rx_drop" to drop frames

2020-10-31 Thread Xie He
On Sat, Oct 31, 2020 at 12:48 PM Willem de Bruijn wrote: > > Returning code in branches vs an error jump label seems more of a > personal preference, and to me does not pass the benefit/cost threshold. This patch is necessary for the 2nd and 5th patch in this series, because the 2nd and 5th patch

[PATCH net-next v7 5/5] net: hdlc_fr: Add support for any Ethertype

2020-10-31 Thread Xie He
recognizes a few Ethertype values and drops frames with other Ethertype values. This patch replaces this code to make fr_rx support any Ethertype. This patch also creates a new function fr_snap_parse as part of the new code. Cc: Krzysztof Halasa Cc: Willem de Bruijn Signed-off-by: Xie He --- drivers

[PATCH net-next v7 0/5] net: hdlc_fr: Improve fr_rx and add support for any Ethertype

2020-10-31 Thread Xie He
tches. Improve the commit message about the stats.rx_dropped count. Change from v2: Small fix to the commit messages. Change from v1: Small fix to the commit messages. Xie He (5): net: hdlc_fr: Simpify fr_rx by using "goto rx_drop" to drop frames net: hdlc_fr: Change the use of &q

[PATCH net-next v7 2/5] net: hdlc_fr: Change the use of "dev" in fr_rx to make the code cleaner

2020-10-31 Thread Xie He
: first make sure the pointer is not NULL, then assign it directly to skb->dev. "dev" is no longer needed until the end where we use it to update stats. Cc: Krzysztof Halasa Cc: Willem de Bruijn Signed-off-by: Xie He --- drivers/net/wan/hdlc_fr.c | 37 --

[PATCH net-next v7 4/5] net: hdlc_fr: Improve the initial checks when we receive an skb

2020-10-31 Thread Xie He
check to the initial checks in fr_rx. fh->ea2 == 1 means the second address byte is the final address byte. We only support the case where the address length is 2 bytes. Cc: Krzysztof Halasa Cc: Willem de Bruijn Signed-off-by: Xie He --- drivers/net/wan/hdlc_fr.c | 2 +- 1 file changed, 1 i

[PATCH net-next v7 3/5] net: hdlc_fr: Do skb_reset_mac_header for skbs received on normal PVC devices

2020-10-31 Thread Xie He
't be visible to upper layer code when receiving, either. Cc: Krzysztof Halasa Cc: Willem de Bruijn Signed-off-by: Xie He --- drivers/net/wan/hdlc_fr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c index 71ee9b60d91b..eb83116aa

[PATCH net-next v7 1/5] net: hdlc_fr: Simpify fr_rx by using "goto rx_drop" to drop frames

2020-10-31 Thread Xie He
eated several times, this patch uses "goto rx_drop" to replace them so that the code looks cleaner. Cc: Krzysztof Halasa Cc: Willem de Bruijn Signed-off-by: Xie He --- drivers/net/wan/hdlc_fr.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/ne

Re: [PATCH net-next] net: dlci: Deprecate the DLCI driver (aka the Frame Relay layer)

2020-10-31 Thread Xie He
On Sat, Oct 31, 2020 at 9:51 AM Jakub Kicinski wrote: > > > > The usual way of getting rid of old code is to move it to staging/ > > > for a few releases then delete it, like Arnd just did with wimax. > > > > Oh. OK. But I see "include/linux/if_frad.h" is included in > > "net/socket.c", and there'

Re: [PATCH net-next v6 4/5] net: hdlc_fr: Improve the initial checks when we receive an skb

2020-10-31 Thread Xie He
On Fri, Oct 30, 2020 at 5:49 PM Xie He wrote: > > Add an fh->ea2 check to the initial checks in fr_rx. fh->ea2 == 1 means > the second address byte is the final address byte. We only support the > case where the address length is 2 bytes. If the address length is not > 2 byt

Re: [PATCH net-next v6 1/5] net: hdlc_fr: Simpify fr_rx by using "goto rx_drop" to drop frames

2020-10-31 Thread Xie He
On Sat, Oct 31, 2020 at 8:18 AM Xie He wrote: > > > Especially without that, I'm not sure this and the follow-on patch add > > much value. Minor code cleanups complicate backports of fixes. > > To me this is necessary, because I feel hard to do any development on >

Re: [PATCH net-next v6 1/5] net: hdlc_fr: Simpify fr_rx by using "goto rx_drop" to drop frames

2020-10-31 Thread Xie He
On Sat, Oct 31, 2020 at 7:33 AM Willem de Bruijn wrote: > > > - rx_error: > > +rx_error: > > frad->stats.rx_errors++; /* Mark error */ > > +rx_drop: > > dev_kfree_skb_any(skb); > > return NET_RX_DROP; > > I meant that I don't think errors should be double counted in rx_erro

Re: [PATCH net-next] net: dlci: Deprecate the DLCI driver (aka the Frame Relay layer)

2020-10-30 Thread Xie He
On Fri, Oct 30, 2020 at 8:07 PM Jakub Kicinski wrote: > > This code has only seen cleanup patches since the git era begun - > do you think that it may still have users? Or is it completely unused? I don't think it is still used. But I don't have solid evidence. So I asked people in the warning me

[PATCH net-next v6 5/5] net: hdlc_fr: Add support for any Ethertype

2020-10-30 Thread Xie He
-off-by: Xie He --- drivers/net/wan/hdlc_fr.c | 75 +-- 1 file changed, 49 insertions(+), 26 deletions(-) diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c index 98444f1d8cc3..0720f5f92caa 100644 --- a/drivers/net/wan/hdlc_fr.c +++ b/drivers/net

[PATCH net-next v6 0/5] net: hdlc_fr: Improve fr_rx and add support for any Ethertype

2020-10-30 Thread Xie He
t the stats.rx_dropped count is also increased after "goto rx_error". Change from v2: Small fix to the commit messages. Change from v1: Small fix to the commit messages. Xie He (5): net: hdlc_fr: Simpify fr_rx by using "goto rx_drop" to drop frames net: hdlc_fr: Change the use of &

[PATCH net-next v6 2/5] net: hdlc_fr: Change the use of "dev" in fr_rx to make the code cleaner

2020-10-30 Thread Xie He
: first make sure the pointer is not NULL, then assign it directly to skb->dev. "dev" is no longer needed until the end where we use it to update stats. Cc: Willem de Bruijn Cc: Krzysztof Halasa Signed-off-by: Xie He --- drivers/net/wan/hdlc_fr.c | 37 --

[PATCH net-next v6 3/5] net: hdlc_fr: Do skb_reset_mac_header for skbs received on normal PVC devices

2020-10-30 Thread Xie He
't be visible to upper layer code when receiving, either. Cc: Willem de Bruijn Cc: Krzysztof Halasa Acked-by: Willem de Bruijn Signed-off-by: Xie He --- drivers/net/wan/hdlc_fr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_

[PATCH net-next v6 4/5] net: hdlc_fr: Improve the initial checks when we receive an skb

2020-10-30 Thread Xie He
ay it is 3 bytes, then the control field and the protocol field would be the 4th and 5th byte instead.) Cc: Willem de Bruijn Cc: Krzysztof Halasa Signed-off-by: Xie He --- drivers/net/wan/hdlc_fr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wan/hdl

[PATCH net-next v6 1/5] net: hdlc_fr: Simpify fr_rx by using "goto rx_drop" to drop frames

2020-10-30 Thread Xie He
eated several times, this patch uses "goto rx_drop" to replace them so that the code looks cleaner. Cc: Willem de Bruijn Cc: Krzysztof Halasa Signed-off-by: Xie He --- drivers/net/wan/hdlc_fr.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/ne

[PATCH net-next v5 3/5] net: hdlc_fr: Do skb_reset_mac_header for skbs received on normal PVC devices

2020-10-30 Thread Xie He
't be visible to upper layer code when receiving, either. Cc: Willem de Bruijn Cc: Krzysztof Halasa Acked-by: Willem de Bruijn Signed-off-by: Xie He --- drivers/net/wan/hdlc_fr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_

[PATCH net-next v5 1/5] net: hdlc_fr: Simpify fr_rx by using "goto rx_drop" to drop frames

2020-10-30 Thread Xie He
eated several times, this patch uses "goto rx_drop" to replace them so that the code looks cleaner. Cc: Willem de Bruijn Cc: Krzysztof Halasa Signed-off-by: Xie He --- drivers/net/wan/hdlc_fr.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/ne

[PATCH net-next v5 2/5] net: hdlc_fr: Change the use of "dev" in fr_rx to make the code cleaner

2020-10-30 Thread Xie He
: first make sure the pointer is not NULL, then assign it directly to skb->dev. "dev" is no longer needed until the end where we use it to update stats. Cc: Willem de Bruijn Cc: Krzysztof Halasa Signed-off-by: Xie He --- drivers/net/wan/hdlc_fr.c | 37 --

[PATCH net-next v5 5/5] net: hdlc_fr: Add support for any Ethertype

2020-10-30 Thread Xie He
-off-by: Xie He --- drivers/net/wan/hdlc_fr.c | 75 +-- 1 file changed, 49 insertions(+), 26 deletions(-) diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c index 98444f1d8cc3..0720f5f92caa 100644 --- a/drivers/net/wan/hdlc_fr.c +++ b/drivers/net

[PATCH net-next v5 0/5] net: hdlc_fr: Improve fr_rx and add support for any Ethertype

2020-10-30 Thread Xie He
o rx_error". Change from v2: Small fix to the commit messages. Change from v1: Small fix to the commit messages. Xie He (5): net: hdlc_fr: Simpify fr_rx by using "goto rx_drop" to drop frames net: hdlc_fr: Change the use of "dev" in fr_rx to make the

[PATCH net-next v5 4/5] net: hdlc_fr: Improve the initial checks when we receive an skb

2020-10-30 Thread Xie He
(Say if it is 3 bytes, then the control field and the protocol field would be the 4th and 5th byte instead.) Cc: Willem de Bruijn Cc: Krzysztof Halasa Signed-off-by: Xie He --- drivers/net/wan/hdlc_fr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wan/hdl

Re: [PATCH net-next v4 4/5] net: hdlc_fr: Do skb_reset_mac_header for skbs received on normal PVC devices

2020-10-30 Thread Xie He
On Fri, Oct 30, 2020 at 3:22 PM Willem de Bruijn wrote: > > It's indirect: > > skb_reset_network_header(skb); > if (!skb_transport_header_was_set(skb)) > skb_reset_transport_header(skb); > skb_reset_mac_len(skb); Oh. I see. skb_reset_mac_len would set skb->

Re: [PATCH net-next v4 4/5] net: hdlc_fr: Do skb_reset_mac_header for skbs received on normal PVC devices

2020-10-30 Thread Xie He
On Fri, Oct 30, 2020 at 2:28 PM Willem de Bruijn wrote: > > Yes, it might require holding off the other patches until net is > merged into net-next. > > Packet sockets are likely not the only way these packets are received? > It changes mac_len as computed in __netif_receive_skb_core. I looked at

Re: [PATCH net-next v4 3/5] net: hdlc_fr: Improve the initial checks when we receive an skb

2020-10-30 Thread Xie He
On Fri, Oct 30, 2020 at 2:20 PM Willem de Bruijn wrote: > > Thanks for that context. If it's not captured in the code, it would be > great to include in the commit message. OK. I'll update the commit message. > From a quick scan, RFC 2427 does not appear to actually define the > Q.922 address. F

Re: [PATCH net-next v4 1/5] net: hdlc_fr: Simpify fr_rx by using "goto rx_drop" to drop frames

2020-10-30 Thread Xie He
On Fri, Oct 30, 2020 at 2:12 PM Willem de Bruijn wrote: > > Jakub recently made stats behavior less ambiguous, in commit > 0db0c34cfbc9 ("net: tighten the definition of interface statistics"). > > That said, it's not entirely clear whether rx_dropped would be allowed > to include rx_errors. > > My

Re: [PATCH net-next v4 4/5] net: hdlc_fr: Do skb_reset_mac_header for skbs received on normal PVC devices

2020-10-30 Thread Xie He
On Fri, Oct 30, 2020 at 9:30 AM Willem de Bruijn wrote: > > Acked-by: Willem de Bruijn Thanks for your ack! > Should this go to net if a bugfix though? Yes, this should theoretically be a bug fix. But I didn't think this was an important fix, because af_packet.c already had workarounds for thi

Re: [PATCH net-next v4 1/5] net: hdlc_fr: Simpify fr_rx by using "goto rx_drop" to drop frames

2020-10-30 Thread Xie He
On Fri, Oct 30, 2020 at 9:35 AM Willem de Bruijn wrote: > > In general we try to avoid changing counter behavior like that, as > existing users > may depend on current behavior, e.g., in dashboards or automated monitoring. > > I don't know how realistic that is in this specific case, no strong > o

Re: [PATCH net-next v4 5/5] net: hdlc_fr: Add support for any Ethertype

2020-10-30 Thread Xie He
On Fri, Oct 30, 2020 at 9:33 AM Willem de Bruijn wrote: > > Should this still check data[5] == FR_PAD? No, the 6th byte (data[5]) is not a padding field. It is the first byte of the SNAP header. The original code is misleading. That is part of the reasons why I want to fix it with this patch. Th

Re: [PATCH net-next v4 3/5] net: hdlc_fr: Improve the initial checks when we receive an skb

2020-10-30 Thread Xie He
On Fri, Oct 30, 2020 at 9:31 AM Willem de Bruijn wrote: > > > Add an fh->ea2 check to the initial checks in fr_rx. fh->ea2 == 1 means > > the second address byte is the final address byte. We only support the > > case where the address length is 2 bytes. > > Can you elaborate a bit for readers not

Re: [PATCH -next] net: wan: sdla: Use bitwise instead of arithmetic

2020-10-30 Thread Xie He
> Fix the following coccinelle warnings: > > ./drivers/net/wan/sdla.c:841:38-39: WARNING: sum of probable bitmasks, > consider | > > Reported-by: Hulk Robot > Signed-off-by: Zou Wei > --- > drivers/net/wan/sdla.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers

[PATCH net-next v4 3/5] net: hdlc_fr: Improve the initial checks when we receive an skb

2020-10-29 Thread Xie He
check to the initial checks in fr_rx. fh->ea2 == 1 means the second address byte is the final address byte. We only support the case where the address length is 2 bytes. Cc: Willem de Bruijn Cc: Krzysztof Halasa Signed-off-by: Xie He --- drivers/net/wan/hdlc_fr.c | 2 +- 1 file changed, 1 i

[PATCH net-next v4 5/5] net: hdlc_fr: Add support for any Ethertype

2020-10-29 Thread Xie He
recognizes a few Ethertype values and drops frames with other Ethertype values. This patch replaces this code to make fr_rx support any Ethertype. This patch also creates a new function fr_snap_parse as part of the new code. Cc: Willem de Bruijn Cc: Krzysztof Halasa Signed-off-by: Xie He --- drivers

[PATCH net-next v4 4/5] net: hdlc_fr: Do skb_reset_mac_header for skbs received on normal PVC devices

2020-10-29 Thread Xie He
't be visible to upper layer code when receiving, either. Cc: Willem de Bruijn Cc: Krzysztof Halasa Signed-off-by: Xie He --- drivers/net/wan/hdlc_fr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c index 3639c2bfb141..9a3757568

[PATCH net-next v4 2/5] net: hdlc_fr: Change the use of "dev" in fr_rx to make the code cleaner

2020-10-29 Thread Xie He
: first make sure the pointer is not NULL, then assign it directly to skb->dev. "dev" is no longer needed until the end where we use it to update stats. Cc: Willem de Bruijn Cc: Krzysztof Halasa Signed-off-by: Xie He --- drivers/net/wan/hdlc_fr.c | 37 --

[PATCH net-next v4 1/5] net: hdlc_fr: Simpify fr_rx by using "goto rx_drop" to drop frames

2020-10-29 Thread Xie He
use I think we should increase this value whenever an skb is dropped. Cc: Willem de Bruijn Cc: Krzysztof Halasa Signed-off-by: Xie He --- drivers/net/wan/hdlc_fr.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/n

[PATCH net-next v4 0/5] net: hdlc_fr: Improve fr_rx and add support for any Ethertype

2020-10-29 Thread Xie He
e 1st patch to explicitly state that the stats.rx_dropped count is also increased after "goto rx_error". Change from v2: Small fix to the commit message of the 2nd and 3rd patch Change from v1: Small fix to the commit message of the 2nd patch Xie He (5): net: hdlc_fr: Simpify fr_rx

Re: [PATCH net-next v2 4/4] net: hdlc_fr: Add support for any Ethertype

2020-10-29 Thread Xie He
On Thu, Oct 29, 2020 at 4:53 PM Xie He wrote: > > > Does it make sense to define a struct snap_hdr instead of manually > > casting all these bytes? > > > And macros or constant integers to self document these kinds of fields. > > Yes, we can define a struct s

Re: [PATCH net-next v2 4/4] net: hdlc_fr: Add support for any Ethertype

2020-10-29 Thread Xie He
On Thu, Oct 29, 2020 at 10:24 AM Willem de Bruijn wrote: > > > Also add skb_reset_mac_header before we pass an skb (received on normal > > PVC devices) to upper layers. Because we don't use header_ops for normal > > PVC devices, we should hide the header from upper layer code in this case. > > Thi

Re: [PATCH net-next v3 2/4] net: hdlc_fr: Change the use of "dev" in fr_rx to make the code cleaner

2020-10-29 Thread Xie He
On Thu, Oct 29, 2020 at 9:58 AM Willem de Bruijn wrote: > > No need for dev at all then? Right, there's no need for "dev" at all actually. I kept "dev" just to keep the code for updating "dev->stats" simpler, because otherwise we need to write "skb->dev->stats" instead, and there are 3 lines wher

Re: [PATCH net-next v3 1/4] net: hdlc_fr: Simpify fr_rx by using "goto rx_drop" to drop frames

2020-10-29 Thread Xie He
On Thu, Oct 29, 2020 at 10:00 AM Willem de Bruijn wrote: > > This does change rx_dropped count on errors. Not sure how important > that is. But perhaps good to call out in the commit explicitly if it's > intentional. Yes, this is intentional, because I think we need to count it as a "drop" whenev

[PATCH net-next] net: dlci: Deprecate the DLCI driver (aka the Frame Relay layer)

2020-10-28 Thread Xie He
i_conf and frad_conf). According to the comments, these two structs are specially crafted for sdla.c (the only hardware driver dlci.c supports). I think this makes dlci.c not generic enough to support other hardware drivers. Signed-off-by: Xie He --- Documentation/networking/framerelay.rst | 3 ++

[PATCH net-next 2/4] net: hdlc_fr: Change the use of "dev" in fr_fx to make the code cleaner

2020-10-28 Thread Xie He
e to: first make sure the pointer is not NULL, then assign it directly to skb->dev. "dev" is no longer needed until the end where we use it to update stats. Cc: Krzysztof Halasa Signed-off-by: Xie He --- drivers/net/wan/hdlc_fr.c | 37 - 1

[PATCH net-next 1/4] net: hdlc_fr: Simpify fr_rx by using "goto rx_drop" to drop frames

2020-10-28 Thread Xie He
eated several times, this patch uses "goto rx_drop" to replace them so that the code looks cleaner. Also add code to increase the stats.rx_dropped count whenever we drop a frame. Cc: Krzysztof Halasa Signed-off-by: Xie He --- drivers/net/wan/hdlc_fr.c | 16 +++- 1 file change

[PATCH net-next v2 3/4] net: hdlc_fr: Improve the initial check when we receive an skb

2020-10-28 Thread Xie He
check to the initial checks in fr_fx. fh->ea2 == 1 means the second address byte is the final address byte. We only support the case where the address length is 2 bytes. Cc: Krzysztof Halasa Signed-off-by: Xie He --- drivers/net/wan/hdlc_fr.c | 2 +- 1 file changed, 1 insertion(+), 1 d

[PATCH net-next v2 4/4] net: hdlc_fr: Add support for any Ethertype

2020-10-28 Thread Xie He
devices) to upper layers. Because we don't use header_ops for normal PVC devices, we should hide the header from upper layer code in this case. Cc: Krzysztof Halasa Signed-off-by: Xie He --- drivers/net/wan/hdlc_fr.c | 76 ++- 1 file changed, 51 insertions(+

[PATCH net-next v2 2/4] net: hdlc_fr: Change the use of "dev" in fr_rx to make the code cleaner

2020-10-28 Thread Xie He
: first make sure the pointer is not NULL, then assign it directly to skb->dev. "dev" is no longer needed until the end where we use it to update stats. Cc: Krzysztof Halasa Signed-off-by: Xie He --- drivers/net/wan/hdlc_fr.c | 37 - 1 file chang

[PATCH net-next v3 0/4] net: hdlc_fr: Add support for any Ethertype

2020-10-28 Thread Xie He
l fix to the commit message of the 2nd patch Xie He (4): net: hdlc_fr: Simpify fr_rx by using "goto rx_drop" to drop frames net: hdlc_fr: Change the use of "dev" in fr_rx to make the code cleaner net: hdlc_fr: Improve the initial checks when we receive an skb net:

[PATCH net-next v2 0/4] net: hdlc_fr: Add support for any Ethertype

2020-10-28 Thread Xie He
zes a few known Ethertypes when receiving and drops skbs with other Ethertypes. However, the standard document RFC 2427 allows Frame Relay to support any Ethertype values. This series adds support for this. Change from v1: Small fix to the commit message of the second patch Xie He (4): net: hd

[PATCH net-next 0/4] net: hdlc_fr: Add support for any Ethertype

2020-10-28 Thread Xie He
zes a few known Ethertypes when receiving and drops skbs with other Ethertypes. However, the standard document RFC 2427 allows Frame Relay to support any Ethertype values. This series adds support for this. Xie He (4): net: hdlc_fr: Simpify fr_rx by using "goto rx_drop" to drop frames

<    1   2   3   4   >