From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5333AC4338F for ; Thu, 5 Aug 2021 17:13:07 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1FA1D60E9B for ; Thu, 5 Aug 2021 17:13:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1FA1D60E9B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Bq8IVaTiprM8wfEDclg6tDr0lpa68XxSDDrhQbhSVt4=; b=rNJP8EkpmeSrOS mTtS38Dj4NpUqN4GErLPkPzAEbjAlrGxP7TPz5nM1vAztP0l1aOlPAqLThaylorBAwzLOf/VSrvBP FNVnA31JvzzkP6M+8+Ja4ZE6Iu6bYEFNJZv67dbzdOYVa1auf0OuKFWtrq3dxoW18HzDqqtOBl5Xq TmjfwUVKWb7nvw4rksM/x4EEm+0qHTH7pD6JQu0fU2s3x94Zhov86aQLZadc9Eu+IcxJwrHvqpAX4 Pc0Fpd2PlhyWCm9mlyHwQX6LBk1qshWxUUH11iPQaUhfSCV9rpWu3Gdr6CjeZxQoD0DUnqoUXotHT WkzKSHmOx9CR/Ki9LcGA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mBgtu-00AM5L-IF; Thu, 05 Aug 2021 17:11:22 +0000 Received: from mail-ej1-f47.google.com ([209.85.218.47]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mBgtp-00AM3m-0F for linux-arm-kernel@lists.infradead.org; Thu, 05 Aug 2021 17:11:18 +0000 Received: by mail-ej1-f47.google.com with SMTP id hs10so10851267ejc.0 for ; Thu, 05 Aug 2021 10:11:16 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=D7+jxX/JlbsLDgJC0GgP7ELLd+nfENBJ343/im26+GM=; b=X0g1RGuPqyeaFpSNUMGsl3fXLBzyJ9oYLrQxaYF40V+K9siwZbC4MzinKFtE+LPpwt 0jr0jhvYI9tGiLpd0FYSd+qMXy0a94AElkj+DwtXnGkIlSk053P+963ZxkEmAzJ/uLUf MmG+jFFf7AzgCoZlfWhuPPrJVMplBfQDd7zMFU5/J/MI9y58KcA7xtckgOHq9YxyOz4z Sp4svf2N0SyMvkXTKYEThif79vWCQPbDGRF09h0ShpBin/A2NHmuVVq1JkOaEFBeRM6P axHSzlhPuF87FNczhhvaaB91YCktOV58uxQvUcmHKmYrI97MSZ8kzM1vZYa20qsBtWH2 4J8w== X-Gm-Message-State: AOAM53334Y1MZ/1Rzoh+RyXbx/ZIBKt1XAPREGKDxz4xQpYLRSUxN40I Re5wo05b/UhZFOQqoR+LodE= X-Google-Smtp-Source: ABdhPJygIfEvBUqlx0/X5AzYLa/bnmtDp5d4zz7lx3m8P24V0rWS5lGo5uMBsVpMwgA+mF2pSX/rQg== X-Received: by 2002:a17:906:fb0a:: with SMTP id lz10mr5878137ejb.502.1628183475524; Thu, 05 Aug 2021 10:11:15 -0700 (PDT) Received: from msft-t490s.fritz.box (host-80-116-27-227.retail.telecomitalia.it. [80.116.27.227]) by smtp.gmail.com with ESMTPSA id n2sm2592655edi.32.2021.08.05.10.11.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Aug 2021 10:11:15 -0700 (PDT) From: Matteo Croce To: netdev@vger.kernel.org Cc: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Maxime Coquelin , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [RFT net-next 1/2] stmmac: use build_skb() Date: Thu, 5 Aug 2021 19:11:00 +0200 Message-Id: <20210805171101.13776-2-mcroce@linux.microsoft.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210805171101.13776-1-mcroce@linux.microsoft.com> References: <20210805171101.13776-1-mcroce@linux.microsoft.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210805_101117_091291_986F023F X-CRM114-Status: GOOD ( 12.01 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Matteo Croce Signed-off-by: Matteo Croce --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index a2aa75cb184e..30a0d915cd4b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -5208,7 +5208,7 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue) /* XDP program may expand or reduce tail */ buf1_len = xdp.data_end - xdp.data; - skb = napi_alloc_skb(&ch->rx_napi, buf1_len); + skb = build_skb(xdp.data_hard_start, PAGE_SIZE); if (!skb) { priv->dev->stats.rx_dropped++; count++; @@ -5216,11 +5216,10 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue) } /* XDP program may adjust header */ - skb_copy_to_linear_data(skb, xdp.data, buf1_len); + skb_reserve(skb, buf->page_offset); skb_put(skb, buf1_len); - /* Data payload copied into SKB, page ready for recycle */ - page_pool_recycle_direct(rx_q->page_pool, buf->page); + page_pool_release_page(rx_q->page_pool, buf->page); buf->page = NULL; } else if (buf1_len) { dma_sync_single_for_cpu(priv->device, buf->addr, -- 2.31.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel