linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
To: Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Maor Gottlieb <maorg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Cc: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Moni Shoua <monis-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Majd Dibbiny <majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH for-next 4/7] net/mlx4_core: Add handlning of RoCE v2 over IPV4 in attach_flow
Date: Tue, 29 Dec 2015 16:28:18 +0200	[thread overview]
Message-ID: <56829882.8040700@mellanox.com> (raw)
In-Reply-To: <1451395447-5198-5-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

On 12/29/2015 3:24 PM, Matan Barak wrote:
> From: Maor Gottlieb <maorg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
s/handlning/handling/

>
> When attaching multicast for RoCE v2, we need to be able to steer
> packets to the QPs. Hence, we add support for IPV4 over IB steering.

not sure to follow on the change-log, can you clarify it little further...

>
> Signed-off-by: Maor Gottlieb <maorg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
>   drivers/net/ethernet/mellanox/mlx4/mcg.c | 14 ++++++++++++--
>   include/linux/mlx4/device.h              |  6 ++++++
>   2 files changed, 18 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx4/mcg.c b/drivers/net/ethernet/mellanox/mlx4/mcg.c
> index 1d4e2e0..834e60e 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/mcg.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/mcg.c
> @@ -858,7 +858,9 @@ static int parse_trans_rule(struct mlx4_dev *dev, struct mlx4_spec_list *spec,
>   		break;
>   
>   	case MLX4_NET_TRANS_RULE_ID_IB:
> -		rule_hw->ib.l3_qpn = spec->ib.l3_qpn;
> +		rule_hw->ib.l3_qpn = spec->ib.l3_qpn |
> +			(spec->ib.roce_type == MLX4_FLOW_SPEC_IB_ROCE_TYPE_IPV4 ?
> +			 (__force __be32)0x80 : (__force __be32)0);

maybe avoid using hard coded constants and get meaningful name for them?

>   		rule_hw->ib.qpn_mask = spec->ib.qpn_msk;
>   		memcpy(&rule_hw->ib.dst_gid, &spec->ib.dst_gid, 16);
>   		memcpy(&rule_hw->ib.dst_gid_msk, &spec->ib.dst_gid_msk, 16);
> @@ -1384,10 +1386,18 @@ int mlx4_trans_to_dmfs_attach(struct mlx4_dev *dev, struct mlx4_qp *qp,
>   			memcpy(spec.eth.dst_mac_msk, &mac_mask, ETH_ALEN);
>   			break;
>   
> +		case MLX4_PROT_IB_IPV4:
> +			spec.id = MLX4_NET_TRANS_RULE_ID_IB;
> +			memcpy(spec.ib.dst_gid + 12, gid + 12, 4);
> +			memset(spec.ib.dst_gid_msk + 12, 0xff, 4);
> +			spec.ib.roce_type = MLX4_FLOW_SPEC_IB_ROCE_TYPE_IPV4;
> +			break;
> +
>   		case MLX4_PROT_IB_IPV6:
>   			spec.id = MLX4_NET_TRANS_RULE_ID_IB;
>   			memcpy(spec.ib.dst_gid, gid, 16);
> -			memset(&spec.ib.dst_gid_msk, 0xff, 16);
> +			memset(spec.ib.dst_gid_msk, 0xff, 16);
> +			spec.ib.roce_type = MLX4_FLOW_SPEC_IB_ROCE_TYPE_IPV6;
>   			break;
>   		default:
>   			return -EINVAL;
> diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
> index 0d873f1ae..cdc75b2 100644
> --- a/include/linux/mlx4/device.h
> +++ b/include/linux/mlx4/device.h
> @@ -391,6 +391,11 @@ enum mlx4_protocol {
>   	MLX4_PROT_FCOE
>   };
>   
> +enum mlx4_flow_roce_type {
> +	MLX4_FLOW_SPEC_IB_ROCE_TYPE_IPV6 = 0,
> +	MLX4_FLOW_SPEC_IB_ROCE_TYPE_IPV4
> +};
> +
>   enum {
>   	MLX4_MTT_FLAG_PRESENT		= 1
>   };
> @@ -1197,6 +1202,7 @@ struct mlx4_spec_ipv4 {
>   struct mlx4_spec_ib {
>   	__be32  l3_qpn;
>   	__be32	qpn_msk;
> +	enum    mlx4_flow_roce_type roce_type;
>   	u8	dst_gid[16];
>   	u8	dst_gid_msk[16];
>   };

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-12-29 14:28 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-29 13:24 [PATCH for-next 0/7] Add RoCE v2 support for mlx4 driver Matan Barak
     [not found] ` <1451395447-5198-1-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-12-29 13:24   ` [PATCH for-next 1/7] IB/mlx4: Query RoCE support Matan Barak
     [not found]     ` <1451395447-5198-2-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-12-29 15:19       ` Or Gerlitz
     [not found]         ` <5682A499.9040701-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-12-30  8:27           ` Matan Barak
     [not found]             ` <5683957B.1070401-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-12-30  8:44               ` Or Gerlitz
     [not found]                 ` <5683997E.9090307-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-12-30 11:11                   ` Matan Barak
2015-12-29 13:24   ` [PATCH for-next 2/7] IB/mlx4: Add RoCE per GID support for add_gid and del_gid Matan Barak
     [not found]     ` <1451395447-5198-3-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-12-29 15:24       ` Or Gerlitz
     [not found]         ` <5682A5AA.9040709-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-12-30 10:21           ` Matan Barak
2015-12-29 13:24   ` [PATCH for-next 3/7] IB/mlx4: Configure device to work in RoCEv2 Matan Barak
     [not found]     ` <1451395447-5198-4-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-12-29 14:37       ` Or Gerlitz
     [not found]         ` <56829AB0.3080805-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-12-30  8:23           ` Matan Barak
     [not found]             ` <56839469.3070508-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-12-30  8:46               ` Or Gerlitz
2015-12-29 13:24   ` [PATCH for-next 4/7] net/mlx4_core: Add handlning of RoCE v2 over IPV4 in attach_flow Matan Barak
     [not found]     ` <1451395447-5198-5-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-12-29 14:28       ` Or Gerlitz [this message]
2015-12-29 13:24   ` [PATCH for-next 5/7] IB/mlx4: Enable send of RoCE QP1 packets with IP/UDP headers Matan Barak
     [not found]     ` <1451395447-5198-6-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-12-29 19:01       ` Or Gerlitz
     [not found]         ` <CAJ3xEMgVvpj5S9gc_3onzCU5zjkXayOEZCCk_DofAwz194s8KQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-12-30 11:04           ` Moni Shoua
     [not found]             ` <CAG9sBKMOE1ULAnL=OWiSYc76vgi8jiuhnQxY3Li9NwGy3+r7oQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-12-31  7:04               ` Or Gerlitz
2015-12-29 13:24   ` [PATCH for-next 6/7] IB/mlx4: Create and use another QP1 for RoCEv2 Matan Barak
     [not found]     ` <1451395447-5198-7-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-12-29 14:42       ` Or Gerlitz
     [not found]         ` <56829BC4.2070709-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-12-30  8:24           ` Matan Barak
2015-12-29 13:24   ` [PATCH for-next 7/7] IB/mlx4: Advertise RoCE support Matan Barak
     [not found]     ` <1451395447-5198-8-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-12-29 14:44       ` Or Gerlitz
     [not found]         ` <56829C3D.5050009-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-12-30  8:25           ` Matan Barak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56829882.8040700@mellanox.com \
    --to=ogerlitz-vpraknaxozvwk0htik3j/w@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=maorg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=monis-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).