Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1088279ybi; Thu, 30 May 2019 11:22:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqy62jUXS+XkIW/emsXWABXhzvrOVyrZ+bNV/MobUexioTb7jPSoHO8/8yx453kVcmU34PEY X-Received: by 2002:a17:90a:62cb:: with SMTP id k11mr4771992pjs.26.1559240536544; Thu, 30 May 2019 11:22:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559240536; cv=none; d=google.com; s=arc-20160816; b=mIZHWz9rNa6mFgnXM1ufNUkc25Aw3QEEjyRHQh9cqHW5ynfbvb9Rt2H7poDCjTdP7M oA5G4R/jUmZBEllG1POc5H7zNEyZX3m35ZH422TcbZ/U+ccmfRBuzOdPPmIporvaZEQ4 vROISzUkw85ofVhC3gGeXvqvWI0X5uT4cGvmrPrZRNGWkZfcBSrYC9NTMLBr1aM+2f+z cQ+5faCr9YmSqI5HON2k8dMIMcNrSRBiyI3Ori/Lmr3n+6zW5ZJ2Gz0SQ5I6Mhw88oT/ WA7cZuzyDOYPiewUf+RFNxiDB8nlPXp6VLu1t+XBuLto/XmdSbeEIPaGww5K+rfgf01C glow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=8x97jd39TwyBk8v0q4IVmayr713NLQSBbX6u/ZPdPME=; b=uf1bgH5VhA66KumXo24x2B/497Pe5wmhEi7c4zt2WD0Y+B9vsGtx5DO6Np5d037cLz EzfGDHEKAqvYHWsd3z0R57lRda9WATssUr/FDSxCQYIPb9HQS2jGXuRAql47wPN871IW KIZ14zPx0o9UxEx/gcR2A4ct3P+PMP+WBAXRI88wXBHeOoK1yZegClSc4paK0arsiUCL okLeOFp6xPhDCFgMZIn1vAeVcaky1KA1KLdXRp724zUbCQ9J0n8BxM48eDTguYFKZTkS u76h80Kib5Lcv1kqKflfCcnQJY+8ZFEihp65wP2wT3l9k9kMY3SNXmm+6DZEnmVGbfaC Aqyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qUINiA4t; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h63si3321499pfb.90.2019.05.30.11.22.00; Thu, 30 May 2019 11:22:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qUINiA4t; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726640AbfE3SUw (ORCPT + 99 others); Thu, 30 May 2019 14:20:52 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:38478 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726442AbfE3SUv (ORCPT ); Thu, 30 May 2019 14:20:51 -0400 Received: by mail-lf1-f68.google.com with SMTP id b11so5794384lfa.5 for ; Thu, 30 May 2019 11:20:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=8x97jd39TwyBk8v0q4IVmayr713NLQSBbX6u/ZPdPME=; b=qUINiA4ttbzBtbe1hlkF3Nw+walwKPKkCWoqKpBx5LsOqYa9O8VkD3su5CoY7cmEpv sgoUuAMAqL7oUQ3pq0y/mNdHF0vxBxthSplDF5bOmjYiTbcfaiyDm8+FCeCgCD89vMFs o5bCIcAltuCh7c/TMagy62EwPDHKdf6NP4tU/AhF73C7sSCTKXiF6Q0XmE7DmrkjVaql 6Ts21LwqV/nGuAiyDjT6jtRHz4x+vB/83M6hUPrIvD0djrh4cya/WOQG+zb1YvjXmhtc DKM4aJZJhuxlWhYQ41SmVt5mxZSowZxZwn35scDT3sVdR5H7FJtheqvfkmJ2xLUaXJXZ 6aVg== 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; bh=8x97jd39TwyBk8v0q4IVmayr713NLQSBbX6u/ZPdPME=; b=AZtctgWctdGsBeZPkdtZ/gtpDNkItm3ZCrqEoqlmeaVD2aTR/m7nZOHH+mFs7OT+mr ut6MptdqFBUY8dXOLCiPzn3czHinFabMdxtl+WZRkAkaqDz+kmcI9z6Hjrb0LYaUr10e wZCblhK/uCISTkt0ud4SEgCOviS2pXhvaMnyV6ajfEX/rNLlIJrY6FGB65eiUYR0eI2o FWP+EDi6bHyLpHz72BXe6i7iXhCsg7JeJhh7lst3butXKEDjITH1gGYP9gLpWgDlttRW 1B3LsBdm7LVLY0s5rohc66l9+nMfQ3CNjpG0x18+FetqIco/pDaVuxVj3lk2IR5Q7OsL jE8w== X-Gm-Message-State: APjAAAVS8/152jLwnh5/JcnD8jm8yeINzwi4XJGv8bYYsZoUTuo0fsri VRBlzh3sJwwimJBZLgnFNiYKzg== X-Received: by 2002:ac2:5922:: with SMTP id v2mr2926685lfi.180.1559240449769; Thu, 30 May 2019 11:20:49 -0700 (PDT) Received: from localhost.localdomain (59-201-94-178.pool.ukrtel.net. [178.94.201.59]) by smtp.gmail.com with ESMTPSA id v7sm388946lfe.11.2019.05.30.11.20.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 May 2019 11:20:49 -0700 (PDT) From: Ivan Khoronzhuk To: grygorii.strashko@ti.com, hawk@kernel.org, davem@davemloft.net Cc: ast@kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, xdp-newbies@vger.kernel.org, ilias.apalodimas@linaro.org, netdev@vger.kernel.org, daniel@iogearbox.net, jakub.kicinski@netronome.com, john.fastabend@gmail.com, Ivan Khoronzhuk Subject: [PATCH v2 net-next 0/7] net: ethernet: ti: cpsw: Add XDP support Date: Thu, 30 May 2019 21:20:32 +0300 Message-Id: <20190530182039.4945-1-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset adds XDP support for TI cpsw driver and base it on page_pool allocator. It was verified on af_xdp socket drop, af_xdp l2f, ebpf XDP_DROP, XDP_REDIRECT, XDP_PASS, XDP_TX. It was verified with following configs enabled: CONFIG_JIT=y CONFIG_BPFILTER=y CONFIG_BPF_SYSCALL=y CONFIG_XDP_SOCKETS=y CONFIG_BPF_EVENTS=y CONFIG_HAVE_EBPF_JIT=y CONFIG_BPF_JIT=y CONFIG_CGROUP_BPF=y Link on previous v1: https://lkml.org/lkml/2019/5/23/795 Also regular tests with iperf2 were done in order to verify impact on regular netstack performance, compared with base commit: https://pastebin.com/JSMT0iZ4 v1..v2: - combined xdp_xmit functions - used page allocation w/o refcnt juggle - unmapped page for skb netstack - moved rxq/page pool allocation to open/close pair - added several preliminary patches: net: page_pool: add helper function to retrieve dma addresses net: page_pool: add helper function to unmap dma addresses net: ethernet: ti: cpsw: use cpsw as drv data net: ethernet: ti: cpsw_ethtool: simplify slave loops Based on net-next/master Ilias Apalodimas (2): net: page_pool: add helper function to retrieve dma addresses net: page_pool: add helper function to unmap dma addresses Ivan Khoronzhuk (5): net: ethernet: ti: cpsw: use cpsw as drv data net: ethernet: ti: cpsw_ethtool: simplify slave loops net: ethernet: ti: davinci_cpdma: add dma mapped submit net: ethernet: ti: davinci_cpdma: return handler status net: ethernet: ti: cpsw: add XDP support drivers/net/ethernet/ti/Kconfig | 1 + drivers/net/ethernet/ti/cpsw.c | 537 ++++++++++++++++++++---- drivers/net/ethernet/ti/cpsw_ethtool.c | 136 +++++- drivers/net/ethernet/ti/cpsw_priv.h | 12 +- drivers/net/ethernet/ti/davinci_cpdma.c | 122 ++++-- drivers/net/ethernet/ti/davinci_cpdma.h | 6 +- drivers/net/ethernet/ti/davinci_emac.c | 18 +- include/net/page_pool.h | 6 + net/core/page_pool.c | 7 + 9 files changed, 710 insertions(+), 135 deletions(-) -- 2.17.1