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] [thread-next>] [day] [month] [year] [list]
Message-ID: <D0814FB9.5EA7E%matthew.vick@intel.com>
Date:	Fri, 7 Nov 2014 01:07:36 +0000
From:	"Vick, Matthew" <matthew.vick@...el.com>
To:	Joe Stringer <joestringer@...ira.com>,
	"alexander.duyck@...il.com" <alexander.duyck@...il.com>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"Dept-GELinuxNICDev@...gic.com" <Dept-GELinuxNICDev@...gic.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC:	"sathya.perla@...lex.com" <sathya.perla@...lex.com>,
	"Kirsher, Jeffrey T" <jeffrey.t.kirsher@...el.com>,
	Linux NICS <Linux-nics@...tope.jf.intel.com>,
	"amirv@...lanox.com" <amirv@...lanox.com>,
	"shahed.shaikh@...gic.com" <shahed.shaikh@...gic.com>,
	"therbert@...gle.com" <therbert@...gle.com>
Subject: Re: [PATCH net 3/5] fm10k: Implement ndo_gso_check()

On 11/6/14, 1:15 PM, "Joe Stringer" <joestringer@...ira.com> wrote:

>Oh, I suppose we need to check the gso_type too. More like this?
>
>+static bool fm10k_gso_check(struct sk_buff *skb, struct net_device *dev)
>+{
>+       if ((skb_shinfo(skb)->gso_type & (SKB_GSO_UDP_TUNNEL |
>SKB_GSO_GRE)) &&
>+           !fm10k_tx_encap_offload(skb))
>+               return false;
>+
>+       return true;
>+}

It seems like the skb_shinfo(skb)->gso_type check should be in some more
generic ndo_gso_check that drivers can default to/extend. Then, we could
end up with something like

static bool fm10k_gso_check(struct sk_buff *skb, struct net_device *dev)
{
	if (skb_gso_check(skb, dev) && !fm10k_tx_encap_offload(skb))
		return false;

	return true;
}

This could even be simplified and still legible as

static bool fm10k_gso_check(struct sk_buff *skb, struct net_device *dev)
{
	return !(skb_gso_check(skb, dev) && !fm10k_tx_encap_offload(skb));
}

What do you think of this approach?

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