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

Commit 89114afd authored by Herbert Xu's avatar Herbert Xu Committed by David S. Miller
Browse files

[NET] gso: Add skb_is_gso



This patch adds the wrapper function skb_is_gso which can be used instead
of directly testing skb_shinfo(skb)->gso_size.  This makes things a little
nicer and allows us to change the primary key for indicating whether an skb
is GSO (if we ever want to do that).

Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9c6c6795
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1639,7 +1639,7 @@ bnx2_tx_int(struct bnx2 *bp)
		skb = tx_buf->skb;
#ifdef BCM_TSO 
		/* partial BD completions possible with TSO packets */
		if (skb_shinfo(skb)->gso_size) {
		if (skb_is_gso(skb)) {
			u16 last_idx, last_ring_idx;

			last_idx = sw_cons +
+1 −1
Original line number Diff line number Diff line
@@ -1417,7 +1417,7 @@ int t1_start_xmit(struct sk_buff *skb, struct net_device *dev)
	struct cpl_tx_pkt *cpl;

#ifdef NETIF_F_TSO
	if (skb_shinfo(skb)->gso_size) {
	if (skb_is_gso(skb)) {
		int eth_type;
		struct cpl_tx_pkt_lso *hdr;

+3 −4
Original line number Diff line number Diff line
@@ -2394,7 +2394,7 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
	uint8_t ipcss, ipcso, tucss, tucso, hdr_len;
	int err;

	if (skb_shinfo(skb)->gso_size) {
	if (skb_is_gso(skb)) {
		if (skb_header_cloned(skb)) {
			err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC);
			if (err)
@@ -2519,7 +2519,7 @@ e1000_tx_map(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
		 * tso gets written back prematurely before the data is fully
		 * DMA'd to the controller */
		if (!skb->data_len && tx_ring->last_tx_tso &&
		    !skb_shinfo(skb)->gso_size) {
		    !skb_is_gso(skb)) {
			tx_ring->last_tx_tso = 0;
			size -= 4;
		}
@@ -2806,8 +2806,7 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)

#ifdef NETIF_F_TSO
	/* Controller Erratum workaround */
	if (!skb->data_len && tx_ring->last_tx_tso &&
	    !skb_shinfo(skb)->gso_size)
	if (!skb->data_len && tx_ring->last_tx_tso && !skb_is_gso(skb))
		count++;
#endif

+1 −1
Original line number Diff line number Diff line
@@ -1495,7 +1495,7 @@ static int nv_start_xmit(struct sk_buff *skb, struct net_device *dev)
	np->tx_skbuff[nr] = skb;

#ifdef NETIF_F_TSO
	if (skb_shinfo(skb)->gso_size)
	if (skb_is_gso(skb))
		tx_flags_extra = NV_TX2_TSO | (skb_shinfo(skb)->gso_size << NV_TX2_TSO_SHIFT);
	else
#endif
+1 −1
Original line number Diff line number Diff line
@@ -1173,7 +1173,7 @@ ixgb_tso(struct ixgb_adapter *adapter, struct sk_buff *skb)
	uint16_t ipcse, tucse, mss;
	int err;

	if(likely(skb_shinfo(skb)->gso_size)) {
	if (likely(skb_is_gso(skb))) {
		if (skb_header_cloned(skb)) {
			err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC);
			if (err)
Loading