Message ID | 20201209014013.4996-1-xie.he.0141@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next,v2] net: hdlc_x25: Remove unnecessary skb_reset_network_header calls | expand |
Context | Check | Description |
---|---|---|
netdev/cover_letter | success | Link |
netdev/fixes_present | success | Link |
netdev/patch_count | success | Link |
netdev/tree_selection | success | Clearly marked for net-next |
netdev/subject_prefix | success | Link |
netdev/source_inline | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Link |
netdev/module_param | success | Was 0 now: 0 |
netdev/build_32bit | success | Errors and warnings before: 0 this patch: 0 |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/verify_fixes | success | Link |
netdev/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 14 lines checked |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 0 this patch: 0 |
netdev/header_inline | success | Link |
netdev/stable | success | Stable not CCed |
From: Xie He <xie.he.0141@gmail.com> Date: Tue, 8 Dec 2020 17:40:13 -0800 > 1. In x25_xmit, skb_reset_network_header is not necessary before we call > lapb_data_request. The lapb module doesn't need skb->network_header. > So there is no need to set skb->network_header before calling > lapb_data_request. > > 2. In x25_data_indication (called by the lapb module after some data > have been received), skb_reset_network_header is not necessary before we > call netif_rx. After we call netif_rx, the code in net/core/dev.c will > call skb_reset_network_header before handing the skb to upper layers > (in __netif_receive_skb_core, called by __netif_receive_skb_one_core, > called by __netif_receive_skb, called by process_backlog). So we don't > need to call skb_reset_network_header by ourselves. > > Cc: Martin Schiller <ms@dev.tdt.de> > Signed-off-by: Xie He <xie.he.0141@gmail.com> Applied, thanks.
diff --git a/drivers/net/wan/hdlc_x25.c b/drivers/net/wan/hdlc_x25.c index f52b9fed0593..bb164805804e 100644 --- a/drivers/net/wan/hdlc_x25.c +++ b/drivers/net/wan/hdlc_x25.c @@ -77,7 +77,6 @@ static int x25_data_indication(struct net_device *dev, struct sk_buff *skb) } skb_push(skb, 1); - skb_reset_network_header(skb); ptr = skb->data; *ptr = X25_IFACE_DATA; @@ -118,7 +117,6 @@ static netdev_tx_t x25_xmit(struct sk_buff *skb, struct net_device *dev) switch (skb->data[0]) { case X25_IFACE_DATA: /* Data to be transmitted */ skb_pull(skb, 1); - skb_reset_network_header(skb); if ((result = lapb_data_request(dev, skb)) != LAPB_OK) dev_kfree_skb(skb); return NETDEV_TX_OK;
1. In x25_xmit, skb_reset_network_header is not necessary before we call lapb_data_request. The lapb module doesn't need skb->network_header. So there is no need to set skb->network_header before calling lapb_data_request. 2. In x25_data_indication (called by the lapb module after some data have been received), skb_reset_network_header is not necessary before we call netif_rx. After we call netif_rx, the code in net/core/dev.c will call skb_reset_network_header before handing the skb to upper layers (in __netif_receive_skb_core, called by __netif_receive_skb_one_core, called by __netif_receive_skb, called by process_backlog). So we don't need to call skb_reset_network_header by ourselves. Cc: Martin Schiller <ms@dev.tdt.de> Signed-off-by: Xie He <xie.he.0141@gmail.com> --- drivers/net/wan/hdlc_x25.c | 2 -- 1 file changed, 2 deletions(-)