Commit 848dd1c1 authored by Atul Gupta's avatar Atul Gupta Committed by David S. Miller

crypto/chelsio/chtls: macro correction in tx path

corrected macro used in tx path. removed redundant hdrlen
and check for !page in chtls_sendmsg
Signed-off-by: default avatarAtul Gupta <atul.gupta@chelsio.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6422ccc5
...@@ -397,7 +397,7 @@ static void tls_tx_data_wr(struct sock *sk, struct sk_buff *skb, ...@@ -397,7 +397,7 @@ static void tls_tx_data_wr(struct sock *sk, struct sk_buff *skb,
req_wr->lsodisable_to_flags = req_wr->lsodisable_to_flags =
htonl(TX_ULP_MODE_V(ULP_MODE_TLS) | htonl(TX_ULP_MODE_V(ULP_MODE_TLS) |
FW_OFLD_TX_DATA_WR_URGENT_V(skb_urgent(skb)) | TX_URG_V(skb_urgent(skb)) |
T6_TX_FORCE_F | wr_ulp_mode_force | T6_TX_FORCE_F | wr_ulp_mode_force |
TX_SHOVE_V((!csk_flag(sk, CSK_TX_MORE_DATA)) && TX_SHOVE_V((!csk_flag(sk, CSK_TX_MORE_DATA)) &&
skb_queue_empty(&csk->txq))); skb_queue_empty(&csk->txq)));
...@@ -534,10 +534,9 @@ static void make_tx_data_wr(struct sock *sk, struct sk_buff *skb, ...@@ -534,10 +534,9 @@ static void make_tx_data_wr(struct sock *sk, struct sk_buff *skb,
FW_OFLD_TX_DATA_WR_SHOVE_F); FW_OFLD_TX_DATA_WR_SHOVE_F);
req->tunnel_to_proxy = htonl(wr_ulp_mode_force | req->tunnel_to_proxy = htonl(wr_ulp_mode_force |
FW_OFLD_TX_DATA_WR_URGENT_V(skb_urgent(skb)) | TX_URG_V(skb_urgent(skb)) |
FW_OFLD_TX_DATA_WR_SHOVE_V((!csk_flag TX_SHOVE_V((!csk_flag(sk, CSK_TX_MORE_DATA)) &&
(sk, CSK_TX_MORE_DATA)) && skb_queue_empty(&csk->txq)));
skb_queue_empty(&csk->txq)));
req->plen = htonl(len); req->plen = htonl(len);
} }
...@@ -995,7 +994,6 @@ int chtls_sendmsg(struct sock *sk, struct msghdr *msg, size_t size) ...@@ -995,7 +994,6 @@ int chtls_sendmsg(struct sock *sk, struct msghdr *msg, size_t size)
int mss, flags, err; int mss, flags, err;
int recordsz = 0; int recordsz = 0;
int copied = 0; int copied = 0;
int hdrlen = 0;
long timeo; long timeo;
lock_sock(sk); lock_sock(sk);
...@@ -1032,7 +1030,7 @@ int chtls_sendmsg(struct sock *sk, struct msghdr *msg, size_t size) ...@@ -1032,7 +1030,7 @@ int chtls_sendmsg(struct sock *sk, struct msghdr *msg, size_t size)
recordsz = tls_header_read(&hdr, &msg->msg_iter); recordsz = tls_header_read(&hdr, &msg->msg_iter);
size -= TLS_HEADER_LENGTH; size -= TLS_HEADER_LENGTH;
hdrlen += TLS_HEADER_LENGTH; copied += TLS_HEADER_LENGTH;
csk->tlshws.txleft = recordsz; csk->tlshws.txleft = recordsz;
csk->tlshws.type = hdr.type; csk->tlshws.type = hdr.type;
if (skb) if (skb)
...@@ -1083,10 +1081,8 @@ int chtls_sendmsg(struct sock *sk, struct msghdr *msg, size_t size) ...@@ -1083,10 +1081,8 @@ int chtls_sendmsg(struct sock *sk, struct msghdr *msg, size_t size)
int off = TCP_OFF(sk); int off = TCP_OFF(sk);
bool merge; bool merge;
if (!page) if (page)
goto wait_for_memory; pg_size <<= compound_order(page);
pg_size <<= compound_order(page);
if (off < pg_size && if (off < pg_size &&
skb_can_coalesce(skb, i, page, off)) { skb_can_coalesce(skb, i, page, off)) {
merge = 1; merge = 1;
...@@ -1187,7 +1183,7 @@ int chtls_sendmsg(struct sock *sk, struct msghdr *msg, size_t size) ...@@ -1187,7 +1183,7 @@ int chtls_sendmsg(struct sock *sk, struct msghdr *msg, size_t size)
chtls_tcp_push(sk, flags); chtls_tcp_push(sk, flags);
done: done:
release_sock(sk); release_sock(sk);
return copied + hdrlen; return copied;
do_fault: do_fault:
if (!skb->len) { if (!skb->len) {
__skb_unlink(skb, &csk->txq); __skb_unlink(skb, &csk->txq);
......
...@@ -1453,6 +1453,9 @@ struct cpl_tx_data { ...@@ -1453,6 +1453,9 @@ struct cpl_tx_data {
#define T6_TX_FORCE_V(x) ((x) << T6_TX_FORCE_S) #define T6_TX_FORCE_V(x) ((x) << T6_TX_FORCE_S)
#define T6_TX_FORCE_F T6_TX_FORCE_V(1U) #define T6_TX_FORCE_F T6_TX_FORCE_V(1U)
#define TX_URG_S 16
#define TX_URG_V(x) ((x) << TX_URG_S)
#define TX_SHOVE_S 14 #define TX_SHOVE_S 14
#define TX_SHOVE_V(x) ((x) << TX_SHOVE_S) #define TX_SHOVE_V(x) ((x) << TX_SHOVE_S)
......
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