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

Commit aa8223c7 authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo Committed by David S. Miller
Browse files

[SK_BUFF]: Introduce tcp_hdr(), remove skb->h.th

parent ab6a5bb6
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -1298,9 +1298,10 @@ static int atl1_tso(struct atl1_adapter *adapter, struct sk_buff *skb,

			iph->tot_len = 0;
			iph->check = 0;
			skb->h.th->check = ~csum_tcpudp_magic(iph->saddr,
			tcp_hdr(skb)->check = ~csum_tcpudp_magic(iph->saddr,
								 iph->daddr, 0,
							      IPPROTO_TCP, 0);
								 IPPROTO_TCP,
								 0);
			ipofst = skb_network_offset(skb);
			if (ipofst != ENET_HEADER_SIZE) /* 802.3 frame */
				tso->tsopl |= 1 << TSO_PARAM_ETHTYPE_SHIFT;
+4 −4
Original line number Diff line number Diff line
@@ -4524,7 +4524,7 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
		vlan_tag_flags |= TX_BD_FLAGS_SW_LSO;

		tcp_opt_len = 0;
		if (skb->h.th->doff > 5)
		if (tcp_hdr(skb)->doff > 5)
			tcp_opt_len = tcp_optlen(skb);

		ip_tcp_len = ip_hdrlen(skb) + sizeof(struct tcphdr);
@@ -4532,9 +4532,9 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
		iph = ip_hdr(skb);
		iph->check = 0;
		iph->tot_len = htons(mss + ip_tcp_len + tcp_opt_len);
		skb->h.th->check = ~csum_tcpudp_magic(iph->saddr, iph->daddr,
						      0, IPPROTO_TCP, 0);

		tcp_hdr(skb)->check = ~csum_tcpudp_magic(iph->saddr,
							 iph->daddr, 0,
							 IPPROTO_TCP, 0);
		if (tcp_opt_len || (iph->ihl > 5)) {
			vlan_tag_flags |= ((iph->ihl - 5) +
					   (tcp_opt_len >> 2)) << 8;
+1 −1
Original line number Diff line number Diff line
@@ -1872,7 +1872,7 @@ int t1_start_xmit(struct sk_buff *skb, struct net_device *dev)
		hdr->opcode = CPL_TX_PKT_LSO;
		hdr->ip_csum_dis = hdr->l4_csum_dis = 0;
		hdr->ip_hdr_words = ip_hdr(skb)->ihl;
		hdr->tcp_hdr_words = skb->h.th->doff;
		hdr->tcp_hdr_words = tcp_hdr(skb)->doff;
		hdr->eth_type_mss = htons(MK_ETH_TYPE_MSS(eth_type,
							  skb_shinfo(skb)->gso_size));
		hdr->len = htonl(skb->len - sizeof(*hdr));
+1 −1
Original line number Diff line number Diff line
@@ -901,7 +901,7 @@ static void write_tx_pkt_wr(struct adapter *adap, struct sk_buff *skb,
		    CPL_ETH_II : CPL_ETH_II_VLAN;
		tso_info |= V_LSO_ETH_TYPE(eth_type) |
		    V_LSO_IPHDR_WORDS(ip_hdr(skb)->ihl) |
		    V_LSO_TCPHDR_WORDS(skb->h.th->doff);
		    V_LSO_TCPHDR_WORDS(tcp_hdr(skb)->doff);
		hdr->lso_info = htonl(tso_info);
		flits = 3;
	} else {
+6 −5
Original line number Diff line number Diff line
@@ -2893,14 +2893,15 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
			struct iphdr *iph = ip_hdr(skb);
			iph->tot_len = 0;
			iph->check = 0;
			skb->h.th->check = ~csum_tcpudp_magic(iph->saddr,
			tcp_hdr(skb)->check = ~csum_tcpudp_magic(iph->saddr,
								 iph->daddr, 0,
							      IPPROTO_TCP, 0);
								 IPPROTO_TCP,
								 0);
			cmd_length = E1000_TXD_CMD_IP;
			ipcse = skb_transport_offset(skb) - 1;
		} else if (skb->protocol == htons(ETH_P_IPV6)) {
			ipv6_hdr(skb)->payload_len = 0;
			skb->h.th->check =
			tcp_hdr(skb)->check =
				~csum_ipv6_magic(&ipv6_hdr(skb)->saddr,
						 &ipv6_hdr(skb)->daddr,
						 0, IPPROTO_TCP, 0);
@@ -2909,7 +2910,7 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
		ipcss = skb_network_offset(skb);
		ipcso = (void *)&(ip_hdr(skb)->check) - (void *)skb->data;
		tucss = skb_transport_offset(skb);
		tucso = (void *)&(skb->h.th->check) - (void *)skb->data;
		tucso = (void *)&(tcp_hdr(skb)->check) - (void *)skb->data;
		tucse = 0;

		cmd_length |= (E1000_TXD_CMD_DEXT | E1000_TXD_CMD_TSE |
Loading