From patchwork Wed May 29 15:02:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Richardson X-Patchwork-Id: 53816 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A53DF1B996; Wed, 29 May 2019 17:03:14 +0200 (CEST) Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by dpdk.org (Postfix) with ESMTP id 82BA91B956 for ; Wed, 29 May 2019 17:03:10 +0200 (CEST) Received: by mail-pl1-f193.google.com with SMTP id s24so1051023plr.8 for ; Wed, 29 May 2019 08:03:10 -0700 (PDT) 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=1+t+/KXu2MNgxM40lfA7kUDrLfbdewVDnBvIuctYlJ8=; b=HQGwUvI2ac4tKD1r3fJo6/9/IblurPEwt/u56Rczt8Dy1dWLWOuqtd/hg5exme3utg Vv2COw28q4dw7GuB6p64S3SfD2V/PxFeJCrge2VFcbU5ig5TZkVbZl18NgskJhU/LWJJ /zjKqeK1zFIQUH5wOAeB5/KQdzjEMHmHwjStE= 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=1+t+/KXu2MNgxM40lfA7kUDrLfbdewVDnBvIuctYlJ8=; b=d3pUrojlMCRGKVQACs2ZBRy/YVF1Qc8fYjsMverZXJpnD/5foaSHaaPtKpINF4LHkU QCRkQS/bZLq1bGcT/W5jNU/V/Ryx2EwiYo5JfHFWBgQIwXmz9r0pc1ClDGo2P3ALMh/4 C4qbTQhNo0nXuIhnvxQ2a6UYiJIXrCz35URFNyMM+TEA5Ja+9wq+9R2Z8gSqToU6ns9Z LZPjF1vTNL21zjsM9U8jghGok92RUUdmGy7p6+Jo2xJHiDVxiNkHn7ccDnMXNDvVNe5A NxdUQXZD/XuEAVX6OzirGVzZYR2QJwN8+7GUNzbNV64O6yB8gyZ6dK/cMiN9xJd0sTT/ wFNA== X-Gm-Message-State: APjAAAVbeVKHtcitE9N4ips7ht4nGJx/iraDBw7WzLpo/GquJRtblYyq EsK2JwqeBBBG5mLdrI7+fP1h4OKE+B1Z8snidCr9wmGqYRnP58W02Tz1XQ5EBjq3JWhHPJeUAqC YJN1xtL7uilENCxYB/4Yta5uIl4dPAmxHlPA0MgBL9R1vpW2nnEnceJbg/W5pQHl+ X-Google-Smtp-Source: APXvYqyvIKEqWY6oGEdeLcgdwuT3JLPM/XaBnEoMAsnSUivw2OzocWFVlvhQM3KlJefyBsKOtGiADA== X-Received: by 2002:a17:902:b682:: with SMTP id c2mr44109991pls.9.1559142189320; Wed, 29 May 2019 08:03:09 -0700 (PDT) Received: from localhost.localdomain ([192.19.231.250]) by smtp.gmail.com with ESMTPSA id q193sm21579361pfc.52.2019.05.29.08.03.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 May 2019 08:03:07 -0700 (PDT) From: Lance Richardson To: dev@dpdk.org Cc: ajit.khaparde@broadcom.com, ferruh.yigit@intel.com, maxime.coquelin@redhat.com, Lance Richardson Date: Wed, 29 May 2019 11:02:29 -0400 Message-Id: <20190529150234.15166-4-lance.richardson@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190529150234.15166-1-lance.richardson@broadcom.com> References: <20190521213953.25425-1-ajit.khaparde@broadcom.com> <20190529150234.15166-1-lance.richardson@broadcom.com> Subject: [dpdk-dev] [PATCH v4 3/8] net/bnxt: compute and store scattered Rx status X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" In preparation for a bnxt vector-mode driver, compute and store scattered_rx status for the device when started. Signed-off-by: Lance Richardson Reviewed-by: Ajit Khaparde Reviewed-by: Maxime Coquelin --- v4: * Moved a fix to bnxt_scattered_rx(), which is introduced in this patch, from patch 4 into this patch. (The original version incorrectly accounted for a possible QinQ header which was in fact already accounted for). drivers/net/bnxt/bnxt_ethdev.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index b0244d6d1..6295fec2a 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -624,6 +624,26 @@ static int bnxt_dev_lsc_intr_setup(struct rte_eth_dev *eth_dev) return 0; } +/* + * Determine whether the current configuration requires support for scattered + * receive; return 1 if scattered receive is required and 0 if not. + */ +static int bnxt_scattered_rx(struct rte_eth_dev *eth_dev) +{ + uint16_t buf_size; + int i; + + for (i = 0; i < eth_dev->data->nb_rx_queues; i++) { + struct bnxt_rx_queue *rxq = eth_dev->data->rx_queues[i]; + + buf_size = (uint16_t)(rte_pktmbuf_data_room_size(rxq->mb_pool) - + RTE_PKTMBUF_HEADROOM); + if (eth_dev->data->dev_conf.rxmode.max_rx_pkt_len > buf_size) + return 1; + } + return 0; +} + static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev) { struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private; @@ -642,6 +662,8 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev) if (rc) goto error; + eth_dev->data->scattered_rx = bnxt_scattered_rx(eth_dev); + bnxt_link_update_op(eth_dev, 1); if (rx_offloads & DEV_RX_OFFLOAD_VLAN_FILTER)