Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 815d3bae authored by Chris Metcalf's avatar Chris Metcalf Committed by David S. Miller
Browse files

tile: avoid bug in tilepro net driver built with old hypervisor



Building against headers from an older Tilera hypervisor can cause
the frags[] array to be overrun.  Don't enable TSO in that case.

Signed-off-by: default avatarChris Metcalf <cmetcalf@tilera.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 439a93a0
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -1929,7 +1929,7 @@ static int tile_net_tx(struct sk_buff *skb, struct net_device *dev)

	unsigned int csum_start = skb_checksum_start_offset(skb);

	lepp_frag_t frags[LEPP_MAX_FRAGS];
	lepp_frag_t frags[1 + MAX_SKB_FRAGS];

	unsigned int num_frags;

@@ -1944,7 +1944,7 @@ static int tile_net_tx(struct sk_buff *skb, struct net_device *dev)
	unsigned int cmd_head, cmd_tail, cmd_next;
	unsigned int comp_tail;

	lepp_cmd_t cmds[LEPP_MAX_FRAGS];
	lepp_cmd_t cmds[1 + MAX_SKB_FRAGS];


	/*
@@ -2332,6 +2332,9 @@ static void tile_net_setup(struct net_device *dev)
	features |= NETIF_F_LLTX;
	features |= NETIF_F_HW_CSUM;
	features |= NETIF_F_SG;

	/* We support TSO iff the HV supports sufficient frags. */
	if (LEPP_MAX_FRAGS >= 1 + MAX_SKB_FRAGS)
		features |= NETIF_F_TSO;

	/* We can't support HIGHDMA without hash_default, since we need