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

Commit bc8acf2c authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

drivers/net: avoid some skb->ip_summed initializations



fresh skbs have ip_summed set to CHECKSUM_NONE (0)

We can avoid setting again skb->ip_summed to CHECKSUM_NONE in drivers.

Introduce skb_checksum_none_assert() helper so that we keep this
assertion documented in driver sources.

Change most occurrences of :

skb->ip_summed = CHECKSUM_NONE;

by :

skb_checksum_none_assert(skb);

Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7162f669
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -561,7 +561,7 @@ static int cp_rx_poll(struct napi_struct *napi, int budget)
		if (cp_rx_csum_ok(status))
			skb->ip_summed = CHECKSUM_UNNECESSARY;
		else
			skb->ip_summed = CHECKSUM_NONE;
			skb_checksum_none_assert(skb);

		skb_put(skb, len);

+1 −1
Original line number Diff line number Diff line
@@ -2033,7 +2033,7 @@ static void ace_rx_int(struct net_device *dev, u32 rxretprd, u32 rxretcsm)
			skb->csum = htons(csum);
			skb->ip_summed = CHECKSUM_COMPLETE;
		} else {
			skb->ip_summed = CHECKSUM_NONE;
			skb_checksum_none_assert(skb);
		}

		/* send it up */
+1 −1
Original line number Diff line number Diff line
@@ -1719,7 +1719,7 @@ static inline void atl1c_rx_checksum(struct atl1c_adapter *adapter,
	 * cannot figure out if the packet is fragmented or not,
	 * so we tell the KERNEL CHECKSUM_NONE
	 */
	skb->ip_summed = CHECKSUM_NONE;
	skb_checksum_none_assert(skb);
}

static int atl1c_alloc_rx_buffer(struct atl1c_adapter *adapter, const int ringid)
+1 −1
Original line number Diff line number Diff line
@@ -1331,7 +1331,7 @@ static inline void atl1e_rx_checksum(struct atl1e_adapter *adapter,
	u16 pkt_flags;
	u16 err_flags;

	skb->ip_summed = CHECKSUM_NONE;
	skb_checksum_none_assert(skb);
	pkt_flags = prrs->pkt_flag;
	err_flags = prrs->err_flag;
	if (((pkt_flags & RRS_IS_IPV4) || (pkt_flags & RRS_IS_IPV6)) &&
+1 −1
Original line number Diff line number Diff line
@@ -1805,7 +1805,7 @@ static void atl1_rx_checksum(struct atl1_adapter *adapter,
	 * the higher layers and let it be sorted out there.
	 */

	skb->ip_summed = CHECKSUM_NONE;
	skb_checksum_none_assert(skb);

	if (unlikely(rrd->pkt_flg & PACKET_FLAG_ERR)) {
		if (rrd->err_flg & (ERR_FLAG_CRC | ERR_FLAG_TRUNC |
Loading