From: Jiri Pirko <jiri@resnulli.us>
To: David Ahern <dsahern@gmail.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net,
arkadis@mellanox.com, idosch@mellanox.com, mlxsw@mellanox.com
Subject: Re: [patch net-next 6/8] mlxsw: spectrum_dpipe: Add support for IPv6 host table dump
Date: Thu, 31 Aug 2017 09:18:23 +0200 [thread overview]
Message-ID: <20170831071823.GB1973@nanopsycho> (raw)
In-Reply-To: <e1e906eb-7c4e-1653-9bd2-2924127f3dcb@gmail.com>
Wed, Aug 30, 2017 at 07:42:36PM CEST, dsahern@gmail.com wrote:
>On 8/30/17 6:03 AM, Jiri Pirko wrote:
>> diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
>> index 5924e97..75da2ef 100644
>> --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
>> +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
>> @@ -386,8 +386,19 @@ mlxsw_sp_dpipe_table_host_match_action_prepare(struct devlink_dpipe_match *match
>>
>> match = &matches[MLXSW_SP_DPIPE_TABLE_HOST_MATCH_DIP];
>> match->type = DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT;
>> - match->header = &devlink_dpipe_header_ipv4;
>> - match->field_id = DEVLINK_DPIPE_FIELD_IPV4_DST_IP;
>> + switch (type) {
>> + case AF_INET:
>> + match->header = &devlink_dpipe_header_ipv4;
>> + match->field_id = DEVLINK_DPIPE_FIELD_IPV4_DST_IP;
>> + break;
>> + case AF_INET6:
>> + match->header = &devlink_dpipe_header_ipv6;
>> + match->field_id = DEVLINK_DPIPE_FIELD_IPV6_DST_IP;
>> + break;
>> + default:
>> + WARN_ON(1);
>
>Here as well.
>
>> + return;
>> + }
>>
>> action->type = DEVLINK_DPIPE_ACTION_TYPE_FIELD_MODIFY;
>> action->header = &devlink_dpipe_header_ethernet;
>> @@ -424,7 +435,18 @@ mlxsw_sp_dpipe_table_host_entry_prepare(struct devlink_dpipe_entry *entry,
>> match_value = &match_values[MLXSW_SP_DPIPE_TABLE_HOST_MATCH_DIP];
>>
>> match_value->match = match;
>> - match_value->value_size = sizeof(u32);
>> + switch (type) {
>> + case AF_INET:
>> + match_value->value_size = sizeof(u32);
>> + break;
>> + case AF_INET6:
>> + match_value->value_size = sizeof(struct in6_addr);
>> + break;
>> + default:
>> + WARN_ON(1);
>
>And here. WARN_ON is overkill
Again, only in case of bug in kernel.
>
>> + return -EINVAL;
>> + }
>> +
>> match_value->value = kmalloc(match_value->value_size, GFP_KERNEL);
>> if (!match_value->value)
>> return -ENOMEM;
>
next prev parent reply other threads:[~2017-08-31 7:18 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-30 12:02 [patch net-next 0/8] mlxsw: Add IPv6 host dpipe table Jiri Pirko
2017-08-30 12:02 ` [patch net-next 1/8] devlink: Add IPv6 header for dpipe Jiri Pirko
2017-08-30 12:03 ` [patch net-next 2/8] mlxsw: spectrum_router: Export IPv6 link local address check helper Jiri Pirko
2017-08-30 12:03 ` [patch net-next 3/8] mlxsw: spectrum_dpipe: Add IPv6 host table initial support Jiri Pirko
2017-08-30 17:36 ` David Ahern
2017-08-31 7:17 ` Jiri Pirko
2017-08-30 12:03 ` [patch net-next 4/8] mlxsw: spectrum_router: Add IPv6 neighbor access helper Jiri Pirko
2017-08-30 12:03 ` [patch net-next 5/8] mlxsw: spectrum_dpipe: Make host entry fill handler more generic Jiri Pirko
2017-08-30 12:03 ` [patch net-next 6/8] mlxsw: spectrum_dpipe: Add support for IPv6 host table dump Jiri Pirko
2017-08-30 17:42 ` David Ahern
2017-08-31 7:18 ` Jiri Pirko [this message]
2017-08-30 12:03 ` [patch net-next 7/8] mlxsw: spectrum_router: Add support for setting counters on IPv6 neighbors Jiri Pirko
2017-08-30 17:43 ` David Ahern
2017-08-30 12:03 ` [patch net-next 8/8] mlxsw: spectrum_dpipe: Add support for controlling IPv6 neighbor counters Jiri Pirko
2017-08-30 17:26 ` [patch net-next 0/8] mlxsw: Add IPv6 host dpipe table Andrew Lunn
2017-08-30 17:33 ` David Ahern
2017-08-31 12:26 ` Arkadi Sharshevsky
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=20170831071823.GB1973@nanopsycho \
--to=jiri@resnulli.us \
--cc=arkadis@mellanox.com \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--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).