aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2013-06-25 19:11:41 -0400
committerDavid S. Miller <davem@davemloft.net>2013-06-25 19:11:41 -0400
commit3bae9db9aacc40cdb5a0a4b74aaf935b3e85b4d6 (patch)
treebda7c296a23fa0d009ab3c97d1c84aa47b2bcc6a /drivers/net/ethernet
parent6541aa52a0f9911b0d9d9df14b1da3147a98f58b (diff)
parent636d73da27e83ce4882f8823f79063bb37980961 (diff)
Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc-next
Ben Hutchings says: ==================== 1. Make EEH recovery work when using legacy interrupts, from Alexandre Rames. 2. Enable accelerated RFS for VLAN-tagged flows, from Andy Lutomirski. 3. Improve performance for non-TCP (and particularly UDP) traffic, which regressed in 3.10 when we switched to always allocating paged RX buffers. Partly by Jon Cooper. 4. Some minor bug fixes to IOMMU detection, timestamping capabilities, and IRQ cleanup on the probe failure path. I've dropped the RX skb cache, which improved some benchmarks but perhaps needs some reworking to be more generally useful. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/sfc/efx.c40
-rw-r--r--drivers/net/ethernet/sfc/efx.h1
-rw-r--r--drivers/net/ethernet/sfc/ethtool.c16
-rw-r--r--drivers/net/ethernet/sfc/filter.c15
-rw-r--r--drivers/net/ethernet/sfc/net_driver.h2
-rw-r--r--drivers/net/ethernet/sfc/nic.c74
-rw-r--r--drivers/net/ethernet/sfc/nic.h4
-rw-r--r--drivers/net/ethernet/sfc/ptp.c13
-rw-r--r--drivers/net/ethernet/sfc/rx.c8
9 files changed, 114 insertions, 59 deletions
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index 46cc11d5e205..e7284a2caffa 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -21,8 +21,8 @@
21#include <linux/ethtool.h> 21#include <linux/ethtool.h>
22#include <linux/topology.h> 22#include <linux/topology.h>
23#include <linux/gfp.h> 23#include <linux/gfp.h>
24#include <linux/cpu_rmap.h>
25#include <linux/aer.h> 24#include <linux/aer.h>
25#include <linux/interrupt.h>
26#include "net_driver.h" 26#include "net_driver.h"
27#include "efx.h" 27#include "efx.h"
28#include "nic.h" 28#include "nic.h"
@@ -1283,29 +1283,6 @@ static unsigned int efx_wanted_parallelism(struct efx_nic *efx)
1283 return count; 1283 return count;
1284} 1284}
1285 1285
1286static int
1287efx_init_rx_cpu_rmap(struct efx_nic *efx, struct msix_entry *xentries)
1288{
1289#ifdef CONFIG_RFS_ACCEL
1290 unsigned int i;
1291 int rc;
1292
1293 efx->net_dev->rx_cpu_rmap = alloc_irq_cpu_rmap(efx->n_rx_channels);
1294 if (!efx->net_dev->rx_cpu_rmap)
1295 return -ENOMEM;
1296 for (i = 0; i < efx->n_rx_channels; i++) {
1297 rc = irq_cpu_rmap_add(efx->net_dev->rx_cpu_rmap,
1298 xentries[i].vector);
1299 if (rc) {
1300 free_irq_cpu_rmap(efx->net_dev->rx_cpu_rmap);
1301 efx->net_dev->rx_cpu_rmap = NULL;
1302 return rc;
1303 }
1304 }
1305#endif
1306 return 0;
1307}
1308
1309/* Probe the number and type of interrupts we are able to obtain, and 1286/* Probe the number and type of interrupts we are able to obtain, and
1310 * the resulting numbers of channels and RX queues. 1287 * the resulting numbers of channels and RX queues.
1311 */ 1288 */
@@ -1359,11 +1336,6 @@ static int efx_probe_interrupts(struct efx_nic *efx)
1359 efx->n_tx_channels = n_channels; 1336 efx->n_tx_channels = n_channels;
1360 efx->n_rx_channels = n_channels; 1337 efx->n_rx_channels = n_channels;
1361 } 1338 }
1362 rc = efx_init_rx_cpu_rmap(efx, xentries);
1363 if (rc) {
1364 pci_disable_msix(efx->pci_dev);
1365 return rc;
1366 }
1367 for (i = 0; i < efx->n_channels; i++) 1339 for (i = 0; i < efx->n_channels; i++)
1368 efx_get_channel(efx, i)->irq = 1340 efx_get_channel(efx, i)->irq =
1369 xentries[i].vector; 1341 xentries[i].vector;
@@ -1427,6 +1399,10 @@ static void efx_start_interrupts(struct efx_nic *efx, bool may_keep_eventq)
1427 1399
1428 BUG_ON(efx->state == STATE_DISABLED); 1400 BUG_ON(efx->state == STATE_DISABLED);
1429 1401
1402 if (efx->eeh_disabled_legacy_irq) {
1403 enable_irq(efx->legacy_irq);
1404 efx->eeh_disabled_legacy_irq = false;
1405 }
1430 if (efx->legacy_irq) 1406 if (efx->legacy_irq)
1431 efx->legacy_irq_enabled = true; 1407 efx->legacy_irq_enabled = true;
1432 efx_nic_enable_interrupts(efx); 1408 efx_nic_enable_interrupts(efx);
@@ -2365,7 +2341,7 @@ out:
2365 * Returns 0 if the recovery mechanisms are unsuccessful. 2341 * Returns 0 if the recovery mechanisms are unsuccessful.
2366 * Returns a non-zero value otherwise. 2342 * Returns a non-zero value otherwise.
2367 */ 2343 */
2368static int efx_try_recovery(struct efx_nic *efx) 2344int efx_try_recovery(struct efx_nic *efx)
2369{ 2345{
2370#ifdef CONFIG_EEH 2346#ifdef CONFIG_EEH
2371 /* A PCI error can occur and not be seen by EEH because nothing 2347 /* A PCI error can occur and not be seen by EEH because nothing
@@ -2603,10 +2579,6 @@ static void efx_pci_remove_main(struct efx_nic *efx)
2603 BUG_ON(efx->state == STATE_READY); 2579 BUG_ON(efx->state == STATE_READY);
2604 cancel_work_sync(&efx->reset_work); 2580 cancel_work_sync(&efx->reset_work);
2605 2581
2606#ifdef CONFIG_RFS_ACCEL
2607 free_irq_cpu_rmap(efx->net_dev->rx_cpu_rmap);
2608 efx->net_dev->rx_cpu_rmap = NULL;
2609#endif
2610 efx_stop_interrupts(efx, false); 2582 efx_stop_interrupts(efx, false);
2611 efx_nic_fini_interrupt(efx); 2583 efx_nic_fini_interrupt(efx);
2612 efx_fini_port(efx); 2584 efx_fini_port(efx);
diff --git a/drivers/net/ethernet/sfc/efx.h b/drivers/net/ethernet/sfc/efx.h
index 8372da239b43..bdb30bbb0c97 100644
--- a/drivers/net/ethernet/sfc/efx.h
+++ b/drivers/net/ethernet/sfc/efx.h
@@ -124,6 +124,7 @@ extern const struct ethtool_ops efx_ethtool_ops;
124extern int efx_reset(struct efx_nic *efx, enum reset_type method); 124extern int efx_reset(struct efx_nic *efx, enum reset_type method);
125extern void efx_reset_down(struct efx_nic *efx, enum reset_type method); 125extern void efx_reset_down(struct efx_nic *efx, enum reset_type method);
126extern int efx_reset_up(struct efx_nic *efx, enum reset_type method, bool ok); 126extern int efx_reset_up(struct efx_nic *efx, enum reset_type method, bool ok);
127extern int efx_try_recovery(struct efx_nic *efx);
127 128
128/* Global */ 129/* Global */
129extern void efx_schedule_reset(struct efx_nic *efx, enum reset_type type); 130extern void efx_schedule_reset(struct efx_nic *efx, enum reset_type type);
diff --git a/drivers/net/ethernet/sfc/ethtool.c b/drivers/net/ethernet/sfc/ethtool.c
index 6e768175e7e0..1fc21458413d 100644
--- a/drivers/net/ethernet/sfc/ethtool.c
+++ b/drivers/net/ethernet/sfc/ethtool.c
@@ -1114,6 +1114,20 @@ static int efx_ethtool_set_rxfh_indir(struct net_device *net_dev,
1114 return 0; 1114 return 0;
1115} 1115}
1116 1116
1117int efx_ethtool_get_ts_info(struct net_device *net_dev,
1118 struct ethtool_ts_info *ts_info)
1119{
1120 struct efx_nic *efx = netdev_priv(net_dev);
1121
1122 /* Software capabilities */
1123 ts_info->so_timestamping = (SOF_TIMESTAMPING_RX_SOFTWARE |
1124 SOF_TIMESTAMPING_SOFTWARE);
1125 ts_info->phc_index = -1;
1126
1127 efx_ptp_get_ts_info(efx, ts_info);
1128 return 0;
1129}
1130
1117static int efx_ethtool_get_module_eeprom(struct net_device *net_dev, 1131static int efx_ethtool_get_module_eeprom(struct net_device *net_dev,
1118 struct ethtool_eeprom *ee, 1132 struct ethtool_eeprom *ee,
1119 u8 *data) 1133 u8 *data)
@@ -1176,7 +1190,7 @@ const struct ethtool_ops efx_ethtool_ops = {
1176 .get_rxfh_indir_size = efx_ethtool_get_rxfh_indir_size, 1190 .get_rxfh_indir_size = efx_ethtool_get_rxfh_indir_size,
1177 .get_rxfh_indir = efx_ethtool_get_rxfh_indir, 1191 .get_rxfh_indir = efx_ethtool_get_rxfh_indir,
1178 .set_rxfh_indir = efx_ethtool_set_rxfh_indir, 1192 .set_rxfh_indir = efx_ethtool_set_rxfh_indir,
1179 .get_ts_info = efx_ptp_get_ts_info, 1193 .get_ts_info = efx_ethtool_get_ts_info,
1180 .get_module_info = efx_ethtool_get_module_info, 1194 .get_module_info = efx_ethtool_get_module_info,
1181 .get_module_eeprom = efx_ethtool_get_module_eeprom, 1195 .get_module_eeprom = efx_ethtool_get_module_eeprom,
1182}; 1196};
diff --git a/drivers/net/ethernet/sfc/filter.c b/drivers/net/ethernet/sfc/filter.c
index 2397f0e8d3eb..b74a60ab9ac7 100644
--- a/drivers/net/ethernet/sfc/filter.c
+++ b/drivers/net/ethernet/sfc/filter.c
@@ -1185,8 +1185,21 @@ int efx_filter_rfs(struct net_device *net_dev, const struct sk_buff *skb,
1185 1185
1186 nhoff = skb_network_offset(skb); 1186 nhoff = skb_network_offset(skb);
1187 1187
1188 if (skb->protocol != htons(ETH_P_IP)) 1188 if (skb->protocol == htons(ETH_P_8021Q)) {
1189 EFX_BUG_ON_PARANOID(skb_headlen(skb) <
1190 nhoff + sizeof(struct vlan_hdr));
1191 if (((const struct vlan_hdr *)skb->data + nhoff)->
1192 h_vlan_encapsulated_proto != htons(ETH_P_IP))
1193 return -EPROTONOSUPPORT;
1194
1195 /* This is IP over 802.1q VLAN. We can't filter on the
1196 * IP 5-tuple and the vlan together, so just strip the
1197 * vlan header and filter on the IP part.
1198 */
1199 nhoff += sizeof(struct vlan_hdr);
1200 } else if (skb->protocol != htons(ETH_P_IP)) {
1189 return -EPROTONOSUPPORT; 1201 return -EPROTONOSUPPORT;
1202 }
1190 1203
1191 /* RFS must validate the IP header length before calling us */ 1204 /* RFS must validate the IP header length before calling us */
1192 EFX_BUG_ON_PARANOID(skb_headlen(skb) < nhoff + sizeof(*ip)); 1205 EFX_BUG_ON_PARANOID(skb_headlen(skb) < nhoff + sizeof(*ip));
diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h
index 9a2914cfd345..f4c7e6b67743 100644
--- a/drivers/net/ethernet/sfc/net_driver.h
+++ b/drivers/net/ethernet/sfc/net_driver.h
@@ -243,6 +243,7 @@ struct efx_rx_buffer {
243#define EFX_RX_BUF_LAST_IN_PAGE 0x0001 243#define EFX_RX_BUF_LAST_IN_PAGE 0x0001
244#define EFX_RX_PKT_CSUMMED 0x0002 244#define EFX_RX_PKT_CSUMMED 0x0002
245#define EFX_RX_PKT_DISCARD 0x0004 245#define EFX_RX_PKT_DISCARD 0x0004
246#define EFX_RX_PKT_TCP 0x0040
246 247
247/** 248/**
248 * struct efx_rx_page_state - Page-based rx buffer state 249 * struct efx_rx_page_state - Page-based rx buffer state
@@ -788,6 +789,7 @@ struct efx_nic {
788 const struct efx_nic_type *type; 789 const struct efx_nic_type *type;
789 int legacy_irq; 790 int legacy_irq;
790 bool legacy_irq_enabled; 791 bool legacy_irq_enabled;
792 bool eeh_disabled_legacy_irq;
791 struct workqueue_struct *workqueue; 793 struct workqueue_struct *workqueue;
792 char workqueue_name[16]; 794 char workqueue_name[16];
793 struct work_struct reset_work; 795 struct work_struct reset_work;
diff --git a/drivers/net/ethernet/sfc/nic.c b/drivers/net/ethernet/sfc/nic.c
index b0503cd8c2a0..56ed3bc71e00 100644
--- a/drivers/net/ethernet/sfc/nic.c
+++ b/drivers/net/ethernet/sfc/nic.c
@@ -14,6 +14,7 @@
14#include <linux/pci.h> 14#include <linux/pci.h>
15#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/seq_file.h> 16#include <linux/seq_file.h>
17#include <linux/cpu_rmap.h>
17#include "net_driver.h" 18#include "net_driver.h"
18#include "bitfield.h" 19#include "bitfield.h"
19#include "efx.h" 20#include "efx.h"
@@ -1080,12 +1081,21 @@ efx_handle_rx_event(struct efx_channel *channel, const efx_qword_t *event)
1080 rx_ev_hdr_type = EFX_QWORD_FIELD(*event, FSF_AZ_RX_EV_HDR_TYPE); 1081 rx_ev_hdr_type = EFX_QWORD_FIELD(*event, FSF_AZ_RX_EV_HDR_TYPE);
1081 1082
1082 if (likely(rx_ev_pkt_ok)) { 1083 if (likely(rx_ev_pkt_ok)) {
1083 /* If packet is marked as OK and packet type is TCP/IP or 1084 /* If packet is marked as OK then we can rely on the
1084 * UDP/IP, then we can rely on the hardware checksum. 1085 * hardware checksum and classification.
1085 */ 1086 */
1086 flags = (rx_ev_hdr_type == FSE_CZ_RX_EV_HDR_TYPE_IPV4V6_TCP || 1087 flags = 0;
1087 rx_ev_hdr_type == FSE_CZ_RX_EV_HDR_TYPE_IPV4V6_UDP) ? 1088 switch (rx_ev_hdr_type) {
1088 EFX_RX_PKT_CSUMMED : 0; 1089 case FSE_CZ_RX_EV_HDR_TYPE_IPV4V6_TCP:
1090 flags |= EFX_RX_PKT_TCP;
1091 /* fall through */
1092 case FSE_CZ_RX_EV_HDR_TYPE_IPV4V6_UDP:
1093 flags |= EFX_RX_PKT_CSUMMED;
1094 /* fall through */
1095 case FSE_CZ_RX_EV_HDR_TYPE_IPV4V6_OTHER:
1096 case FSE_AZ_RX_EV_HDR_TYPE_OTHER:
1097 break;
1098 }
1089 } else { 1099 } else {
1090 flags = efx_handle_rx_not_ok(rx_queue, event); 1100 flags = efx_handle_rx_not_ok(rx_queue, event);
1091 } 1101 }
@@ -1579,6 +1589,16 @@ static irqreturn_t efx_legacy_interrupt(int irq, void *dev_id)
1579 efx_readd(efx, &reg, FR_BZ_INT_ISR0); 1589 efx_readd(efx, &reg, FR_BZ_INT_ISR0);
1580 queues = EFX_EXTRACT_DWORD(reg, 0, 31); 1590 queues = EFX_EXTRACT_DWORD(reg, 0, 31);
1581 1591
1592 /* Legacy interrupts are disabled too late by the EEH kernel
1593 * code. Disable them earlier.
1594 * If an EEH error occurred, the read will have returned all ones.
1595 */
1596 if (EFX_DWORD_IS_ALL_ONES(reg) && efx_try_recovery(efx) &&
1597 !efx->eeh_disabled_legacy_irq) {
1598 disable_irq_nosync(efx->legacy_irq);
1599 efx->eeh_disabled_legacy_irq = true;
1600 }
1601
1582 /* Handle non-event-queue sources */ 1602 /* Handle non-event-queue sources */
1583 if (queues & (1U << efx->irq_level)) { 1603 if (queues & (1U << efx->irq_level)) {
1584 syserr = EFX_OWORD_FIELD(*int_ker, FSF_AZ_NET_IVEC_FATAL_INT); 1604 syserr = EFX_OWORD_FIELD(*int_ker, FSF_AZ_NET_IVEC_FATAL_INT);
@@ -1687,6 +1707,7 @@ void efx_nic_push_rx_indir_table(struct efx_nic *efx)
1687int efx_nic_init_interrupt(struct efx_nic *efx) 1707int efx_nic_init_interrupt(struct efx_nic *efx)
1688{ 1708{
1689 struct efx_channel *channel; 1709 struct efx_channel *channel;
1710 unsigned int n_irqs;
1690 int rc; 1711 int rc;
1691 1712
1692 if (!EFX_INT_MODE_USE_MSI(efx)) { 1713 if (!EFX_INT_MODE_USE_MSI(efx)) {
@@ -1707,7 +1728,19 @@ int efx_nic_init_interrupt(struct efx_nic *efx)
1707 return 0; 1728 return 0;
1708 } 1729 }
1709 1730
1731#ifdef CONFIG_RFS_ACCEL
1732 if (efx->interrupt_mode == EFX_INT_MODE_MSIX) {
1733 efx->net_dev->rx_cpu_rmap =
1734 alloc_irq_cpu_rmap(efx->n_rx_channels);
1735 if (!efx->net_dev->rx_cpu_rmap) {
1736 rc = -ENOMEM;
1737 goto fail1;
1738 }
1739 }
1740#endif
1741
1710 /* Hook MSI or MSI-X interrupt */ 1742 /* Hook MSI or MSI-X interrupt */
1743 n_irqs = 0;
1711 efx_for_each_channel(channel, efx) { 1744 efx_for_each_channel(channel, efx) {
1712 rc = request_irq(channel->irq, efx_msi_interrupt, 1745 rc = request_irq(channel->irq, efx_msi_interrupt,
1713 IRQF_PROBE_SHARED, /* Not shared */ 1746 IRQF_PROBE_SHARED, /* Not shared */
@@ -1718,13 +1751,31 @@ int efx_nic_init_interrupt(struct efx_nic *efx)
1718 "failed to hook IRQ %d\n", channel->irq); 1751 "failed to hook IRQ %d\n", channel->irq);
1719 goto fail2; 1752 goto fail2;
1720 } 1753 }
1754 ++n_irqs;
1755
1756#ifdef CONFIG_RFS_ACCEL
1757 if (efx->interrupt_mode == EFX_INT_MODE_MSIX &&
1758 channel->channel < efx->n_rx_channels) {
1759 rc = irq_cpu_rmap_add(efx->net_dev->rx_cpu_rmap,
1760 channel->irq);
1761 if (rc)
1762 goto fail2;
1763 }
1764#endif
1721 } 1765 }
1722 1766
1723 return 0; 1767 return 0;
1724 1768
1725 fail2: 1769 fail2:
1726 efx_for_each_channel(channel, efx) 1770#ifdef CONFIG_RFS_ACCEL
1771 free_irq_cpu_rmap(efx->net_dev->rx_cpu_rmap);
1772 efx->net_dev->rx_cpu_rmap = NULL;
1773#endif
1774 efx_for_each_channel(channel, efx) {
1775 if (n_irqs-- == 0)
1776 break;
1727 free_irq(channel->irq, &efx->channel[channel->channel]); 1777 free_irq(channel->irq, &efx->channel[channel->channel]);
1778 }
1728 fail1: 1779 fail1:
1729 return rc; 1780 return rc;
1730} 1781}
@@ -1734,11 +1785,14 @@ void efx_nic_fini_interrupt(struct efx_nic *efx)
1734 struct efx_channel *channel; 1785 struct efx_channel *channel;
1735 efx_oword_t reg; 1786 efx_oword_t reg;
1736 1787
1788#ifdef CONFIG_RFS_ACCEL
1789 free_irq_cpu_rmap(efx->net_dev->rx_cpu_rmap);
1790 efx->net_dev->rx_cpu_rmap = NULL;
1791#endif
1792
1737 /* Disable MSI/MSI-X interrupts */ 1793 /* Disable MSI/MSI-X interrupts */
1738 efx_for_each_channel(channel, efx) { 1794 efx_for_each_channel(channel, efx)
1739 if (channel->irq) 1795 free_irq(channel->irq, &efx->channel[channel->channel]);
1740 free_irq(channel->irq, &efx->channel[channel->channel]);
1741 }
1742 1796
1743 /* ACK legacy interrupt */ 1797 /* ACK legacy interrupt */
1744 if (efx_nic_rev(efx) >= EFX_REV_FALCON_B0) 1798 if (efx_nic_rev(efx) >= EFX_REV_FALCON_B0)
diff --git a/drivers/net/ethernet/sfc/nic.h b/drivers/net/ethernet/sfc/nic.h
index 1b0003323498..d63c2991a751 100644
--- a/drivers/net/ethernet/sfc/nic.h
+++ b/drivers/net/ethernet/sfc/nic.h
@@ -254,8 +254,8 @@ extern int efx_sriov_set_vf_spoofchk(struct net_device *net_dev, int vf,
254struct ethtool_ts_info; 254struct ethtool_ts_info;
255extern void efx_ptp_probe(struct efx_nic *efx); 255extern void efx_ptp_probe(struct efx_nic *efx);
256extern int efx_ptp_ioctl(struct efx_nic *efx, struct ifreq *ifr, int cmd); 256extern int efx_ptp_ioctl(struct efx_nic *efx, struct ifreq *ifr, int cmd);
257extern int efx_ptp_get_ts_info(struct net_device *net_dev, 257extern void efx_ptp_get_ts_info(struct efx_nic *efx,
258 struct ethtool_ts_info *ts_info); 258 struct ethtool_ts_info *ts_info);
259extern bool efx_ptp_is_ptp_tx(struct efx_nic *efx, struct sk_buff *skb); 259extern bool efx_ptp_is_ptp_tx(struct efx_nic *efx, struct sk_buff *skb);
260extern int efx_ptp_tx(struct efx_nic *efx, struct sk_buff *skb); 260extern int efx_ptp_tx(struct efx_nic *efx, struct sk_buff *skb);
261extern void efx_ptp_event(struct efx_nic *efx, efx_qword_t *ev); 261extern void efx_ptp_event(struct efx_nic *efx, efx_qword_t *ev);
diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c
index 9a95abf2dedf..b495394a6dfa 100644
--- a/drivers/net/ethernet/sfc/ptp.c
+++ b/drivers/net/ethernet/sfc/ptp.c
@@ -1203,18 +1203,16 @@ static int efx_ptp_ts_init(struct efx_nic *efx, struct hwtstamp_config *init)
1203 return 0; 1203 return 0;
1204} 1204}
1205 1205
1206int 1206void efx_ptp_get_ts_info(struct efx_nic *efx, struct ethtool_ts_info *ts_info)
1207efx_ptp_get_ts_info(struct net_device *net_dev, struct ethtool_ts_info *ts_info)
1208{ 1207{
1209 struct efx_nic *efx = netdev_priv(net_dev);
1210 struct efx_ptp_data *ptp = efx->ptp_data; 1208 struct efx_ptp_data *ptp = efx->ptp_data;
1211 1209
1212 if (!ptp) 1210 if (!ptp)
1213 return -EOPNOTSUPP; 1211 return;
1214 1212
1215 ts_info->so_timestamping = (SOF_TIMESTAMPING_TX_HARDWARE | 1213 ts_info->so_timestamping |= (SOF_TIMESTAMPING_TX_HARDWARE |
1216 SOF_TIMESTAMPING_RX_HARDWARE | 1214 SOF_TIMESTAMPING_RX_HARDWARE |
1217 SOF_TIMESTAMPING_RAW_HARDWARE); 1215 SOF_TIMESTAMPING_RAW_HARDWARE);
1218 ts_info->phc_index = ptp_clock_index(ptp->phc_clock); 1216 ts_info->phc_index = ptp_clock_index(ptp->phc_clock);
1219 ts_info->tx_types = 1 << HWTSTAMP_TX_OFF | 1 << HWTSTAMP_TX_ON; 1217 ts_info->tx_types = 1 << HWTSTAMP_TX_OFF | 1 << HWTSTAMP_TX_ON;
1220 ts_info->rx_filters = (1 << HWTSTAMP_FILTER_NONE | 1218 ts_info->rx_filters = (1 << HWTSTAMP_FILTER_NONE |
@@ -1224,7 +1222,6 @@ efx_ptp_get_ts_info(struct net_device *net_dev, struct ethtool_ts_info *ts_info)
1224 1 << HWTSTAMP_FILTER_PTP_V2_L4_EVENT | 1222 1 << HWTSTAMP_FILTER_PTP_V2_L4_EVENT |
1225 1 << HWTSTAMP_FILTER_PTP_V2_L4_SYNC | 1223 1 << HWTSTAMP_FILTER_PTP_V2_L4_SYNC |
1226 1 << HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ); 1224 1 << HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ);
1227 return 0;
1228} 1225}
1229 1226
1230int efx_ptp_ioctl(struct efx_nic *efx, struct ifreq *ifr, int cmd) 1227int efx_ptp_ioctl(struct efx_nic *efx, struct ifreq *ifr, int cmd)
diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c
index a7dfe36cabf4..65646cd7af8e 100644
--- a/drivers/net/ethernet/sfc/rx.c
+++ b/drivers/net/ethernet/sfc/rx.c
@@ -36,7 +36,7 @@
36#define EFX_RECYCLE_RING_SIZE_NOIOMMU (2 * EFX_RX_PREFERRED_BATCH) 36#define EFX_RECYCLE_RING_SIZE_NOIOMMU (2 * EFX_RX_PREFERRED_BATCH)
37 37
38/* Size of buffer allocated for skb header area. */ 38/* Size of buffer allocated for skb header area. */
39#define EFX_SKB_HEADERS 64u 39#define EFX_SKB_HEADERS 128u
40 40
41/* This is the percentage fill level below which new RX descriptors 41/* This is the percentage fill level below which new RX descriptors
42 * will be added to the RX descriptor ring. 42 * will be added to the RX descriptor ring.
@@ -598,6 +598,8 @@ static void efx_rx_deliver(struct efx_channel *channel, u8 *eh,
598 598
599 /* Set the SKB flags */ 599 /* Set the SKB flags */
600 skb_checksum_none_assert(skb); 600 skb_checksum_none_assert(skb);
601 if (likely(rx_buf->flags & EFX_RX_PKT_CSUMMED))
602 skb->ip_summed = CHECKSUM_UNNECESSARY;
601 603
602 if (channel->type->receive_skb) 604 if (channel->type->receive_skb)
603 if (channel->type->receive_skb(channel, skb)) 605 if (channel->type->receive_skb(channel, skb))
@@ -627,7 +629,7 @@ void __efx_rx_packet(struct efx_channel *channel)
627 if (unlikely(!(efx->net_dev->features & NETIF_F_RXCSUM))) 629 if (unlikely(!(efx->net_dev->features & NETIF_F_RXCSUM)))
628 rx_buf->flags &= ~EFX_RX_PKT_CSUMMED; 630 rx_buf->flags &= ~EFX_RX_PKT_CSUMMED;
629 631
630 if (!channel->type->receive_skb) 632 if ((rx_buf->flags & EFX_RX_PKT_TCP) && !channel->type->receive_skb)
631 efx_rx_packet_gro(channel, rx_buf, channel->rx_pkt_n_frags, eh); 633 efx_rx_packet_gro(channel, rx_buf, channel->rx_pkt_n_frags, eh);
632 else 634 else
633 efx_rx_deliver(channel, eh, rx_buf, channel->rx_pkt_n_frags); 635 efx_rx_deliver(channel, eh, rx_buf, channel->rx_pkt_n_frags);
@@ -675,7 +677,7 @@ static void efx_init_rx_recycle_ring(struct efx_nic *efx,
675#ifdef CONFIG_PPC64 677#ifdef CONFIG_PPC64
676 bufs_in_recycle_ring = EFX_RECYCLE_RING_SIZE_IOMMU; 678 bufs_in_recycle_ring = EFX_RECYCLE_RING_SIZE_IOMMU;
677#else 679#else
678 if (efx->pci_dev->dev.iommu_group) 680 if (iommu_present(&pci_bus_type))
679 bufs_in_recycle_ring = EFX_RECYCLE_RING_SIZE_IOMMU; 681 bufs_in_recycle_ring = EFX_RECYCLE_RING_SIZE_IOMMU;
680 else 682 else
681 bufs_in_recycle_ring = EFX_RECYCLE_RING_SIZE_NOIOMMU; 683 bufs_in_recycle_ring = EFX_RECYCLE_RING_SIZE_NOIOMMU;