Commit 4e98a880 authored by Vinay Kumar Yadav's avatar Vinay Kumar Yadav Committed by Herbert Xu

crypto: chelsio/chtls - Fixed tls stats

Added tls rx stats and reset tls rx/tx stats when chtls driver unload.
Signed-off-by: default avatarVinay Kumar Yadav <vinay.yadav@chelsio.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent fa03481b
...@@ -1399,6 +1399,8 @@ static int chtls_pt_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, ...@@ -1399,6 +1399,8 @@ static int chtls_pt_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
{ {
struct chtls_sock *csk = rcu_dereference_sk_user_data(sk); struct chtls_sock *csk = rcu_dereference_sk_user_data(sk);
struct chtls_hws *hws = &csk->tlshws; struct chtls_hws *hws = &csk->tlshws;
struct net_device *dev = csk->egress_dev;
struct adapter *adap = netdev2adap(dev);
struct tcp_sock *tp = tcp_sk(sk); struct tcp_sock *tp = tcp_sk(sk);
unsigned long avail; unsigned long avail;
int buffers_freed; int buffers_freed;
...@@ -1540,6 +1542,7 @@ static int chtls_pt_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, ...@@ -1540,6 +1542,7 @@ static int chtls_pt_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
tp->copied_seq += skb->len; tp->copied_seq += skb->len;
hws->rcvpld = skb->hdr_len; hws->rcvpld = skb->hdr_len;
} else { } else {
atomic_inc(&adap->chcr_stats.tls_pdu_rx);
tp->copied_seq += hws->rcvpld; tp->copied_seq += hws->rcvpld;
} }
chtls_free_skb(sk, skb); chtls_free_skb(sk, skb);
......
...@@ -174,9 +174,16 @@ static inline void chtls_dev_release(struct kref *kref) ...@@ -174,9 +174,16 @@ static inline void chtls_dev_release(struct kref *kref)
{ {
struct tls_toe_device *dev; struct tls_toe_device *dev;
struct chtls_dev *cdev; struct chtls_dev *cdev;
struct adapter *adap;
dev = container_of(kref, struct tls_toe_device, kref); dev = container_of(kref, struct tls_toe_device, kref);
cdev = to_chtls_dev(dev); cdev = to_chtls_dev(dev);
/* Reset tls rx/tx stats */
adap = pci_get_drvdata(cdev->pdev);
atomic_set(&adap->chcr_stats.tls_pdu_tx, 0);
atomic_set(&adap->chcr_stats.tls_pdu_rx, 0);
chtls_free_uld(cdev); chtls_free_uld(cdev);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment