提交 a1e621bf 编写于 作者: M Michael Chan 提交者: David S. Miller

cnic: Refactor code in cnic_cm_process_kcqe().

Move chip-specific code to the respective chip's ->close_conn() functions
for better code organization.
Signed-off-by: NMichael Chan <mchan@broadcom.com>
Signed-off-by: NEddie Wai <waie@broadcom.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 ed99daa5
...@@ -3143,12 +3143,6 @@ static void cnic_cm_process_kcqe(struct cnic_dev *dev, struct kcqe *kcqe) ...@@ -3143,12 +3143,6 @@ static void cnic_cm_process_kcqe(struct cnic_dev *dev, struct kcqe *kcqe)
break; break;
case L4_KCQE_OPCODE_VALUE_RESET_RECEIVED: case L4_KCQE_OPCODE_VALUE_RESET_RECEIVED:
if (test_bit(CNIC_F_BNX2_CLASS, &dev->flags)) {
cnic_cm_upcall(cp, csk, opcode);
break;
} else if (test_and_clear_bit(SK_F_OFFLD_COMPLETE, &csk->flags))
csk->state = opcode;
/* fall through */
case L4_KCQE_OPCODE_VALUE_CLOSE_COMP: case L4_KCQE_OPCODE_VALUE_CLOSE_COMP:
case L4_KCQE_OPCODE_VALUE_RESET_COMP: case L4_KCQE_OPCODE_VALUE_RESET_COMP:
case L5CM_RAMROD_CMD_ID_SEARCHER_DELETE: case L5CM_RAMROD_CMD_ID_SEARCHER_DELETE:
...@@ -3204,6 +3198,10 @@ static int cnic_cm_alloc_mem(struct cnic_dev *dev) ...@@ -3204,6 +3198,10 @@ static int cnic_cm_alloc_mem(struct cnic_dev *dev)
static int cnic_ready_to_close(struct cnic_sock *csk, u32 opcode) static int cnic_ready_to_close(struct cnic_sock *csk, u32 opcode)
{ {
if (opcode == L4_KCQE_OPCODE_VALUE_RESET_RECEIVED) {
if (test_and_clear_bit(SK_F_OFFLD_COMPLETE, &csk->flags))
csk->state = opcode;
}
if ((opcode == csk->state) || if ((opcode == csk->state) ||
(opcode == L4_KCQE_OPCODE_VALUE_RESET_RECEIVED && (opcode == L4_KCQE_OPCODE_VALUE_RESET_RECEIVED &&
csk->state == L4_KCQE_OPCODE_VALUE_CLOSE_COMP)) { csk->state == L4_KCQE_OPCODE_VALUE_CLOSE_COMP)) {
...@@ -3228,6 +3226,11 @@ static void cnic_close_bnx2_conn(struct cnic_sock *csk, u32 opcode) ...@@ -3228,6 +3226,11 @@ static void cnic_close_bnx2_conn(struct cnic_sock *csk, u32 opcode)
struct cnic_dev *dev = csk->dev; struct cnic_dev *dev = csk->dev;
struct cnic_local *cp = dev->cnic_priv; struct cnic_local *cp = dev->cnic_priv;
if (opcode == L4_KCQE_OPCODE_VALUE_RESET_RECEIVED) {
cnic_cm_upcall(cp, csk, opcode);
return;
}
clear_bit(SK_F_CONNECT_START, &csk->flags); clear_bit(SK_F_CONNECT_START, &csk->flags);
cnic_close_conn(csk); cnic_close_conn(csk);
cnic_cm_upcall(cp, csk, opcode); cnic_cm_upcall(cp, csk, opcode);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册