From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by dpdk.org (Postfix) with ESMTP id A96D71C7D0 for ; Wed, 4 Apr 2018 18:08:56 +0200 (CEST) Received: by mail-wm0-f53.google.com with SMTP id p9so42424841wmc.3 for ; Wed, 04 Apr 2018 09:08:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=QAB8fuSSMXrEtZE7CJrgwbDMAiPAxUZy6Um8lQcQz8k=; b=wdAQfMFqOpYBQbYZ3EdtnR91t9lFis1zCI4k+deXCjGhEpSQlkdRmBN3p+t4325mR9 IX1i8V7xocj+cnDEkm1VWsY3b9+orkSD/JGAdWxJjYhYDJzbS5vsnurQIGolUJqnRneN jt+Jd1lUtg6MJHZUaI4fnd+eq+H10EWYkGxelEl7Tflzk0Ap2X5A5U4PxNSq3cqzqUyn GNB3UwHCpQ/Wio9RpOYG/yylxLPJFXEUrXZ00Ou3hgERi+FstPl/f2REypEGIyq9VO4D tXyp/3lgYEArzkZ4dM2Vo6FbSCZstufGSmLFfpWUezkp/76QWFD74DzO0rxR4ISBnqeq Szgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=QAB8fuSSMXrEtZE7CJrgwbDMAiPAxUZy6Um8lQcQz8k=; b=rKuCL/Fbg9kLlfkRiYcO0ukfu41/PmrssnVHTPsUdlqFdYYjo8zxnfBpUgLnSmRLGf shW25KYMaMU7csAtB8F9o9lpLZaDZ4UZ1ZcG4/d6tX5uIA5/dC2eQRbL1e/hnxQJZtY/ FsrmED9odKKGpctAw3JOcmyz5IIQFFphVYjQ3Fjn9cP7cppdbfjjZPynzBPjT+/7Kus9 6PP1WsZzTLyZuiivUOLLakkTduzrsXO/O7hBYpunzNu9gjl+LOVbz4tX7E1tvyMyOd9F oEVk6Zwc79kdRYt2y/J7cT6RsnX7I5FmT/TkD5HUYPo2LFlhsrpvJzbhtEdbC0NV8bRu h8Og== X-Gm-Message-State: AElRT7GUg6e7+5Cspouq6z/z+6yvIpQWGp+AiW4FrloNVvQOV0liohD9 bDYGpJdTCLTuguytM3W/4mw8Pw== X-Google-Smtp-Source: AIpwx4/zKLFOuVinuk+5dtGOquaaps3IHH2UKZnpIINBh5r7FmvJ22jBWRbE4oi4xjsWJXU7P5eAoQ== X-Received: by 10.28.106.17 with SMTP id f17mr8594605wmc.92.1522858136409; Wed, 04 Apr 2018 09:08:56 -0700 (PDT) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id y100sm29170053wmh.2.2018.04.04.09.08.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Apr 2018 09:08:55 -0700 (PDT) Date: Wed, 4 Apr 2018 18:08:42 +0200 From: Adrien Mazarguil To: Andrew Rybchenko Cc: dev@dpdk.org, stable@dpdk.org, Roman Zhukov Message-ID: <20180404160842.GG4957@6wind.com> References: <20180323124725.15806-1-adrien.mazarguil@6wind.com> <20180404144805.11966-1-adrien.mazarguil@6wind.com> <20180404144805.11966-6-adrien.mazarguil@6wind.com> <83b6a6b0-2f97-0a24-d7dd-887ea4cdcd83@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83b6a6b0-2f97-0a24-d7dd-887ea4cdcd83@solarflare.com> Subject: Re: [dpdk-dev] [PATCH v2 05/13] net/sfc: fix endian conversions in flow API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Apr 2018 16:08:56 -0000 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 > > Cc: Andrew Rybchenko > > > > Signed-off-by: Adrien Mazarguil > > --- > > 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 > > #include > > #include > > #include > > @@ -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 -- Adrien Mazarguil 6WIND