Commit efca3878 authored by Rohit Maheshwari's avatar Rohit Maheshwari Committed by David S. Miller

ch_ktls: Issue if connection offload fails

Since driver first return success to tls_dev_add, if req to HW is
successful, but later if HW returns failure, that connection traffic
fails permanently and connection status remains unknown to stack.

v1->v2:
- removed conn_up from all places.

v2->v3:
- Corrected timeout handling.

Fixes: 34aba2c4 ("cxgb4/chcr : Register to tls add and del callback")
Signed-off-by: default avatarRohit Maheshwari <rohitm@chelsio.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2c956a5a
...@@ -27,22 +27,20 @@ ...@@ -27,22 +27,20 @@
#define CHCR_KTLS_WR_SIZE (CHCR_PLAIN_TX_DATA_LEN +\ #define CHCR_KTLS_WR_SIZE (CHCR_PLAIN_TX_DATA_LEN +\
sizeof(struct cpl_tx_sec_pdu)) sizeof(struct cpl_tx_sec_pdu))
enum chcr_ktls_conn_state { enum ch_ktls_open_state {
KTLS_CONN_CLOSED, CH_KTLS_OPEN_SUCCESS = 0,
KTLS_CONN_ACT_OPEN_REQ, CH_KTLS_OPEN_PENDING = 1,
KTLS_CONN_ACT_OPEN_RPL, CH_KTLS_OPEN_FAILURE = 2,
KTLS_CONN_SET_TCB_REQ,
KTLS_CONN_SET_TCB_RPL,
KTLS_CONN_TX_READY,
}; };
struct chcr_ktls_info { struct chcr_ktls_info {
struct sock *sk; struct sock *sk;
spinlock_t lock; /* state machine lock */ spinlock_t lock; /* lock for pending_close */
struct ktls_key_ctx key_ctx; struct ktls_key_ctx key_ctx;
struct adapter *adap; struct adapter *adap;
struct l2t_entry *l2te; struct l2t_entry *l2te;
struct net_device *netdev; struct net_device *netdev;
struct completion completion;
u64 iv; u64 iv;
u64 record_no; u64 record_no;
int tid; int tid;
...@@ -58,13 +56,14 @@ struct chcr_ktls_info { ...@@ -58,13 +56,14 @@ struct chcr_ktls_info {
u32 tcp_start_seq_number; u32 tcp_start_seq_number;
u32 scmd0_short_seqno_numivs; u32 scmd0_short_seqno_numivs;
u32 scmd0_short_ivgen_hdrlen; u32 scmd0_short_ivgen_hdrlen;
enum chcr_ktls_conn_state connection_state;
u16 prev_win; u16 prev_win;
u8 tx_chan; u8 tx_chan;
u8 smt_idx; u8 smt_idx;
u8 port_id; u8 port_id;
u8 ip_family; u8 ip_family;
u8 first_qset; u8 first_qset;
enum ch_ktls_open_state open_state;
bool pending_close;
}; };
struct chcr_ktls_ofld_ctx_tx { struct chcr_ktls_ofld_ctx_tx {
......
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