Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 214589
b: refs/heads/master
c: 4874c13
h: refs/heads/master
i:
  214587: b62e29e
v: v3
  • Loading branch information
Gerrit Renker committed Sep 21, 2010
1 parent 9d1687d commit 485ce74
Show file tree
Hide file tree
Showing 25 changed files with 76 additions and 888 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e254c274ae19888e5693ba6d32576ab03a8ae8a4
refs/heads/master: 4874c131d79695e3d372042781a408a1a8a762d8
6 changes: 6 additions & 0 deletions trunk/drivers/net/qlcnic/qlcnic_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1418,6 +1418,8 @@ qlcnic_process_rcv(struct qlcnic_adapter *adapter,
if (pkt_offset)
skb_pull(skb, pkt_offset);

skb->truesize = skb->len + sizeof(struct sk_buff);

if (unlikely(qlcnic_check_rx_tagging(adapter, skb, &vid))) {
adapter->stats.rxdropped++;
dev_kfree_skb(skb);
Expand Down Expand Up @@ -1489,6 +1491,8 @@ qlcnic_process_lro(struct qlcnic_adapter *adapter,

skb_put(skb, lro_length + data_offset);

skb->truesize = skb->len + sizeof(struct sk_buff) + skb_headroom(skb);

skb_pull(skb, l2_hdr_offset);

if (unlikely(qlcnic_check_rx_tagging(adapter, skb, &vid))) {
Expand Down Expand Up @@ -1728,6 +1732,8 @@ qlcnic_process_rcv_diag(struct qlcnic_adapter *adapter,
if (pkt_offset)
skb_pull(skb, pkt_offset);

skb->truesize = skb->len + sizeof(struct sk_buff);

if (!qlcnic_check_loopback_buff(skb->data))
adapter->diag_cnt++;

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/sfc/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sfc-y += efx.o nic.o falcon.o siena.o tx.o rx.o filter.o \
sfc-y += efx.o nic.o falcon.o siena.o tx.o rx.o \
falcon_gmac.o falcon_xmac.o mcdi_mac.o \
selftest.o ethtool.o qt202x_phy.o mdio_10g.o \
tenxpress.o falcon_boards.o mcdi.o mcdi_phy.o
Expand Down
34 changes: 13 additions & 21 deletions trunk/drivers/net/sfc/efx.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,8 @@ MODULE_PARM_DESC(separate_tx_channels,
static int napi_weight = 64;

/* This is the time (in jiffies) between invocations of the hardware
* monitor. On Falcon-based NICs, this will:
* - Check the on-board hardware monitor;
* - Poll the link state and reconfigure the hardware as necessary.
* monitor, which checks for known hardware bugs and resets the
* hardware and driver as necessary.
*/
unsigned int efx_monitor_interval = 1 * HZ;

Expand Down Expand Up @@ -1358,17 +1357,8 @@ static int efx_probe_all(struct efx_nic *efx)
if (rc)
goto fail3;

rc = efx_probe_filters(efx);
if (rc) {
netif_err(efx, probe, efx->net_dev,
"failed to create filter tables\n");
goto fail4;
}

return 0;

fail4:
efx_remove_channels(efx);
fail3:
efx_remove_port(efx);
fail2:
Expand Down Expand Up @@ -1499,7 +1489,6 @@ static void efx_stop_all(struct efx_nic *efx)

static void efx_remove_all(struct efx_nic *efx)
{
efx_remove_filters(efx);
efx_remove_channels(efx);
efx_remove_port(efx);
efx_remove_nic(efx);
Expand Down Expand Up @@ -1546,7 +1535,8 @@ void efx_init_irq_moderation(struct efx_nic *efx, int tx_usecs, int rx_usecs,
*
**************************************************************************/

/* Run periodically off the general workqueue */
/* Run periodically off the general workqueue. Serialised against
* efx_reconfigure_port via the mac_lock */
static void efx_monitor(struct work_struct *data)
{
struct efx_nic *efx = container_of(data, struct efx_nic,
Expand All @@ -1559,13 +1549,16 @@ static void efx_monitor(struct work_struct *data)

/* If the mac_lock is already held then it is likely a port
* reconfiguration is already in place, which will likely do
* most of the work of monitor() anyway. */
if (mutex_trylock(&efx->mac_lock)) {
if (efx->port_enabled)
efx->type->monitor(efx);
mutex_unlock(&efx->mac_lock);
}
* most of the work of check_hw() anyway. */
if (!mutex_trylock(&efx->mac_lock))
goto out_requeue;
if (!efx->port_enabled)
goto out_unlock;
efx->type->monitor(efx);

out_unlock:
mutex_unlock(&efx->mac_lock);
out_requeue:
queue_delayed_work(efx->workqueue, &efx->monitor_work,
efx_monitor_interval);
}
Expand Down Expand Up @@ -2009,7 +2002,6 @@ int efx_reset_up(struct efx_nic *efx, enum reset_type method, bool ok)
efx->mac_op->reconfigure(efx);

efx_init_channels(efx);
efx_restore_filters(efx);

mutex_unlock(&efx->spi_lock);
mutex_unlock(&efx->mac_lock);
Expand Down
14 changes: 0 additions & 14 deletions trunk/drivers/net/sfc/efx.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#define EFX_EFX_H

#include "net_driver.h"
#include "filter.h"

/* PCI IDs */
#define EFX_VENDID_SFC 0x1924
Expand Down Expand Up @@ -65,19 +64,6 @@ extern void efx_schedule_slow_fill(struct efx_rx_queue *rx_queue);
* skb. Falcon/A1 may require up to three descriptors per skb_frag. */
#define EFX_MIN_RING_SIZE (roundup_pow_of_two(2 * 3 * MAX_SKB_FRAGS))

/* Filters */
extern int efx_probe_filters(struct efx_nic *efx);
extern void efx_restore_filters(struct efx_nic *efx);
extern void efx_remove_filters(struct efx_nic *efx);
extern int efx_filter_insert_filter(struct efx_nic *efx,
struct efx_filter_spec *spec,
bool replace);
extern int efx_filter_remove_filter(struct efx_nic *efx,
struct efx_filter_spec *spec);
extern void efx_filter_table_clear(struct efx_nic *efx,
enum efx_filter_table_id table_id,
enum efx_filter_priority priority);

/* Channels */
extern void efx_process_channel_now(struct efx_channel *channel);
extern int
Expand Down
118 changes: 2 additions & 116 deletions trunk/drivers/net/sfc/ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "workarounds.h"
#include "selftest.h"
#include "efx.h"
#include "filter.h"
#include "nic.h"
#include "spi.h"
#include "mdio_10g.h"
Expand Down Expand Up @@ -552,22 +551,9 @@ static u32 efx_ethtool_get_rx_csum(struct net_device *net_dev)
static int efx_ethtool_set_flags(struct net_device *net_dev, u32 data)
{
struct efx_nic *efx = netdev_priv(net_dev);
u32 supported = (efx->type->offload_features &
(ETH_FLAG_RXHASH | ETH_FLAG_NTUPLE));
int rc;

rc = ethtool_op_set_flags(net_dev, data, supported);
if (rc)
return rc;

if (!(data & ETH_FLAG_NTUPLE)) {
efx_filter_table_clear(efx, EFX_FILTER_TABLE_RX_IP,
EFX_FILTER_PRI_MANUAL);
efx_filter_table_clear(efx, EFX_FILTER_TABLE_RX_MAC,
EFX_FILTER_PRI_MANUAL);
}
u32 supported = efx->type->offload_features & ETH_FLAG_RXHASH;

return 0;
return ethtool_op_set_flags(net_dev, data, supported);
}

static void efx_ethtool_self_test(struct net_device *net_dev,
Expand Down Expand Up @@ -969,105 +955,6 @@ efx_ethtool_get_rxnfc(struct net_device *net_dev,
}
}

static int efx_ethtool_set_rx_ntuple(struct net_device *net_dev,
struct ethtool_rx_ntuple *ntuple)
{
struct efx_nic *efx = netdev_priv(net_dev);
struct ethtool_tcpip4_spec *ip_entry = &ntuple->fs.h_u.tcp_ip4_spec;
struct ethtool_tcpip4_spec *ip_mask = &ntuple->fs.m_u.tcp_ip4_spec;
struct ethhdr *mac_entry = &ntuple->fs.h_u.ether_spec;
struct ethhdr *mac_mask = &ntuple->fs.m_u.ether_spec;
struct efx_filter_spec filter;

/* Range-check action */
if (ntuple->fs.action < ETHTOOL_RXNTUPLE_ACTION_CLEAR ||
ntuple->fs.action >= (s32)efx->n_rx_channels)
return -EINVAL;

if (~ntuple->fs.data_mask)
return -EINVAL;

switch (ntuple->fs.flow_type) {
case TCP_V4_FLOW:
case UDP_V4_FLOW:
/* Must match all of destination, */
if (ip_mask->ip4dst | ip_mask->pdst)
return -EINVAL;
/* all or none of source, */
if ((ip_mask->ip4src | ip_mask->psrc) &&
((__force u32)~ip_mask->ip4src |
(__force u16)~ip_mask->psrc))
return -EINVAL;
/* and nothing else */
if ((u8)~ip_mask->tos | (u16)~ntuple->fs.vlan_tag_mask)
return -EINVAL;
break;
case ETHER_FLOW:
/* Must match all of destination, */
if (!is_zero_ether_addr(mac_mask->h_dest))
return -EINVAL;
/* all or none of VID, */
if (ntuple->fs.vlan_tag_mask != 0xf000 &&
ntuple->fs.vlan_tag_mask != 0xffff)
return -EINVAL;
/* and nothing else */
if (!is_broadcast_ether_addr(mac_mask->h_source) ||
mac_mask->h_proto != htons(0xffff))
return -EINVAL;
break;
default:
return -EINVAL;
}

filter.priority = EFX_FILTER_PRI_MANUAL;
filter.flags = 0;

switch (ntuple->fs.flow_type) {
case TCP_V4_FLOW:
if (!ip_mask->ip4src)
efx_filter_set_rx_tcp_full(&filter,
htonl(ip_entry->ip4src),
htons(ip_entry->psrc),
htonl(ip_entry->ip4dst),
htons(ip_entry->pdst));
else
efx_filter_set_rx_tcp_wild(&filter,
htonl(ip_entry->ip4dst),
htons(ip_entry->pdst));
break;
case UDP_V4_FLOW:
if (!ip_mask->ip4src)
efx_filter_set_rx_udp_full(&filter,
htonl(ip_entry->ip4src),
htons(ip_entry->psrc),
htonl(ip_entry->ip4dst),
htons(ip_entry->pdst));
else
efx_filter_set_rx_udp_wild(&filter,
htonl(ip_entry->ip4dst),
htons(ip_entry->pdst));
break;
case ETHER_FLOW:
if (ntuple->fs.vlan_tag_mask == 0xf000)
efx_filter_set_rx_mac_full(&filter,
ntuple->fs.vlan_tag & 0xfff,
mac_entry->h_dest);
else
efx_filter_set_rx_mac_wild(&filter, mac_entry->h_dest);
break;
}

if (ntuple->fs.action == ETHTOOL_RXNTUPLE_ACTION_CLEAR) {
return efx_filter_remove_filter(efx, &filter);
} else {
if (ntuple->fs.action == ETHTOOL_RXNTUPLE_ACTION_DROP)
filter.dmaq_id = 0xfff;
else
filter.dmaq_id = ntuple->fs.action;
return efx_filter_insert_filter(efx, &filter, true);
}
}

static int efx_ethtool_get_rxfh_indir(struct net_device *net_dev,
struct ethtool_rxfh_indir *indir)
{
Expand Down Expand Up @@ -1146,7 +1033,6 @@ const struct ethtool_ops efx_ethtool_ops = {
.set_wol = efx_ethtool_set_wol,
.reset = efx_ethtool_reset,
.get_rxnfc = efx_ethtool_get_rxnfc,
.set_rx_ntuple = efx_ethtool_set_rx_ntuple,
.get_rxfh_indir = efx_ethtool_get_rxfh_indir,
.set_rxfh_indir = efx_ethtool_set_rxfh_indir,
};
2 changes: 1 addition & 1 deletion trunk/drivers/net/sfc/falcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1874,7 +1874,7 @@ struct efx_nic_type falcon_b0_nic_type = {
* channels */
.tx_dc_base = 0x130000,
.rx_dc_base = 0x100000,
.offload_features = NETIF_F_IP_CSUM | NETIF_F_RXHASH | NETIF_F_NTUPLE,
.offload_features = NETIF_F_IP_CSUM | NETIF_F_RXHASH,
.reset_world_flags = ETH_RESET_IRQ,
};

Loading

0 comments on commit 485ce74

Please sign in to comment.