From: Jiri Pirko <jiri@resnulli.us>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, arkadis@mellanox.com, idosch@mellanox.com,
mlxsw@mellanox.com
Subject: [patch net-next repost 5/8] mlxsw: spectrum_dpipe: Make host entry fill handler more generic
Date: Thu, 31 Aug 2017 17:59:16 +0200 [thread overview]
Message-ID: <20170831155919.1366-6-jiri@resnulli.us> (raw)
In-Reply-To: <20170831155919.1366-1-jiri@resnulli.us>
From: Arkadi Sharshevsky <arkadis@mellanox.com>
Change the host entry filler helper to be applicable for both IPv4/6
addresses.
Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
index 93ba6a6..5924e97 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
@@ -439,13 +439,12 @@ mlxsw_sp_dpipe_table_host_entry_prepare(struct devlink_dpipe_entry *entry,
}
static void
-__mlxsw_sp_dpipe_table_host4_entry_fill(struct devlink_dpipe_entry *entry,
- struct mlxsw_sp_rif *rif,
- unsigned char *ha, u32 dip)
+__mlxsw_sp_dpipe_table_host_entry_fill(struct devlink_dpipe_entry *entry,
+ struct mlxsw_sp_rif *rif,
+ unsigned char *ha, void *dip)
{
struct devlink_dpipe_value *value;
u32 *rif_value;
- u32 *dip_value;
u8 *ha_value;
/* Set Match RIF index */
@@ -458,9 +457,7 @@ __mlxsw_sp_dpipe_table_host4_entry_fill(struct devlink_dpipe_entry *entry,
/* Set Match DIP */
value = &entry->match_values[MLXSW_SP_DPIPE_TABLE_HOST_MATCH_DIP];
-
- dip_value = value->value;
- *dip_value = dip;
+ memcpy(value->value, dip, value->value_size);
/* Set Action DMAC */
value = entry->action_values;
@@ -478,7 +475,7 @@ mlxsw_sp_dpipe_table_host4_entry_fill(struct devlink_dpipe_entry *entry,
ha = mlxsw_sp_neigh_entry_ha(neigh_entry);
dip = mlxsw_sp_neigh4_entry_dip(neigh_entry);
- __mlxsw_sp_dpipe_table_host4_entry_fill(entry, rif, ha, dip);
+ __mlxsw_sp_dpipe_table_host_entry_fill(entry, rif, ha, &dip);
}
static void
--
2.9.3
next prev parent reply other threads:[~2017-08-31 15:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-31 15:59 [patch net-next repost 0/8] mlxsw: Add IPv6 host dpipe table Jiri Pirko
2017-08-31 15:59 ` [patch net-next repost 1/8] devlink: Add IPv6 header for dpipe Jiri Pirko
2017-08-31 15:59 ` [patch net-next repost 2/8] mlxsw: spectrum_router: Export IPv6 link local address check helper Jiri Pirko
2017-08-31 15:59 ` [patch net-next repost 3/8] mlxsw: spectrum_dpipe: Add IPv6 host table initial support Jiri Pirko
2017-08-31 15:59 ` [patch net-next repost 4/8] mlxsw: spectrum_router: Add IPv6 neighbor access helper Jiri Pirko
2017-08-31 15:59 ` Jiri Pirko [this message]
2017-08-31 15:59 ` [patch net-next repost 6/8] mlxsw: spectrum_dpipe: Add support for IPv6 host table dump Jiri Pirko
2017-08-31 15:59 ` [patch net-next repost 7/8] mlxsw: spectrum_router: Add support for setting counters on IPv6 neighbors Jiri Pirko
2017-08-31 15:59 ` [patch net-next repost 8/8] mlxsw: spectrum_dpipe: Add support for controlling IPv6 neighbor counters Jiri Pirko
2017-08-31 21:43 ` [patch net-next repost 0/8] mlxsw: Add IPv6 host dpipe table 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=20170831155919.1366-6-jiri@resnulli.us \
--to=jiri@resnulli.us \
--cc=arkadis@mellanox.com \
--cc=davem@davemloft.net \
--cc=idosch@mellanox.com \
--cc=mlxsw@mellanox.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).