linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Lobakin <alobakin@marvell.com>
To: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Cc: Alexander Lobakin <alobakin@marvell.com>,
	Igor Russkikh <irusskikh@marvell.com>,
	Michal Kalderon <michal.kalderon@marvell.com>,
	"Ariel Elior" <aelior@marvell.com>,
	Denis Bolotin <denis.bolotin@marvell.com>,
	<GR-everest-linux-l2@marvell.com>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: [PATCH net-next 9/9] net: qede: fix BE vs CPU comparison
Date: Mon, 6 Jul 2020 18:38:21 +0300	[thread overview]
Message-ID: <20200706153821.786-10-alobakin@marvell.com> (raw)
In-Reply-To: <20200706153821.786-1-alobakin@marvell.com>

Flow Dissector's keys are mostly Network / Big Endian. U{16,32}_MAX are
the same in either of byteorders, but let's make sparse happy with
wrapping them into noops.

Signed-off-by: Alexander Lobakin <alobakin@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
---
 drivers/net/ethernet/qlogic/qede/qede_filter.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qede/qede_filter.c b/drivers/net/ethernet/qlogic/qede/qede_filter.c
index db17a675bd02..d8100434e340 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_filter.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_filter.c
@@ -1764,8 +1764,8 @@ qede_flow_parse_ports(struct qede_dev *edev, struct flow_rule *rule,
 		struct flow_match_ports match;
 
 		flow_rule_match_ports(rule, &match);
-		if ((match.key->src && match.mask->src != U16_MAX) ||
-		    (match.key->dst && match.mask->dst != U16_MAX)) {
+		if ((match.key->src && match.mask->src != htons(U16_MAX)) ||
+		    (match.key->dst && match.mask->dst != htons(U16_MAX))) {
 			DP_NOTICE(edev, "Do not support ports masks\n");
 			return -EINVAL;
 		}
@@ -1817,8 +1817,8 @@ qede_flow_parse_v4_common(struct qede_dev *edev, struct flow_rule *rule,
 		struct flow_match_ipv4_addrs match;
 
 		flow_rule_match_ipv4_addrs(rule, &match);
-		if ((match.key->src && match.mask->src != U32_MAX) ||
-		    (match.key->dst && match.mask->dst != U32_MAX)) {
+		if ((match.key->src && match.mask->src != htonl(U32_MAX)) ||
+		    (match.key->dst && match.mask->dst != htonl(U32_MAX))) {
 			DP_NOTICE(edev, "Do not support ipv4 prefix/masks\n");
 			return -EINVAL;
 		}
-- 
2.25.1


  parent reply	other threads:[~2020-07-06 15:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-06 15:38 [PATCH net-next 0/9] net: qed/qede: W=1 C=1 warnings cleanup Alexander Lobakin
2020-07-06 15:38 ` [PATCH net-next 1/9] net: qed: move static iro_arr[] out of header file Alexander Lobakin
2020-07-06 15:38 ` [PATCH net-next 2/9] net: qed: cleanup global structs declarations Alexander Lobakin
2020-07-06 15:38 ` [PATCH net-next 3/9] net: qed: correct qed_hw_err_notify() prototype Alexander Lobakin
2020-07-06 15:38 ` [PATCH net-next 4/9] net: qed: address kernel-doc warnings Alexander Lobakin
2020-07-06 15:38 ` [PATCH net-next 5/9] net: qed: improve indentation of some parts of code Alexander Lobakin
2020-07-06 15:38 ` [PATCH net-next 6/9] net: qed: use ptr shortcuts to dedup field accessing in some parts Alexander Lobakin
2020-07-06 15:38 ` [PATCH net-next 7/9] net: qed: sanitize BE/LE data processing Alexander Lobakin
2020-07-06 15:38 ` [PATCH net-next 8/9] net: qede: fix kernel-doc for qede_ptp_adjfreq() Alexander Lobakin
2020-07-06 15:38 ` Alexander Lobakin [this message]
2020-07-06 20:19 ` [PATCH net-next 0/9] net: qed/qede: W=1 C=1 warnings cleanup David Miller

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=20200706153821.786-10-alobakin@marvell.com \
    --to=alobakin@marvell.com \
    --cc=GR-everest-linux-l2@marvell.com \
    --cc=aelior@marvell.com \
    --cc=davem@davemloft.net \
    --cc=denis.bolotin@marvell.com \
    --cc=irusskikh@marvell.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.kalderon@marvell.com \
    --cc=netdev@vger.kernel.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).