[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1307481879.2908.25.camel@bwh-desktop>
Date: Tue, 07 Jun 2011 22:24:39 +0100
From: Ben Hutchings <bhutchings@...arflare.com>
To: Jeff Kirsher <jeffrey.t.kirsher@...el.com>
Cc: davem@...emloft.net, Alexander Duyck <alexander.h.duyck@...el.com>,
netdev@...r.kernel.org, gospo@...hat.com
Subject: Re: [net-next 30/40] ixgbe: add support for nfc addition and
removal of filters
On Tue, 2011-06-07 at 05:33 -0700, Jeff Kirsher wrote:
> From: Alexander Duyck <alexander.h.duyck@...el.com>
>
> This change is meant to allow for nfc to insert and remove filters in order
> to test the ethtool interface which includes it's own rules manager.
>
> Signed-off-by: Alexander Duyck <alexander.h.duyck@...el.com>
> Tested-by: Ross Brattain <ross.b.brattain@...el.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@...el.com>
> ---
> drivers/net/ixgbe/ixgbe_ethtool.c | 245 +++++++++++++++++++++++++++++++++++++
> drivers/net/ixgbe/ixgbe_main.c | 45 +++++++
> 2 files changed, 290 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
> index 2c70363..f37c9b8 100644
> --- a/drivers/net/ixgbe/ixgbe_ethtool.c
> +++ b/drivers/net/ixgbe/ixgbe_ethtool.c
[...]
> + /* Copy input into formatted structures */
> + input->filter.formatted.src_ip[0] = fsp->h_u.tcp_ip4_spec.ip4src;
> + mask.formatted.src_ip[0] = fsp->m_u.tcp_ip4_spec.ip4src;
> + input->filter.formatted.dst_ip[0] = fsp->h_u.tcp_ip4_spec.ip4dst;
> + mask.formatted.dst_ip[0] = fsp->m_u.tcp_ip4_spec.ip4dst;
> + input->filter.formatted.src_port = fsp->h_u.tcp_ip4_spec.psrc;
> + mask.formatted.src_port = fsp->m_u.tcp_ip4_spec.psrc;
> + input->filter.formatted.dst_port = fsp->h_u.tcp_ip4_spec.pdst;
> + mask.formatted.dst_port = fsp->m_u.tcp_ip4_spec.pdst;
> +
> + if (fsp->flow_type & FLOW_EXT) {
> + input->filter.formatted.vm_pool =
> + (unsigned char)ntohl(fsp->h_ext.data[1]);
> + mask.formatted.vm_pool =
> + (unsigned char)ntohl(fsp->m_ext.data[1]);
> + input->filter.formatted.vlan_id = fsp->h_ext.vlan_tci;
> + mask.formatted.vlan_id = fsp->m_ext.vlan_tci;
> + input->filter.formatted.flex_bytes =
> + fsp->h_ext.vlan_etype;
> + mask.formatted.flex_bytes = fsp->m_ext.vlan_etype;
> + }
[...]
Sure you don't need any byte-swapping for the IP, port, and VLAN tag?
Also is the 'vlan_id' field used to match the whole VLAN/priority tag or
only the VID? If it only matches the VID then you need to check that
the priority and CF bits are not set in the given mask.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists