From patchwork Sun Jan 27 17:36:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10782939 X-Patchwork-Delegate: geert@linux-m68k.org 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 AADA91390 for ; Sun, 27 Jan 2019 17:36:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9062828A72 for ; Sun, 27 Jan 2019 17:36:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 82FED29F6C; Sun, 27 Jan 2019 17:36:15 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 1BA3328A72 for ; Sun, 27 Jan 2019 17:36:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726934AbfA0RgO (ORCPT ); Sun, 27 Jan 2019 12:36:14 -0500 Received: from mail-lf1-f67.google.com ([209.85.167.67]:33264 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726895AbfA0RgO (ORCPT ); Sun, 27 Jan 2019 12:36:14 -0500 Received: by mail-lf1-f67.google.com with SMTP id i26so10230192lfc.0 for ; Sun, 27 Jan 2019 09:36:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=subject:from:to:cc:references:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=kd73bZ7AKCEuKOrg+1QczlJBtttkncjpF7aX0xEIksY=; b=oRvSGKEpCIGZEdD4P4pmcQGLbtQ3xFhykI2lWVi2VcUp2B5iRkCHPTEI7HtRhmk3VE dk2Y8nQmenfpntZUsoD6u3FaqkZSGQjIz/XmKuoQUKB1FaF4uYofIeL+RskrWqMIOk4i pC8r9oN+Pny9yC+iEqbiuXNSBjGbooJ4oBaz8pp12UxeUyxemgrP8Da1rtmKgKnDG/H7 h8QbFtVrsYYUBfTcDbxVabjReklifW1UalT9NzjrlF9SucNOPs3gHaiNWIGeKYvcmEgx 7i9kNPeQkXLrimYKN+vF+rMSTrOe0nipVnPGHyOXGw1PWbLLN112OUTq4SOqo395PLHu p1ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=kd73bZ7AKCEuKOrg+1QczlJBtttkncjpF7aX0xEIksY=; b=NELUctmeq9j6DKsoHBt7o7HMEGEIiWHPS9vZu48IG9rjISlTbJdhzgIpvB26lBWQZl MQa2aR9uIXlJ6d9LmmC+ZVyWF6AHr5IJhEJASV/aznX+yZYF+gbyULM7AJHxKxuPvafI ovXUJyaeoNlxREeq/dzk6hfhHHZxltQjiS7ZxMU6IhIZNoOZJVTm3HUBClXMwx2MpDt0 8HaJaUe9bPRuvOP518RJt9Vhlv9clZXnDBSeu1Wdkq5ON8UiIW3CKSEJeNUYhVqO1gM8 7ZL1fAhDd0vp5IstXx/vkdBdiMxL89MgPz0u0c2HFqeh37+XU/WVDcc9Bs9vyx0kHWmP dJfw== X-Gm-Message-State: AJcUukcmjxN8f+GJ5URL9x1aY2Wg3WN6dqviqR2oLW2BmjMel5epKyyW 257cyyyRIohSvK48jcOzaT6cR76MRzI= X-Google-Smtp-Source: ALg8bN6wYAy6ZuoyqhdWTjkadRVlZRCC7C0HV7imTtJ533E5mUNGBOkMmYRKtSbopHfbwWKFM4IGeQ== X-Received: by 2002:a19:ced3:: with SMTP id e202mr15016133lfg.13.1548610572330; Sun, 27 Jan 2019 09:36:12 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.84.150]) by smtp.gmail.com with ESMTPSA id u65sm2678360lff.54.2019.01.27.09.36.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Jan 2019 09:36:11 -0800 (PST) Subject: [PATCH 1/7] sh_eth: rename sh_eth_cpu_data::hw_checksum From: Sergei Shtylyov To: netdev@vger.kernel.org, "David S. Miller" Cc: linux-renesas-soc@vger.kernel.org, linux-sh@vger.kernel.org References: Organization: Cogent Embedded Message-ID: Date: Sun, 27 Jan 2019 20:36:10 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-MW Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit 62e04b7e0e3c ("sh_eth: rename 'sh_eth_cpu_data::hw_crc'") renamed the field to 'hw_checksum' for the Ether DMAC "intelligent checksum", however some Ether MACs implement a simpler checksumming scheme, so that name now seems misleading. Rename that filed to 'csmr' as the "intelligent checkmum" is always controlled by the CSMR register. Signed-off-by: Sergei Shtylyov Reviewed-by: Geert Uytterhoeven --- drivers/net/ethernet/renesas/sh_eth.c | 14 +++++++------- drivers/net/ethernet/renesas/sh_eth.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) Index: net-next/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c +++ net-next/drivers/net/ethernet/renesas/sh_eth.c @@ -555,7 +555,7 @@ static int sh_eth_soft_reset_gether(stru sh_eth_write(ndev, 0, RDFFR); /* Reset HW CRC register */ - if (mdp->cd->hw_checksum) + if (mdp->cd->csmr) sh_eth_write(ndev, 0, CSMR); /* Select MII mode */ @@ -619,7 +619,7 @@ static struct sh_eth_cpu_data r7s72100_d .no_trimd = 1, .no_ade = 1, .xdfar_rw = 1, - .hw_checksum = 1, + .csmr = 1, .tsu = 1, .no_tx_cntrs = 1, }; @@ -668,7 +668,7 @@ static struct sh_eth_cpu_data r8a7740_da .no_trimd = 1, .no_ade = 1, .xdfar_rw = 1, - .hw_checksum = 1, + .csmr = 1, .tsu = 1, .select_mii = 1, .magic = 1, @@ -793,7 +793,7 @@ static struct sh_eth_cpu_data r8a77980_d .no_trimd = 1, .no_ade = 1, .xdfar_rw = 1, - .hw_checksum = 1, + .csmr = 1, .select_mii = 1, .magic = 1, .cexcr = 1, @@ -1045,7 +1045,7 @@ static struct sh_eth_cpu_data sh7734_dat .no_ade = 1, .xdfar_rw = 1, .tsu = 1, - .hw_checksum = 1, + .csmr = 1, .select_mii = 1, .magic = 1, .cexcr = 1, @@ -1633,7 +1633,7 @@ static int sh_eth_rx(struct net_device * * the RFS bits are from bit 25 to bit 16. So, the * driver needs right shifting by 16. */ - if (mdp->cd->hw_checksum) + if (mdp->cd->csmr) desc_status >>= 16; skb = mdp->rx_skbuff[entry]; @@ -2173,7 +2173,7 @@ static size_t __sh_eth_get_regs(struct n add_reg(MAFCR); if (cd->rtrate) add_reg(RTRATE); - if (cd->hw_checksum) + if (cd->csmr) add_reg(CSMR); if (cd->select_mii) add_reg(RMII_MII); Index: net-next/drivers/net/ethernet/renesas/sh_eth.h =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.h +++ net-next/drivers/net/ethernet/renesas/sh_eth.h @@ -499,7 +499,7 @@ struct sh_eth_cpu_data { unsigned no_ade:1; /* E-DMAC DOES NOT have ADE bit in EESR */ unsigned no_xdfar:1; /* E-DMAC DOES NOT have RDFAR/TDFAR */ unsigned xdfar_rw:1; /* E-DMAC has writeable RDFAR/TDFAR */ - unsigned hw_checksum:1; /* E-DMAC has CSMR */ + unsigned csmr:1; /* E-DMAC has CSMR */ unsigned select_mii:1; /* EtherC has RMII_MII (MII select register) */ unsigned rmiimode:1; /* EtherC has RMIIMODE register */ unsigned rtrate:1; /* EtherC has RTRATE register */ From patchwork Sun Jan 27 17:37:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10782945 X-Patchwork-Delegate: geert@linux-m68k.org 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 947721823 for ; Sun, 27 Jan 2019 17:37:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 839C5294CA for ; Sun, 27 Jan 2019 17:37:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 697C429F20; Sun, 27 Jan 2019 17:37: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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable 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 BAD2129F20 for ; Sun, 27 Jan 2019 17:37:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726861AbfA0Rhj (ORCPT ); Sun, 27 Jan 2019 12:37:39 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:44591 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726930AbfA0Rhj (ORCPT ); Sun, 27 Jan 2019 12:37:39 -0500 Received: by mail-lj1-f193.google.com with SMTP id k19-v6so12226079lji.11 for ; Sun, 27 Jan 2019 09:37:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=subject:from:to:cc:references:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=+OPgEEmQMA4QDlmXE8Cj6PmumWTVij50Xc1NgEDFbGM=; b=U3bCyJWzoEI7vKkGAV1UH0v5e4HEvHWcZ2/v9U5uj9OO/xSZFlwMqcRO2DbsRl0o9/ mHVZaRbFRyR3RjE5vwhC52Pl5cs0hCQAyHvOMlf/IwiGWeLaV8o+sjivIAXuOfE/RdsA kyaM0NoQSGIKHNBQgRDQTTQfCcXmLT30cHTIcVg5JEM7HUlIpw21WSwIDCwTn53RJ5bd rX+ILWpDnE0oqo+BVg2HPEIDwS41Mke9nFN9I19tIezVDCTnokof6jWos1M4chq87Rei PK47QqYMp3TbYHrPChYcsMpu3Aw8b91AgMiReHOKfVJWkpjmmrTYkFfC/0WB4f1/Y1JZ yctA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=+OPgEEmQMA4QDlmXE8Cj6PmumWTVij50Xc1NgEDFbGM=; b=lHnB8kSbWf4dDd4U0kT4i6e/yEMLvMMWTbWroqfaY2e/8Lwi2dfcwOCNTwtvtGuLAM D0BrKJko6H0aILYwuqSwfMJFMJmw6GLwv1n358z/UIfuobJ5VCFzJTfICWpp18D/Y6vN FRJZIicrOgUtnG2FyM/Zy8m9y6bLUXsC9jbvPoZM1gW41gCfg0XqjzyCghNg+TmoSktw d/Vkf3hWWbgaHZ8BtY8oWHP664hlfVntQm81upNHCHRZwyw2BI4jyBW74oLIBCvE60gu gE5rgl1/Yz7cNBpGGgI9M1jUZUB/uDaUlxgA3zdG4Ilu3z+aUfMtU2EMmMD1McSnvW5q mP9Q== X-Gm-Message-State: AJcUukecQ/QBCOAtVQ9N8Rc46MnN0tDEaPQk6x37372Xd0GIvpIxuVlk GLODB3V3/pmzQjn462gVOOnTCQ== X-Google-Smtp-Source: ALg8bN471JG5RmZNUq0cII/vavj3lt4RL6/3y3ds1D+nyFGYnEskd+F9OL6fE925SaD81+weX8njSg== X-Received: by 2002:a2e:9ad0:: with SMTP id p16-v6mr15182695ljj.102.1548610654559; Sun, 27 Jan 2019 09:37:34 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.84.150]) by smtp.gmail.com with ESMTPSA id q23sm2497091lfm.82.2019.01.27.09.37.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Jan 2019 09:37:34 -0800 (PST) Subject: [PATCH 2/7] sh_eth: RX checksum offload support From: Sergei Shtylyov To: netdev@vger.kernel.org, "David S. Miller" Cc: linux-renesas-soc@vger.kernel.org, linux-sh@vger.kernel.org References: Organization: Cogent Embedded Message-ID: <29cb4d33-37c3-43c0-3bce-fa01737c0fa4@cogentembedded.com> Date: Sun, 27 Jan 2019 20:37:33 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-MW Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add support for the RX checksum offload. This is enabled by default and may be disabled and re-enabled using 'ethtool': # ethtool -K eth0 rx {on|off} Some Ether MACs provide a simple checksumming scheme which appears to be completely compatible with CHECKSUM_COMPLETE: sum of all packet data after the L2 header is appended to packet data; this may be trivially read by the driver and used to update the skb accordingly. The same checksumming scheme is implemented in the EtherAVB MACs and now supported by tha 'ravb' driver. In terms of performance, throughput is close to gigabit line rate with the RX checksum offload both enabled and disabled. The 'perf' output, however, appears to indicate that significantly less time is spent in do_csum() -- this is as expected. Test results with RX checksum offload enabled: ~/netperf-2.2pl4# perf record -a ./netperf -t TCP_MAERTS -H 192.168.2.4 TCP MAERTS TEST to 192.168.2.4 Recv Send Send Socket Socket Message Elapsed Size Size Size Time Throughput bytes bytes bytes secs. 10^6bits/sec 131072 16384 16384 10.01 933.93 [ perf record: Woken up 8 times to write data ] [ perf record: Captured and wrote 1.955 MB perf.data (41940 samples) ] ~/netperf-2.2pl4# perf report Samples: 41K of event 'cycles:ppp', Event count (approx.): 9915302763 Overhead Command Shared Object Symbol 9.44% netperf [kernel.kallsyms] [k] __arch_copy_to_user 7.75% swapper [kernel.kallsyms] [k] _raw_spin_unlock_irq 6.31% swapper [kernel.kallsyms] [k] default_idle_call 5.89% swapper [kernel.kallsyms] [k] arch_cpu_idle 4.37% swapper [kernel.kallsyms] [k] tick_nohz_idle_exit 4.02% netperf [kernel.kallsyms] [k] _raw_spin_unlock_irq 2.52% netperf [kernel.kallsyms] [k] preempt_count_sub 1.81% netperf [kernel.kallsyms] [k] tcp_recvmsg 1.80% netperf [kernel.kallsyms] [k] _raw_spin_unlock_irqres 1.78% netperf [kernel.kallsyms] [k] preempt_count_add 1.36% netperf [kernel.kallsyms] [k] __tcp_transmit_skb 1.20% netperf [kernel.kallsyms] [k] __local_bh_enable_ip 1.10% netperf [kernel.kallsyms] [k] sh_eth_start_xmit Test results with RX checksum offload disabled: ~/netperf-2.2pl4# perf record -a ./netperf -t TCP_MAERTS -H 192.168.2.4 TCP MAERTS TEST to 192.168.2.4 Recv Send Send Socket Socket Message Elapsed Size Size Size Time Throughput bytes bytes bytes secs. 10^6bits/sec 131072 16384 16384 10.01 932.04 [ perf record: Woken up 14 times to write data ] [ perf record: Captured and wrote 3.642 MB perf.data (78817 samples) ] ~/netperf-2.2pl4# perf report Samples: 78K of event 'cycles:ppp', Event count (approx.): 18091442796 Overhead Command Shared Object Symbol 7.00% swapper [kernel.kallsyms] [k] do_csum 3.94% swapper [kernel.kallsyms] [k] sh_eth_poll 3.83% ksoftirqd/0 [kernel.kallsyms] [k] do_csum 3.23% swapper [kernel.kallsyms] [k] _raw_spin_unlock_irq 2.87% netperf [kernel.kallsyms] [k] __arch_copy_to_user 2.86% swapper [kernel.kallsyms] [k] arch_cpu_idle 2.13% swapper [kernel.kallsyms] [k] default_idle_call 2.12% ksoftirqd/0 [kernel.kallsyms] [k] sh_eth_poll 2.02% swapper [kernel.kallsyms] [k] _raw_spin_unlock_irqrestore 1.84% swapper [kernel.kallsyms] [k] __softirqentry_text_start 1.64% swapper [kernel.kallsyms] [k] tick_nohz_idle_exit 1.53% netperf [kernel.kallsyms] [k] _raw_spin_unlock_irq 1.32% netperf [kernel.kallsyms] [k] preempt_count_sub 1.27% swapper [kernel.kallsyms] [k] __pi___inval_dcache_area 1.22% swapper [kernel.kallsyms] [k] check_preemption_disabled 1.01% ksoftirqd/0 [kernel.kallsyms] [k] _raw_spin_unlock_irqrestore The above results collected on the R-Car V3H Starter Kit board. Based on the commit 4d86d3818627 ("ravb: RX checksum offload")... Signed-off-by: Sergei Shtylyov --- drivers/net/ethernet/renesas/sh_eth.c | 60 ++++++++++++++++++++++++++++++++-- drivers/net/ethernet/renesas/sh_eth.h | 1 2 files changed, 59 insertions(+), 2 deletions(-) Index: net-next/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c +++ net-next/drivers/net/ethernet/renesas/sh_eth.c @@ -1532,8 +1532,9 @@ static int sh_eth_dev_init(struct net_de mdp->irq_enabled = true; sh_eth_write(ndev, mdp->cd->eesipr_value, EESIPR); - /* PAUSE Prohibition */ + /* EMAC Mode: PAUSE prohibition; Duplex; RX Checksum; TX; RX */ sh_eth_write(ndev, ECMR_ZPF | (mdp->duplex ? ECMR_DM : 0) | + (ndev->features & NETIF_F_RXCSUM ? ECMR_RCSC : 0) | ECMR_TE | ECMR_RE, ECMR); if (mdp->cd->set_rate) @@ -1592,6 +1593,19 @@ static void sh_eth_dev_exit(struct net_d update_mac_address(ndev); } +static void sh_eth_rx_csum(struct sk_buff *skb) +{ + u8 *hw_csum; + + /* The hardware checksum is 2 bytes appended to packet data */ + if (unlikely(skb->len < sizeof(__sum16))) + return; + hw_csum = skb_tail_pointer(skb) - sizeof(__sum16); + skb->csum = csum_unfold((__force __sum16)get_unaligned_le16(hw_csum)); + skb->ip_summed = CHECKSUM_COMPLETE; + skb_trim(skb, skb->len - sizeof(__sum16)); +} + /* Packet receive function */ static int sh_eth_rx(struct net_device *ndev, u32 intr_status, int *quota) { @@ -1666,6 +1680,8 @@ static int sh_eth_rx(struct net_device * DMA_FROM_DEVICE); skb_put(skb, pkt_len); skb->protocol = eth_type_trans(skb, ndev); + if (ndev->features & NETIF_F_RXCSUM) + sh_eth_rx_csum(skb); netif_receive_skb(skb); ndev->stats.rx_packets++; ndev->stats.rx_bytes += pkt_len; @@ -2921,6 +2937,39 @@ static void sh_eth_set_rx_mode(struct ne spin_unlock_irqrestore(&mdp->lock, flags); } +static void sh_eth_set_rx_csum(struct net_device *ndev, bool enable) +{ + struct sh_eth_private *mdp = netdev_priv(ndev); + unsigned long flags; + + spin_lock_irqsave(&mdp->lock, flags); + + /* Disable TX and RX */ + sh_eth_rcv_snd_disable(ndev); + + /* Modify RX Checksum setting */ + sh_eth_modify(ndev, ECMR, ECMR_RCSC, enable ? ECMR_RCSC : 0); + + /* Enable TX and RX */ + sh_eth_rcv_snd_enable(ndev); + + spin_unlock_irqrestore(&mdp->lock, flags); +} + +static int sh_eth_set_features(struct net_device *ndev, + netdev_features_t features) +{ + netdev_features_t changed = ndev->features ^ features; + struct sh_eth_private *mdp = netdev_priv(ndev); + + if (changed & NETIF_F_RXCSUM && mdp->cd->rx_csum) + sh_eth_set_rx_csum(ndev, features & NETIF_F_RXCSUM); + + ndev->features = features; + + return 0; +} + static int sh_eth_get_vtag_index(struct sh_eth_private *mdp) { if (!mdp->port) @@ -3102,6 +3151,7 @@ static const struct net_device_ops sh_et .ndo_change_mtu = sh_eth_change_mtu, .ndo_validate_addr = eth_validate_addr, .ndo_set_mac_address = eth_mac_addr, + .ndo_set_features = sh_eth_set_features, }; static const struct net_device_ops sh_eth_netdev_ops_tsu = { @@ -3117,6 +3167,7 @@ static const struct net_device_ops sh_et .ndo_change_mtu = sh_eth_change_mtu, .ndo_validate_addr = eth_validate_addr, .ndo_set_mac_address = eth_mac_addr, + .ndo_set_features = sh_eth_set_features, }; #ifdef CONFIG_OF @@ -3245,6 +3296,11 @@ static int sh_eth_drv_probe(struct platf ndev->max_mtu = 2000 - (ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN); ndev->min_mtu = ETH_MIN_MTU; + if (mdp->cd->rx_csum) { + ndev->features = NETIF_F_RXCSUM; + ndev->hw_features = NETIF_F_RXCSUM; + } + /* set function */ if (mdp->cd->tsu) ndev->netdev_ops = &sh_eth_netdev_ops_tsu; @@ -3294,7 +3350,7 @@ static int sh_eth_drv_probe(struct platf goto out_release; } mdp->port = port; - ndev->features = NETIF_F_HW_VLAN_CTAG_FILTER; + ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER; /* Need to init only the first port of the two sharing a TSU */ if (port == 0) { Index: net-next/drivers/net/ethernet/renesas/sh_eth.h =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.h +++ net-next/drivers/net/ethernet/renesas/sh_eth.h @@ -500,6 +500,7 @@ struct sh_eth_cpu_data { unsigned no_xdfar:1; /* E-DMAC DOES NOT have RDFAR/TDFAR */ unsigned xdfar_rw:1; /* E-DMAC has writeable RDFAR/TDFAR */ unsigned csmr:1; /* E-DMAC has CSMR */ + unsigned rx_csum:1; /* EtherC has ECMR.RCSC */ unsigned select_mii:1; /* EtherC has RMII_MII (MII select register) */ unsigned rmiimode:1; /* EtherC has RMIIMODE register */ unsigned rtrate:1; /* EtherC has RTRATE register */ From patchwork Sun Jan 27 17:38:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10782947 X-Patchwork-Delegate: geert@linux-m68k.org 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 2DFEF1390 for ; Sun, 27 Jan 2019 17:38:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 17C41294CA for ; Sun, 27 Jan 2019 17:38:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0598A29F6C; Sun, 27 Jan 2019 17:38:38 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 9EE83294CA for ; Sun, 27 Jan 2019 17:38:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726965AbfA0Rig (ORCPT ); Sun, 27 Jan 2019 12:38:36 -0500 Received: from mail-lj1-f178.google.com ([209.85.208.178]:34753 "EHLO mail-lj1-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726930AbfA0Rig (ORCPT ); Sun, 27 Jan 2019 12:38:36 -0500 Received: by mail-lj1-f178.google.com with SMTP id u89-v6so12304942lje.1 for ; Sun, 27 Jan 2019 09:38:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=subject:from:to:cc:references:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=aHyVNCcWCeqcw7MfnB1A7u/ATcPWbzDNG8u18WnCJZo=; b=d8HNhCYqCTc5R7TZKUYzVXqFfPspdTkh0Py4OgB+IpxTbsvj7oGmbPaCN/Kacci31r OH7SbvPP3Rsj4Nr/ozz42HK9tL54iwbj1BItGLDY2cshGmk6A2SNFpu+4rFW/l4F6iJ1 dXQhucPj2PpyvdyPu0bHKXk8qHpwmKx1CMIdRTQLdhz00XP8bVEqcv7arA6j2Ucwbg7J Z4tgAQpC1G1X4QD6hGnWtegpVok5TrgQ63qeWzQAyx8+myU/KkfDQjG0d3deQO4RCnET EXQHNWSpsT8bNZmJMogK+xOvzpwv/A+jnVDZ2t5Vrnbexr2RkZjyMZcy0pFueNfLovZn FipA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=aHyVNCcWCeqcw7MfnB1A7u/ATcPWbzDNG8u18WnCJZo=; b=HxIHjMla29FJrAFKsZ26XCQFvqhwylEcodrCkJvMwIY5jzK+O/bsE8YVSTRCUwKg3H WBqbkUQCtPeZEdiAsaInx4Y/fYHpwyGbhC8ez9ZXw8GmlBykxTcUHjdDmw5mwWKNT29i lttZ6w9VhG+q0Gy+OKZ+cG2NFPg31oTbFHALHrsF8GNDTihD9p5gK5KxDEidTR0KU2jk OlK2QP0I2VsdvsuT+H1aBjEm8NPVzldmg78UHpWw4nB3PK3aA8/WMiL7WyIO+zgs5WHa 5cfRxkqMe2UHTgFsL9W4je+3AyuqY8TgLqK+zNAQOiZZdWt6vt2ccBAkjN0OLotx3mAE uIVA== X-Gm-Message-State: AJcUukcOK2LP+cGliDEUiMG1ecXSp9uMBi/0AYqP/shDD36GdMDn8j4S oQxnqEveDb+upaKOXKliUn3h1g== X-Google-Smtp-Source: ALg8bN7UOhxEoDtAnGFEpy4wwLXhcvd75ZOcttVkysG8aQ5hSuA5tSD/Ss70L5HzWdwpohNvUZo5DQ== X-Received: by 2002:a2e:131a:: with SMTP id 26-v6mr14279788ljt.107.1548610714576; Sun, 27 Jan 2019 09:38:34 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.84.150]) by smtp.gmail.com with ESMTPSA id j138sm2573355lfg.64.2019.01.27.09.38.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Jan 2019 09:38:33 -0800 (PST) Subject: [PATCH 3/7] sh_eth: offload RX checksum on R7S72100 From: Sergei Shtylyov To: netdev@vger.kernel.org, "David S. Miller" Cc: linux-renesas-soc@vger.kernel.org, linux-sh@vger.kernel.org References: Organization: Cogent Embedded Message-ID: <0476beba-ea1f-7675-aa08-573b74e84f4e@cogentembedded.com> Date: Sun, 27 Jan 2019 20:38:33 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-MW Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The RZ/A1H (R7S721000) SoC manual describes the Ether MAC's RX checksum offload the same way as it's implemented in the EtherAVB MACs... Signed-off-by: Sergei Shtylyov --- drivers/net/ethernet/renesas/sh_eth.c | 1 + 1 file changed, 1 insertion(+) Index: net-next/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c +++ net-next/drivers/net/ethernet/renesas/sh_eth.c @@ -620,6 +620,7 @@ static struct sh_eth_cpu_data r7s72100_d .no_ade = 1, .xdfar_rw = 1, .csmr = 1, + .rx_csum = 1, .tsu = 1, .no_tx_cntrs = 1, }; From patchwork Sun Jan 27 17:39:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10782951 X-Patchwork-Delegate: geert@linux-m68k.org 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 E65946C2 for ; Sun, 27 Jan 2019 17:39:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D4BBC2A597 for ; Sun, 27 Jan 2019 17:39:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C8F422A5A2; Sun, 27 Jan 2019 17:39:29 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 4CE442A597 for ; Sun, 27 Jan 2019 17:39:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726980AbfA0Rj3 (ORCPT ); Sun, 27 Jan 2019 12:39:29 -0500 Received: from mail-lf1-f67.google.com ([209.85.167.67]:34595 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726967AbfA0Rj2 (ORCPT ); Sun, 27 Jan 2019 12:39:28 -0500 Received: by mail-lf1-f67.google.com with SMTP id p6so10232392lfc.1 for ; Sun, 27 Jan 2019 09:39:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=subject:from:to:cc:references:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Z+qVVsyJBLplm6bGaJBQWS/1LQRYqWLc8ZoZXm/b/XU=; b=EEH5gCCt2TcI2CQgEUDUw2ErI3aKFzT9XdfWk5bSCzbVA4oe5H7maEIl2NL+44t2CV yRj5pgXEGMPWJP3ciFRSprsNum4QjhpawSoef4rGoWhFsK0WdrcePDzm9DyJJlouB0rG UvoOcLmS8oYqlq+ZRvEJIWQdBPx9fJ0hoSTFAoL8CioU2+5Rce0fFrPA+/BvhFt70/qf biUBnvrkrZ3Al4g8k0p9rCV0Iby3SdVd3YSl0NgLHHy86dcWb10qsxwIRTOtbTu0/n2w Acf0gVgzP6xMPgXoa/k7kKp2YeF4EbeJTwguS2lQRTeuPSdCJjLktpyZ/MkAWGDA0sq2 SI4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=Z+qVVsyJBLplm6bGaJBQWS/1LQRYqWLc8ZoZXm/b/XU=; b=APztuASqw4E+K4SpZh553l5pTBLuXD4ElRjmFkZnLgIAuBQ4QFkRYFullSEoAee3o2 xygDyLAuNTDK7dBjsgUBwmLs0O7TafH2BpOLxMpSdUwIeeb4HJ6Ql+dOdmCGL5F0+TGK 0MyOHyr2ph+9pBV70bZmkH3QYnh10qc6s2NM3wAYXpzD2CFOaiI9Lx5GyCheEFmfQHYM P3KR+sixQw7ac4TlmfwoiIdNq9UUXkbnVKO4kFflr0DXtFb2n1Cg+LJhsZfVGHj+9VSO ZsDpQO7dDXhJVXVIzu8XA+HxTRqSfpxrio04c3MOs1YToH3zenklPgqj8YyUaPB7ibB4 xgwQ== X-Gm-Message-State: AJcUukfDHOOqM638kNNeJ9ju/44rzlVaYG8lvBvhXSnVCQlNKw33j8rw hbCdfksKfrkS+EaO7yds9ZcdGQ== X-Google-Smtp-Source: ALg8bN6IJz/2MCmb/nKHXnOrtHpbukN+QpG5KO0yRRPqIIuXRLlYsrwfShvVBjuUfUS8yxfYa9E2OA== X-Received: by 2002:a19:a9d2:: with SMTP id s201mr8866754lfe.154.1548610767030; Sun, 27 Jan 2019 09:39:27 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.84.150]) by smtp.gmail.com with ESMTPSA id z2-v6sm2670667ljk.50.2019.01.27.09.39.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Jan 2019 09:39:26 -0800 (PST) Subject: [PATCH 4/7] sh_eth: offload RX checksum on R8A7740 From: Sergei Shtylyov To: netdev@vger.kernel.org, "David S. Miller" Cc: linux-renesas-soc@vger.kernel.org, linux-sh@vger.kernel.org References: Organization: Cogent Embedded Message-ID: Date: Sun, 27 Jan 2019 20:39:25 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-MW Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The R-Mobile A1 (R8A7740) SoC manual describes the Ether MAC's RX checksum offload the same way as it's implemented in the EtherAVB MAC... Signed-off-by: Sergei Shtylyov Tested-by: Geert Uytterhoeven --- drivers/net/ethernet/renesas/sh_eth.c | 1 + 1 file changed, 1 insertion(+) Index: net-next/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c +++ net-next/drivers/net/ethernet/renesas/sh_eth.c @@ -670,6 +670,7 @@ static struct sh_eth_cpu_data r8a7740_da .no_ade = 1, .xdfar_rw = 1, .csmr = 1, + .rx_csum = 1, .tsu = 1, .select_mii = 1, .magic = 1, From patchwork Sun Jan 27 17:40:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10782955 X-Patchwork-Delegate: geert@linux-m68k.org 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 0CB806C2 for ; Sun, 27 Jan 2019 17:40:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC5192A597 for ; Sun, 27 Jan 2019 17:40:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DE3222A5A4; Sun, 27 Jan 2019 17:40:27 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 88EDC2A597 for ; Sun, 27 Jan 2019 17:40:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726775AbfA0Rk1 (ORCPT ); Sun, 27 Jan 2019 12:40:27 -0500 Received: from mail-lj1-f173.google.com ([209.85.208.173]:33624 "EHLO mail-lj1-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726357AbfA0Rk1 (ORCPT ); Sun, 27 Jan 2019 12:40:27 -0500 Received: by mail-lj1-f173.google.com with SMTP id v1-v6so12297447ljd.0 for ; Sun, 27 Jan 2019 09:40:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=subject:from:to:cc:references:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Ao08bhATJPPJEJ2i7oY65jvyZ15tEsZMfg8UyfvAdIY=; b=oG+nKj0HsX0LBaT6NjwIXuTKcRa0lZZiAWsLkezwPdrkh/GhcA1iz/ynLP5jz7n2Kt VC/oq0dO76T3V6+zc7U1mibqTfVOX6rA9qsHCPqWkTfCRi4IDX+tg46AfHiftpXUsBHb Gce2rcjg4mhHBC0dwHTqy9Kmn4X+p3aQfggsulYfmMIB87FYk3o1CPV3nU5KrFmbO7Vu 54WcfS25pRqlpCuj2NEARf32xgpHgUkkmVSg5PpLEx71oVRky1B6qaN53SBduPf/zrfu AjRNuGdaLHQovqv/1VRV0xDVKJsmlaxpDxI5tBpQI+zsgswiYXVlgJYm9Ua2Xg3oZK27 kGfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=Ao08bhATJPPJEJ2i7oY65jvyZ15tEsZMfg8UyfvAdIY=; b=I2ZUO8ymGm6KsJ9xZTATgsih+CqY4je1u862350ZNV5Amh8gaREOqKnVgY5EEf3FEy ZnGYvaTHMRX0tlpp+cobPfV8XcoHC7uZYq55Y2t6WEU2ut/SnfnRdLLTiuxkVdTY9Oub 2LaX2o27uNnmfRqzTDB1nbwsfhxrbL1L+NKahjFUYc7gtq+3JHG2ld/bY7FLpybJxTLU sKUuI5DlvRzs97k152LL1BedUG2YpRRNDcShEWSobQ2vv5H3CXXIRRkTYZP3uFTD4+om b4p5Gu9UcUBqAg4C9C6tLR2Vt3GxpnlesPTg7Rn+pIbPGhk6ZVy1Jc13KiTY7LPpxzhz K/8Q== X-Gm-Message-State: AHQUAuYblhLdwsgBpIj2/4L7iwQDTzDtmUeGHA4xvKF5BAw/rFGhKHR1 sXKOfdwbq0RfEidcFsVStEyPfg== X-Google-Smtp-Source: AHgI3IYv0zscDvy1aCFtUh0oUE0KIWMXwWn1lL21OMQLdj+zinbt1Z/wvp31TySswr3UfJV9jGY5Kg== X-Received: by 2002:a2e:7c13:: with SMTP id x19-v6mr5162800ljc.83.1548610824968; Sun, 27 Jan 2019 09:40:24 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.84.150]) by smtp.gmail.com with ESMTPSA id s127sm2602874lfe.8.2019.01.27.09.40.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Jan 2019 09:40:24 -0800 (PST) Subject: [PATCH 5/7] sh_eth: offload RX checksum on R8A77980 From: Sergei Shtylyov To: netdev@vger.kernel.org, "David S. Miller" Cc: linux-renesas-soc@vger.kernel.org, linux-sh@vger.kernel.org References: Organization: Cogent Embedded Message-ID: <32f4bec9-35e6-6bbe-f9b6-a8996fc0793d@cogentembedded.com> Date: Sun, 27 Jan 2019 20:40:23 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-MW Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The R-Car V3H (R8A77980) SoC manual describes the Ether MAC's RX checksum offload the same way as it's implemented in the EtherAVB MAC... Signed-off-by: Sergei Shtylyov --- drivers/net/ethernet/renesas/sh_eth.c | 1 + 1 file changed, 1 insertion(+) Index: net-next/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c +++ net-next/drivers/net/ethernet/renesas/sh_eth.c @@ -796,6 +796,7 @@ static struct sh_eth_cpu_data r8a77980_d .no_ade = 1, .xdfar_rw = 1, .csmr = 1, + .rx_csum = 1, .select_mii = 1, .magic = 1, .cexcr = 1, From patchwork Sun Jan 27 17:41:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10782961 X-Patchwork-Delegate: geert@linux-m68k.org 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 2E3DB1390 for ; Sun, 27 Jan 2019 17:41:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 207702A59B for ; Sun, 27 Jan 2019 17:41:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 151362A5A4; Sun, 27 Jan 2019 17:41:31 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable 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 C8BD82A59B for ; Sun, 27 Jan 2019 17:41:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726879AbfA0Rl2 (ORCPT ); Sun, 27 Jan 2019 12:41:28 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:39767 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726386AbfA0Rl2 (ORCPT ); Sun, 27 Jan 2019 12:41:28 -0500 Received: by mail-lf1-f68.google.com with SMTP id n18so10190217lfh.6 for ; Sun, 27 Jan 2019 09:41:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=subject:from:to:cc:references:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=liwjm9ze8qxoGKXwexudNjirVwtaRClbT1XeBLQwbv8=; b=mmznrsRr8CY+RKYrzcfzIlkwsO8c+ADsv0+imGOyrCMQz1/LCiCHQKcopzT8hI9RaD Gq1yENHlsg0yE15AX/fOO4c6uQulsJYfciDFSaXw8I5SDJyUjNmPA1F6X8PNW09gJqvH 4rdlX5SNhceKTb6vryW68LEN9Ryci7wdUbRxqpi0iDlRskd1NWXuPAldutUZhHu2aHv0 w+pUsXkHN99AcgsnClzGtJbPfCmxQbjXbGEIXmG5UWpyGBcbFEHPX27k7oUC/gU3XzDL vOAHml2HDI7XQwNNz6OgGptYOhlx8eGLbT/8B0tD5kqZwPIqwyehKRoQPePbaqBFaeKN 5luw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=liwjm9ze8qxoGKXwexudNjirVwtaRClbT1XeBLQwbv8=; b=CwZSdL6aU1bL2EawPARQLKLmIoQ97QJgQG40TJZdm5I8nMFjhMhzpSUXy1c9fnGp9j l/+xcObpAyKi2Bvn+9T6h+wvG3hoUsfKWOBrOSnoJ54b+KYOeqp84J0GQsdjyViykzGY rPUt2oJXmLd9iRs0NISeQavNtzAWAqboTEzrTYxxCPpjEUx6EYDpM9EnfFyExNBes8gV UvqkdQ+GEBBQ4q0FlrD/djZfEc8r8BDmRAiRcKxdGX0uGeT3jt/+dT2+f1/iUcHDr6Ea suF/PeQq/h1C2cGQDI5yMCzRLOH9IYSBe5YFkLLJe0oMcTqKkr64GfN02/XzwgofdW53 rdVg== X-Gm-Message-State: AJcUukftOEcSnF2g5e/rdKF/9L9jttygTRSq9/Y5P+2ha/S+Auwt2IwH lDXM+fb46XWJFORtRWYtAe6Icw== X-Google-Smtp-Source: ALg8bN6vuKKAzehf73W2AHTxZP850Lrjs6GOw/In9ngClJDX87BoWL7KWCN4phAPe87bfHk95M9tGA== X-Received: by 2002:a19:750a:: with SMTP id y10mr3771742lfe.43.1548610885827; Sun, 27 Jan 2019 09:41:25 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.84.150]) by smtp.gmail.com with ESMTPSA id j12-v6sm2619597ljh.66.2019.01.27.09.41.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Jan 2019 09:41:25 -0800 (PST) Subject: [PATCH 6/7] sh_eth: offload RX checksum on SH7734 From: Sergei Shtylyov To: netdev@vger.kernel.org, "David S. Miller" Cc: linux-renesas-soc@vger.kernel.org, linux-sh@vger.kernel.org References: Organization: Cogent Embedded Message-ID: Date: Sun, 27 Jan 2019 20:41:24 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-MW Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The SH7734 SoC manual describes the Ether MAC's RX checksum offload the same way as it's implemented in the EtherAVB MACs... Signed-off-by: Sergei Shtylyov --- drivers/net/ethernet/renesas/sh_eth.c | 1 + 1 file changed, 1 insertion(+) Index: net-next/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c +++ net-next/drivers/net/ethernet/renesas/sh_eth.c @@ -1049,6 +1049,7 @@ static struct sh_eth_cpu_data sh7734_dat .xdfar_rw = 1, .tsu = 1, .csmr = 1, + .rx_csum = 1, .select_mii = 1, .magic = 1, .cexcr = 1, From patchwork Sun Jan 27 17:42:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10782963 X-Patchwork-Delegate: geert@linux-m68k.org 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 6E1426C2 for ; Sun, 27 Jan 2019 17:42:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5ADDD2A59B for ; Sun, 27 Jan 2019 17:42:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4E92A2A5A4; Sun, 27 Jan 2019 17:42:17 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 E74332A59B for ; Sun, 27 Jan 2019 17:42:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726915AbfA0RmQ (ORCPT ); Sun, 27 Jan 2019 12:42:16 -0500 Received: from mail-lj1-f176.google.com ([209.85.208.176]:35837 "EHLO mail-lj1-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726357AbfA0RmQ (ORCPT ); Sun, 27 Jan 2019 12:42:16 -0500 Received: by mail-lj1-f176.google.com with SMTP id x85-v6so12278337ljb.2 for ; Sun, 27 Jan 2019 09:42:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=subject:from:to:cc:references:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=BYbSDIH705JTQdZk8auJnmv7JIjM4wJP9hknZKvmNxQ=; b=DpNPCNWFp91Qx1x5CtrC0h2qKndmZsMEUQvG5dl4cDXSed9vnQLM0IvwiEbmGFbVbc NviCv7+uxPiXtZEDx4witWflks6u8vTlw3HAiqLuQ9aI0e66d8L5slwCUzMuEgYjdq2X qhbk4k8LX+y18dGJFgz14ROTvfXYdp/LCLQJ0X6CCb07o3lQKSZO8f5PCQvTTihzLnTA rwzWXWRYh0EyhMyWWaYfV66i84aNPbIv52YBiSzUa8crTYBGlmARxIiD5nGluRXsBPs0 VJY5pxpWuUYpVf6FGlFcgyfKZ3Yh+segdyocCZby8QinryvTn59X+P3frBdBg8sU5aG3 rnuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=BYbSDIH705JTQdZk8auJnmv7JIjM4wJP9hknZKvmNxQ=; b=HnNXgUQjJ/TpdMbuYmPpCiFBYS3BXG0JiXoOTN2l9bK2rQ/2KiHnGek00zi6RaSMkv 8+Q1XakYkFKOLllIEXOaAifub2P5OOMwlKadKu6xjduEp9Db4vv1m6ZRsJKLdvwqOL+l BY7uOGSObjeEE8Fr9otkWNoJmEhvqZrG+PM90lNAm1ut8h3b3T20q+0G26U1Ke7N6nGH Xi164+bkQZCwJeFEFKKH4OlGf9XMgj9V+BWLK6kXZD/iFt5sfj+JI4tW7119oneqyoyH rVIM8Hese912ZjhwFtequI3i1siW3pl8Wgy+k2VksuUi57d3GZN2CeVUC3MRenE76Y4v pW3A== X-Gm-Message-State: AJcUukdgyclyROG/wNZXdItdVOH0A0lZGmx3bTUsUEq4zxiRF1zetMDu iWmtYYtTnwkamfiwnjuMzuHmZQ== X-Google-Smtp-Source: ALg8bN6elgr9PuZFYkjNP37T8EtrQfeF9EsxjQEpHQYhKClnQV+1SnPLUdWraYIRdgzwwRUUljdItw== X-Received: by 2002:a2e:20c3:: with SMTP id g64-v6mr15099809lji.101.1548610934326; Sun, 27 Jan 2019 09:42:14 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.84.150]) by smtp.gmail.com with ESMTPSA id b17sm2523107lfc.21.2019.01.27.09.42.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Jan 2019 09:42:13 -0800 (PST) Subject: [PATCH 7/7] sh_eth: offload RX checksum on SH7763 From: Sergei Shtylyov To: netdev@vger.kernel.org, "David S. Miller" Cc: linux-renesas-soc@vger.kernel.org, linux-sh@vger.kernel.org References: Organization: Cogent Embedded Message-ID: Date: Sun, 27 Jan 2019 20:42:12 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-MW Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The SH7763 SoC manual describes the Ether MAC's RX checksum offload the same way as it's implemented in the EtherAVB MACs... Signed-off-by: Sergei Shtylyov --- drivers/net/ethernet/renesas/sh_eth.c | 1 + 1 file changed, 1 insertion(+) Index: net-next/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c +++ net-next/drivers/net/ethernet/renesas/sh_eth.c @@ -1092,6 +1092,7 @@ static struct sh_eth_cpu_data sh7763_dat .irq_flags = IRQF_SHARED, .magic = 1, .cexcr = 1, + .rx_csum = 1, .dual_port = 1, };