nfp: tls: count TSO segments separately for the TLS offload
authorJakub Kicinski <jakub.kicinski@netronome.com>
Tue, 9 Jul 2019 02:53:12 +0000 (19:53 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 9 Jul 2019 03:21:09 +0000 (20:21 -0700)
Count the number of successfully submitted TLS segments,
not skbs. This will make it easier to compare the TLS
encryption count against other counters.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/nfp_net_common.c

index 27033442744838bac54c7d29305b4a8db3fc807d..9a4421df9be97c120e62408e406c128adb4b19ff 100644 (file)
@@ -880,7 +880,10 @@ nfp_net_tls_tx(struct nfp_net_dp *dp, struct nfp_net_r_vector *r_vec,
 
        if (datalen) {
                u64_stats_update_begin(&r_vec->tx_sync);
-               r_vec->hw_tls_tx++;
+               if (!skb_is_gso(skb))
+                       r_vec->hw_tls_tx++;
+               else
+                       r_vec->hw_tls_tx += skb_shinfo(skb)->gso_segs;
                u64_stats_update_end(&r_vec->tx_sync);
        }