From patchwork Thu Nov 9 09:10:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devesh Sharma X-Patchwork-Id: 10050587 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D54BE601EA for ; Thu, 9 Nov 2017 09:15:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CAA1A2AC02 for ; Thu, 9 Nov 2017 09:15:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF47F2AC0A; Thu, 9 Nov 2017 09:15:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B885F2AC02 for ; Thu, 9 Nov 2017 09:15:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753969AbdKIJL0 (ORCPT ); Thu, 9 Nov 2017 04:11:26 -0500 Received: from mail-qt0-f194.google.com ([209.85.216.194]:54001 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753957AbdKIJLU (ORCPT ); Thu, 9 Nov 2017 04:11:20 -0500 Received: by mail-qt0-f194.google.com with SMTP id n61so6733982qte.10 for ; Thu, 09 Nov 2017 01:11:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=fjUkBHw6LOcr+/fWjTOiChI2uG0WtessNpUwPT/coDs=; b=Bs//qKGZ8f9i//lq9+aNo8ShGrZLqcdgUhCLUUajsR5ss/jCCmW3xHmRV+Ih9CyWe+ zWCtaCSylnw4owVXdqfILV+Qj6XqfeYbZkpK5RQ+wWBZSVA9mu3kBgDLvfI+LXjjNck3 1xkbYLMapRFIC8zHYlgS1dfzGY7wHnF7ZYp9Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=fjUkBHw6LOcr+/fWjTOiChI2uG0WtessNpUwPT/coDs=; b=IJW7c854xH67pXKIpG5re8HYmEKhxuJsvpeXgYtfs2XyaEY2AuoujD1K+9sWTrNbzw yZ3h6+QUu6UwdM9FxcMXPPqmNkiQchTRKhmNzcz94yhSLW6r1lS0kngx8dl6C6X/PeXd uly9PtrlDr3spS4dXN/rMURC8L0knySq0p1OF7CBLSKsPx4WSMEjJcFAjpv9ij8LfDEt jEA0i5l8yoFWtOD/NnwvgRwmEBmqwyfoVFduvIE+D4SeL5EhqS0ih8/T2fw6GojCJZQ5 2JREIIWOGuXxGy+A5S+K3+laKcNO8BKU4LUzn8pVgYoSuiX/soFdcIVO6gVlCfrUIWSu vtGw== X-Gm-Message-State: AJaThX5KZU6fnW1Z4jsPJ5bQi3/48sZLFkOqhrjootRKn2dGJK40N0HM bf9I+ats/9d8Ndk7sTaS3miC0jg1 X-Google-Smtp-Source: AGs4zMYJtvlzkBXQXCFcg0Ay4TzxQ8p3cZS4p6WvPiUb7ef61XtuDIRJpGFXupwTj9wih/zmwEW74w== X-Received: by 10.200.36.150 with SMTP id s22mr5476554qts.237.1510218678757; Thu, 09 Nov 2017 01:11:18 -0800 (PST) Received: from neo00-el73.iig.avagotech.net ([192.19.239.250]) by smtp.gmail.com with ESMTPSA id f38sm4307052qtf.17.2017.11.09.01.11.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Nov 2017 01:11:17 -0800 (PST) From: Devesh Sharma To: linux-rdma@vger.kernel.org Cc: dledford@redhat.com, leon@kernel.org, Devesh Sharma Subject: [PATCH rdma-core 2/2] bnxt_re/lib: increament psn in case of 0 length packets Date: Thu, 9 Nov 2017 04:10:58 -0500 Message-Id: <1510218658-16710-3-git-send-email-devesh.sharma@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1510218658-16710-1-git-send-email-devesh.sharma@broadcom.com> References: <1510218658-16710-1-git-send-email-devesh.sharma@broadcom.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If application posts a 0 length packte, post send routine is skipping to increament the psn number. This will cause PSN number to go out of sync and evantually connection would terminate due to sequence error. post_send routine must increament the psn number by 1 even for zero length packets. Signed-off-by: Devesh Sharma --- providers/bnxt_re/verbs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/providers/bnxt_re/verbs.c b/providers/bnxt_re/verbs.c index 4d9b044..9d4e02b 100644 --- a/providers/bnxt_re/verbs.c +++ b/providers/bnxt_re/verbs.c @@ -1048,6 +1048,8 @@ static void bnxt_re_fill_psns(struct bnxt_re_qp *qp, struct bnxt_re_psns *psns, pkt_cnt = (len / qp->mtu); if (len % qp->mtu) pkt_cnt++; + if (len == 0) + pkt_cnt = 1; nxt_psn = ((qp->sq_psn + pkt_cnt) & BNXT_RE_PSNS_NPSN_MASK); psns->flg_npsn = htole32(nxt_psn); qp->sq_psn = nxt_psn;