[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1454636854.20702.16.camel@decadent.org.uk>
Date: Fri, 05 Feb 2016 01:47:34 +0000
From: Ben Hutchings <ben@...adent.org.uk>
To: Edward Cree <ecree@...arflare.com>,
David Miller <davem@...emloft.net>
Cc: netdev@...r.kernel.org, linux-net-drivers@...arflare.com
Subject: Re: [PATCH net-next 2/2] sfc: implement IPv6 NFC (and
IPV4_USER_FLOW)
On Tue, 2016-02-02 at 18:49 +0000, Edward Cree wrote:
> Signed-off-by: Edward Cree <ecree@...arflare.com>
> ---
> drivers/net/ethernet/sfc/ethtool.c | 176 +++++++++++++++++++++++++++++++++++++
> 1 file changed, 176 insertions(+)
>
> diff --git a/drivers/net/ethernet/sfc/ethtool.c b/drivers/net/ethernet/sfc/ethtool.c
> index 0347976..49fac36 100644
> --- a/drivers/net/ethernet/sfc/ethtool.c
> +++ b/drivers/net/ethernet/sfc/ethtool.c
[...]
> static int efx_ethtool_get_class_rule(struct efx_nic *efx,
> struct ethtool_rx_flow_spec *rule)
> {
[...]
> @@ -855,6 +896,39 @@ static int efx_ethtool_get_class_rule(struct efx_nic *efx,
> mac_entry->h_proto = spec.ether_type;
> mac_mask->h_proto = ETHER_TYPE_FULL_MASK;
> }
> + } else if (spec.match_flags & EFX_FILTER_MATCH_ETHER_TYPE &&
> + spec.ether_type == htons(ETH_P_IP)) {
Shouldn't this also check that no unhandled match flags are set?
> + rule->flow_type = IPV4_USER_FLOW;
> + uip_entry->ip_ver = ETH_RX_NFC_IP4;
> + if (spec.match_flags & EFX_FILTER_MATCH_IP_PROTO) {
> + uip_mask->proto = IP_PROTO_FULL_MASK;
> + uip_entry->proto = spec.ip_proto;
> + }
> + if (spec.match_flags & EFX_FILTER_MATCH_LOC_HOST) {
> + uip_entry->ip4dst = spec.loc_host[0];
> + uip_mask->ip4dst = IP4_ADDR_FULL_MASK;
> + }
> + if (spec.match_flags & EFX_FILTER_MATCH_REM_HOST) {
> + uip_entry->ip4src = spec.rem_host[0];
> + uip_mask->ip4src = IP4_ADDR_FULL_MASK;
> + }
> + } else if (spec.match_flags & EFX_FILTER_MATCH_ETHER_TYPE &&
> + spec.ether_type == htons(ETH_P_IPV6)) {
Same here.
[...]
> static int efx_ethtool_set_class_rule(struct efx_nic *efx,
> struct ethtool_rx_flow_spec *rule)
> {
[...]
> + case IPV6_USER_FLOW:
> + if (uip6_mask->l4_4_bytes || uip6_mask->tos)
> + return -EINVAL;
> + spec.match_flags = EFX_FILTER_MATCH_ETHER_TYPE;
> + spec.ether_type = htons(ETH_P_IPV6);
> + if (!ip6_mask_is_empty(ip6_mask->ip6dst)) {
This should use uip6_mask not ip6_mask.
> + if (!ip6_mask_is_full(uip6_mask->ip6dst))
> + return -EINVAL;
> + spec.match_flags |= EFX_FILTER_MATCH_LOC_HOST;
> + memcpy(spec.loc_host, uip6_entry->ip6dst, sizeof(spec.loc_host));
> + }
> + if (!ip6_mask_is_empty(ip6_mask->ip6src)) {
[...]
Same here.
Ben.
--
Ben Hutchings
It is a miracle that curiosity survives formal education. - Albert Einstein
Download attachment "signature.asc" of type "application/pgp-signature" (812 bytes)
Powered by blists - more mailing lists