From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) by dpdk.org (Postfix) with ESMTP id 9F22A1B7C2 for ; Tue, 15 May 2018 15:49:00 +0200 (CEST) Received: by mail-wr0-f196.google.com with SMTP id o4-v6so241004wrm.0 for ; Tue, 15 May 2018 06:49:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=v6IQR79uB1OHljxgs1ShNqoejNa+agwN3neiAwDwoEU=; b=Udeb9EkrqOS8mwv3unAjX4q8PDhi5E/KoYN5p5OvCCK0gDbPtRJQiqtawwMPAdZ25I A7jEQfBPhLlbcu5sozUicA1gsUmbQVcQg9YgBmzYa3ryFRaf7JMUyGA+ppF9poU1vJa7 lALpvNmCpQS0wFlK4Ll2y5pQFhxtt3pzLtuY+y/ibM641lvskWLKMB4S8CZsU35wx9nS O2j4CXJzBB/F8qDd6HzWZ8tGIrFSDABtBlYQ9syrewlt4XAt9N28FmiAVjDTOISF90ky QPcXDBZAJg2pwh52B50fQBI34JUYLCCo3Dgj3k0X/xr4o7o12jYR6jy1i5QdY8URTLiW osEA== 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=v6IQR79uB1OHljxgs1ShNqoejNa+agwN3neiAwDwoEU=; b=XlceGmLu9H8rG2KoqPe/HGKO88foWg54SyMrzAZqY+V7IqkgyO3SCX1BuHaa/pgsn5 xsmNY6FAI6drl6rwCZjzJ0vt1RQKg/DDYqSeVQQNBGNDG8xgRdhCWtX+S6ujNH1v2TYS sV6VpPzTFyYIKUywTUhXjY7A5i1XMTCQ9lhst2tTJEH3Lli+G/I97hMDJoZ8oYEbEDFd o95aj9oIbStcTf8qZX11REb0CO5jx8p5u3Hj8/vZQU3/11527HkotzZRyK3oXl4zhcN/ UgixUiWwkNzXU/tyZEEv5/Bjv6sIMHxXrfA2snk5J5Kvx36Fe2x50c93vOvtQyRDU/HV K3Kw== X-Gm-Message-State: ALKqPweY+U146SqNt+v4hWddTQrWNdMyIzEOkKlOEnMfXq6VdBw4L8b7 5xSJi2joqjDW0jM3oWS6qJjuTkX3jzQ= X-Google-Smtp-Source: AB8JxZogVkH37Ne8ifntRYUQCOV+XH11LTiTrXuLp9mc7lxD47Jn8scOTj+b2v2ShKDkwTt86jEsrA== X-Received: by 2002:adf:abc6:: with SMTP id s64-v6mr10660127wrc.66.1526392140347; Tue, 15 May 2018 06:49:00 -0700 (PDT) Received: from localhost (slip139-92-244-193.lon.uk.prserv.net. [139.92.244.193]) by smtp.gmail.com with ESMTPSA id p17-v6sm566645wmc.17.2018.05.15.06.48.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 15 May 2018 06:48:59 -0700 (PDT) From: luca.boccassi@gmail.com To: Ajit Khaparde Cc: Qingmin Liu , Scott Branden , Jay Ding , Randy Schacher , dpdk stable Date: Tue, 15 May 2018 14:46:58 +0100 Message-Id: <20180515134731.9337-47-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180515134731.9337-1-luca.boccassi@gmail.com> References: <20180503110612.12146-2-luca.boccassi@gmail.com> <20180515134731.9337-1-luca.boccassi@gmail.com> Subject: [dpdk-stable] patch 'net/bnxt: fix MTU calculation' has been queued to stable release 18.02.2 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: , X-List-Received-Date: Tue, 15 May 2018 13:49:00 -0000 Hi, FYI, your patch has been queued to stable release 18.02.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/16/18. So please shout if anyone has objections. Thanks. Luca Boccassi --- >>From b73c0d87dcce8958321a82092fa0aac47f61dc0f Mon Sep 17 00:00:00 2001 From: Ajit Khaparde Date: Mon, 30 Apr 2018 18:06:11 -0700 Subject: [PATCH] net/bnxt: fix MTU calculation [ upstream commit 3d911af8607b2c4a546f118cde89e04b58671caf ] We were not considering the case of nested VLANs while calculating MTU. This patch takes care of the same. Fixes: daef48efe5e5 ("net/bnxt: support set MTU") Signed-off-by: Qingmin Liu Signed-off-by: Scott Branden Reviewed-by: Jay Ding Reviewed-by: Ajit Khaparde Reviewed-by: Randy Schacher Signed-off-by: Ajit Khaparde --- drivers/net/bnxt/bnxt.h | 1 + drivers/net/bnxt/bnxt_ethdev.c | 3 ++- drivers/net/bnxt/bnxt_hwrm.c | 9 ++++++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index b5a0badfc..81637e370 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -51,6 +51,7 @@ #define BNXT_MAX_MTU 9500 #define VLAN_TAG_SIZE 4 #define BNXT_MAX_LED 4 +#define BNXT_NUM_VLANS 2 struct bnxt_led_info { uint8_t led_id; diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 22de7f9f3..e5486b58a 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -544,7 +544,8 @@ static int bnxt_dev_configure_op(struct rte_eth_dev *eth_dev) if (eth_dev->data->dev_conf.rxmode.jumbo_frame) { eth_dev->data->mtu = eth_dev->data->dev_conf.rxmode.max_rx_pkt_len - - ETHER_HDR_LEN - ETHER_CRC_LEN - VLAN_TAG_SIZE; + ETHER_HDR_LEN - ETHER_CRC_LEN - VLAN_TAG_SIZE * + BNXT_NUM_VLANS; bnxt_mtu_set_op(eth_dev, eth_dev->data->mtu); } return 0; diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index 3f73a9001..460523624 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -2366,7 +2366,8 @@ static int bnxt_hwrm_pf_func_cfg(struct bnxt *bp, int tx_rings) req.flags = rte_cpu_to_le_32(bp->pf.func_cfg_flags); req.mtu = rte_cpu_to_le_16(BNXT_MAX_MTU); req.mru = rte_cpu_to_le_16(bp->eth_dev->data->mtu + ETHER_HDR_LEN + - ETHER_CRC_LEN + VLAN_TAG_SIZE); + ETHER_CRC_LEN + VLAN_TAG_SIZE * + BNXT_NUM_VLANS); req.num_rsscos_ctxs = rte_cpu_to_le_16(bp->max_rsscos_ctx); req.num_stat_ctxs = rte_cpu_to_le_16(bp->max_stat_ctx); req.num_cmpl_rings = rte_cpu_to_le_16(bp->max_cp_rings); @@ -2403,9 +2404,11 @@ static void populate_vf_func_cfg_req(struct bnxt *bp, HWRM_FUNC_CFG_INPUT_ENABLES_NUM_HW_RING_GRPS); req->mtu = rte_cpu_to_le_16(bp->eth_dev->data->mtu + ETHER_HDR_LEN + - ETHER_CRC_LEN + VLAN_TAG_SIZE); + ETHER_CRC_LEN + VLAN_TAG_SIZE * + BNXT_NUM_VLANS); req->mru = rte_cpu_to_le_16(bp->eth_dev->data->mtu + ETHER_HDR_LEN + - ETHER_CRC_LEN + VLAN_TAG_SIZE); + ETHER_CRC_LEN + VLAN_TAG_SIZE * + BNXT_NUM_VLANS); req->num_rsscos_ctxs = rte_cpu_to_le_16(bp->max_rsscos_ctx / (num_vfs + 1)); req->num_stat_ctxs = rte_cpu_to_le_16(bp->max_stat_ctx / (num_vfs + 1)); -- 2.14.2