From patchwork Mon Feb 4 18:05:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10796287 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 BC9CC6C2 for ; Mon, 4 Feb 2019 18:06:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5C572B6D7 for ; Mon, 4 Feb 2019 18:06:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 97DFE2B761; Mon, 4 Feb 2019 18:06:02 +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 75F752B6D7 for ; Mon, 4 Feb 2019 18:06:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728056AbfBDSGA (ORCPT ); Mon, 4 Feb 2019 13:06:00 -0500 Received: from mail-lf1-f66.google.com ([209.85.167.66]:38599 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727880AbfBDSGA (ORCPT ); Mon, 4 Feb 2019 13:06:00 -0500 Received: by mail-lf1-f66.google.com with SMTP id j15so612511lfh.5 for ; Mon, 04 Feb 2019 10:05:59 -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=2LikyD00HIeOBZ2NOhi84eobUL86EoR/49Zn2BRPSZk=; b=wyXKhbNtzHptE8TP0boExdqrj6j7F/8O2IsDFzNM5KH0uVz9XOEz2W891epYiOapYr uOr8SP9Te1QlAYS29cEuz4WL1mPHyfJ8++BUCWEwLfW+EqtW9gd398R1eebj5ti5NUxO JI1mKO/wmyj8nnnTi/KB3ujtEpRHgKWh6ILALlr64bBZxYq1qTX9F5jqnhiTfPdkQiL7 xXmnTnKLOO2RjYvifcuugwzzR7kszcTI+0fkyeL2jQ7ZGcpg9CZpDKQ4lZfu3FKOwYzc H/+8BtNZ78IahZ9uzmv2TEEb7SeAuM1dOAh92jZa1SiI+iY67kWi+sVkGILXnDUqHmjj OdqA== 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=2LikyD00HIeOBZ2NOhi84eobUL86EoR/49Zn2BRPSZk=; b=CN5v7NPnvN5pzxKtGVEKwqh2YISOvSFYrvUwFmDBXzQAok5F0PoF1AoYBEmMLk2xP1 19FF3/YWU+h+6VdZBtBeMDAqsTzx6RUFN7DYPPfYx6lHiqUSCM9G/CxLh4cuhBKjMJko +xNhRPCLXNCj+bc2aCPEXQeieFq5x91Kz6rGMp3aK6yNBTZuunmCcx84Pfgwh5SyMfuI BEVjJ83OuQUXas34wEIroDYvWvmfgFqO3l1PgA0ht7kaUU9COA26WxhlnvW9mIN9UKrR vEC1fEHWIfOM0yyLMhFop96jqO2zXdMQhdBZUAHeM7L0Ecjt0gTmiUZk47LwP68tClno mUvw== X-Gm-Message-State: AHQUAuZEi4M4cJZ9473OtvGx1fwI+ymOCAKgMFBdvYwr/cKr6dVNSbu+ S+AmLqRi/XklCCJI4sST28+J+Q== X-Google-Smtp-Source: AHgI3Ib4LgtrNghCZU2kx0QtFNZ5qxG1dLzDdV61azKZbxksFLKh5AwWWWckm+hMxcxgAxq33wsTkQ== X-Received: by 2002:a19:660a:: with SMTP id a10mr442792lfc.146.1549303558178; Mon, 04 Feb 2019 10:05:58 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.83.140]) by smtp.gmail.com with ESMTPSA id z20sm1474081lfg.53.2019.02.04.10.05.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Feb 2019 10:05:57 -0800 (PST) Subject: [PATCH v2 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: <49e422f5-08aa-cb39-b39f-7f963c2f15a5@cogentembedded.com> Date: Mon, 4 Feb 2019 21:05:55 +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 field to 'csmr' as the "intelligent checksum" is always controlled by the CSMR register. Signed-off-by: Sergei Shtylyov Reviewed-by: Geert Uytterhoeven --- Changes in version 2: - fixed typos in the patch description; - added Geert's tag. drivers/net/ethernet/renesas/sh_eth.c | 14 +++++++------- drivers/net/ethernet/renesas/sh_eth.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) Index: renesas/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- renesas.orig/drivers/net/ethernet/renesas/sh_eth.c +++ renesas/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: renesas/drivers/net/ethernet/renesas/sh_eth.h =================================================================== --- renesas.orig/drivers/net/ethernet/renesas/sh_eth.h +++ renesas/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 Mon Feb 4 18:06:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10796289 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 C86326C2 for ; Mon, 4 Feb 2019 18:07:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B229D2B6D7 for ; Mon, 4 Feb 2019 18:07:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A3DC92B74C; Mon, 4 Feb 2019 18:07:01 +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 D97802B6D7 for ; Mon, 4 Feb 2019 18:07:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728169AbfBDSG6 (ORCPT ); Mon, 4 Feb 2019 13:06:58 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:35895 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726585AbfBDSG5 (ORCPT ); Mon, 4 Feb 2019 13:06:57 -0500 Received: by mail-lf1-f68.google.com with SMTP id a16so628112lfg.3 for ; Mon, 04 Feb 2019 10:06:55 -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=yVFZMLfM5Mf/hx+mOeFeITtE3HycYn9JLFRNcumD3iY=; b=PHVpigF8yYpYGIy8GVgNogi87XQsQOv3gRSLq1NeUC82mGikJ6+5WRYlu3z0LBfPmV WC3Wkk50PfMTCSGG0/xzshb5kCGj+mAkhRD84jQxAZwKXgpof6OTS5TGWBUVxIeIArwB okAfynl3lo+dYQq5xBekfx7fuZwei4KJ8oCikmKshUUIUV5znBzv8FyxfxCuUSrpRMnr Lqu+w4XMQWBnVVfGVqtC++kpee1xeKEDW/48pP8X6HEw5BvrZicW/1wU1E+/7GP3qqgQ oFSSlxB0Fzss1vtlwKiO4hci6xiw7gFcarrdwS6UNOzxqmLKlLT+Fax7By3A0za7Mfdj nAdw== 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=yVFZMLfM5Mf/hx+mOeFeITtE3HycYn9JLFRNcumD3iY=; b=k2GV5KzBMkXQCNB6/1SEYkREUCQKxOt0Grbxl8a6ebQUYOBLOJowdiPJ0Fh2NXV01T yCgvmfjsNjwdPmg6KXv8zKj341RI54m9gDPVQIe2UK3cTZJKAcTDZOX5fz2X3wd4/Fh8 qmpWp9V6BlNUJT+POSzyWIbA5abSYsBtxICtv606HBCnxhCpkZ0BSKqidim3uZnrFvmJ ufg/bfYxDiM3wrOcFb/T/t4r7ZghpuKe1D2wXfMY+P+5caaw/A/qsASND5cYiWOGZ8Dc uvVSKuarlkHg3gfqn1BfARpzgsmIfQPCmR05auCkcODxOWEUJAW1g5cqVDQA1TT7zz8Y F3ig== X-Gm-Message-State: AHQUAubxvmz+sTAaToIfhIqmNOfBUkUV4264e1ky6ksAF9FiRJAIydLk xwsOJOvxoMhspwn11J9iGSOFpw== X-Google-Smtp-Source: AHgI3Iay8gO+XhbilmgEm4ivBnhrCDf1sJojgtPg74hmWGbF7sQv8FQ0PxPHWmPHBfkGXCM9JUw5VQ== X-Received: by 2002:a19:9e11:: with SMTP id h17mr381975lfe.73.1549303614134; Mon, 04 Feb 2019 10:06:54 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.83.140]) by smtp.gmail.com with ESMTPSA id z15-v6sm3146809ljb.9.2019.02.04.10.06.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Feb 2019 10:06:53 -0800 (PST) Subject: [PATCH v2 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: <6bd27192-d158-d3bf-4db7-6a442c29f16c@cogentembedded.com> Date: Mon, 4 Feb 2019 21:06:52 +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 off # ethtool -K eth0 rx on 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 --- Changes in version 2: - clarified the command line example. drivers/net/ethernet/renesas/sh_eth.c | 60 ++++++++++++++++++++++++++++++++-- drivers/net/ethernet/renesas/sh_eth.h | 1 2 files changed, 59 insertions(+), 2 deletions(-) Index: renesas/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- renesas.orig/drivers/net/ethernet/renesas/sh_eth.c +++ renesas/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: renesas/drivers/net/ethernet/renesas/sh_eth.h =================================================================== --- renesas.orig/drivers/net/ethernet/renesas/sh_eth.h +++ renesas/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 Mon Feb 4 18:07:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10796293 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 688CB6C2 for ; Mon, 4 Feb 2019 18:07:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 573FD2B761 for ; Mon, 4 Feb 2019 18:07:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4AF762B830; Mon, 4 Feb 2019 18:07:58 +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 E3F3D2B730 for ; Mon, 4 Feb 2019 18:07:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728147AbfBDSH5 (ORCPT ); Mon, 4 Feb 2019 13:07:57 -0500 Received: from mail-lf1-f49.google.com ([209.85.167.49]:36601 "EHLO mail-lf1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728056AbfBDSH5 (ORCPT ); Mon, 4 Feb 2019 13:07:57 -0500 Received: by mail-lf1-f49.google.com with SMTP id a16so630530lfg.3 for ; Mon, 04 Feb 2019 10:07:56 -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=EXKdwmo20YMZC/V88QG3nxEMIZWNmrNm7jkbU1maseQ=; b=YV8rABnW+J780n65H9fXRliFm0zCPVpVqzD76d43JkViLK1oKeKi1O5hd/gsZu/e26 wGFromjkGAImq/5FZbSXPs3qs3IyRHO2HFe4RBp3iXRMMZEOh8N8DRnH+0SxlbFLYOhq vdHibW0KQ2Eh0pOXIxR23O2gLWiQ2usYb4oU/QJIMA3KrC4ETYzyL/rB4vODcmL8/SW8 lgYs7L/U9jJPiOlbNc2rFSGQsdaEiV3IbX7WJ89gMu6TMaOfwfv1S1AIXBPgZ8ngxhYD iCH6FfBBW1NfcLkr3m8Low8Je2/TumB+zrnnkM5YtowcKpFIchVJHhoSZ7tJCRmtTe+R HbDg== 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=EXKdwmo20YMZC/V88QG3nxEMIZWNmrNm7jkbU1maseQ=; b=hckaYx6+xs9jdDAYd5QObYycT8x4rBPaonmC17pnn/UhGw4Jqk9wD57G0YIuNcpPl2 IqFIjWliPypkDy8qY984zVnRgxeea5J2rrB2XleriYs1JJ0/r+pFpUk3T4U3sSn/uZPg FkWMqxzkU5TMhVfHuJzc1mITcCwCT9UPWZ05uTn+y5iSDGwO5vdI89hORb4TKloMsrdP P/qpeeDKcZbCjR8X+UNgRcL578j4pl/ZGakOq81xEbsXLam4zhvzxQdA1HWeQUc2Hbze wfkbKXgr9ejFE5LI4fj0MbV/VEntxgIQJ8ThkMevdWAVY/kXA6bDKhIFSWnUu3DrWQ0u FlpQ== X-Gm-Message-State: AHQUAuZfoABawc3ImB49uCkWPOsIZF2g+kwTxS88hws0PItbEXIRbSu8 lr5IcwHweQkFUleT5FlUudZ6fA== X-Google-Smtp-Source: AHgI3IbHGXSUyRQnUdfo/3lb1oEuJK/VQRBrTKo27lX4XNucODD6rc96Nn1QS2dnKndoQAnsGcbm1A== X-Received: by 2002:a19:f705:: with SMTP id z5mr425571lfe.158.1549303675231; Mon, 04 Feb 2019 10:07:55 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.83.140]) by smtp.gmail.com with ESMTPSA id j12-v6sm2846626ljh.66.2019.02.04.10.07.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Feb 2019 10:07:54 -0800 (PST) Subject: [PATCH v2 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: <5d0f2d2e-4a05-b659-7f95-264335ab66ab@cogentembedded.com> Date: Mon, 4 Feb 2019 21:07:53 +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: renesas/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- renesas.orig/drivers/net/ethernet/renesas/sh_eth.c +++ renesas/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 Mon Feb 4 18:08:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10796297 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 290816C2 for ; Mon, 4 Feb 2019 18:08:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 17B5629D7C for ; Mon, 4 Feb 2019 18:08:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B4EE2B1DA; Mon, 4 Feb 2019 18:08:59 +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 B16CF29D7C for ; Mon, 4 Feb 2019 18:08:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728906AbfBDSI6 (ORCPT ); Mon, 4 Feb 2019 13:08:58 -0500 Received: from mail-lf1-f46.google.com ([209.85.167.46]:39270 "EHLO mail-lf1-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728056AbfBDSI6 (ORCPT ); Mon, 4 Feb 2019 13:08:58 -0500 Received: by mail-lf1-f46.google.com with SMTP id z26so614116lfj.6 for ; Mon, 04 Feb 2019 10:08:57 -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=Yu4cqKkS9y756h3einJDErDF0f6zpMtA7KTom2kmnvY=; b=g+thGznaPquOLEB6tSiK+6GIcdtIIM52T1tRciYzaSQmQ39awi9LndSodrsKZDqZjS LS8jcIImzwcYWyiab+THNyBYHVyoO7x4VWVC3yDvipKD9eucux4bDQUeZ49e3cpR+Jtu uIN9LW0UqmnjPBCtnT8jNoCqnh6dwWU9c/GNxJXafA+YOIzMoi6KbEUyomaNWFbiDvpp gmww+XCPu4TNJGYlto9/tzkIkWtDwEcl1s5WFspyevWh5vrrwcix8bfo5Rsmy4G8tuQV GEYMsULOGiPoB4YJq+mMqwa0Z81Lx4d7OEdYa7AV43ebp3F144uICaHYkwefDAbgJOhC 5WDw== 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=Yu4cqKkS9y756h3einJDErDF0f6zpMtA7KTom2kmnvY=; b=qz9PlavIPBnH6M2V+zrl4TcqnKfSWXvggRKC9dDMQQu7xs3zyKjB5LShKoaTPDRhHG UNOTfjw+QYDAUVaGc/0bHcpFk/t/D3etkQB0tEcjUEtvRTswi0bIBgI9tSew66KjXfJc uXCJm6Q60vyogU1EhauP8YrOsfN7wWHGbssftJOQV4VLlDyee9xSB9+L3gNaB+Mrjcjo wzRjYGG95nZnMJj8vCKy/c9neUuHRC3P7iO6ig5/ztBY7frBsgwWZdvAGOhpZ1aTfm9u /2KOrD7eWgu8GIqNz8dlukWpLf6VsDZMYgCKLR0sKT4kKibKXfOj4Km+jWFpgGVSZsDQ bQGg== X-Gm-Message-State: AHQUAuZlolE1jdTbmEt3fexH5frcyubrJLzJElLUu/xB/mRn60RqWA/V 92oEWERJsL5fFywDPUJwRVdIbQ== X-Google-Smtp-Source: AHgI3Ibjk+uoEAZ+O8iBUCbWiI/kOQIaTqeWXunF5fZsDX1N+sebUgkvki+xgrmYDOoTG/AUpHqBcA== X-Received: by 2002:a19:a98f:: with SMTP id s137mr454374lfe.18.1549303736420; Mon, 04 Feb 2019 10:08:56 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.83.140]) by smtp.gmail.com with ESMTPSA id i13-v6sm2792509ljg.82.2019.02.04.10.08.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Feb 2019 10:08:55 -0800 (PST) Subject: [PATCH v2 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: <047ee1f3-b64c-5421-150e-15993049e1ef@cogentembedded.com> Date: Mon, 4 Feb 2019 21:08:54 +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 --- Changes in version 2: - added Geert's tag. drivers/net/ethernet/renesas/sh_eth.c | 1 + 1 file changed, 1 insertion(+) Index: renesas/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- renesas.orig/drivers/net/ethernet/renesas/sh_eth.c +++ renesas/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 Mon Feb 4 18:10:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10796303 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 B49C86C2 for ; Mon, 4 Feb 2019 18:10:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A761B2BF1B for ; Mon, 4 Feb 2019 18:10:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B74D2BF2F; Mon, 4 Feb 2019 18:10:40 +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 4EC652BF25 for ; Mon, 4 Feb 2019 18:10:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728333AbfBDSKj (ORCPT ); Mon, 4 Feb 2019 13:10:39 -0500 Received: from mail-lf1-f47.google.com ([209.85.167.47]:46999 "EHLO mail-lf1-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726585AbfBDSKj (ORCPT ); Mon, 4 Feb 2019 13:10:39 -0500 Received: by mail-lf1-f47.google.com with SMTP id f5so575344lfc.13 for ; Mon, 04 Feb 2019 10:10:38 -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=6q4Ogs/xu/BHkdLHpHi3xG9nEcDUkatHU10+VQ6N3JQ=; b=Ns5vrEsyfXAQrLHeiooapY5+6QLA6f9DOlWqzIS51gTQQhm4O22ssNr5mOic0XHYL2 p6gjMrZ00EqPEz8/HfzsV5+5uhIhO493HCi3fYYE4m6Sb9oUUVHDqLBiEcQyaFhdUA4l rzEvnm0RTEeg7CkBLbp3tGXwMbMZScYb4hqFwiyQYBQ6YkoCGR/ZhDI3wRhyts5emMY2 gKxkfKFLGqbn+JN6xJyNzBF0PSjUoErBxaAMt9u60csDnAnHmiO6XMK34JyJtV12sQ3v wTjBNmL3Hi9M+udmhAJW3iBquNot6YAWCXpkh0KuiQ4g6zGGZG144GIL6YWCMwxnD7gN 5tww== 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=6q4Ogs/xu/BHkdLHpHi3xG9nEcDUkatHU10+VQ6N3JQ=; b=GKOLgRvaFPTdRtlkOu4DAjSA2O7JKWQcR/7xtvshrNbxAt6Pv6vDudjf6iPWl0Pff5 LNX1xmfcexgIOP/fVzAv0/m5uVSG5d20Bt9JPFcZ6KAVtL/DuPkVXBv0Dkff1lCxVWuD FG1/KbNLYR+gmiUP5evv4MJ8AO8SfTlqoV/3YYJekZvarIuoFK3U4+LyZx/jGizgAl9l nZ0XZcLDoUQNdBR6kcMe70ODKx9xhhaKjb+bFjczY3QMO60BxTHSdZXCCjXY7Wa5M1Nh 0J27XUjqTAwTb4ROHrrAM+sfwcdx70NNOMWXuxy6Ygp4Ts6tbQ4fU2ZGg5CwqmsIOgul Wo2A== X-Gm-Message-State: AHQUAubCjv6d/Z7Gy1icmQ5iE3gAiUT73iBocaYxn1u8wId7ysyS4Td5 MHlT5i4FqZno7M/Oxid8xM+gMFEg1oc= X-Google-Smtp-Source: AHgI3IZV+LleXpMLAzkm3D0oQQGQxCwdO/k0SSiud6ee8C7uq6m0iggH9Nq5OyV49lSg44Jp2JU/nw== X-Received: by 2002:a19:df41:: with SMTP id q1mr425864lfj.25.1549303837439; Mon, 04 Feb 2019 10:10:37 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.83.140]) by smtp.gmail.com with ESMTPSA id h22-v6sm3124606lji.45.2019.02.04.10.10.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Feb 2019 10:10:35 -0800 (PST) Subject: [PATCH v2 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: <8697e411-02ae-3223-3a0c-4a3eb770ae3a@cogentembedded.com> Date: Mon, 4 Feb 2019 21:10:32 +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: renesas/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- renesas.orig/drivers/net/ethernet/renesas/sh_eth.c +++ renesas/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 Mon Feb 4 18:11:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10796305 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 E025013A4 for ; Mon, 4 Feb 2019 18:11:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CDE2D2BF78 for ; Mon, 4 Feb 2019 18:11:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C27102BF7E; Mon, 4 Feb 2019 18:11:39 +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 5B4552BF78 for ; Mon, 4 Feb 2019 18:11:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729235AbfBDSLi (ORCPT ); Mon, 4 Feb 2019 13:11:38 -0500 Received: from mail-lf1-f45.google.com ([209.85.167.45]:46087 "EHLO mail-lf1-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728056AbfBDSLi (ORCPT ); Mon, 4 Feb 2019 13:11:38 -0500 Received: by mail-lf1-f45.google.com with SMTP id f5so577789lfc.13 for ; Mon, 04 Feb 2019 10:11:37 -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=WuripNQOWF5h9FMd3FHVu69JYoXkifUIWFtz9+M3z/I=; b=VkLX9B4NL2Rrgb7f22C8qNQ45LJ0XtWJO7cmgwyHqCIbjXop6aKTnNbfm5EcmR9wH8 JiWHMBL87Lj7Cl8QYr8mCxqz8LX7I7WXe/15c3VeEaHlueoJc36H4ALMtZf6qAbQpzJY k7K0ckuv29G5AOzvLP4QnXPSBXFFXRYiOjO2cEGTP6QUSNCHG1DRtqpyguwX1ikJRzAF u1pB3rs9+a0kxTaWmtWY9KtH4wWdlPFdXBnRvYjHjnTLL6xrOjvyIWnxJWzA4M7A8ePg n8nQXMSeMKsEMy0UqicbTVqIykcdEx9xtTLC/pUoUohrTMrf5ise+48okJVAjSXXCh68 tl6A== 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=WuripNQOWF5h9FMd3FHVu69JYoXkifUIWFtz9+M3z/I=; b=cmLGNWt53caP8pOIlYNZ+u2D1DQCwLAn21AvahUQ097F7AuGBr6+aQ3ya2+rUj5+sY aGt7QQ+cbyX5YcCVcCrI0j3txftE96Q/jMYSLlna/17acEB9W2IaJ+oDYdYdQWmf7ASk wVZ0spVQQDM2z7Ag8KRauOWC/UtxUsSB6cKFN5Daz/67FxfRKbO+m9l0WIZteEbFE+vA bID4BNv98dzOWn++5XXSpoxsqvcwZiyBvoLVXslFL6NR/jJwGtYtCbzGpiCx+vQz1vW5 b2gfMcVpSGBT27N/mL9sstBvwYqw3mymkE3ADHwSitJWdD5gX3byoWiIHNn70bc6p5xN Vkcg== X-Gm-Message-State: AHQUAubkuu6IaqA3eoZfVcofXCD5F72ONkWAL/BnDGbdQpp8orFATrhU dmlXM4j9t0vZYo4jGrbd4HNj/w== X-Google-Smtp-Source: AHgI3IbVLb31o6Vv9gOQeG+rtcpgk6V5HMygrumdB/+B8NXsq/8ZqLMlUIpFbYtl8hD+wD0QUXP7TQ== X-Received: by 2002:ac2:434f:: with SMTP id o15mr397216lfl.29.1549303896201; Mon, 04 Feb 2019 10:11:36 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.83.140]) by smtp.gmail.com with ESMTPSA id t22sm3477710lfb.0.2019.02.04.10.11.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Feb 2019 10:11:34 -0800 (PST) Subject: [PATCH v2 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: Mon, 4 Feb 2019 21:11:32 +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: renesas/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- renesas.orig/drivers/net/ethernet/renesas/sh_eth.c +++ renesas/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 Mon Feb 4 18:12:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10796311 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 1E40513A4 for ; Mon, 4 Feb 2019 18:13:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0826F2BF6C for ; Mon, 4 Feb 2019 18:13:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EF3152BF72; Mon, 4 Feb 2019 18:13:00 +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 A8C212BF6C for ; Mon, 4 Feb 2019 18:13:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728408AbfBDSM7 (ORCPT ); Mon, 4 Feb 2019 13:12:59 -0500 Received: from mail-lj1-f182.google.com ([209.85.208.182]:41120 "EHLO mail-lj1-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728356AbfBDSM6 (ORCPT ); Mon, 4 Feb 2019 13:12:58 -0500 Received: by mail-lj1-f182.google.com with SMTP id k15-v6so669763ljc.8 for ; Mon, 04 Feb 2019 10:12:57 -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=iQ0EU+A67yBKqvtr/KKNnjcfu3fMAHJQV/90tv/pTqo=; b=YJr2Th3KYA2xyayTUzysDu12AB1EC/S4TOsyt6bjfzOHdDD8VgbdA0yPCYkALVhnx2 sNnjPtM8vOwwpYtGXc1EGq5zxxJNJXWji57IQWclrNEvfYaG8mJkl9uiV+kh0rRSaT1k OV4P3qnVUDWIMur1T8prkngIQcmWabJqFuvGvpUIIdrojC9DPLM+FvZqcPsv9MO/CTV7 AjZxGHdyFV8TBxmYOr/OodVqKlQbsjwEevdPoj5V9pKreAlwaJANMjSm79NvTBkmJ+IU 2K30WaDVr3uNCJMHeUvIgm7nMwRUI5iKDmW5pAr3U1nSIFhixQ3eg61MLx+laCIzoQkG 218w== 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=iQ0EU+A67yBKqvtr/KKNnjcfu3fMAHJQV/90tv/pTqo=; b=mbrPKCUxAedgcqb3uGZ+Oq6YLQZCr/cODMqW0XWJzZ+yexW+dVr03JiwqGBXUytZc4 xO6NmmusvsPx7gsq7Dx2pMpk1gZS9KkfzeuI0MVIS5wEnh4312IM4R2HqW9aSJ4jjkYH Jc9l21eZHEEG09uLPTqVf3dapseNLcb/rOuR2WL4Vy6GLs/87jQYP11WPh2fuRv6N8lF xWDYqGfvgC0huR/jWNwr5W3QCdLfH3qFpm/sSrg2aUGWCEviptq0IUsh6SgTyVnh5cD/ Fy0EHXMcoJ+os7j2usBEB9hoy7bzH61thUukk+ekRkkrffpeUofsFPqU0gBpNXmmQr1Z gAAA== X-Gm-Message-State: AHQUAubdVAv6Ta48/lH/722N1MEpqDTu8pUYJN0Xhy78W/yzoFQf52+O d15I2g3440R5PN1BlhU0PU7FQw== X-Google-Smtp-Source: AHgI3IaiPYcrqlc+FB4Gh7UOl+mwJfcpTUteIrZn2oZjIvsWp/GZLuDLJx4BJt33Ig4t5QkWMc/TvA== X-Received: by 2002:a2e:4a19:: with SMTP id x25-v6mr352737lja.19.1549303976422; Mon, 04 Feb 2019 10:12:56 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.83.140]) by smtp.gmail.com with ESMTPSA id z9sm3195545lfj.79.2019.02.04.10.12.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Feb 2019 10:12:46 -0800 (PST) Subject: [PATCH v2 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: <2d6569b3-b83a-b815-30b1-56fde1a7a0e6@cogentembedded.com> Date: Mon, 4 Feb 2019 21:12:39 +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: renesas/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- renesas.orig/drivers/net/ethernet/renesas/sh_eth.c +++ renesas/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, };