[PATCH] bonding: Remove unnecessary check

Sun Shouxin posted 1 patch 3 years, 7 months ago
There is a newer version of this series
drivers/net/bonding/bond_main.c | 13 -------------
1 file changed, 13 deletions(-)
[PATCH] bonding: Remove unnecessary check
Posted by Sun Shouxin 3 years, 7 months ago
This check is not necessary since the commit d5410ac7b0ba
("net:bonding:support balance-alb interface with vlan to bridge").

Suggested-by: Hu Yadi <huyd12@chinatelecom.cn>
Signed-off-by: Sun Shouxin <sunshouxin@chinatelecom.cn>
---
 drivers/net/bonding/bond_main.c | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 50e60843020c..6b0f0ce9b9a1 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1578,19 +1578,6 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
 
 	skb->dev = bond->dev;
 
-	if (BOND_MODE(bond) == BOND_MODE_ALB &&
-	    netif_is_bridge_port(bond->dev) &&
-	    skb->pkt_type == PACKET_HOST) {
-
-		if (unlikely(skb_cow_head(skb,
-					  skb->data - skb_mac_header(skb)))) {
-			kfree_skb(skb);
-			return RX_HANDLER_CONSUMED;
-		}
-		bond_hw_addr_copy(eth_hdr(skb)->h_dest, bond->dev->dev_addr,
-				  bond->dev->addr_len);
-	}
-
 	return ret;
 }
 
-- 
2.27.0
Re: [PATCH] bonding: Remove unnecessary check
Posted by Jay Vosburgh 3 years, 7 months ago
Sun Shouxin <sunshouxin@chinatelecom.cn> wrote:

>This check is not necessary since the commit d5410ac7b0ba
>("net:bonding:support balance-alb interface with vlan to bridge").

	Please explain why this assertion is correct in your commit
message.

	Also, I presume this is for net-next; please specify in the
PATCH block of the Subject.

	-J

>Suggested-by: Hu Yadi <huyd12@chinatelecom.cn>
>Signed-off-by: Sun Shouxin <sunshouxin@chinatelecom.cn>
>---
> drivers/net/bonding/bond_main.c | 13 -------------
> 1 file changed, 13 deletions(-)
>
>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>index 50e60843020c..6b0f0ce9b9a1 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -1578,19 +1578,6 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
> 
> 	skb->dev = bond->dev;
> 
>-	if (BOND_MODE(bond) == BOND_MODE_ALB &&
>-	    netif_is_bridge_port(bond->dev) &&
>-	    skb->pkt_type == PACKET_HOST) {
>-
>-		if (unlikely(skb_cow_head(skb,
>-					  skb->data - skb_mac_header(skb)))) {
>-			kfree_skb(skb);
>-			return RX_HANDLER_CONSUMED;
>-		}
>-		bond_hw_addr_copy(eth_hdr(skb)->h_dest, bond->dev->dev_addr,
>-				  bond->dev->addr_len);
>-	}
>-
> 	return ret;
> }
> 
>-- 
>2.27.0
>

---
	-Jay Vosburgh, jay.vosburgh@canonical.com
Re: [PATCH] bonding: Remove unnecessary check
Posted by Eric Dumazet 3 years, 7 months ago
On Mon, Aug 22, 2022 at 3:33 AM Sun Shouxin <sunshouxin@chinatelecom.cn> wrote:
>
> This check is not necessary since the commit d5410ac7b0ba
> ("net:bonding:support balance-alb interface with vlan to bridge").

Please provide more details. I fail to see the relation between d5410ac7b0ba
and this patch, thanks.

>
> Suggested-by: Hu Yadi <huyd12@chinatelecom.cn>
> Signed-off-by: Sun Shouxin <sunshouxin@chinatelecom.cn>
> ---
>  drivers/net/bonding/bond_main.c | 13 -------------
>  1 file changed, 13 deletions(-)
>
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index 50e60843020c..6b0f0ce9b9a1 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -1578,19 +1578,6 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
>
>         skb->dev = bond->dev;
>
> -       if (BOND_MODE(bond) == BOND_MODE_ALB &&
> -           netif_is_bridge_port(bond->dev) &&
> -           skb->pkt_type == PACKET_HOST) {
> -
> -               if (unlikely(skb_cow_head(skb,
> -                                         skb->data - skb_mac_header(skb)))) {
> -                       kfree_skb(skb);
> -                       return RX_HANDLER_CONSUMED;
> -               }
> -               bond_hw_addr_copy(eth_hdr(skb)->h_dest, bond->dev->dev_addr,
> -                                 bond->dev->addr_len);
> -       }
> -
>         return ret;
>  }
>
> --
> 2.27.0
>