All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Rybchenko <arybchenko@solarflare.com>
To: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Cc: <dev@dpdk.org>, Roman Zhukov <roman.zhukov@oktetlabs.ru>
Subject: Re: [PATCH v2 05/13] net/sfc: fix endian conversions in flow API
Date: Thu, 5 Apr 2018 18:10:41 +0300	[thread overview]
Message-ID: <6f11d761-167c-0716-a5b1-e850c800d5b8@solarflare.com> (raw)
In-Reply-To: <20180404160842.GG4957@6wind.com>

Hi Adrien,

On 04/04/2018 07:08 PM, Adrien Mazarguil wrote:
> Hi Andrew,
>
> On Wed, Apr 04, 2018 at 06:30:24PM +0300, Andrew Rybchenko wrote:
>> Adrien,
>>
>> On 04/04/2018 05:57 PM, Adrien Mazarguil wrote:
>>> These conversions do not use the adequate function.
>>>
>>> Fixes: a9825ccf5bb8 ("net/sfc: support flow API filters")
>>> Fixes: 894080975e1e ("net/sfc: support VLAN in flow API filters")
>>> Fixes: e2675132444e ("net/sfc: support TCP in flow API filters")
>>> Fixes: e01f84f42cad ("net/sfc: support UDP in flow API filters")
>>> Cc: stable@dpdk.org
>>> Cc: Roman Zhukov <roman.zhukov@oktetlabs.ru>
>>> Cc: Andrew Rybchenko <arybchenko@solarflare.com>
>>>
>>> Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
>>> ---
>>>    drivers/net/sfc/sfc_flow.c | 13 +++++++------
>>>    1 file changed, 7 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c
>>> index fe4c0b0c5..9060fdc2f 100644
>>> --- a/drivers/net/sfc/sfc_flow.c
>>> +++ b/drivers/net/sfc/sfc_flow.c
>>> @@ -7,6 +7,7 @@
>>>     * for Solarflare) and Solarflare Communications, Inc.
>>>     */
>>> +#include <rte_byteorder.h>
>>>    #include <rte_tailq.h>
>>>    #include <rte_common.h>
>>>    #include <rte_ethdev_driver.h>
>>> @@ -315,7 +316,7 @@ sfc_flow_parse_eth(const struct rte_flow_item *item,
>>>    	 */
>>>    	if (mask->type == supp_mask.type) {
>>>    		efx_spec->efs_match_flags |= EFX_FILTER_MATCH_ETHER_TYPE;
>>> -		efx_spec->efs_ether_type = rte_bswap16(spec->type);
>>> +		efx_spec->efs_ether_type = rte_be_to_cpu_16(spec->type);
>>>    	} else if (mask->type != 0) {
>>>    		goto fail_bad_mask;
>>>    	}
>>> @@ -370,7 +371,7 @@ sfc_flow_parse_vlan(const struct rte_flow_item *item,
>>>    	 * the outer tag and the next matches the inner tag.
>>>    	 */
>>>    	if (mask->tci == supp_mask.tci) {
>>> -		vid = rte_bswap16(spec->tci);
>>> +		vid = rte_be_to_cpu_16(spec->tci);
>>>    		if (!(efx_spec->efs_match_flags &
>>>    		      EFX_FILTER_MATCH_OUTER_VID)) {
>>> @@ -654,14 +655,14 @@ sfc_flow_parse_tcp(const struct rte_flow_item *item,
>>>    	 */
>>>    	if (mask->hdr.src_port == supp_mask.hdr.src_port) {
>>>    		efx_spec->efs_match_flags |= EFX_FILTER_MATCH_REM_PORT;
>>> -		efx_spec->efs_rem_port = rte_bswap16(spec->hdr.src_port);
>>> +		efx_spec->efs_rem_port = rte_be_to_cpu_16(spec->hdr.src_port);
>>>    	} else if (mask->hdr.src_port != 0) {
>>>    		goto fail_bad_mask;
>>>    	}
>>>    	if (mask->hdr.dst_port == supp_mask.hdr.dst_port) {
>>>    		efx_spec->efs_match_flags |= EFX_FILTER_MATCH_LOC_PORT;
>>> -		efx_spec->efs_loc_port = rte_bswap16(spec->hdr.dst_port);
>>> +		efx_spec->efs_loc_port = rte_be_to_cpu_16(spec->hdr.dst_port);
>>>    	} else if (mask->hdr.dst_port != 0) {
>>>    		goto fail_bad_mask;
>>>    	}
>>> @@ -735,14 +736,14 @@ sfc_flow_parse_udp(const struct rte_flow_item *item,
>>>    	 */
>>>    	if (mask->hdr.src_port == supp_mask.hdr.src_port) {
>>>    		efx_spec->efs_match_flags |= EFX_FILTER_MATCH_REM_PORT;
>>> -		efx_spec->efs_rem_port = rte_bswap16(spec->hdr.src_port);
>>> +		efx_spec->efs_rem_port = rte_be_to_cpu_16(spec->hdr.src_port);
>>>    	} else if (mask->hdr.src_port != 0) {
>>>    		goto fail_bad_mask;
>>>    	}
>>>    	if (mask->hdr.dst_port == supp_mask.hdr.dst_port) {
>>>    		efx_spec->efs_match_flags |= EFX_FILTER_MATCH_LOC_PORT;
>>> -		efx_spec->efs_loc_port = rte_bswap16(spec->hdr.dst_port);
>>> +		efx_spec->efs_loc_port = rte_be_to_cpu_16(spec->hdr.dst_port);
>>>    	} else if (mask->hdr.dst_port != 0) {
>>>    		goto fail_bad_mask;
>>>    	}
>> efs_filter_spec_t members are little-endian (_not_ host-endian). At least
>> comments
>> say so and to be consistent we use rte_bswap*() functions intentionally.
>> Yes, may be it is buggy in fact - I don't know. The code never worked on
>> big-endian.
>> So, we're aware and thanks for the reminder.
>> We'd prefer to keep it as is if there is no strong reasons to change.
> I didn't notice those members had to be little endian, I'll drop this patch
> from the series and fix subsequent patch [1] accordingly.
>
> Can you have a look at this patch before I roll new version for both series?
>
> Thanks.
>
> [1] http://dpdk.org/ml/archives/dev/2018-April/095311.html

We're still testing these patches since it requires fixes in test harness.
We'll provide feedback tomorrow.

Thanks,
Andrew.

  reply	other threads:[~2018-04-05 15:10 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-23 12:58 [PATCH v1 0/9] Bunch of flow API-related fixes Adrien Mazarguil
2018-03-23 12:58 ` [PATCH v1 1/9] net/mlx4: fix RSS resource leak in case of error Adrien Mazarguil
2018-03-23 12:58 ` [PATCH v1 2/9] net/mlx4: fix ignored RSS hash types Adrien Mazarguil
2018-03-23 12:58 ` [PATCH v1 3/9] app/testpmd: fix flow completion for RSS queues Adrien Mazarguil
2018-03-23 12:58 ` [PATCH v1 4/9] app/testpmd: fix lack of flow action configuration Adrien Mazarguil
2018-03-23 12:58 ` [PATCH v1 5/9] app/testpmd: fix RSS " Adrien Mazarguil
2018-05-07  6:53   ` Zhao1, Wei
2018-03-23 12:58 ` [PATCH v1 6/9] app/testpmd: fix missing RSS fields in flow action Adrien Mazarguil
2018-03-23 12:58 ` [PATCH v1 7/9] ethdev: fix shallow copy of flow API RSS action Adrien Mazarguil
2018-03-23 12:58 ` [PATCH v1 8/9] ethdev: fix missing boolean values in flow command Adrien Mazarguil
2018-03-23 12:58 ` [PATCH v1 9/9] ethdev: fix ABI version in meson build Adrien Mazarguil
2018-04-04 14:57 ` [PATCH v2 00/13] Bunch of flow API-related fixes Adrien Mazarguil
2018-04-04 14:57   ` [PATCH v2 01/13] net/mlx4: fix RSS resource leak in case of error Adrien Mazarguil
2018-04-04 14:57   ` [PATCH v2 02/13] net/mlx4: fix ignored RSS hash types Adrien Mazarguil
2018-04-04 14:57   ` [PATCH v2 03/13] net/mlx5: fix RSS flow action bounds check Adrien Mazarguil
2018-04-05  6:57     ` Nélio Laranjeiro
2018-04-04 14:57   ` [PATCH v2 04/13] net/bnxt: fix matching of flow API item masks Adrien Mazarguil
2018-04-04 14:57   ` [PATCH v2 05/13] net/sfc: fix endian conversions in flow API Adrien Mazarguil
2018-04-04 15:30     ` Andrew Rybchenko
2018-04-04 16:08       ` Adrien Mazarguil
2018-04-05 15:10         ` Andrew Rybchenko [this message]
2018-04-04 14:57   ` [PATCH v2 06/13] app/testpmd: fix flow completion for RSS queues Adrien Mazarguil
2018-04-04 14:57   ` [PATCH v2 07/13] app/testpmd: fix lack of flow action configuration Adrien Mazarguil
2018-04-05  6:59     ` [dpdk-stable] " Nélio Laranjeiro
2018-04-04 14:57   ` [PATCH v2 08/13] app/testpmd: fix RSS " Adrien Mazarguil
2018-04-05  7:39     ` [dpdk-stable] " Nélio Laranjeiro
2018-04-04 14:58   ` [PATCH v2 09/13] app/testpmd: fix missing RSS fields in flow action Adrien Mazarguil
2018-04-05  8:15     ` [dpdk-stable] " Nélio Laranjeiro
2018-04-04 14:58   ` [PATCH v2 10/13] ethdev: fix shallow copy of flow API RSS action Adrien Mazarguil
2018-04-04 14:58   ` [PATCH v2 11/13] ethdev: fix missing boolean values in flow command Adrien Mazarguil
2018-04-05  8:17     ` [dpdk-stable] " Nélio Laranjeiro
2018-04-04 14:58   ` [PATCH v2 12/13] ethdev: fix ABI version in meson build Adrien Mazarguil
2018-04-04 14:58   ` [PATCH v2 13/13] ethdev: fix missing include in flow API Adrien Mazarguil
2018-04-05  8:18     ` [dpdk-stable] " Nélio Laranjeiro
2018-04-06 13:22   ` [PATCH v3 00/11] Bunch of flow API-related fixes Adrien Mazarguil
2018-04-06 13:22     ` [PATCH v3 01/11] net/mlx4: fix RSS resource leak in case of error Adrien Mazarguil
2018-04-06 13:22     ` [PATCH v3 02/11] net/mlx4: fix ignored RSS hash types Adrien Mazarguil
2018-04-06 13:22     ` [PATCH v3 03/11] net/mlx5: fix RSS flow action bounds check Adrien Mazarguil
2018-04-06 13:22     ` [PATCH v3 04/11] net/bnxt: fix matching of flow API item masks Adrien Mazarguil
2018-04-06 13:22     ` [PATCH v3 05/11] app/testpmd: fix flow completion for RSS queues Adrien Mazarguil
2018-04-06 13:22     ` [PATCH v3 06/11] app/testpmd: fix lack of flow action configuration Adrien Mazarguil
2018-04-06 13:22     ` [PATCH v3 07/11] app/testpmd: fix RSS " Adrien Mazarguil
2018-04-06 13:22     ` [PATCH v3 08/11] app/testpmd: fix missing RSS fields in flow action Adrien Mazarguil
2018-04-06 13:22     ` [PATCH v3 09/11] ethdev: fix shallow copy of flow API RSS action Adrien Mazarguil
2018-04-06 13:22     ` [PATCH v3 10/11] ethdev: fix missing boolean values in flow command Adrien Mazarguil
2018-04-06 13:22     ` [PATCH v3 11/11] ethdev: fix missing include in flow API Adrien Mazarguil
     [not found]     ` <20180410161132.8776-1-adrien.mazarguil@6wind.com>
2018-04-10 16:34       ` [PATCH v4 02/11] net/mlx4: fix ignored RSS hash types Adrien Mazarguil
2018-04-10 16:34       ` [PATCH v4 03/11] net/mlx5: fix RSS flow action bounds check Adrien Mazarguil
2018-04-10 16:34       ` [PATCH v4 04/11] net/bnxt: fix matching of flow API item masks Adrien Mazarguil
2018-04-10 16:34       ` [PATCH v4 05/11] app/testpmd: fix flow completion for RSS queues Adrien Mazarguil
2018-04-10 16:34       ` [PATCH v4 06/11] app/testpmd: fix lack of flow action configuration Adrien Mazarguil
2018-04-10 16:34       ` [PATCH v4 07/11] app/testpmd: fix RSS " Adrien Mazarguil
2018-04-10 16:34       ` [PATCH v4 08/11] app/testpmd: fix missing RSS fields in flow action Adrien Mazarguil
2018-04-10 16:34       ` [PATCH v4 09/11] ethdev: fix shallow copy of flow API RSS action Adrien Mazarguil
2018-04-10 16:34       ` [PATCH v4 10/11] ethdev: fix missing boolean values in flow command Adrien Mazarguil
2018-04-10 16:34       ` [PATCH v4 11/11] ethdev: fix missing include in flow API Adrien Mazarguil
2018-04-16 16:21       ` [PATCH v5 00/11] Bunch of flow API-related fixes Adrien Mazarguil
2018-04-16 16:21         ` [PATCH v5 01/11] net/mlx4: fix RSS resource leak in case of error Adrien Mazarguil
2018-04-17  9:19           ` Nélio Laranjeiro
2018-04-16 16:21         ` [PATCH v5 02/11] net/mlx4: fix ignored RSS hash types Adrien Mazarguil
2018-04-17  9:20           ` Nélio Laranjeiro
2018-04-16 16:21         ` [PATCH v5 03/11] net/mlx5: fix RSS flow action bounds check Adrien Mazarguil
2018-04-16 16:21         ` [PATCH v5 04/11] net/bnxt: fix matching of flow API item masks Adrien Mazarguil
2018-04-16 16:21         ` [PATCH v5 05/11] app/testpmd: fix flow completion for RSS queues Adrien Mazarguil
2018-04-16 16:21         ` [PATCH v5 06/11] app/testpmd: fix lack of flow action configuration Adrien Mazarguil
2018-04-16 16:21         ` [PATCH v5 07/11] app/testpmd: fix RSS " Adrien Mazarguil
2018-04-16 16:22         ` [PATCH v5 08/11] app/testpmd: fix missing RSS fields in flow action Adrien Mazarguil
2018-04-16 16:22         ` [PATCH v5 09/11] ethdev: fix shallow copy of flow API RSS action Adrien Mazarguil
2018-04-17  9:18           ` [dpdk-stable] " Nélio Laranjeiro
2018-04-16 16:22         ` [PATCH v5 10/11] ethdev: fix missing boolean values in flow command Adrien Mazarguil
2018-04-16 19:17           ` Matan Azrad
2018-04-17  8:25             ` Adrien Mazarguil
2018-04-18 17:16               ` [dpdk-stable] " Ferruh Yigit
2018-04-19 10:18                 ` Adrien Mazarguil
2018-04-16 16:22         ` [PATCH v5 11/11] ethdev: fix missing include in flow API Adrien Mazarguil
2018-04-17  9:17         ` [PATCH v5 00/11] Bunch of flow API-related fixes Ferruh Yigit
2018-04-19 10:07         ` [PATCH v6 " Adrien Mazarguil
2018-04-19 10:07           ` [PATCH v6 01/11] net/mlx4: fix RSS resource leak in case of error Adrien Mazarguil
2018-04-19 10:07           ` [PATCH v6 02/11] net/mlx4: fix ignored RSS hash types Adrien Mazarguil
2018-04-19 10:07           ` [PATCH v6 03/11] net/mlx5: fix RSS flow action bounds check Adrien Mazarguil
2018-04-19 10:07           ` [PATCH v6 04/11] net/bnxt: fix matching of flow API item masks Adrien Mazarguil
2018-04-19 10:07           ` [PATCH v6 05/11] app/testpmd: fix flow completion for RSS queues Adrien Mazarguil
2018-04-19 10:07           ` [PATCH v6 06/11] app/testpmd: fix lack of flow action configuration Adrien Mazarguil
2018-04-19 10:07           ` [PATCH v6 07/11] app/testpmd: fix RSS " Adrien Mazarguil
2018-05-07  5:23             ` Peng, Yuan
2018-04-19 10:07           ` [PATCH v6 08/11] app/testpmd: fix missing RSS fields in flow action Adrien Mazarguil
2018-04-19 10:07           ` [PATCH v6 09/11] app/testpmd: fix missing boolean values in flow command Adrien Mazarguil
2018-04-19 10:07           ` [PATCH v6 10/11] ethdev: fix shallow copy of flow API RSS action Adrien Mazarguil
2018-04-19 10:07           ` [PATCH v6 11/11] ethdev: fix missing include in flow API Adrien Mazarguil
2018-04-19 14:03           ` [PATCH v6 00/11] Bunch of flow API-related fixes Ferruh Yigit
2018-04-19 14:07             ` Ferruh Yigit

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=6f11d761-167c-0716-a5b1-e850c800d5b8@solarflare.com \
    --to=arybchenko@solarflare.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=dev@dpdk.org \
    --cc=roman.zhukov@oktetlabs.ru \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.