netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matan Barak <matanb@mellanox.com>
To: David Laight <David.Laight@ACULAB.COM>,
	'Or Gerlitz' <ogerlitz@mellanox.com>,
	"David S. Miller" <davem@davemloft.net>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Doug Ledford <dledford@redhat.com>,
	Maor Gottlieb <maorg@mellanox.com>,
	Saeed Mahameed <saeedm@mellanox.com>,
	Eran Ben Elisha <eranbe@mellanox.com>,
	Moni Shoua <monis@mellanox.com>
Subject: Re: [PATCH net-next V2 09/12] net/mlx5_core: Make ipv4/ipv6 location more clear
Date: Mon, 11 Jan 2016 15:06:16 +0200	[thread overview]
Message-ID: <5693A8C8.2050100@mellanox.com> (raw)
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D1CCC1ECF@AcuExch.aculab.com>



On 1/11/2016 2:17 PM, David Laight wrote:
> From: Or Gerlitz
>> Sent: 10 January 2016 08:40
>> Change the mlx5 firmware interface header to make it
>> more clear which bytes should be used by IPv4 or
>> IPv6 addresses.
>>
>> Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
>> Signed-off-by: Moni Shoua <monis@mellanox.com>
>> Signed-off-by: Matan Barak <matanb@mellanox.com>
>> ---
>>   include/linux/mlx5/mlx5_ifc.h | 20 ++++++++++++++++++--
>>   1 file changed, 18 insertions(+), 2 deletions(-)
>>
>> diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
>> index 7f16695..68d73f8 100644
>> --- a/include/linux/mlx5/mlx5_ifc.h
>> +++ b/include/linux/mlx5/mlx5_ifc.h
>> @@ -298,6 +298,22 @@ struct mlx5_ifc_odp_per_transport_service_cap_bits {
>>   	u8         reserved_1[0x1a];
>>   };
>>
>> +struct mlx5_ifc_ipv4_layout_bits {
>> +	u8         reserved_0[0x60];
>> +
>> +	u8         ipv4[0x20];
>> +};
>> +
>> +struct mlx5_ifc_ipv6_layout_bits {
>> +	u8         ipv6[16][0x8];
>> +};
>> +
>> +union mlx5_ifc_ipv6_layout_ipv4_layout_auto_bits {
>> +	struct mlx5_ifc_ipv6_layout_bits ipv6_layout;
>> +	struct mlx5_ifc_ipv4_layout_bits ipv4_layout;
>> +	u8         reserved_0[0x80];
>> +};
>
> I like the way these names just roll off the tongue :-)
>
>> +
>>   struct mlx5_ifc_fte_match_set_lyr_2_4_bits {
>>   	u8         smac_47_16[0x20];
>>
>> @@ -328,9 +344,9 @@ struct mlx5_ifc_fte_match_set_lyr_2_4_bits {
>>   	u8         udp_sport[0x10];
>>   	u8         udp_dport[0x10];
>>
>> -	u8         src_ip[4][0x20];
>> +	union mlx5_ifc_ipv6_layout_ipv4_layout_auto_bits src_ipv4_src_ipv6;
>>
>> -	u8         dst_ip[4][0x20];
>> +	union mlx5_ifc_ipv6_layout_ipv4_layout_auto_bits dst_ipv4_dst_ipv6;
>>   };
>
> Have you considered just how long the line of code to access these
> fields will be?
> It might be better to do (I think it compiles):
> 	union {
> 		u8	src_ipv6[16][0x8];
> 		struct {
> 			u8	src_ipv4_pad[0x60];
> 			u8	src_ipv4[0x20];
> 		}
> 	};
> Repeated for the 'dst' addresses.
> Then fixup the definition of src_ipv4[] (and probably src_ipv6[]) to
> be much clearer about how the addresses are supplied.
>

This is actually created automatically, but I fully agree the names here 
look odd (to say the least). We'll of course fix that :)
Thanks for taking a look.

> 	David
>

Regards,
Matan

  reply	other threads:[~2016-01-11 16:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-10  8:39 [PATCH for-net V2 00/12] net/mlx5_core: Enhance flow steering support Or Gerlitz
2016-01-10  8:39 ` [PATCH net-next V2 01/12] net/mlx5_core: Introduce flow steering autogrouped flow table Or Gerlitz
2016-01-10  8:39 ` [PATCH net-next V2 02/12] net/mlx5_core: Add utilities to find next and prev flow-tables Or Gerlitz
2016-01-10  8:39 ` [PATCH net-next V2 03/12] net/mlx5_core: Managing root flow table Or Gerlitz
2016-01-10  8:39 ` [PATCH net-next V2 04/12] net/mlx5_core: Introduce modify flow table command Or Gerlitz
2016-01-10  8:39 ` [PATCH net-next V2 05/12] net/mlx5_core: Connect flow tables Or Gerlitz
2016-01-10  8:39 ` [PATCH net-next V2 06/12] net/mlx5_core: Set priority attributes Or Gerlitz
2016-01-10  8:39 ` [PATCH net-next V2 07/12] net/mlx5_core: Initialize namespaces only when supported by device Or Gerlitz
2016-01-10  8:39 ` [PATCH net-next V2 08/12] net/mlx5_core: Enable flow steering support for the IB driver Or Gerlitz
2016-01-10  8:39 ` [PATCH net-next V2 09/12] net/mlx5_core: Make ipv4/ipv6 location more clear Or Gerlitz
2016-01-11 12:17   ` David Laight
2016-01-11 13:06     ` Matan Barak [this message]
2016-01-11 13:18     ` Or Gerlitz
2016-01-10  8:39 ` [PATCH net-next V2 10/12] net/mlx5_core: Export flow steering API Or Gerlitz
2016-01-10  8:39 ` [PATCH net-next V2 11/12] IB/mlx5: Add flow steering utilities Or Gerlitz
2016-01-10  8:39 ` [PATCH net-next V2 12/12] IB/mlx5: Add flow steering support Or Gerlitz
2016-01-10  8:46 ` [PATCH for-net V2 00/12] net/mlx5_core: Enhance " Or Gerlitz
2016-01-10 22:05 ` David Miller
2016-01-11  4:15   ` Or Gerlitz
2016-01-11  8:24     ` Or Gerlitz

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=5693A8C8.2050100@mellanox.com \
    --to=matanb@mellanox.com \
    --cc=David.Laight@ACULAB.COM \
    --cc=davem@davemloft.net \
    --cc=dledford@redhat.com \
    --cc=eranbe@mellanox.com \
    --cc=maorg@mellanox.com \
    --cc=monis@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    --cc=saeedm@mellanox.com \
    /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).