From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f178.google.com (mail-pf0-f178.google.com [209.85.192.178]) by dpdk.org (Postfix) with ESMTP id 09EF6214A for ; Thu, 14 Apr 2016 18:22:13 +0200 (CEST) Received: by mail-pf0-f178.google.com with SMTP id c20so47434526pfc.1 for ; Thu, 14 Apr 2016 09:22:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=WEKs9pZ/lnBVXBPwC6Bl4DsLmyKb49bLzeYuXTSv810=; b=kNKI5nhixf2P9Ji0vaulOhIHlNc1gquRXmH08AUmb0eKG5jwMMbxbjYz0hSbzBr522 9d1qbz202dRrJxvkdIzjDyDZ0IZYk8uRGIJcOlI12I0LIff1Kd1/nRV12DiSG5sg021v fM5yLsO3g6ftKcKJrBdfArhiyfnyFEnzyYDmhmx8dtgKn7tRpg/67Zefm1O5fzPVsx6q VEqWFHFzofsrfWyxH30Lznl/aU2vmOm+oeF7ikmO39tiZJXd/Bqmu5HMnmOPDZQviucY BRv8b2Wv5WlE0so+oCv1wKczcLuW3cxd16EtOXxyPHKv4DtPSm/VXfG8en8eAhtuCqUq KZJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=WEKs9pZ/lnBVXBPwC6Bl4DsLmyKb49bLzeYuXTSv810=; b=A7uDCyCisJAtujM59uI6KL/r4Gc7scb44Neur5J1z4G/Doi7qGDa86gMOOKFYlZcDv DVQhMg5llVQoFCCmbPJHaqocP+BEatiBeMcwyC4tKfS0WpuJkBhu+xZOZCiDu3Z5MP+Q gOzcRGpKuvFfOvdfNt7K/2qeT0Z8mzenJpKIps/BHmVs+u6To6cvJDM5K0XvbK1WyGuv 9Pszyt9IlkDJ2BYdn3kFBVepEC52nthyle7ThsWb9ggTKaGHby4DSssrNqyLmYD5FCTX rTTonda/EQobwEH5vPt9LhEK7oL5YxmXm5bu5Hi0EVCFk9tKCYAekpz47mun6+YGJYjj /jzg== X-Gm-Message-State: AOPr4FUpVs1yT39EF4cJh0rCF3fA92U/FfrVCTs7KLO7qPfK3Eu4C3J0w+eeReV9koDh3g== X-Received: by 10.98.13.130 with SMTP id 2mr22471329pfn.97.1460650932314; Thu, 14 Apr 2016 09:22:12 -0700 (PDT) Received: from buildhost2.vyatta.com. ([144.49.132.22]) by smtp.gmail.com with ESMTPSA id 3sm58895920pfn.59.2016.04.14.09.22.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Apr 2016 09:22:11 -0700 (PDT) From: Eric Kinzie To: dev@dpdk.org Date: Thu, 14 Apr 2016 10:23:44 -0700 Message-Id: <1460654624-2066-1-git-send-email-ehkinzie@gmail.com> X-Mailer: git-send-email 1.7.10.4 Subject: [dpdk-dev] [PATCH] bond: inherit maximum rx packet length X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Apr 2016 16:22:13 -0000 Instead of a hard-coded maximum receive length, allow the bond interface to inherit this limit from the first slave added. This allows an application that uses jumbo frames to pass realistic values to rte_eth_dev_configure without causing an error. Signed-off-by: Eric Kinzie --- drivers/net/bonding/rte_eth_bond_api.c | 4 ++++ drivers/net/bonding/rte_eth_bond_pmd.c | 2 +- drivers/net/bonding/rte_eth_bond_private.h | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c index e9247b5..b763b37 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -247,6 +247,7 @@ rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id) internals->active_slave_count = 0; internals->rx_offload_capa = 0; internals->tx_offload_capa = 0; + internals->max_rx_pktlen = (uint32_t)2048; /* Initially allow to choose any offload type */ internals->flow_type_rss_offloads = ETH_RSS_PROTO_MASK; @@ -365,6 +366,9 @@ __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id) internals->tx_offload_capa = dev_info.tx_offload_capa; internals->flow_type_rss_offloads = dev_info.flow_type_rss_offloads; + /* Inherit first slave's max rx packet size */ + internals->max_rx_pktlen = dev_info.max_rx_pktlen; + } else { /* Check slave link properties are supported if props are set, * all slaves must be the same */ diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 54788cf..189fb47 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -1650,7 +1650,7 @@ bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) dev_info->max_mac_addrs = 1; - dev_info->max_rx_pktlen = (uint32_t)2048; + dev_info->max_rx_pktlen = internals->max_rx_pktlen; dev_info->max_rx_queues = (uint16_t)128; dev_info->max_tx_queues = (uint16_t)512; diff --git a/drivers/net/bonding/rte_eth_bond_private.h b/drivers/net/bonding/rte_eth_bond_private.h index 8312397..79ca69d 100644 --- a/drivers/net/bonding/rte_eth_bond_private.h +++ b/drivers/net/bonding/rte_eth_bond_private.h @@ -169,6 +169,8 @@ struct bond_dev_private { struct rte_kvargs *kvlist; uint8_t slave_update_idx; + + uint32_t max_rx_pktlen; }; extern const struct eth_dev_ops default_dev_ops; -- 1.7.10.4