From patchwork Wed Apr 17 17:49:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 10905693 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C64C9922 for ; Wed, 17 Apr 2019 17:50:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B0C47288E4 for ; Wed, 17 Apr 2019 17:50:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A5047289DD; Wed, 17 Apr 2019 17:50:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F859288E4 for ; Wed, 17 Apr 2019 17:50:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733154AbfDQRuJ (ORCPT ); Wed, 17 Apr 2019 13:50:09 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:44975 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729641AbfDQRuJ (ORCPT ); Wed, 17 Apr 2019 13:50:09 -0400 Received: by mail-lf1-f67.google.com with SMTP id h18so19505752lfj.11 for ; Wed, 17 Apr 2019 10:50:07 -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=hHpxRlsiI7GvZSM+HkyKQPu0rObcw/POqpTIQVI3tSA=; b=zdILDgDtdu3OIxwYRtN2PyPe9WxxvQu1KOtzg7eDwEvm49Z0o+2lnaNEt6ePNo+m2P yBFjM6da6vX3QnQsNjic0Hy9FjlWfcXSLo2b5ezAZ+qTrR1qBPTKj/KFPthwGiHOaPJj ZCuXA44G0qe10XhjxYfusyxE/4KloUCw2md/Tbs+40RSejCYp1/qKE4YoN0MRm0z6OZM JyRFCLFqPQWu/6UYj4cqlyzEx+FdeNvDl6u8OXLe74OVYxd7JOEGRLncU3LpjBhHBI/A kG0ulgqeBpsds+pPUwuFimDaYXlK+ssK9o9BjCoI2i68WD+BeghHf2hpTYO5xaW+hGr0 UUbg== 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=hHpxRlsiI7GvZSM+HkyKQPu0rObcw/POqpTIQVI3tSA=; b=Xex8d16jWFSPl4uDWjbpCAOJ5uBt7+MkSr3oAbY3/xcCO+ojZKEMS0uiRn5V7TBo/D 6jloExakLiJ1z4TAHSQuu8FVNLBlzljyMhSwFUOM7PJ/OOmDxNKYLEFGKkkWBtwmB7J+ 0XblrqvcW3E45kdJu9N+qcFaBEV+EgR+eFQ8jYym7N+FQjyE+/fDb3I1Gbfm6D2+sryf BHnUEAOSCKR56Js4Wnglew4GEUbe79Mh1Bjx1a+3GJt9/NuGqLnmJvuhNhLGPmgBR1JI CvRpxtECHmnW6YtAsGbdyKsMCuTtwwSI4DcdKugfxGlkrT3ueQX5feyya5m5Y5/Dfpld ZVjw== X-Gm-Message-State: APjAAAUaemwa2gDioUdLRYzdl33hnHLAwB5ASkPXU3z3LMDoyssDCAAJ b8p3q/a/u4zm/4TRlLt54eGXpg== X-Google-Smtp-Source: APXvYqwGZJCSP2KnWaR0DY0gMgr0qfCTIsgxfvXg3tn6XB38QGPJOBsF/ekiJFC2GWXznohm9y2jew== X-Received: by 2002:ac2:554a:: with SMTP id l10mr15734978lfk.45.1555523406673; Wed, 17 Apr 2019 10:50:06 -0700 (PDT) Received: from localhost.localdomain (59-201-94-178.pool.ukrtel.net. [178.94.201.59]) by smtp.gmail.com with ESMTPSA id f4sm11197173ljg.37.2019.04.17.10.50.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Apr 2019 10:50:06 -0700 (PDT) From: Ivan Khoronzhuk To: grygorii.strashko@ti.com Cc: linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, ilias.apalodimas@linaro.org, hawk@kernel.org, xdp-newbies@vger.kernel.org, ast@kernel.org, aniel@iogearbox.net, jakub.kicinski@netronome.com, john.fastabend@gmail.com, Ivan Khoronzhuk Subject: [RFC PATCH 0/3] net: ethernet: ti: cpsw: Add XDP support Date: Wed, 17 Apr 2019 20:49:39 +0300 Message-Id: <20190417174942.11811-1-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patchset is RFC adding XDP support for TI cpsw driver that is based on page_pool allocator. It was verified with af_xdp sockets and on xdp drop. For XDP redirect to another interface it's under verification, still not sure about all cases that should be verified. Also regular tests with iperf2 were done in order to verify impact on regular netstack performance, compared with base commit from net-next/master: 432bc230700f86801cffa5e159e05dea6229f722 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 iperf2 UDP RX summary (packet size / Mbps): +--------------------------------------------------------------+ | pkt_size/rate | 1024 | 1500 | 1470 | 64 | 128 | 512 | 256 | |---------------+------+------+------+------+------+-----+-----| | base commit | 561 | 470 | 796 | 35 | 70.1 | 281 | 140 | |---------------+------+------+------+------+------+-----+-----| | XDP patched | 563 | 455 | 808 | 35 | 70.2 | 282 | 141 | +--------------------------------------------------------------+ iperf2 UDP TX summary (packet size / Mbps): +--------------------------------------------------------------+ | pkt_size/rate | 1024 | 1500 | 1470 | 64 | 128 | 512 | 256 | |---------------+------+------+------+------+------+-----+-----| | base commit | 555 | 666 | 736 | 34.5 | 70.3 | 281 | 140 | |---------------+------+------+------+------+------+-----+-----| | XDP patched | 558 | 696 | 759 | 35.2 | 69.2 | 279 | 140 | +--------------------------------------------------------------+ iperf2 TCP summary (window size / Mbps): +------------------------------------------------------------+ | window size/rate | 16 | 32 | 64 | 128 | 8 | 256 | |------------------+------+------+------+------+------+------| | base commit | 753 | 887 | 931 | 932 | 676 | 932 | |------------------+------+------+------+------+------+------| | XDP patched | 823 | 888 | 932 | 933 | 669 | 933 | +------------------------------------------------------------+ For af_xdp socket type verification several generic changes should be added that can be seen here (rough fixes, for samples related seems like last version of samples is more integrated with libbpf api, so should be rebased, witch I will send as RFC separately): https://github.com/ikhorn/af_xdp_stuff/tree/af_xdp_armv7 Ivan Khoronzhuk (3): 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 | 552 +++++++++++++++++++++--- drivers/net/ethernet/ti/davinci_cpdma.c | 117 +++-- drivers/net/ethernet/ti/davinci_cpdma.h | 6 +- drivers/net/ethernet/ti/davinci_emac.c | 18 +- 5 files changed, 591 insertions(+), 103 deletions(-)