All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guillaume Nault <gnault@redhat.com>
To: David Miller <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org, Taras Chornyi <tchornyi@marvell.com>,
	Ido Schimmel <idosch@nvidia.com>, Petr Machata <petrm@nvidia.com>,
	Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
	David Ahern <dsahern@kernel.org>
Subject: [PATCH net-next 5/5] net: marvell: prestera: Use dscp_t in struct prestera_kern_fib_cache
Date: Fri, 8 Apr 2022 22:08:50 +0200	[thread overview]
Message-ID: <d33d876900a6cc75a30ef0d5a3f00dc22f51673d.1649445279.git.gnault@redhat.com> (raw)
In-Reply-To: <cover.1649445279.git.gnault@redhat.com>

Use the new dscp_t type to replace the kern_tos field of struct
prestera_kern_fib_cache. This ensures ECN bits are ignored and makes it
compatible with the dscp fields of struct fib_entry_notifier_info and
struct fib_rt_info.

This also allows sparse to flag potential incorrect uses of DSCP and
ECN bits.

Signed-off-by: Guillaume Nault <gnault@redhat.com>
---
 drivers/net/ethernet/marvell/prestera/prestera_router.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/marvell/prestera/prestera_router.c b/drivers/net/ethernet/marvell/prestera/prestera_router.c
index a6b608ade2b9..3754d8aec76d 100644
--- a/drivers/net/ethernet/marvell/prestera/prestera_router.c
+++ b/drivers/net/ethernet/marvell/prestera/prestera_router.c
@@ -27,7 +27,7 @@ struct prestera_kern_fib_cache {
 	/* Indicate if route is not overlapped by another table */
 	struct rhash_head ht_node; /* node of prestera_router */
 	struct fib_info *fi;
-	u8 kern_tos;
+	dscp_t kern_dscp;
 	u8 kern_type;
 	bool reachable;
 };
@@ -101,7 +101,7 @@ prestera_kern_fib_cache_create(struct prestera_switch *sw,
 	memcpy(&fib_cache->key, key, sizeof(*key));
 	fib_info_hold(fi);
 	fib_cache->fi = fi;
-	fib_cache->kern_tos = inet_dscp_to_dsfield(dscp);
+	fib_cache->kern_dscp = dscp;
 	fib_cache->kern_type = type;
 
 	err = rhashtable_insert_fast(&sw->router->kern_fib_cache_ht,
@@ -133,7 +133,7 @@ __prestera_k_arb_fib_lpm_offload_set(struct prestera_switch *sw,
 	fri.tb_id = fc->key.kern_tb_id;
 	fri.dst = fc->key.addr.u.ipv4;
 	fri.dst_len = fc->key.prefix_len;
-	fri.dscp = inet_dsfield_to_dscp(fc->kern_tos);
+	fri.dscp = fc->kern_dscp;
 	fri.type = fc->kern_type;
 	/* flags begin */
 	fri.offload = offload;
-- 
2.21.3


  parent reply	other threads:[~2022-04-08 20:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-08 20:08 [PATCH net-next 0/5] ipv4: Convert several tos fields to dscp_t Guillaume Nault
2022-04-08 20:08 ` [PATCH net-next 1/5] ipv4: Use dscp_t in struct fib_rt_info Guillaume Nault
2022-04-10 17:01   ` Ido Schimmel
2022-04-10 17:58   ` David Ahern
2022-04-08 20:08 ` [PATCH net-next 2/5] ipv4: Use dscp_t in struct fib_entry_notifier_info Guillaume Nault
2022-04-10 17:01   ` Ido Schimmel
2022-04-10 17:59   ` David Ahern
2022-04-08 20:08 ` [PATCH net-next 3/5] netdevsim: Use dscp_t in struct nsim_fib4_rt Guillaume Nault
2022-04-09  3:38   ` Jakub Kicinski
2022-04-10 17:02   ` Ido Schimmel
2022-04-10 18:00   ` David Ahern
2022-04-08 20:08 ` [PATCH net-next 4/5] mlxsw: Use dscp_t in struct mlxsw_sp_fib4_entry Guillaume Nault
2022-04-10 17:02   ` Ido Schimmel
2022-04-08 20:08 ` Guillaume Nault [this message]
2022-04-11 15:09   ` [PATCH net-next 5/5] net: marvell: prestera: Use dscp_t in struct prestera_kern_fib_cache Yevhen Orlov
2022-04-12  1:20 ` [PATCH net-next 0/5] ipv4: Convert several tos fields to dscp_t patchwork-bot+netdevbpf

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=d33d876900a6cc75a30ef0d5a3f00dc22f51673d.1649445279.git.gnault@redhat.com \
    --to=gnault@redhat.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=petrm@nvidia.com \
    --cc=tchornyi@marvell.com \
    --cc=yoshfuji@linux-ipv6.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 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.