Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2580064pxb; Mon, 19 Apr 2021 08:52:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzACqhRymMYi5eXKQO2tnwVbtQjmxSCwCoFOQtWFVemh7a8FvO48zV/atHWB0fUiqUV3tfD X-Received: by 2002:aa7:d3da:: with SMTP id o26mr26636204edr.147.1618847546830; Mon, 19 Apr 2021 08:52:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618847546; cv=none; d=google.com; s=arc-20160816; b=imfKc5YU0HZOWxt5KH2nZz2867NmlSc8upJIvvVoimcUsbUKb5q+D9Yu2ra/qRSOu0 fdq3qXiRcMDoGJ7/vudwIkyIvO6Sx4uVBezl4WfUabF8rRoMVgAGgkTQETxuYaU9v8Bl j/FClCVVSVHwWpBaQC1kc/LkdegAqJ5A/bgJjOOxEkQ683jbIGJMahB6p5kUkZEPETK2 I4Occz8GEYl7SaG/i/Ze+SJa6tD9PncCJUG9HRi4dbs+qiXEDI1bgEjHpNymgA/Qm/pG SPEr/rvyvV+AXj6u6sbkK0iWwSpqZvSlKpMojmFPPMbwxhKBwH1CXirW9wQkoJ2ivmSJ vYDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8onETF8p6djsIsNXfm6cCyxQSWJSPB9MgOEfmtfpubk=; b=X9I6TBVzpIYhbUXpIStvownGfXh2RpTGqEHKXARsAJgPCXaudHSBat1KuP1v5CAO06 w7qHSp2qEGAxY5B/5aXLFPakjWa4o3zyxlFfVQWRwqzvr5YLSE0DVrgty10AJE4weXhb v6841rnlzi7WSsycdHSpnJbgdLg6UUTGrZMRcmDLG/NiGqSTFz7ZjAscAdR4zBREJxeD 2sUgUZJMi3gCZiXHcqZmFGcI6Tmyx5HomhEGlZuEfboGYd31gHFBsu5fMyxJyD1rMlS7 a8vs6dSZfv9kJER17/dbx+AOq7IIETqZPQYxVbtWG71I2mbzZGp90Hf2orewygGIdRCA 2d9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rNOjAHDY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l7si1308134ejk.583.2021.04.19.08.52.02; Mon, 19 Apr 2021 08:52:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rNOjAHDY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240250AbhDSNbZ (ORCPT + 99 others); Mon, 19 Apr 2021 09:31:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:56310 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241357AbhDSNWu (ORCPT ); Mon, 19 Apr 2021 09:22:50 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2CAB361354; Mon, 19 Apr 2021 13:18:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618838288; bh=imUZ3C9Sftcex1J+MERKEd8JzO2ZbcZ53DzjncOKK1Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rNOjAHDYNg1iZuPTtpWssXZr7qIGagTadEf8zwiCS4B+hVL4cBujiPgdO5jDfUDad BM1KRuasjKz5OK3pjWy+/x+gNWxGIf8YiP/sn7Un8RZvu2cIYXLA3w6MWnTrzG4kZs gNpJup5LHWHdcqsjMXMXJNjOS4uJM/aYp21lPkpY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vinay Kumar Yadav , Rohit Maheshwari , "David S. Miller" Subject: [PATCH 5.10 084/103] ch_ktls: do not send snd_una update to TCB in middle Date: Mon, 19 Apr 2021 15:06:35 +0200 Message-Id: <20210419130530.686424234@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210419130527.791982064@linuxfoundation.org> References: <20210419130527.791982064@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vinay Kumar Yadav commit e8a4155567b3c903f49cbf89b8017e9cc22c4fe4 upstream. snd_una update should not be done when the same skb is being sent out.chcr_short_record_handler() sends it again even though SND_UNA update is already sent for the skb in chcr_ktls_xmit(), which causes mismatch in un-acked TCP seq number, later causes problem in sending out complete record. Fixes: 429765a149f1 ("chcr: handle partial end part of a record") Signed-off-by: Vinay Kumar Yadav Signed-off-by: Rohit Maheshwari Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 53 ---------- 1 file changed, 53 deletions(-) --- a/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c +++ b/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c @@ -1650,54 +1650,6 @@ static void chcr_ktls_copy_record_in_skb } /* - * chcr_ktls_update_snd_una: Reset the SEND_UNA. It will be done to avoid - * sending the same segment again. It will discard the segment which is before - * the current tx max. - * @tx_info - driver specific tls info. - * @q - TX queue. - * return: NET_TX_OK/NET_XMIT_DROP. - */ -static int chcr_ktls_update_snd_una(struct chcr_ktls_info *tx_info, - struct sge_eth_txq *q) -{ - struct fw_ulptx_wr *wr; - unsigned int ndesc; - int credits; - void *pos; - u32 len; - - len = sizeof(*wr) + roundup(CHCR_SET_TCB_FIELD_LEN, 16); - ndesc = DIV_ROUND_UP(len, 64); - - credits = chcr_txq_avail(&q->q) - ndesc; - if (unlikely(credits < 0)) { - chcr_eth_txq_stop(q); - return NETDEV_TX_BUSY; - } - - pos = &q->q.desc[q->q.pidx]; - - wr = pos; - /* ULPTX wr */ - wr->op_to_compl = htonl(FW_WR_OP_V(FW_ULPTX_WR)); - wr->cookie = 0; - /* fill len in wr field */ - wr->flowid_len16 = htonl(FW_WR_LEN16_V(DIV_ROUND_UP(len, 16))); - - pos += sizeof(*wr); - - pos = chcr_write_cpl_set_tcb_ulp(tx_info, q, tx_info->tid, pos, - TCB_SND_UNA_RAW_W, - TCB_SND_UNA_RAW_V(TCB_SND_UNA_RAW_M), - TCB_SND_UNA_RAW_V(0), 0); - - chcr_txq_advance(&q->q, ndesc); - cxgb4_ring_tx_db(tx_info->adap, &q->q, ndesc); - - return 0; -} - -/* * chcr_end_part_handler: This handler will handle the record which * is complete or if record's end part is received. T6 adapter has a issue that * it can't send out TAG with partial record so if its an end part then we have @@ -1897,11 +1849,6 @@ static int chcr_short_record_handler(str /* reset tcp_seq as per the prior_data_required len */ tcp_seq -= prior_data_len; } - /* reset snd una, so the middle record won't send the already - * sent part. - */ - if (chcr_ktls_update_snd_una(tx_info, q)) - goto out; atomic64_inc(&tx_info->adap->ch_ktls_stats.ktls_tx_middle_pkts); } else { atomic64_inc(&tx_info->adap->ch_ktls_stats.ktls_tx_start_pkts);