Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7159047ybi; Mon, 8 Jul 2019 15:51:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqwl7cJrllrvJUoYyt5L0NOMtUKZBRcRy+q9LivgvBNYPOGHEcakMF1o5LDubV/sKVn7gVOm X-Received: by 2002:a63:e018:: with SMTP id e24mr26281818pgh.361.1562626271101; Mon, 08 Jul 2019 15:51:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562626271; cv=none; d=google.com; s=arc-20160816; b=LEZO0CwFd30oK0i49QwFl9CCZi9tz+soa20KOXB5SIxMBhBLhLaXvLNzoCWHmmFxnA +lzBART8Gxaedu6t3faB9KliPUxF2vZyCww56TOaJnGqAWqBC1rU524G+jf71vFH+gZ1 IvEUavUN/97/4y6KyCRsRTf7jl8XpjsFqmp+n+ztLhfd1qtAvBlmDF3gkSSa/CqJkbLn JhMZnnNPEqf7WNpRe2w3Bf9zToYxtleHRtsSbhob168UuzScq6Xmzi8+d4ii2wPglX00 IL5yurrRbP5L/RPUpCoutnPkjoQ+n7L6DYshY5CQqDdcf3Vs5UBej7FXMjzpSLI+Tcvp d5rg== 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=/jUllDDZ3b7We2EmtZhggvnRSS7NBu/TTaz5tD6/PUc=; b=z0E8f+eyauG2EC94q5JvWRkVC4/DJfRdgOJnwafz50DWbAyJn+VUOsBThZS9E6YEZw uNo/r0h33YEStnfhvNg1glFgrfVBLB3JqWN/DSi90XUx0Vl8tCyjD++vN9bzfXsSSJgT f/hzJb0utphzVSjk04GelajTHGLoZLRlunU8NqllvmCAWcRY90G+PxRQqrWjOvYl2LXx KKYWEvkUHx2+AmVhkptRszhJokZFDFsSTpEAfZCBqHRbDN5ISMyHqnSWNIJic1IpV53U LITmPeVodoi+7gaHGZWCnvdLFFh6IRmyklq+0XthFnbojThlO7LO4CsJVZNRI4o7Ql/L 818Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T8pbps6C; 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 u6si20091661pga.360.2019.07.08.15.50.56; Mon, 08 Jul 2019 15:51:11 -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=T8pbps6C; 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 S1732517AbfGHVei (ORCPT + 99 others); Mon, 8 Jul 2019 17:34:38 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:38385 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729474AbfGHVei (ORCPT ); Mon, 8 Jul 2019 17:34:38 -0400 Received: by mail-lj1-f194.google.com with SMTP id r9so17431801ljg.5 for ; Mon, 08 Jul 2019 14:34:36 -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=/jUllDDZ3b7We2EmtZhggvnRSS7NBu/TTaz5tD6/PUc=; b=T8pbps6CRd0YYwTNpgOwCFTwOOC7K3bS+QLebfKLWanCnY22hZ2/Fzlhoz21wi9btl qeHAu27UExxlUyTgdNIVzORsRVkvD3PDhUCD7Z2LQRxS0R9ofH1QhUxQRs6Te1v6eGyZ LG1uW2nD+Ayo0T1reG8dFirp5xGI/MbJiyeG0tO5JKRgedhe7zP2ba2fOODu1NV0RFZq 0j5U87HXsJ1iFXKpPtbeK9jKHLRN2vUICPWz3OSNeWLZZ1zqhrrdqHV2PEiI7IG2DrQV 4/303OFQ65FkDNFHHdYHF81pcV4rhG06bASB5InaH3MQxmxx2WsbbMPYxSAN/o98cxgp NwQA== 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=/jUllDDZ3b7We2EmtZhggvnRSS7NBu/TTaz5tD6/PUc=; b=VNaSu5eU4fSZphLVT+6va6ur/1DzOgco5OCphIYjko75xDUoXQbcwG4ZbQgjIuQKyu yiSYOo2MGAGxPDF8CpnoqXIpUkCfDAXLgwtRYZdjxUQ8vtvPh+jlQx4opdnzD41IgEPP pRMAb9voMi74IfYFwLjMkZBRxebNBIYjiBVwk6TrUo637LNUFx0kD6FDCkT8nAl8zKV/ s/sqrhjcRGSdo6vBYZ/ql/BabEfUaE+STBeeti2Ncd0s/xvzkKerDiZs5xeauZpty+lJ FNlKtbHjHtI+FJx1hpDlPuod3nIhKFkjhh69x0d3cn1CjmNa0KVNmYFt4Bz3JblVTUfc 8D6Q== X-Gm-Message-State: APjAAAUhExtTjh0pCMSKwVVK5yrd2r+galudOImXXQo850AVa4qg4ciw Tyka7ZZ6mzvH5DB6gCW0lTl959CDukQ= X-Received: by 2002:a2e:1459:: with SMTP id 25mr8862117lju.153.1562621676013; Mon, 08 Jul 2019 14:34:36 -0700 (PDT) Received: from localhost.localdomain (59-201-94-178.pool.ukrtel.net. [178.94.201.59]) by smtp.gmail.com with ESMTPSA id o24sm3883096ljg.6.2019.07.08.14.34.34 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 08 Jul 2019 14:34:35 -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 v9 net-next 0/5] net: ethernet: ti: cpsw: Add XDP support Date: Tue, 9 Jul 2019 00:34:27 +0300 Message-Id: <20190708213432.8525-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 v7: https://lkml.org/lkml/2019/7/4/715 Also regular tests with iperf2 were done in order to verify impact on regular netstack performance, compared with base commit: https://pastebin.com/JSMT0iZ4 v8..v9: - fix warnings on arm64 caused by typos in type casting v7..v8: - corrected dma calculation based on headroom instead of hard start - minor comment changes v6..v7: - rolled back to v4 solution but with small modification - picked up patch: https://www.spinics.net/lists/netdev/msg583145.html - added changes related to netsec fix and cpsw v5..v6: - do changes that is rx_dev while redirect/flush cycle is kept the same - dropped net: ethernet: ti: davinci_cpdma: return handler status - other changes desc in patches v4..v5: - added two plreliminary patches: net: ethernet: ti: davinci_cpdma: allow desc split while down net: ethernet: ti: cpsw_ethtool: allow res split while down - added xdp alocator refcnt on xdp level, avoiding page pool refcnt - moved flush status as separate argument for cpdma_chan_process - reworked cpsw code according to last changes to allocator - added missed statistic counter v3..v4: - added page pool user counter - use same pool for ndevs in dual mac - restructured page pool create/destroy according to the last changes in API v2..v3: - each rxq and ndev has its own page pool 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 Ivan Khoronzhuk (5): net: core: page_pool: add user refcnt and reintroduce page_pool_destroy net: ethernet: ti: davinci_cpdma: add dma mapped submit net: ethernet: ti: davinci_cpdma: allow desc split while down net: ethernet: ti: cpsw_ethtool: allow res split while down net: ethernet: ti: cpsw: add XDP support .../net/ethernet/mellanox/mlx5/core/en_main.c | 4 +- drivers/net/ethernet/socionext/netsec.c | 8 +- drivers/net/ethernet/ti/Kconfig | 1 + drivers/net/ethernet/ti/cpsw.c | 502 ++++++++++++++++-- drivers/net/ethernet/ti/cpsw_ethtool.c | 57 +- drivers/net/ethernet/ti/cpsw_priv.h | 7 + drivers/net/ethernet/ti/davinci_cpdma.c | 106 +++- drivers/net/ethernet/ti/davinci_cpdma.h | 7 +- include/net/page_pool.h | 25 + net/core/page_pool.c | 8 + net/core/xdp.c | 3 + 11 files changed, 640 insertions(+), 88 deletions(-) -- 2.17.1