Patchwork [net-next] net/mlx4_en: remove redundant code

login
register
mail settings
Submitter Eric Dumazet
Date Jan. 17, 2013, 3:26 p.m.
Message ID <1358436367.29723.49.camel@edumazet-glaptop>
Download mbox | patch
Permalink /patch/213306/
State Accepted
Delegated to: David Miller
Headers show

Comments

Eric Dumazet - Jan. 17, 2013, 3:26 p.m.
From: Eric Dumazet <edumazet@google.com>

remove redundant code from build_inline_wqe()

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
Amir, reviewing this driver, it looks like following could be done,
could you test the patch for me ?

Thanks



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Amir Vadai - Jan. 17, 2013, 4:22 p.m.
On 17/01/2013 17:26, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> remove redundant code from build_inline_wqe()
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
> Amir, reviewing this driver, it looks like following could be done,
> could you test the patch for me ?
>
> Thanks
>
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
> index 2b799f4..16af338 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
> @@ -515,10 +515,6 @@ static void build_inline_wqe(struct mlx4_en_tx_desc *tx_desc, struct sk_buff *sk
>   		wmb();
>   		inl->byte_count = cpu_to_be32(1 << 31 | (skb->len - spc));
>   	}
> -	tx_desc->ctrl.vlan_tag = cpu_to_be16(*vlan_tag);
> -	tx_desc->ctrl.ins_vlan = MLX4_WQE_CTRL_INS_VLAN *
> -		(!!vlan_tx_tag_present(skb));
> -	tx_desc->ctrl.fence_size = (real_size / 16) & 0x3f;
>   }
>
>   u16 mlx4_en_select_queue(struct net_device *dev, struct sk_buff *skb)
>
>

It seems that you're right.

I'm currently out of office - will check it on Sunday.

Thanks,
Amir
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Amir Vadai - Jan. 20, 2013, 2:48 p.m.
On 17/01/2013 17:26, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> remove redundant code from build_inline_wqe()
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
> Amir, reviewing this driver, it looks like following could be done,
> could you test the patch for me ?
>
> Thanks
>
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
> index 2b799f4..16af338 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
> @@ -515,10 +515,6 @@ static void build_inline_wqe(struct mlx4_en_tx_desc *tx_desc, struct sk_buff *sk
>   		wmb();
>   		inl->byte_count = cpu_to_be32(1 << 31 | (skb->len - spc));
>   	}
> -	tx_desc->ctrl.vlan_tag = cpu_to_be16(*vlan_tag);
> -	tx_desc->ctrl.ins_vlan = MLX4_WQE_CTRL_INS_VLAN *
> -		(!!vlan_tx_tag_present(skb));
> -	tx_desc->ctrl.fence_size = (real_size / 16) & 0x3f;
>   }
>
>   u16 mlx4_en_select_queue(struct net_device *dev, struct sk_buff *skb)
>
>
Acked-By: Amir Vadai <amirv@mellanox.com>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - Jan. 21, 2013, 4:11 a.m.
From: Amir Vadai <amirv@mellanox.com>
Date: Sun, 20 Jan 2013 16:48:26 +0200

> On 17/01/2013 17:26, Eric Dumazet wrote:
>> From: Eric Dumazet <edumazet@google.com>
>>
>> remove redundant code from build_inline_wqe()
>>
>> Signed-off-by: Eric Dumazet <edumazet@google.com>
...
> Acked-By: Amir Vadai <amirv@mellanox.com>

Applied, thanks everyone.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
index 2b799f4..16af338 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
@@ -515,10 +515,6 @@  static void build_inline_wqe(struct mlx4_en_tx_desc *tx_desc, struct sk_buff *sk
 		wmb();
 		inl->byte_count = cpu_to_be32(1 << 31 | (skb->len - spc));
 	}
-	tx_desc->ctrl.vlan_tag = cpu_to_be16(*vlan_tag);
-	tx_desc->ctrl.ins_vlan = MLX4_WQE_CTRL_INS_VLAN *
-		(!!vlan_tx_tag_present(skb));
-	tx_desc->ctrl.fence_size = (real_size / 16) & 0x3f;
 }
 
 u16 mlx4_en_select_queue(struct net_device *dev, struct sk_buff *skb)