From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id CD890A04F0 for ; Tue, 10 Dec 2019 16:01:00 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C24761B13C; Tue, 10 Dec 2019 16:01:00 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id 6E8731B9B5 for ; Tue, 10 Dec 2019 16:00:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575990058; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ITapxsrQ7o62HJC8dwH6I4RSjGMoZ7AjZnIcYI1MSVc=; b=c+/g1WikNHEJYtra+B8xiyVxD7vuohp6/C6OLY2/Zhr5sTqCtd5xzil2nTC6MVyQ/mC/FQ TDZMzu9XwP/JfkGZaAfHnz4OUzx/1AdDZOtxQJcg4gGg9d4k9Xjoyd2FzYKjRWx2VFAlc7 S1btWHwCECJ7Vwtn0cf8jeopjYg6RRE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-372-BMmOwcSiPPeIRxwtWQxvoQ-1; Tue, 10 Dec 2019 10:00:55 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5DEAA107ACE6; Tue, 10 Dec 2019 15:00:54 +0000 (UTC) Received: from rh.redhat.com (ovpn-116-64.ams2.redhat.com [10.36.116.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 25B565D9C5; Tue, 10 Dec 2019 15:00:52 +0000 (UTC) From: Kevin Traynor To: Santoshkumar Karanappa Rastapur Cc: Ajit Khaparde , Somnath Kotur , dpdk stable Date: Tue, 10 Dec 2019 14:59:08 +0000 Message-Id: <20191210145937.32755-34-ktraynor@redhat.com> In-Reply-To: <20191210145937.32755-1-ktraynor@redhat.com> References: <20191210145937.32755-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: BMmOwcSiPPeIRxwtWQxvoQ-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-stable] patch 'net/bnxt: fix ping with MTU change' has been queued to LTS release 18.11.6 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/16/19. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasi= ng (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/5326842b58bd8570c3= b8303216da70f82a661895 Thanks. Kevin. --- >From 5326842b58bd8570c3b8303216da70f82a661895 Mon Sep 17 00:00:00 2001 From: Santoshkumar Karanappa Rastapur Date: Thu, 24 Oct 2019 13:14:17 +0530 Subject: [PATCH] net/bnxt: fix ping with MTU change [ upstream commit 7d4e9e2606752678aacc96e017ebc3c44a260ff1 ] Driver was setting maximum receive unit differently in bnxt_mtu_set_op and bnxt_hwrm_vnic_alloc. Moreover firmware adds the 4 bytes for FCS. Fixed it by setting correct maximum receive unit value. Fixes: daef48efe5e5 ("net/bnxt: support set MTU") Reviewed-by: Ajit Khaparde Signed-off-by: Santoshkumar Karanappa Rastapur Signed-off-by: Somnath Kotur --- drivers/net/bnxt/bnxt.h | 3 +++ drivers/net/bnxt/bnxt_ethdev.c | 3 +-- drivers/net/bnxt/bnxt_hwrm.c | 11 +++-------- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index 0ef5afcba..eeced3a47 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -23,4 +23,7 @@ #define BNXT_MAX_MTU=09=099574 #define VLAN_TAG_SIZE=09=094 +/* FW adds extra 4 bytes for FCS */ +#define BNXT_VNIC_MRU(mtu)\ +=09((mtu) + ETHER_HDR_LEN + VLAN_TAG_SIZE * BNXT_NUM_VLANS) #define BNXT_VF_RSV_NUM_RSS_CTX=091 #define BNXT_VF_RSV_NUM_L2_CTX=094 diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.= c index 9da3a46c6..925ea42e6 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -1692,6 +1692,5 @@ static int bnxt_mtu_set_op(struct rte_eth_dev *eth_de= v, uint16_t new_mtu) =09=09uint16_t size =3D 0; =20 -=09=09vnic->mru =3D bp->eth_dev->data->mtu + ETHER_HDR_LEN + -=09=09=09=09=09ETHER_CRC_LEN + VLAN_TAG_SIZE * 2; +=09=09vnic->mru =3D BNXT_VNIC_MRU(new_mtu); =09=09rc =3D bnxt_hwrm_vnic_cfg(bp, vnic); =09=09if (rc) diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index 74f046c29..596ab3658 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -1333,6 +1333,5 @@ int bnxt_hwrm_vnic_alloc(struct bnxt *bp, struct bnxt= _vnic_info *vnic) =09vnic->cos_rule =3D (uint16_t)HWRM_NA_SIGNATURE; =09vnic->lb_rule =3D (uint16_t)HWRM_NA_SIGNATURE; -=09vnic->mru =3D bp->eth_dev->data->mtu + ETHER_HDR_LEN + -=09=09=09=09ETHER_CRC_LEN + VLAN_TAG_SIZE; +=09vnic->mru =3D BNXT_VNIC_MRU(bp->eth_dev->data->mtu); =09HWRM_PREP(req, VNIC_ALLOC, BNXT_USE_CHIMP_MB); =20 @@ -2528,7 +2527,5 @@ static int bnxt_hwrm_pf_func_cfg(struct bnxt *bp, int= tx_rings) =09req.flags =3D rte_cpu_to_le_32(bp->pf.func_cfg_flags); =09req.mtu =3D rte_cpu_to_le_16(BNXT_MAX_MTU); -=09req.mru =3D rte_cpu_to_le_16(bp->eth_dev->data->mtu + ETHER_HDR_LEN + -=09=09=09=09 ETHER_CRC_LEN + VLAN_TAG_SIZE * -=09=09=09=09 BNXT_NUM_VLANS); +=09req.mru =3D rte_cpu_to_le_16(BNXT_VNIC_MRU(bp->eth_dev->data->mtu)); =09req.num_rsscos_ctxs =3D rte_cpu_to_le_16(bp->max_rsscos_ctx); =09req.num_stat_ctxs =3D rte_cpu_to_le_16(bp->max_stat_ctx); @@ -2569,7 +2566,5 @@ static void populate_vf_func_cfg_req(struct bnxt *bp, =09=09=09=09 ETHER_CRC_LEN + VLAN_TAG_SIZE * =09=09=09=09 BNXT_NUM_VLANS); -=09req->mru =3D rte_cpu_to_le_16(bp->eth_dev->data->mtu + ETHER_HDR_LEN + -=09=09=09=09 ETHER_CRC_LEN + VLAN_TAG_SIZE * -=09=09=09=09 BNXT_NUM_VLANS); +=09req->mru =3D rte_cpu_to_le_16(BNXT_VNIC_MRU(bp->eth_dev->data->mtu)); =09req->num_rsscos_ctxs =3D rte_cpu_to_le_16(bp->max_rsscos_ctx / =09=09=09=09=09=09(num_vfs + 1)); --=20 2.21.0 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- -=092019-12-10 14:49:41.399037258 +0000 +++ 0034-net-bnxt-fix-ping-with-MTU-change.patch=092019-12-10 14:49:39.0574= 57674 +0000 @@ -1 +1 @@ -From 7d4e9e2606752678aacc96e017ebc3c44a260ff1 Mon Sep 17 00:00:00 2001 +From 5326842b58bd8570c3b8303216da70f82a661895 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 7d4e9e2606752678aacc96e017ebc3c44a260ff1 ] + @@ -11 +12,0 @@ -Cc: stable@dpdk.org @@ -23 +24 @@ -index e5bdf6360..975bcf9c6 100644 +index 0ef5afcba..eeced3a47 100644 @@ -26,3 +27,3 @@ -@@ -78,4 +78,7 @@ - =09=09=09=09 RTE_ETHER_CRC_LEN +\ - =09=09=09=09 (BNXT_NUM_VLANS * VLAN_TAG_SIZE)) +@@ -23,4 +23,7 @@ + #define BNXT_MAX_MTU=09=099574 + #define VLAN_TAG_SIZE=09=094 @@ -31 +32 @@ -+=09((mtu) + RTE_ETHER_HDR_LEN + VLAN_TAG_SIZE * BNXT_NUM_VLANS) ++=09((mtu) + ETHER_HDR_LEN + VLAN_TAG_SIZE * BNXT_NUM_VLANS) @@ -35 +36 @@ -index e7ec99e15..c97fcaceb 100644 +index 9da3a46c6..925ea42e6 100644 @@ -38 +39 @@ -@@ -2175,6 +2175,5 @@ static int bnxt_mtu_set_op(struct rte_eth_dev *eth_d= ev, uint16_t new_mtu) +@@ -1692,6 +1692,5 @@ static int bnxt_mtu_set_op(struct rte_eth_dev *eth_d= ev, uint16_t new_mtu) @@ -41,2 +42,2 @@ --=09=09vnic->mru =3D new_mtu + RTE_ETHER_HDR_LEN + --=09=09=09=09RTE_ETHER_CRC_LEN + VLAN_TAG_SIZE * 2; +-=09=09vnic->mru =3D bp->eth_dev->data->mtu + ETHER_HDR_LEN + +-=09=09=09=09=09ETHER_CRC_LEN + VLAN_TAG_SIZE * 2; @@ -47 +48 @@ -index 18e7429a7..018113c4c 100644 +index 74f046c29..596ab3658 100644 @@ -50,5 +51,5 @@ -@@ -1593,6 +1593,5 @@ int bnxt_hwrm_vnic_alloc(struct bnxt *bp, struct bnx= t_vnic_info *vnic) -=20 - skip_ring_grps: --=09vnic->mru =3D bp->eth_dev->data->mtu + RTE_ETHER_HDR_LEN + --=09=09=09=09RTE_ETHER_CRC_LEN + VLAN_TAG_SIZE; +@@ -1333,6 +1333,5 @@ int bnxt_hwrm_vnic_alloc(struct bnxt *bp, struct bnx= t_vnic_info *vnic) + =09vnic->cos_rule =3D (uint16_t)HWRM_NA_SIGNATURE; + =09vnic->lb_rule =3D (uint16_t)HWRM_NA_SIGNATURE; +-=09vnic->mru =3D bp->eth_dev->data->mtu + ETHER_HDR_LEN + +-=09=09=09=09ETHER_CRC_LEN + VLAN_TAG_SIZE; @@ -58 +59 @@ -@@ -2955,7 +2954,5 @@ static int bnxt_hwrm_pf_func_cfg(struct bnxt *bp, in= t tx_rings) +@@ -2528,7 +2527,5 @@ static int bnxt_hwrm_pf_func_cfg(struct bnxt *bp, in= t tx_rings) @@ -61,2 +62,2 @@ --=09req.mru =3D rte_cpu_to_le_16(bp->eth_dev->data->mtu + RTE_ETHER_HDR_LE= N + --=09=09=09=09 RTE_ETHER_CRC_LEN + VLAN_TAG_SIZE * +-=09req.mru =3D rte_cpu_to_le_16(bp->eth_dev->data->mtu + ETHER_HDR_LEN + +-=09=09=09=09 ETHER_CRC_LEN + VLAN_TAG_SIZE * @@ -67,2 +68,2 @@ -@@ -2996,7 +2993,5 @@ static void populate_vf_func_cfg_req(struct bnxt *bp= , - =09=09=09=09 RTE_ETHER_CRC_LEN + VLAN_TAG_SIZE * +@@ -2569,7 +2566,5 @@ static void populate_vf_func_cfg_req(struct bnxt *bp= , + =09=09=09=09 ETHER_CRC_LEN + VLAN_TAG_SIZE * @@ -70,2 +71,2 @@ --=09req->mru =3D rte_cpu_to_le_16(bp->eth_dev->data->mtu + RTE_ETHER_HDR_L= EN + --=09=09=09=09 RTE_ETHER_CRC_LEN + VLAN_TAG_SIZE * +-=09req->mru =3D rte_cpu_to_le_16(bp->eth_dev->data->mtu + ETHER_HDR_LEN + +-=09=09=09=09 ETHER_CRC_LEN + VLAN_TAG_SIZE *