[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAF2d9jhesfOW8c4pXOAmMGonGv+1ryFsZ_PoCknX+ahy-fGdaw@mail.gmail.com>
Date: Tue, 22 Nov 2011 17:34:32 -0800
From: Mahesh Bandewar <maheshb@...gle.com>
To: Yevgeny Petrilin <yevgenyp@...lanox.co.il>
Cc: davem@...emloft.net, netdev@...r.kernel.org, ogerlitz@...lanox.com,
oren@...lanox.co.il, amirv@...lanox.co.il
Subject: Re: [PATCH 7/8] net/mlx4_en: adding loopback support
On Mon, Nov 21, 2011 at 12:43 AM, Yevgeny Petrilin
<yevgenyp@...lanox.co.il> wrote:
>
> From: Amir Vadai <amirv@...lanox.co.il>
>
> Device must be in promiscious mode or DMAC must be same as the host MAC, or
> else packet will be dropped by the HW rx filtering.
>
> Signed-off-by: Amir Vadai <amirv@...lanox.co.il>
> ---
> drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 1 +
> drivers/net/ethernet/mellanox/mlx4/en_tx.c | 3 +++
> include/linux/mlx4/qp.h | 1 +
> 3 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> index 78d776b..55fdbce 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> @@ -1088,6 +1088,7 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
> dev->features = dev->hw_features | NETIF_F_HIGHDMA |
> NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX |
> NETIF_F_HW_VLAN_FILTER;
> + dev->hw_features |= NETIF_F_LOOPBACK;
>
> mdev->pndev[port] = dev;
>
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
> index 3094f94..f9093b5 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
> @@ -681,6 +681,9 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
> tx_desc->ctrl.fence_size = (real_size / 16) & 0x3f;
> tx_desc->ctrl.srcrb_flags = cpu_to_be32(MLX4_WQE_CTRL_CQ_UPDATE |
> MLX4_WQE_CTRL_SOLICITED);
> + if (dev->features & NETIF_F_LOOPBACK)
> + tx_desc->ctrl.srcrb_flags |=
> + cpu_to_be32(MLX4_WQE_CTRL_FORCE_LOOPBACK);
This is re-calculated for every xmit. Is it required to be that way?
May be you can pre-calculate it and just assign / add it to the
control-flags here.
> if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
> tx_desc->ctrl.srcrb_flags |= cpu_to_be32(MLX4_WQE_CTRL_IP_CSUM |
> MLX4_WQE_CTRL_TCP_UDP_CSUM);
> diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
> index 6562ff6..bee8fa2 100644
> --- a/include/linux/mlx4/qp.h
> +++ b/include/linux/mlx4/qp.h
> @@ -210,6 +210,7 @@ struct mlx4_wqe_ctrl_seg {
> * [4] IP checksum
> * [3:2] C (generate completion queue entry)
> * [1] SE (solicited event)
> + * [0] FL (force loopback)
> */
> __be32 srcrb_flags;
> /*
> --
> 1.7.7
>
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists