lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 14 Jan 2015 15:55:42 +0300
From:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:	Sriharsha Basavapatna <sriharsha.basavapatna@...lex.com>,
	netdev@...r.kernel.org
Subject: Re: [PATCH net] be2net: Allow GRE to work concurrently while a VxLAN
 tunnel is configured

Hello.

On 1/15/2015 6:37 AM, Sriharsha Basavapatna wrote:

> Other tunnels like GRE break while VxLAN offloads are enabled in Skyhawk-R. To
> avoid this, we should restrict offload features on a per-packet basis in such
> conditions.

> Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@...lex.com>
> ---
>   drivers/net/ethernet/emulex/benet/be_main.c |   41 +++++++++++++++++++++++++--
>   1 file changed, 38 insertions(+), 3 deletions(-)

    Some nitpicking, mostly grammatical...

> diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
> index 41a0a54..726a4a4 100644
> --- a/drivers/net/ethernet/emulex/benet/be_main.c
> +++ b/drivers/net/ethernet/emulex/benet/be_main.c
[...]
> @@ -4463,7 +4464,41 @@ static netdev_features_t be_features_check(struct sk_buff *skb,
>   					   struct net_device *dev,
>   					   netdev_features_t features)
>   {
> -	return vxlan_features_check(skb, features);
> +	struct be_adapter *adapter = netdev_priv(dev);
> +	u8 l4_hdr = 0;
> +
> +	/* The code below restricts offload features for some tunneled packets.
> +	 * Offload features for normal(non tunnel) packets are unchanged.

    You forgot space before (.

> +	 */
> +	if (!skb->encapsulation ||
> +	    !(adapter->flags & BE_FLAGS_VXLAN_OFFLOADS))
> +		return features;
> +
> +	/* It's an encapsulated packet and VxLAN offloads are enabled. We
> +	 * should disable tunnel offload features if it's not a VxLAN packet,
> +	 * as tunnel offloads have been enabled only for VxLAN. This is done to
> +	 * allow other tunneled trafffic like GRE work fine while VxLAN

    Just "traffic", too many f's.

> +	 * offloads are configured in Skyhawk-R.
> +	 */
> +	switch (vlan_get_protocol(skb)) {
> +	case htons(ETH_P_IP):
> +		l4_hdr = ip_hdr(skb)->protocol;
> +		break;
> +	case htons(ETH_P_IPV6):
> +		l4_hdr = ipv6_hdr(skb)->nexthdr;
> +		break;
> +	default:
> +		return features;
> +	}
> +
> +	if (l4_hdr != IPPROTO_UDP ||
> +	    skb->inner_protocol_type != ENCAP_TYPE_ETHER ||
> +	    skb->inner_protocol != htons(ETH_P_TEB) ||
> +	    (skb_inner_mac_header(skb) - skb_transport_header(skb) !=
> +	    sizeof(struct udphdr) + sizeof(struct vxlanhdr)))

    () not needed around !=.

[...]

WBR, Sergei

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ