@@ -967,7 +967,7 @@ chcr_ktls_write_tcp_options(struct chcr_ktls_info *tx_info, struct sk_buff *skb,
967
967
/* packet length = eth hdr len + ip hdr len + tcp hdr len
968
968
* (including options).
969
969
*/
970
- pktlen = skb -> len - skb -> data_len ;
970
+ pktlen = skb_transport_offset ( skb ) + tcp_hdrlen ( skb ) ;
971
971
972
972
ctrl = sizeof (* cpl ) + pktlen ;
973
973
len16 = DIV_ROUND_UP (sizeof (* wr ) + ctrl , 16 );
@@ -1860,23 +1860,26 @@ static int chcr_short_record_handler(struct chcr_ktls_info *tx_info,
1860
1860
/* nic tls TX handler */
1861
1861
static int chcr_ktls_xmit (struct sk_buff * skb , struct net_device * dev )
1862
1862
{
1863
+ u32 tls_end_offset , tcp_seq , skb_data_len , skb_offset ;
1863
1864
struct ch_ktls_port_stats_debug * port_stats ;
1864
1865
struct chcr_ktls_ofld_ctx_tx * tx_ctx ;
1865
1866
struct ch_ktls_stats_debug * stats ;
1866
1867
struct tcphdr * th = tcp_hdr (skb );
1867
1868
int data_len , qidx , ret = 0 , mss ;
1868
1869
struct tls_record_info * record ;
1869
1870
struct chcr_ktls_info * tx_info ;
1870
- u32 tls_end_offset , tcp_seq ;
1871
1871
struct tls_context * tls_ctx ;
1872
1872
struct sk_buff * local_skb ;
1873
1873
struct sge_eth_txq * q ;
1874
1874
struct adapter * adap ;
1875
1875
unsigned long flags ;
1876
1876
1877
1877
tcp_seq = ntohl (th -> seq );
1878
+ skb_offset = skb_transport_offset (skb ) + tcp_hdrlen (skb );
1879
+ skb_data_len = skb -> len - skb_offset ;
1880
+ data_len = skb_data_len ;
1878
1881
1879
- mss = skb_is_gso (skb ) ? skb_shinfo (skb )-> gso_size : skb -> data_len ;
1882
+ mss = skb_is_gso (skb ) ? skb_shinfo (skb )-> gso_size : data_len ;
1880
1883
1881
1884
tls_ctx = tls_get_ctx (skb -> sk );
1882
1885
if (unlikely (tls_ctx -> netdev != dev ))
@@ -1922,8 +1925,6 @@ static int chcr_ktls_xmit(struct sk_buff *skb, struct net_device *dev)
1922
1925
/* copy skb contents into local skb */
1923
1926
chcr_ktls_skb_copy (skb , local_skb );
1924
1927
1925
- /* go through the skb and send only one record at a time. */
1926
- data_len = skb -> data_len ;
1927
1928
/* TCP segments can be in received either complete or partial.
1928
1929
* chcr_end_part_handler will handle cases if complete record or end
1929
1930
* part of the record is received. Incase of partial end part of record,
@@ -2020,9 +2021,9 @@ static int chcr_ktls_xmit(struct sk_buff *skb, struct net_device *dev)
2020
2021
2021
2022
} while (data_len > 0 );
2022
2023
2023
- tx_info -> prev_seq = ntohl (th -> seq ) + skb -> data_len ;
2024
+ tx_info -> prev_seq = ntohl (th -> seq ) + skb_data_len ;
2024
2025
atomic64_inc (& port_stats -> ktls_tx_encrypted_packets );
2025
- atomic64_add (skb -> data_len , & port_stats -> ktls_tx_encrypted_bytes );
2026
+ atomic64_add (skb_data_len , & port_stats -> ktls_tx_encrypted_bytes );
2026
2027
2027
2028
/* tcp finish is set, send a separate tcp msg including all the options
2028
2029
* as well.
0 commit comments