Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2683016pxj; Mon, 31 May 2021 08:10:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7dt2qL+O26D51MSQC/BgBN6er29G+QEs5Mpn5eb5DUH5zWu5aKEouWGPM+3ycxiplbo8l X-Received: by 2002:a05:6e02:1ba2:: with SMTP id n2mr18907645ili.60.1622473833367; Mon, 31 May 2021 08:10:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622473833; cv=none; d=google.com; s=arc-20160816; b=UmMQybxNljU0RVkdFDxxh5zZasVrqyDk1Fb2pUeOQiJ29nvI3yIohBx5iEC/k99mAN M8wjfSp/+VbMAIAUVtZPImWy/qTQEys89wCe7xQMNNJYTS6vZcHKMn+7UJ/iSzjGuo97 2PflawLKBL2h4TzLG4/VacQRdee869vLNIqSpPTXMeBv5gX+7urI2xgpKsP0Q5YbYKA7 lfRWyIPfhlKtcaQZxxR7HJfdOJRzCQHyXEUYfCZnw6rT+o99C45KPC6mK3xw9zf32EsT VUZ09dX+R7fVrWCT6awCPeZLOpU90Z1MQ4CTvoW+C9gJ0UmUqNBxxKxcpO+Eu10pc6LU Aikg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=p17cSif8r5/WH4UHkK+jDs9beOfLycmbRJ9DrDjthbY=; b=IKgvGCgy8FccPnLO65mq5wEAao+e99XBqNWFxmpfAk08I9yZsxmAFgoZsEhAcmkcDO JC5SjP+7rejmXNkFlNo+QdLjrMN4omySe/Y2AXSHD0bsZdoeiz3/BOoWAa9WwPQfDI2T tn99iljrBKq1VPpnmoVTB2MjQI6oAJDGG7S03Q4v3SdHm1SvhhTysJf0BsaZ/abhiy0H o7n9jOIhE9tPzSWL1GVm7tAhFPMaFact6INDctk16Zz/B2it/BHC7MmWBulH47YD6UFT 9ee4cwPlIanQItwOZO3Bc3YQmKh6eG+ggk/UruLqAn/VpNI8Vtv/IzwNLmPgTtTmKKnK yLbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ia6MiL1B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w17si12892586iot.47.2021.05.31.08.10.19; Mon, 31 May 2021 08:10:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ia6MiL1B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231995AbhEaPLN (ORCPT + 99 others); Mon, 31 May 2021 11:11:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:40580 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232589AbhEaOKC (ORCPT ); Mon, 31 May 2021 10:10:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 051E86197F; Mon, 31 May 2021 13:40:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468440; bh=gLN9xRhtMut5ybpyzUePqsoPUTJ5b+eBpwH+/zoWfZQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ia6MiL1B1mfllAtSiLc1i1uOo+0ZU4QCFDik6f+ESrkNUik6AqcB002BYLqox+2gf coWGqz+XwxdSim1KnRNKHGQJ78xScxHOCYLFBkxqKhgobBc08HDBuZQp0rYjD/7O01 28bmUv7DE6qpdCyryzTkoTkTfDx+OgGAEIssxgX4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Magnus Karlsson , Daniel Borkmann , Maciej Fijalkowski Subject: [PATCH 5.10 244/252] samples/bpf: Consider frame size in tx_only of xdpsock sample Date: Mon, 31 May 2021 15:15:09 +0200 Message-Id: <20210531130706.303010579@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130657.971257589@linuxfoundation.org> References: <20210531130657.971257589@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Magnus Karlsson commit 3b80d106e110d39d3f678954d3b55078669cf07e upstream. Fix the tx_only micro-benchmark in xdpsock to take frame size into consideration. It was hardcoded to the default value of frame_size which is 4K. Changing this on the command line to 2K made half of the packets illegal as they were outside the umem and were therefore discarded by the kernel. Fixes: 46738f73ea4f ("samples/bpf: add use of need_wakeup flag in xdpsock") Signed-off-by: Magnus Karlsson Signed-off-by: Daniel Borkmann Acked-by: Maciej Fijalkowski Link: https://lore.kernel.org/bpf/20210506124349.6666-1-magnus.karlsson@gmail.com Signed-off-by: Greg Kroah-Hartman --- samples/bpf/xdpsock_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/samples/bpf/xdpsock_user.c +++ b/samples/bpf/xdpsock_user.c @@ -1257,7 +1257,7 @@ static void tx_only(struct xsk_socket_in for (i = 0; i < batch_size; i++) { struct xdp_desc *tx_desc = xsk_ring_prod__tx_desc(&xsk->tx, idx + i); - tx_desc->addr = (*frame_nb + i) << XSK_UMEM__DEFAULT_FRAME_SHIFT; + tx_desc->addr = (*frame_nb + i) * opt_xsk_frame_size; tx_desc->len = PKT_SIZE; }