* [PATCH 01/15] ehea: Remove NETIF_F_LLTX
From: Thadeu Lima de Souza Cascardo @ 2011-10-14 15:30 UTC (permalink / raw)
To: netdev; +Cc: Anton Blanchard, Thadeu Lima de Souza Cascardo
In-Reply-To: <1318606272-27647-1-git-send-email-cascardo@linux.vnet.ibm.com>
From: Anton Blanchard <anton@samba.org>
Remove the deprecated NETIF_F_LLTX feature. Since the network stack
now provides the locking we can remove the driver specific
pr->xmit_lock.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
---
drivers/net/ethernet/ibm/ehea/ehea.h | 1 -
drivers/net/ethernet/ibm/ehea/ehea_main.c | 12 ++----------
2 files changed, 2 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ethernet/ibm/ehea/ehea.h b/drivers/net/ethernet/ibm/ehea/ehea.h
index 0b8e6a9..5b5c1b5 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea.h
+++ b/drivers/net/ethernet/ibm/ehea/ehea.h
@@ -363,7 +363,6 @@ struct ehea_port_res {
struct port_stats p_stats;
struct ehea_mr send_mr; /* send memory region */
struct ehea_mr recv_mr; /* receive memory region */
- spinlock_t xmit_lock;
struct ehea_port *port;
char int_recv_name[EHEA_IRQ_NAME_SIZE];
char int_send_name[EHEA_IRQ_NAME_SIZE];
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
index dfefe80..ce9a670 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -1534,7 +1534,6 @@ static int ehea_init_port_res(struct ehea_port *port, struct ehea_port_res *pr,
pr->rx_packets = rx_packets;
pr->port = port;
- spin_lock_init(&pr->xmit_lock);
spin_lock_init(&pr->netif_queue);
pr->eq = ehea_create_eq(adapter, eq_type, EHEA_MAX_ENTRIES_EQ, 0);
@@ -2254,14 +2253,9 @@ static int ehea_start_xmit(struct sk_buff *skb, struct net_device *dev)
pr = &port->port_res[ehea_hash_skb(skb, port->num_tx_qps)];
- if (!spin_trylock(&pr->xmit_lock))
+ if (pr->queue_stopped)
return NETDEV_TX_BUSY;
- if (pr->queue_stopped) {
- spin_unlock(&pr->xmit_lock);
- return NETDEV_TX_BUSY;
- }
-
swqe = ehea_get_swqe(pr->qp, &swqe_index);
memset(swqe, 0, SWQE_HEADER_SIZE);
atomic_dec(&pr->swqe_avail);
@@ -2325,8 +2319,6 @@ static int ehea_start_xmit(struct sk_buff *skb, struct net_device *dev)
}
spin_unlock_irqrestore(&pr->netif_queue, flags);
}
- dev->trans_start = jiffies; /* NETIF_F_LLTX driver :( */
- spin_unlock(&pr->xmit_lock);
return NETDEV_TX_OK;
}
@@ -3233,7 +3225,7 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter,
dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_TSO
| NETIF_F_HIGHDMA | NETIF_F_IP_CSUM | NETIF_F_HW_VLAN_TX
| NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER
- | NETIF_F_LLTX | NETIF_F_RXCSUM;
+ | NETIF_F_RXCSUM;
dev->watchdog_timeo = EHEA_WATCH_DOG_TIMEOUT;
if (use_lro)
--
1.7.4.4
^ permalink raw reply related
* [PATCH 03/15] ehea: Remove force_irq logic in napi poll routine
From: Thadeu Lima de Souza Cascardo @ 2011-10-14 15:31 UTC (permalink / raw)
To: netdev; +Cc: Anton Blanchard, Thadeu Lima de Souza Cascardo
In-Reply-To: <1318606272-27647-1-git-send-email-cascardo@linux.vnet.ibm.com>
From: Anton Blanchard <anton@samba.org>
commit 18604c548545 (ehea: NAPI multi queue TX/RX path for SMP) added
driver specific logic for exiting napi mode. I'm not sure what it was
trying to solve and it should be up to the network stack to decide when
we are done polling so remove it.
v3:
[cascardo] Fixed extra parentheses.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
---
drivers/net/ethernet/ibm/ehea/ehea.h | 1 -
drivers/net/ethernet/ibm/ehea/ehea_main.c | 13 +++----------
2 files changed, 3 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ethernet/ibm/ehea/ehea.h b/drivers/net/ethernet/ibm/ehea/ehea.h
index e247927..4a4d466 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea.h
+++ b/drivers/net/ethernet/ibm/ehea/ehea.h
@@ -383,7 +383,6 @@ struct ehea_port_res {
u64 tx_bytes;
u64 rx_packets;
u64 rx_bytes;
- u32 poll_counter;
struct net_lro_mgr lro_mgr;
struct net_lro_desc lro_desc[MAX_LRO_DESCRIPTORS];
int sq_restart_flag;
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
index a6c4192..4032a0a 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -926,7 +926,6 @@ static struct ehea_cqe *ehea_proc_cqes(struct ehea_port_res *pr, int my_quota)
return cqe;
}
-#define EHEA_NAPI_POLL_NUM_BEFORE_IRQ 16
#define EHEA_POLL_MAX_CQES 65535
static int ehea_poll(struct napi_struct *napi, int budget)
@@ -936,18 +935,13 @@ static int ehea_poll(struct napi_struct *napi, int budget)
struct net_device *dev = pr->port->netdev;
struct ehea_cqe *cqe;
struct ehea_cqe *cqe_skb = NULL;
- int force_irq, wqe_index;
+ int wqe_index;
int rx = 0;
- force_irq = (pr->poll_counter > EHEA_NAPI_POLL_NUM_BEFORE_IRQ);
cqe_skb = ehea_proc_cqes(pr, EHEA_POLL_MAX_CQES);
+ rx += ehea_proc_rwqes(dev, pr, budget - rx);
- if (!force_irq)
- rx += ehea_proc_rwqes(dev, pr, budget - rx);
-
- while ((rx != budget) || force_irq) {
- pr->poll_counter = 0;
- force_irq = 0;
+ while (rx != budget) {
napi_complete(napi);
ehea_reset_cq_ep(pr->recv_cq);
ehea_reset_cq_ep(pr->send_cq);
@@ -967,7 +961,6 @@ static int ehea_poll(struct napi_struct *napi, int budget)
rx += ehea_proc_rwqes(dev, pr, budget - rx);
}
- pr->poll_counter++;
return rx;
}
--
1.7.4.4
^ permalink raw reply related
* [PATCH 02/15] ehea: Update multiqueue support
From: Thadeu Lima de Souza Cascardo @ 2011-10-14 15:30 UTC (permalink / raw)
To: netdev; +Cc: Anton Blanchard, Thadeu Lima de Souza Cascardo
In-Reply-To: <1318606272-27647-1-git-send-email-cascardo@linux.vnet.ibm.com>
From: Anton Blanchard <anton@samba.org>
The ehea driver had some multiqueue support but was missing the last
few years of networking stack improvements:
- Use skb_record_rx_queue to record which queue an skb came in on.
- Remove the driver specific netif_queue lock and use the networking
stack transmit lock instead.
- Remove the driver specific transmit queue hashing and use
skb_get_queue_mapping instead.
- Use netif_tx_{start|stop|wake}_queue where appropriate. We can also
remove pr->queue_stopped and just check the queue status directly.
- Print all 16 queues in the ethtool stats.
We now enable multiqueue by default since it is a clear win on all my
testing so far.
v3:
[cascardo] fixed use_mcs parameter description
[cascardo] set ehea_ethtool_stats_keys as const
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
---
drivers/net/ethernet/ibm/ehea/ehea.h | 2 -
drivers/net/ethernet/ibm/ehea/ehea_ethtool.c | 17 +++--
drivers/net/ethernet/ibm/ehea/ehea_main.c | 92 +++++++++++---------------
3 files changed, 49 insertions(+), 62 deletions(-)
diff --git a/drivers/net/ethernet/ibm/ehea/ehea.h b/drivers/net/ethernet/ibm/ehea/ehea.h
index 5b5c1b5..e247927 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea.h
+++ b/drivers/net/ethernet/ibm/ehea/ehea.h
@@ -375,8 +375,6 @@ struct ehea_port_res {
struct ehea_q_skb_arr rq3_skba;
struct ehea_q_skb_arr sq_skba;
int sq_skba_size;
- spinlock_t netif_queue;
- int queue_stopped;
int swqe_refill_th;
atomic_t swqe_avail;
int swqe_ll_count;
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_ethtool.c b/drivers/net/ethernet/ibm/ehea/ehea_ethtool.c
index 7f642ae..d185016 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_ethtool.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_ethtool.c
@@ -180,7 +180,7 @@ static void ehea_set_msglevel(struct net_device *dev, u32 value)
port->msg_enable = value;
}
-static char ehea_ethtool_stats_keys[][ETH_GSTRING_LEN] = {
+static const char ehea_ethtool_stats_keys[][ETH_GSTRING_LEN] = {
{"sig_comp_iv"},
{"swqe_refill_th"},
{"port resets"},
@@ -189,7 +189,6 @@ static char ehea_ethtool_stats_keys[][ETH_GSTRING_LEN] = {
{"IP cksum errors"},
{"Frame cksum errors"},
{"num SQ stopped"},
- {"SQ stopped"},
{"PR0 free_swqes"},
{"PR1 free_swqes"},
{"PR2 free_swqes"},
@@ -198,6 +197,14 @@ static char ehea_ethtool_stats_keys[][ETH_GSTRING_LEN] = {
{"PR5 free_swqes"},
{"PR6 free_swqes"},
{"PR7 free_swqes"},
+ {"PR8 free_swqes"},
+ {"PR9 free_swqes"},
+ {"PR10 free_swqes"},
+ {"PR11 free_swqes"},
+ {"PR12 free_swqes"},
+ {"PR13 free_swqes"},
+ {"PR14 free_swqes"},
+ {"PR15 free_swqes"},
{"LRO aggregated"},
{"LRO flushed"},
{"LRO no_desc"},
@@ -255,11 +262,7 @@ static void ehea_get_ethtool_stats(struct net_device *dev,
tmp += port->port_res[k].p_stats.queue_stopped;
data[i++] = tmp;
- for (k = 0, tmp = 0; k < EHEA_MAX_PORT_RES; k++)
- tmp |= port->port_res[k].queue_stopped;
- data[i++] = tmp;
-
- for (k = 0; k < 8; k++)
+ for (k = 0; k < 16; k++)
data[i++] = atomic_read(&port->port_res[k].swqe_avail);
for (k = 0, tmp = 0; k < EHEA_MAX_PORT_RES; k++)
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
index ce9a670..a6c4192 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -61,7 +61,7 @@ static int rq1_entries = EHEA_DEF_ENTRIES_RQ1;
static int rq2_entries = EHEA_DEF_ENTRIES_RQ2;
static int rq3_entries = EHEA_DEF_ENTRIES_RQ3;
static int sq_entries = EHEA_DEF_ENTRIES_SQ;
-static int use_mcs;
+static int use_mcs = 1;
static int use_lro;
static int lro_max_aggr = EHEA_LRO_MAX_AGGR;
static int num_tx_qps = EHEA_NUM_TX_QP;
@@ -94,7 +94,8 @@ MODULE_PARM_DESC(rq1_entries, "Number of entries for Receive Queue 1 "
MODULE_PARM_DESC(sq_entries, " Number of entries for the Send Queue "
"[2^x - 1], x = [6..14]. Default = "
__MODULE_STRING(EHEA_DEF_ENTRIES_SQ) ")");
-MODULE_PARM_DESC(use_mcs, " 0:NAPI, 1:Multiple receive queues, Default = 0 ");
+MODULE_PARM_DESC(use_mcs, " Multiple receive queues, 1: enable, 0: disable, "
+ "Default = 1");
MODULE_PARM_DESC(lro_max_aggr, " LRO: Max packets to be aggregated. Default = "
__MODULE_STRING(EHEA_LRO_MAX_AGGR));
@@ -551,7 +552,8 @@ static inline int ehea_check_cqe(struct ehea_cqe *cqe, int *rq_num)
}
static inline void ehea_fill_skb(struct net_device *dev,
- struct sk_buff *skb, struct ehea_cqe *cqe)
+ struct sk_buff *skb, struct ehea_cqe *cqe,
+ struct ehea_port_res *pr)
{
int length = cqe->num_bytes_transfered - 4; /*remove CRC */
@@ -565,6 +567,8 @@ static inline void ehea_fill_skb(struct net_device *dev,
skb->csum = csum_unfold(~cqe->inet_checksum_value);
} else
skb->ip_summed = CHECKSUM_UNNECESSARY;
+
+ skb_record_rx_queue(skb, pr - &pr->port->port_res[0]);
}
static inline struct sk_buff *get_skb_by_index(struct sk_buff **skb_array,
@@ -750,7 +754,7 @@ static int ehea_proc_rwqes(struct net_device *dev,
}
skb_copy_to_linear_data(skb, ((char *)cqe) + 64,
cqe->num_bytes_transfered - 4);
- ehea_fill_skb(dev, skb, cqe);
+ ehea_fill_skb(dev, skb, cqe, pr);
} else if (rq == 2) {
/* RQ2 */
skb = get_skb_by_index(skb_arr_rq2,
@@ -760,7 +764,7 @@ static int ehea_proc_rwqes(struct net_device *dev,
"rq2: skb=NULL\n");
break;
}
- ehea_fill_skb(dev, skb, cqe);
+ ehea_fill_skb(dev, skb, cqe, pr);
processed_rq2++;
} else {
/* RQ3 */
@@ -771,7 +775,7 @@ static int ehea_proc_rwqes(struct net_device *dev,
"rq3: skb=NULL\n");
break;
}
- ehea_fill_skb(dev, skb, cqe);
+ ehea_fill_skb(dev, skb, cqe, pr);
processed_rq3++;
}
@@ -857,7 +861,8 @@ static struct ehea_cqe *ehea_proc_cqes(struct ehea_port_res *pr, int my_quota)
int cqe_counter = 0;
int swqe_av = 0;
int index;
- unsigned long flags;
+ struct netdev_queue *txq = netdev_get_tx_queue(pr->port->netdev,
+ pr - &pr->port->port_res[0]);
cqe = ehea_poll_cq(send_cq);
while (cqe && (quota > 0)) {
@@ -907,14 +912,15 @@ static struct ehea_cqe *ehea_proc_cqes(struct ehea_port_res *pr, int my_quota)
ehea_update_feca(send_cq, cqe_counter);
atomic_add(swqe_av, &pr->swqe_avail);
- spin_lock_irqsave(&pr->netif_queue, flags);
-
- if (pr->queue_stopped && (atomic_read(&pr->swqe_avail)
- >= pr->swqe_refill_th)) {
- netif_wake_queue(pr->port->netdev);
- pr->queue_stopped = 0;
+ if (unlikely(netif_tx_queue_stopped(txq) &&
+ (atomic_read(&pr->swqe_avail) >= pr->swqe_refill_th))) {
+ __netif_tx_lock(txq, smp_processor_id());
+ if (netif_tx_queue_stopped(txq) &&
+ (atomic_read(&pr->swqe_avail) >= pr->swqe_refill_th))
+ netif_tx_wake_queue(txq);
+ __netif_tx_unlock(txq);
}
- spin_unlock_irqrestore(&pr->netif_queue, flags);
+
wake_up(&pr->port->swqe_avail_wq);
return cqe;
@@ -1251,7 +1257,7 @@ static void ehea_parse_eqe(struct ehea_adapter *adapter, u64 eqe)
netif_info(port, link, dev,
"Logical port down\n");
netif_carrier_off(dev);
- netif_stop_queue(dev);
+ netif_tx_disable(dev);
}
if (EHEA_BMASK_GET(NEQE_EXTSWITCH_PORT_UP, eqe)) {
@@ -1282,7 +1288,7 @@ static void ehea_parse_eqe(struct ehea_adapter *adapter, u64 eqe)
case EHEA_EC_PORT_MALFUNC:
netdev_info(dev, "Port malfunction\n");
netif_carrier_off(dev);
- netif_stop_queue(dev);
+ netif_tx_disable(dev);
break;
default:
netdev_err(dev, "unknown event code %x, eqe=0x%llX\n", ec, eqe);
@@ -1534,7 +1540,6 @@ static int ehea_init_port_res(struct ehea_port *port, struct ehea_port_res *pr,
pr->rx_packets = rx_packets;
pr->port = port;
- spin_lock_init(&pr->netif_queue);
pr->eq = ehea_create_eq(adapter, eq_type, EHEA_MAX_ENTRIES_EQ, 0);
if (!pr->eq) {
@@ -2226,35 +2231,17 @@ static void ehea_xmit3(struct sk_buff *skb, struct net_device *dev,
dev_kfree_skb(skb);
}
-static inline int ehea_hash_skb(struct sk_buff *skb, int num_qps)
-{
- struct tcphdr *tcp;
- u32 tmp;
-
- if ((skb->protocol == htons(ETH_P_IP)) &&
- (ip_hdr(skb)->protocol == IPPROTO_TCP)) {
- tcp = (struct tcphdr *)(skb_network_header(skb) +
- (ip_hdr(skb)->ihl * 4));
- tmp = (tcp->source + (tcp->dest << 16)) % 31;
- tmp += ip_hdr(skb)->daddr % 31;
- return tmp % num_qps;
- } else
- return 0;
-}
-
static int ehea_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct ehea_port *port = netdev_priv(dev);
struct ehea_swqe *swqe;
- unsigned long flags;
u32 lkey;
int swqe_index;
struct ehea_port_res *pr;
+ struct netdev_queue *txq;
- pr = &port->port_res[ehea_hash_skb(skb, port->num_tx_qps)];
-
- if (pr->queue_stopped)
- return NETDEV_TX_BUSY;
+ pr = &port->port_res[skb_get_queue_mapping(skb)];
+ txq = netdev_get_tx_queue(dev, skb_get_queue_mapping(skb));
swqe = ehea_get_swqe(pr->qp, &swqe_index);
memset(swqe, 0, SWQE_HEADER_SIZE);
@@ -2304,20 +2291,15 @@ static int ehea_start_xmit(struct sk_buff *skb, struct net_device *dev)
ehea_dump(swqe, 512, "swqe");
if (unlikely(test_bit(__EHEA_STOP_XFER, &ehea_driver_flags))) {
- netif_stop_queue(dev);
+ netif_tx_stop_queue(txq);
swqe->tx_control |= EHEA_SWQE_PURGE;
}
ehea_post_swqe(pr->qp, swqe);
if (unlikely(atomic_read(&pr->swqe_avail) <= 1)) {
- spin_lock_irqsave(&pr->netif_queue, flags);
- if (unlikely(atomic_read(&pr->swqe_avail) <= 1)) {
- pr->p_stats.queue_stopped++;
- netif_stop_queue(dev);
- pr->queue_stopped = 1;
- }
- spin_unlock_irqrestore(&pr->netif_queue, flags);
+ pr->p_stats.queue_stopped++;
+ netif_tx_stop_queue(txq);
}
return NETDEV_TX_OK;
@@ -2642,7 +2624,7 @@ static int ehea_open(struct net_device *dev)
ret = ehea_up(dev);
if (!ret) {
port_napi_enable(port);
- netif_start_queue(dev);
+ netif_tx_start_all_queues(dev);
}
mutex_unlock(&port->port_lock);
@@ -2688,7 +2670,7 @@ static int ehea_stop(struct net_device *dev)
cancel_work_sync(&port->reset_task);
cancel_delayed_work_sync(&port->stats_work);
mutex_lock(&port->port_lock);
- netif_stop_queue(dev);
+ netif_tx_stop_all_queues(dev);
port_napi_disable(port);
ret = ehea_down(dev);
mutex_unlock(&port->port_lock);
@@ -2912,7 +2894,7 @@ static void ehea_reset_port(struct work_struct *work)
mutex_lock(&dlpar_mem_lock);
port->resets++;
mutex_lock(&port->port_lock);
- netif_stop_queue(dev);
+ netif_tx_disable(dev);
port_napi_disable(port);
@@ -2928,7 +2910,7 @@ static void ehea_reset_port(struct work_struct *work)
port_napi_enable(port);
- netif_wake_queue(dev);
+ netif_tx_wake_all_queues(dev);
out:
mutex_unlock(&port->port_lock);
mutex_unlock(&dlpar_mem_lock);
@@ -2955,7 +2937,7 @@ static void ehea_rereg_mrs(void)
if (dev->flags & IFF_UP) {
mutex_lock(&port->port_lock);
- netif_stop_queue(dev);
+ netif_tx_disable(dev);
ehea_flush_sq(port);
ret = ehea_stop_qps(dev);
if (ret) {
@@ -3000,7 +2982,7 @@ static void ehea_rereg_mrs(void)
if (!ret) {
check_sqs(port);
port_napi_enable(port);
- netif_wake_queue(dev);
+ netif_tx_wake_all_queues(dev);
} else {
netdev_err(dev, "Unable to restart QPS\n");
}
@@ -3176,7 +3158,7 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter,
int jumbo;
/* allocate memory for the port structures */
- dev = alloc_etherdev(sizeof(struct ehea_port));
+ dev = alloc_etherdev_mq(sizeof(struct ehea_port), EHEA_MAX_PORT_RES);
if (!dev) {
pr_err("no mem for net_device\n");
@@ -3208,6 +3190,10 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter,
if (ret)
goto out_free_mc_list;
+ netif_set_real_num_rx_queues(dev, port->num_def_qps);
+ netif_set_real_num_tx_queues(dev, port->num_def_qps +
+ port->num_add_tx_qps);
+
port_dev = ehea_register_port(port, dn);
if (!port_dev)
goto out_free_mc_list;
--
1.7.4.4
^ permalink raw reply related
* [PATCH 04/15] ehea: Remove num_tx_qps module option
From: Thadeu Lima de Souza Cascardo @ 2011-10-14 15:31 UTC (permalink / raw)
To: netdev; +Cc: Anton Blanchard, Thadeu Lima de Souza Cascardo
In-Reply-To: <1318606272-27647-1-git-send-email-cascardo@linux.vnet.ibm.com>
From: Anton Blanchard <anton@samba.org>
The num_tx_qps module option allows a user to configure a different
number of tx and rx queues. Now the networking stack is multiqueue
aware it makes little sense just to enable the tx queues and not the
rx queues so remove the option.
v3:
[cascardo] fixed conflict with get_stats change
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
---
drivers/net/ethernet/ibm/ehea/ehea.h | 3 --
drivers/net/ethernet/ibm/ehea/ehea_main.c | 51 ++++++++++------------------
2 files changed, 18 insertions(+), 36 deletions(-)
diff --git a/drivers/net/ethernet/ibm/ehea/ehea.h b/drivers/net/ethernet/ibm/ehea/ehea.h
index 4a4d466..8e7c594 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea.h
+++ b/drivers/net/ethernet/ibm/ehea/ehea.h
@@ -58,7 +58,6 @@
#define EHEA_MIN_ENTRIES_QP 127
#define EHEA_SMALL_QUEUES
-#define EHEA_NUM_TX_QP 1
#define EHEA_LRO_MAX_AGGR 64
#ifdef EHEA_SMALL_QUEUES
@@ -460,8 +459,6 @@ struct ehea_port {
char int_aff_name[EHEA_IRQ_NAME_SIZE];
int allmulti; /* Indicates IFF_ALLMULTI state */
int promisc; /* Indicates IFF_PROMISC state */
- int num_tx_qps;
- int num_add_tx_qps;
int num_mcs;
int resets;
unsigned long flags;
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
index 4032a0a..6ded42a 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -64,7 +64,6 @@ static int sq_entries = EHEA_DEF_ENTRIES_SQ;
static int use_mcs = 1;
static int use_lro;
static int lro_max_aggr = EHEA_LRO_MAX_AGGR;
-static int num_tx_qps = EHEA_NUM_TX_QP;
static int prop_carrier_state;
module_param(msg_level, int, 0);
@@ -76,9 +75,7 @@ module_param(prop_carrier_state, int, 0);
module_param(use_mcs, int, 0);
module_param(use_lro, int, 0);
module_param(lro_max_aggr, int, 0);
-module_param(num_tx_qps, int, 0);
-MODULE_PARM_DESC(num_tx_qps, "Number of TX-QPS");
MODULE_PARM_DESC(msg_level, "msg_level");
MODULE_PARM_DESC(prop_carrier_state, "Propagate carrier state of physical "
"port to stack. 1:yes, 0:no. Default = 0 ");
@@ -174,7 +171,7 @@ static void ehea_update_firmware_handles(void)
continue;
num_ports++;
- num_portres += port->num_def_qps + port->num_add_tx_qps;
+ num_portres += port->num_def_qps;
}
}
@@ -200,9 +197,7 @@ static void ehea_update_firmware_handles(void)
(num_ports == 0))
continue;
- for (l = 0;
- l < port->num_def_qps + port->num_add_tx_qps;
- l++) {
+ for (l = 0; l < port->num_def_qps; l++) {
struct ehea_port_res *pr = &port->port_res[l];
arr[i].adh = adapter->handle;
@@ -340,7 +335,7 @@ static struct net_device_stats *ehea_get_stats(struct net_device *dev)
rx_bytes += port->port_res[i].rx_bytes;
}
- for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
+ for (i = 0; i < port->num_def_qps; i++) {
tx_packets += port->port_res[i].tx_packets;
tx_bytes += port->port_res[i].tx_bytes;
}
@@ -810,7 +805,7 @@ static void reset_sq_restart_flag(struct ehea_port *port)
{
int i;
- for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
+ for (i = 0; i < port->num_def_qps; i++) {
struct ehea_port_res *pr = &port->port_res[i];
pr->sq_restart_flag = 0;
}
@@ -823,7 +818,7 @@ static void check_sqs(struct ehea_port *port)
int swqe_index;
int i, k;
- for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
+ for (i = 0; i < port->num_def_qps; i++) {
struct ehea_port_res *pr = &port->port_res[i];
int ret;
k = 0;
@@ -1112,13 +1107,6 @@ int ehea_sense_port_attr(struct ehea_port *port)
goto out_free;
}
- port->num_tx_qps = num_tx_qps;
-
- if (port->num_def_qps >= port->num_tx_qps)
- port->num_add_tx_qps = 0;
- else
- port->num_add_tx_qps = port->num_tx_qps - port->num_def_qps;
-
ret = 0;
out_free:
if (ret || netif_msg_probe(port))
@@ -1359,7 +1347,7 @@ static int ehea_reg_interrupts(struct net_device *dev)
port->qp_eq->attr.ist1);
- for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
+ for (i = 0; i < port->num_def_qps; i++) {
pr = &port->port_res[i];
snprintf(pr->int_send_name, EHEA_IRQ_NAME_SIZE - 1,
"%s-queue%d", dev->name, i);
@@ -1402,7 +1390,7 @@ static void ehea_free_interrupts(struct net_device *dev)
/* send */
- for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
+ for (i = 0; i < port->num_def_qps; i++) {
pr = &port->port_res[i];
ibmebus_free_irq(pr->eq->attr.ist1, pr);
netif_info(port, intr, dev,
@@ -2438,8 +2426,7 @@ out:
return ret;
}
-static int ehea_port_res_setup(struct ehea_port *port, int def_qps,
- int add_tx_qps)
+static int ehea_port_res_setup(struct ehea_port *port, int def_qps)
{
int ret, i;
struct port_res_cfg pr_cfg, pr_cfg_small_rx;
@@ -2472,7 +2459,7 @@ static int ehea_port_res_setup(struct ehea_port *port, int def_qps,
if (ret)
goto out_clean_pr;
}
- for (i = def_qps; i < def_qps + add_tx_qps; i++) {
+ for (i = def_qps; i < def_qps; i++) {
ret = ehea_init_port_res(port, &port->port_res[i],
&pr_cfg_small_rx, i);
if (ret)
@@ -2495,7 +2482,7 @@ static int ehea_clean_all_portres(struct ehea_port *port)
int ret = 0;
int i;
- for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++)
+ for (i = 0; i < port->num_def_qps; i++)
ret |= ehea_clean_portres(port, &port->port_res[i]);
ret |= ehea_destroy_eq(port->qp_eq);
@@ -2527,8 +2514,7 @@ static int ehea_up(struct net_device *dev)
if (port->state == EHEA_PORT_UP)
return 0;
- ret = ehea_port_res_setup(port, port->num_def_qps,
- port->num_add_tx_qps);
+ ret = ehea_port_res_setup(port, port->num_def_qps);
if (ret) {
netdev_err(dev, "port_res_failed\n");
goto out;
@@ -2547,7 +2533,7 @@ static int ehea_up(struct net_device *dev)
goto out_clean_pr;
}
- for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
+ for (i = 0; i < port->num_def_qps; i++) {
ret = ehea_activate_qp(port->adapter, port->port_res[i].qp);
if (ret) {
netdev_err(dev, "activate_qp failed\n");
@@ -2593,7 +2579,7 @@ static void port_napi_disable(struct ehea_port *port)
{
int i;
- for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++)
+ for (i = 0; i < port->num_def_qps; i++)
napi_disable(&port->port_res[i].napi);
}
@@ -2601,7 +2587,7 @@ static void port_napi_enable(struct ehea_port *port)
{
int i;
- for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++)
+ for (i = 0; i < port->num_def_qps; i++)
napi_enable(&port->port_res[i].napi);
}
@@ -2689,7 +2675,7 @@ static void ehea_flush_sq(struct ehea_port *port)
{
int i;
- for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
+ for (i = 0; i < port->num_def_qps; i++) {
struct ehea_port_res *pr = &port->port_res[i];
int swqe_max = pr->sq_skba_size - 2 - pr->swqe_ll_count;
int ret;
@@ -2723,7 +2709,7 @@ int ehea_stop_qps(struct net_device *dev)
goto out;
}
- for (i = 0; i < (port->num_def_qps + port->num_add_tx_qps); i++) {
+ for (i = 0; i < (port->num_def_qps); i++) {
struct ehea_port_res *pr = &port->port_res[i];
struct ehea_qp *qp = pr->qp;
@@ -2825,7 +2811,7 @@ int ehea_restart_qps(struct net_device *dev)
goto out;
}
- for (i = 0; i < (port->num_def_qps + port->num_add_tx_qps); i++) {
+ for (i = 0; i < (port->num_def_qps); i++) {
struct ehea_port_res *pr = &port->port_res[i];
struct ehea_qp *qp = pr->qp;
@@ -3184,8 +3170,7 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter,
goto out_free_mc_list;
netif_set_real_num_rx_queues(dev, port->num_def_qps);
- netif_set_real_num_tx_queues(dev, port->num_def_qps +
- port->num_add_tx_qps);
+ netif_set_real_num_tx_queues(dev, port->num_def_qps);
port_dev = ehea_register_port(port, dn);
if (!port_dev)
--
1.7.4.4
^ permalink raw reply related
* [PATCH 06/15] ehea: Add vlan_features
From: Thadeu Lima de Souza Cascardo @ 2011-10-14 15:31 UTC (permalink / raw)
To: netdev; +Cc: Anton Blanchard, Thadeu Lima de Souza Cascardo
In-Reply-To: <1318606272-27647-1-git-send-email-cascardo@linux.vnet.ibm.com>
From: Anton Blanchard <anton@samba.org>
We weren't enabling any VLAN features so we missed out on checksum
offload and TSO when using VLANs. Enable them.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
---
drivers/net/ethernet/ibm/ehea/ehea_main.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
index 0cb3a9b..1321809 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -3190,6 +3190,8 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter,
| NETIF_F_HIGHDMA | NETIF_F_IP_CSUM | NETIF_F_HW_VLAN_TX
| NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER
| NETIF_F_RXCSUM;
+ dev->vlan_features = NETIF_F_SG | NETIF_F_TSO | NETIF_F_HIGHDMA |
+ NETIF_F_IP_CSUM;
dev->watchdog_timeo = EHEA_WATCH_DOG_TIMEOUT;
if (use_lro)
--
1.7.4.4
^ permalink raw reply related
* [PATCH 07/15] ehea: Allocate large enough skbs to avoid partial cacheline DMA writes
From: Thadeu Lima de Souza Cascardo @ 2011-10-14 15:31 UTC (permalink / raw)
To: netdev; +Cc: Anton Blanchard, Thadeu Lima de Souza Cascardo
In-Reply-To: <1318606272-27647-1-git-send-email-cascardo@linux.vnet.ibm.com>
From: Anton Blanchard <anton@samba.org>
The ehea adapter has a mode where it will avoid partial cacheline DMA
writes on receive by always padding packets to fall on a cacheline
boundary.
Unfortunately we currently aren't allocating enough space for a full
ethernet MTU packet to be rounded up, so this optimisation doesn't hit.
It's unfortunate that the next largest packet size exposed by the
hypervisor interface is 2kB, meaning our skb allocation comes out of a
4kB SLAB. However the performance increase due to this optimisation is
quite large and my TCP stream numbers increase from 900MB to 1000MB/sec.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
---
drivers/net/ethernet/ibm/ehea/ehea.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/ibm/ehea/ehea.h b/drivers/net/ethernet/ibm/ehea/ehea.h
index 8e7c594..7aa47d8 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea.h
+++ b/drivers/net/ethernet/ibm/ehea/ehea.h
@@ -82,7 +82,7 @@
#define EHEA_SG_RQ3 0
#define EHEA_MAX_PACKET_SIZE 9022 /* for jumbo frames */
-#define EHEA_RQ2_PKT_SIZE 1522
+#define EHEA_RQ2_PKT_SIZE 2048
#define EHEA_L_PKT_SIZE 256 /* low latency */
#define MAX_LRO_DESCRIPTORS 8
@@ -93,7 +93,7 @@
#define EHEA_PD_ID 0xaabcdeff
#define EHEA_RQ2_THRESHOLD 1
-#define EHEA_RQ3_THRESHOLD 9 /* use RQ3 threshold of 1522 bytes */
+#define EHEA_RQ3_THRESHOLD 4 /* use RQ3 threshold of 2048 bytes */
#define EHEA_SPEED_10G 10000
#define EHEA_SPEED_1G 1000
--
1.7.4.4
^ permalink raw reply related
* [PATCH 09/15] ehea: Merge swqe2 TSO and non TSO paths
From: Thadeu Lima de Souza Cascardo @ 2011-10-14 15:31 UTC (permalink / raw)
To: netdev; +Cc: Anton Blanchard, Thadeu Lima de Souza Cascardo
In-Reply-To: <1318606272-27647-1-git-send-email-cascardo@linux.vnet.ibm.com>
From: Anton Blanchard <anton@samba.org>
write_swqe2_TSO and write_swqe2_nonTSO are almost identical.
For TSO we have to set the TSO and mss bits in the wqe and we only
put the header in the immediate area, no data. Collapse both
functions into write_swqe2_immediate.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
---
drivers/net/ethernet/ibm/ehea/ehea_main.c | 76 ++++++++---------------------
1 files changed, 21 insertions(+), 55 deletions(-)
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
index 77aafba..0fc0ae8 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -1676,65 +1676,35 @@ static int ehea_clean_portres(struct ehea_port *port, struct ehea_port_res *pr)
return ret;
}
-static void write_swqe2_TSO(struct sk_buff *skb,
- struct ehea_swqe *swqe, u32 lkey)
-{
- struct ehea_vsgentry *sg1entry = &swqe->u.immdata_desc.sg_entry;
- u8 *imm_data = &swqe->u.immdata_desc.immediate_data[0];
- int skb_data_size = skb_headlen(skb);
- int headersize;
-
- /* Packet is TCP with TSO enabled */
- swqe->tx_control |= EHEA_SWQE_TSO;
- swqe->mss = skb_shinfo(skb)->gso_size;
- /* copy only eth/ip/tcp headers to immediate data and
- * the rest of skb->data to sg1entry
- */
- headersize = ETH_HLEN + ip_hdrlen(skb) + tcp_hdrlen(skb);
-
- skb_data_size = skb_headlen(skb);
-
- if (skb_data_size >= headersize) {
- /* copy immediate data */
- skb_copy_from_linear_data(skb, imm_data, headersize);
- swqe->immediate_data_length = headersize;
-
- if (skb_data_size > headersize) {
- /* set sg1entry data */
- sg1entry->l_key = lkey;
- sg1entry->len = skb_data_size - headersize;
- sg1entry->vaddr =
- ehea_map_vaddr(skb->data + headersize);
- swqe->descriptors++;
- }
- } else
- pr_err("cannot handle fragmented headers\n");
-}
-
-static void write_swqe2_nonTSO(struct sk_buff *skb,
- struct ehea_swqe *swqe, u32 lkey)
+static void write_swqe2_immediate(struct sk_buff *skb, struct ehea_swqe *swqe,
+ u32 lkey)
{
int skb_data_size = skb_headlen(skb);
u8 *imm_data = &swqe->u.immdata_desc.immediate_data[0];
struct ehea_vsgentry *sg1entry = &swqe->u.immdata_desc.sg_entry;
+ unsigned int immediate_len = SWQE2_MAX_IMM;
+
+ swqe->descriptors = 0;
- /* Packet is any nonTSO type
- *
- * Copy as much as possible skb->data to immediate data and
- * the rest to sg1entry
- */
- if (skb_data_size >= SWQE2_MAX_IMM) {
- /* copy immediate data */
- skb_copy_from_linear_data(skb, imm_data, SWQE2_MAX_IMM);
+ if (skb_is_gso(skb)) {
+ swqe->tx_control |= EHEA_SWQE_TSO;
+ swqe->mss = skb_shinfo(skb)->gso_size;
+ /*
+ * For TSO packets we only copy the headers into the
+ * immediate area.
+ */
+ immediate_len = ETH_HLEN + ip_hdrlen(skb) + tcp_hdrlen(skb);
+ }
- swqe->immediate_data_length = SWQE2_MAX_IMM;
+ if (skb_is_gso(skb) || skb_data_size >= SWQE2_MAX_IMM) {
+ skb_copy_from_linear_data(skb, imm_data, immediate_len);
+ swqe->immediate_data_length = immediate_len;
- if (skb_data_size > SWQE2_MAX_IMM) {
- /* copy sg1entry data */
+ if (skb_data_size > immediate_len) {
sg1entry->l_key = lkey;
- sg1entry->len = skb_data_size - SWQE2_MAX_IMM;
+ sg1entry->len = skb_data_size - immediate_len;
sg1entry->vaddr =
- ehea_map_vaddr(skb->data + SWQE2_MAX_IMM);
+ ehea_map_vaddr(skb->data + immediate_len);
swqe->descriptors++;
}
} else {
@@ -1753,13 +1723,9 @@ static inline void write_swqe2_data(struct sk_buff *skb, struct net_device *dev,
nfrags = skb_shinfo(skb)->nr_frags;
sg1entry = &swqe->u.immdata_desc.sg_entry;
sg_list = (struct ehea_vsgentry *)&swqe->u.immdata_desc.sg_list;
- swqe->descriptors = 0;
sg1entry_contains_frag_data = 0;
- if (skb_is_gso(skb))
- write_swqe2_TSO(skb, swqe, lkey);
- else
- write_swqe2_nonTSO(skb, swqe, lkey);
+ write_swqe2_immediate(skb, swqe, lkey);
/* write descriptors */
if (nfrags > 0) {
--
1.7.4.4
^ permalink raw reply related
* [PATCH 14/15] ehea: Add GRO support
From: Thadeu Lima de Souza Cascardo @ 2011-10-14 15:31 UTC (permalink / raw)
To: netdev; +Cc: Anton Blanchard, Thadeu Lima de Souza Cascardo
In-Reply-To: <1318606272-27647-1-git-send-email-cascardo@linux.vnet.ibm.com>
From: Anton Blanchard <anton@samba.org>
Add GRO support to the ehea driver.
v3:
[cascardo] no need to enable GRO, since it's enabled by default
[cascardo] vgrp was removed in the vlan cleanup
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
---
drivers/net/ethernet/ibm/ehea/ehea_main.c | 15 +++++----------
1 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
index 3b8e657..bfd08b2 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -647,15 +647,6 @@ static int ehea_treat_poll_error(struct ehea_port_res *pr, int rq,
return 0;
}
-static void ehea_proc_skb(struct ehea_port_res *pr, struct ehea_cqe *cqe,
- struct sk_buff *skb)
-{
- if (cqe->status & EHEA_CQE_VLAN_TAG_XTRACT)
- __vlan_hwaccel_put_tag(skb, cqe->vlan_tag);
-
- netif_receive_skb(skb);
-}
-
static int ehea_proc_rwqes(struct net_device *dev,
struct ehea_port_res *pr,
int budget)
@@ -732,7 +723,11 @@ static int ehea_proc_rwqes(struct net_device *dev,
}
processed_bytes += skb->len;
- ehea_proc_skb(pr, cqe, skb);
+
+ if (cqe->status & EHEA_CQE_VLAN_TAG_XTRACT)
+ __vlan_hwaccel_put_tag(skb, cqe->vlan_tag);
+
+ napi_gro_receive(&pr->napi, skb);
} else {
pr->p_stats.poll_receive_errors++;
port_reset = ehea_treat_poll_error(pr, rq, cqe,
--
1.7.4.4
^ permalink raw reply related
* [PATCH 13/15] ehea: Remove LRO support
From: Thadeu Lima de Souza Cascardo @ 2011-10-14 15:31 UTC (permalink / raw)
To: netdev; +Cc: Anton Blanchard, Thadeu Lima de Souza Cascardo
In-Reply-To: <1318606272-27647-1-git-send-email-cascardo@linux.vnet.ibm.com>
From: Anton Blanchard <anton@samba.org>
In preparation for adding GRO to ehea, remove LRO.
v3:
[cascardo] fixed conflict with vlan cleanup
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
---
drivers/net/ethernet/ibm/ehea/ehea.h | 7 ---
drivers/net/ethernet/ibm/ehea/ehea_ethtool.c | 16 -------
drivers/net/ethernet/ibm/ehea/ehea_main.c | 61 +-------------------------
3 files changed, 1 insertions(+), 83 deletions(-)
diff --git a/drivers/net/ethernet/ibm/ehea/ehea.h b/drivers/net/ethernet/ibm/ehea/ehea.h
index c9dbe52..410d6a1 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea.h
+++ b/drivers/net/ethernet/ibm/ehea/ehea.h
@@ -33,7 +33,6 @@
#include <linux/ethtool.h>
#include <linux/vmalloc.h>
#include <linux/if_vlan.h>
-#include <linux/inet_lro.h>
#include <asm/ibmebus.h>
#include <asm/abs_addr.h>
@@ -58,7 +57,6 @@
#define EHEA_MIN_ENTRIES_QP 127
#define EHEA_SMALL_QUEUES
-#define EHEA_LRO_MAX_AGGR 64
#ifdef EHEA_SMALL_QUEUES
#define EHEA_MAX_CQE_COUNT 1023
@@ -85,8 +83,6 @@
#define EHEA_RQ2_PKT_SIZE 2048
#define EHEA_L_PKT_SIZE 256 /* low latency */
-#define MAX_LRO_DESCRIPTORS 8
-
/* Send completion signaling */
/* Protection Domain Identifier */
@@ -382,8 +378,6 @@ struct ehea_port_res {
u64 tx_bytes;
u64 rx_packets;
u64 rx_bytes;
- struct net_lro_mgr lro_mgr;
- struct net_lro_desc lro_desc[MAX_LRO_DESCRIPTORS];
int sq_restart_flag;
};
@@ -468,7 +462,6 @@ struct ehea_port {
u32 msg_enable;
u32 sig_comp_iv;
u32 state;
- u32 lro_max_aggr;
u8 phy_link;
u8 full_duplex;
u8 autoneg;
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_ethtool.c b/drivers/net/ethernet/ibm/ehea/ehea_ethtool.c
index d185016..05b7359 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_ethtool.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_ethtool.c
@@ -205,9 +205,6 @@ static const char ehea_ethtool_stats_keys[][ETH_GSTRING_LEN] = {
{"PR13 free_swqes"},
{"PR14 free_swqes"},
{"PR15 free_swqes"},
- {"LRO aggregated"},
- {"LRO flushed"},
- {"LRO no_desc"},
};
static void ehea_get_strings(struct net_device *dev, u32 stringset, u8 *data)
@@ -264,19 +261,6 @@ static void ehea_get_ethtool_stats(struct net_device *dev,
for (k = 0; k < 16; k++)
data[i++] = atomic_read(&port->port_res[k].swqe_avail);
-
- for (k = 0, tmp = 0; k < EHEA_MAX_PORT_RES; k++)
- tmp |= port->port_res[k].lro_mgr.stats.aggregated;
- data[i++] = tmp;
-
- for (k = 0, tmp = 0; k < EHEA_MAX_PORT_RES; k++)
- tmp |= port->port_res[k].lro_mgr.stats.flushed;
- data[i++] = tmp;
-
- for (k = 0, tmp = 0; k < EHEA_MAX_PORT_RES; k++)
- tmp |= port->port_res[k].lro_mgr.stats.no_desc;
- data[i++] = tmp;
-
}
const struct ethtool_ops ehea_ethtool_ops = {
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
index a0a3c5f..3b8e657 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -62,8 +62,6 @@ static int rq2_entries = EHEA_DEF_ENTRIES_RQ2;
static int rq3_entries = EHEA_DEF_ENTRIES_RQ3;
static int sq_entries = EHEA_DEF_ENTRIES_SQ;
static int use_mcs = 1;
-static int use_lro;
-static int lro_max_aggr = EHEA_LRO_MAX_AGGR;
static int prop_carrier_state;
module_param(msg_level, int, 0);
@@ -73,8 +71,6 @@ module_param(rq3_entries, int, 0);
module_param(sq_entries, int, 0);
module_param(prop_carrier_state, int, 0);
module_param(use_mcs, int, 0);
-module_param(use_lro, int, 0);
-module_param(lro_max_aggr, int, 0);
MODULE_PARM_DESC(msg_level, "msg_level");
MODULE_PARM_DESC(prop_carrier_state, "Propagate carrier state of physical "
@@ -94,11 +90,6 @@ MODULE_PARM_DESC(sq_entries, " Number of entries for the Send Queue "
MODULE_PARM_DESC(use_mcs, " Multiple receive queues, 1: enable, 0: disable, "
"Default = 1");
-MODULE_PARM_DESC(lro_max_aggr, " LRO: Max packets to be aggregated. Default = "
- __MODULE_STRING(EHEA_LRO_MAX_AGGR));
-MODULE_PARM_DESC(use_lro, " Large Receive Offload, 1: enable, 0: disable, "
- "Default = 0");
-
static int port_name_cnt;
static LIST_HEAD(adapter_list);
static unsigned long ehea_driver_flags;
@@ -656,47 +647,13 @@ static int ehea_treat_poll_error(struct ehea_port_res *pr, int rq,
return 0;
}
-static int get_skb_hdr(struct sk_buff *skb, void **iphdr,
- void **tcph, u64 *hdr_flags, void *priv)
-{
- struct ehea_cqe *cqe = priv;
- unsigned int ip_len;
- struct iphdr *iph;
-
- /* non tcp/udp packets */
- if (!cqe->header_length)
- return -1;
-
- /* non tcp packet */
- skb_reset_network_header(skb);
- iph = ip_hdr(skb);
- if (iph->protocol != IPPROTO_TCP)
- return -1;
-
- ip_len = ip_hdrlen(skb);
- skb_set_transport_header(skb, ip_len);
- *tcph = tcp_hdr(skb);
-
- /* check if ip header and tcp header are complete */
- if (ntohs(iph->tot_len) < ip_len + tcp_hdrlen(skb))
- return -1;
-
- *hdr_flags = LRO_IPV4 | LRO_TCP;
- *iphdr = iph;
-
- return 0;
-}
-
static void ehea_proc_skb(struct ehea_port_res *pr, struct ehea_cqe *cqe,
struct sk_buff *skb)
{
if (cqe->status & EHEA_CQE_VLAN_TAG_XTRACT)
__vlan_hwaccel_put_tag(skb, cqe->vlan_tag);
- if (skb->dev->features & NETIF_F_LRO)
- lro_receive_skb(&pr->lro_mgr, skb, cqe);
- else
- netif_receive_skb(skb);
+ netif_receive_skb(skb);
}
static int ehea_proc_rwqes(struct net_device *dev,
@@ -786,8 +743,6 @@ static int ehea_proc_rwqes(struct net_device *dev,
}
cqe = ehea_poll_rq1(qp, &wqe_index);
}
- if (dev->features & NETIF_F_LRO)
- lro_flush_all(&pr->lro_mgr);
pr->rx_packets += processed;
pr->rx_bytes += processed_bytes;
@@ -1611,15 +1566,6 @@ static int ehea_init_port_res(struct ehea_port *port, struct ehea_port_res *pr,
netif_napi_add(pr->port->netdev, &pr->napi, ehea_poll, 64);
- pr->lro_mgr.max_aggr = pr->port->lro_max_aggr;
- pr->lro_mgr.max_desc = MAX_LRO_DESCRIPTORS;
- pr->lro_mgr.lro_arr = pr->lro_desc;
- pr->lro_mgr.get_skb_header = get_skb_hdr;
- pr->lro_mgr.features = LRO_F_NAPI | LRO_F_EXTRACT_VLAN_ID;
- pr->lro_mgr.dev = port->netdev;
- pr->lro_mgr.ip_summed = CHECKSUM_UNNECESSARY;
- pr->lro_mgr.ip_summed_aggr = CHECKSUM_UNNECESSARY;
-
ret = 0;
goto out;
@@ -3082,9 +3028,6 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter,
NETIF_F_IP_CSUM;
dev->watchdog_timeo = EHEA_WATCH_DOG_TIMEOUT;
- if (use_lro)
- dev->features |= NETIF_F_LRO;
-
INIT_WORK(&port->reset_task, ehea_reset_port);
INIT_DELAYED_WORK(&port->stats_work, ehea_update_stats);
@@ -3098,8 +3041,6 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter,
goto out_unreg_port;
}
- port->lro_max_aggr = lro_max_aggr;
-
ret = ehea_get_jumboframe_status(port, &jumbo);
if (ret)
netdev_err(dev, "failed determining jumbo frame status\n");
--
1.7.4.4
^ permalink raw reply related
* [PATCH 11/15] ehea: Remove some unused definitions
From: Thadeu Lima de Souza Cascardo @ 2011-10-14 15:31 UTC (permalink / raw)
To: netdev; +Cc: Anton Blanchard, Thadeu Lima de Souza Cascardo
In-Reply-To: <1318606272-27647-1-git-send-email-cascardo@linux.vnet.ibm.com>
From: Anton Blanchard <anton@samba.org>
The queue macros are many levels deep and it makes it harder to
work your way through them when many of the versions are unused.
Remove the unused versions.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
---
drivers/net/ethernet/ibm/ehea/ehea_hw.h | 25 -------------------------
1 files changed, 0 insertions(+), 25 deletions(-)
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_hw.h b/drivers/net/ethernet/ibm/ehea/ehea_hw.h
index 567981b..1a2fe4d 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_hw.h
+++ b/drivers/net/ethernet/ibm/ehea/ehea_hw.h
@@ -210,36 +210,11 @@ static inline void epa_store_acc(struct h_epa epa, u32 offset, u64 value)
__raw_writeq(value, (void __iomem *)(epa.addr + offset));
}
-#define epa_store_eq(epa, offset, value)\
- epa_store(epa, EQTEMM_OFFSET(offset), value)
-#define epa_load_eq(epa, offset)\
- epa_load(epa, EQTEMM_OFFSET(offset))
-
#define epa_store_cq(epa, offset, value)\
epa_store(epa, CQTEMM_OFFSET(offset), value)
#define epa_load_cq(epa, offset)\
epa_load(epa, CQTEMM_OFFSET(offset))
-#define epa_store_qp(epa, offset, value)\
- epa_store(epa, QPTEMM_OFFSET(offset), value)
-#define epa_load_qp(epa, offset)\
- epa_load(epa, QPTEMM_OFFSET(offset))
-
-#define epa_store_qped(epa, offset, value)\
- epa_store(epa, QPEDMM_OFFSET(offset), value)
-#define epa_load_qped(epa, offset)\
- epa_load(epa, QPEDMM_OFFSET(offset))
-
-#define epa_store_mrmw(epa, offset, value)\
- epa_store(epa, MRMWMM_OFFSET(offset), value)
-#define epa_load_mrmw(epa, offset)\
- epa_load(epa, MRMWMM_OFFSET(offset))
-
-#define epa_store_base(epa, offset, value)\
- epa_store(epa, HCAGR_OFFSET(offset), value)
-#define epa_load_base(epa, offset)\
- epa_load(epa, HCAGR_OFFSET(offset))
-
static inline void ehea_update_sqa(struct ehea_qp *qp, u16 nr_wqes)
{
struct h_epa epa = qp->epas.kernel;
--
1.7.4.4
^ permalink raw reply related
* [PATCH 15/15] ehea: Remove unused tcp_end field in send WQ
From: Thadeu Lima de Souza Cascardo @ 2011-10-14 15:31 UTC (permalink / raw)
To: netdev; +Cc: Anton Blanchard, Thadeu Lima de Souza Cascardo
In-Reply-To: <1318606272-27647-1-git-send-email-cascardo@linux.vnet.ibm.com>
From: Anton Blanchard <anton@samba.org>
The tcp_end field is not actually used by the hardware, so there
is no need to set it.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
---
drivers/net/ethernet/ibm/ehea/ehea_main.c | 2 --
drivers/net/ethernet/ibm/ehea/ehea_qmr.h | 2 +-
2 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
index bfd08b2..adb462d 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -2001,7 +2001,6 @@ static void xmit_common(struct sk_buff *skb, struct ehea_swqe *swqe)
swqe->tcp_offset = swqe->ip_end + 1 +
offsetof(struct udphdr, check);
- swqe->tcp_end = skb->len - 1;
break;
case IPPROTO_TCP:
@@ -2010,7 +2009,6 @@ static void xmit_common(struct sk_buff *skb, struct ehea_swqe *swqe)
swqe->tcp_offset = swqe->ip_end + 1 +
offsetof(struct tcphdr, check);
- swqe->tcp_end = skb->len - 1;
break;
}
}
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_qmr.h b/drivers/net/ethernet/ibm/ehea/ehea_qmr.h
index fddff8e..337a47e 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_qmr.h
+++ b/drivers/net/ethernet/ibm/ehea/ehea_qmr.h
@@ -107,7 +107,7 @@ struct ehea_swqe {
u8 immediate_data_length;
u8 tcp_offset;
u8 reserved2;
- u16 tcp_end;
+ u16 reserved2b;
u8 wrap_tag;
u8 descriptors; /* number of valid descriptors in WQE */
u16 reserved3;
--
1.7.4.4
^ permalink raw reply related
* [PATCH 12/15] ehea: Add 64bit statistics
From: Thadeu Lima de Souza Cascardo @ 2011-10-14 15:31 UTC (permalink / raw)
To: netdev; +Cc: Anton Blanchard, Thadeu Lima de Souza Cascardo
In-Reply-To: <1318606272-27647-1-git-send-email-cascardo@linux.vnet.ibm.com>
From: Anton Blanchard <anton@samba.org>
Switch to using ndo_get_stats64 to get 64bit statistics.
v3:
[cascardo] use rtnl_link_stats64 as port stats
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
---
drivers/net/ethernet/ibm/ehea/ehea.h | 2 +-
drivers/net/ethernet/ibm/ehea/ehea_main.c | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/ibm/ehea/ehea.h b/drivers/net/ethernet/ibm/ehea/ehea.h
index 7aa47d8..c9dbe52 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea.h
+++ b/drivers/net/ethernet/ibm/ehea/ehea.h
@@ -448,7 +448,7 @@ struct ehea_bcmc_reg_array {
struct ehea_port {
struct ehea_adapter *adapter; /* adapter that owns this port */
struct net_device *netdev;
- struct net_device_stats stats;
+ struct rtnl_link_stats64 stats;
struct ehea_port_res port_res[EHEA_MAX_PORT_RES];
struct platform_device ofdev; /* Open Firmware Device */
struct ehea_mc_list *mc_list; /* Multicast MAC addresses */
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
index 289ad4d..a0a3c5f 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -323,10 +323,10 @@ out:
spin_unlock_irqrestore(&ehea_bcmc_regs.lock, flags);
}
-static struct net_device_stats *ehea_get_stats(struct net_device *dev)
+static struct rtnl_link_stats64 *ehea_get_stats64(struct net_device *dev,
+ struct rtnl_link_stats64 *stats)
{
struct ehea_port *port = netdev_priv(dev);
- struct net_device_stats *stats = &port->stats;
u64 rx_packets = 0, tx_packets = 0, rx_bytes = 0, tx_bytes = 0;
int i;
@@ -353,7 +353,7 @@ static void ehea_update_stats(struct work_struct *work)
struct ehea_port *port =
container_of(work, struct ehea_port, stats_work.work);
struct net_device *dev = port->netdev;
- struct net_device_stats *stats = &port->stats;
+ struct rtnl_link_stats64 *stats = &port->stats;
struct hcp_ehea_port_cb2 *cb2;
u64 hret;
@@ -3004,7 +3004,7 @@ static const struct net_device_ops ehea_netdev_ops = {
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = ehea_netpoll,
#endif
- .ndo_get_stats = ehea_get_stats,
+ .ndo_get_stats64 = ehea_get_stats64,
.ndo_set_mac_address = ehea_set_mac_addr,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_rx_mode = ehea_set_multicast_list,
--
1.7.4.4
^ permalink raw reply related
* [PATCH 05/15] ehea: Dont check NETIF_F_TSO in TX path
From: Thadeu Lima de Souza Cascardo @ 2011-10-14 15:31 UTC (permalink / raw)
To: netdev; +Cc: Anton Blanchard, Thadeu Lima de Souza Cascardo
In-Reply-To: <1318606272-27647-1-git-send-email-cascardo@linux.vnet.ibm.com>
From: Anton Blanchard <anton@samba.org>
It seems like the ehea xmit routine and an ethtool change of TSO
mode could race, resulting in corrupt packets. Checking gso_size
is enough and we can use the helper function.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
---
drivers/net/ethernet/ibm/ehea/ehea_main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
index 6ded42a..0cb3a9b 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -1787,7 +1787,7 @@ static inline void write_swqe2_data(struct sk_buff *skb, struct net_device *dev,
swqe->descriptors = 0;
sg1entry_contains_frag_data = 0;
- if ((dev->features & NETIF_F_TSO) && skb_shinfo(skb)->gso_size)
+ if (skb_is_gso(skb))
write_swqe2_TSO(skb, swqe, lkey);
else
write_swqe2_nonTSO(skb, swqe, lkey);
--
1.7.4.4
^ permalink raw reply related
* [PATCH 08/15] ehea: Simplify ehea_xmit2 and ehea_xmit3
From: Thadeu Lima de Souza Cascardo @ 2011-10-14 15:31 UTC (permalink / raw)
To: netdev; +Cc: Anton Blanchard, Thadeu Lima de Souza Cascardo
In-Reply-To: <1318606272-27647-1-git-send-email-cascardo@linux.vnet.ibm.com>
From: Anton Blanchard <anton@samba.org>
Based on a patch from Michael Ellerman, clean up a significant
portion of the transmit path. There was a lot of duplication here.
Even worse, we were always checksumming tx packets and ignoring the
skb->ip_summed field.
Also remove NETIF_F_FRAGLIST from dev->features, I'm not sure why
it was enabled.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
---
drivers/net/ethernet/ibm/ehea/ehea_main.c | 137 ++++++++---------------------
1 files changed, 36 insertions(+), 101 deletions(-)
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
index 1321809..77aafba 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -1676,37 +1676,6 @@ static int ehea_clean_portres(struct ehea_port *port, struct ehea_port_res *pr)
return ret;
}
-/*
- * The write_* functions store information in swqe which is used by
- * the hardware to calculate the ip/tcp/udp checksum
- */
-
-static inline void write_ip_start_end(struct ehea_swqe *swqe,
- const struct sk_buff *skb)
-{
- swqe->ip_start = skb_network_offset(skb);
- swqe->ip_end = (u8)(swqe->ip_start + ip_hdrlen(skb) - 1);
-}
-
-static inline void write_tcp_offset_end(struct ehea_swqe *swqe,
- const struct sk_buff *skb)
-{
- swqe->tcp_offset =
- (u8)(swqe->ip_end + 1 + offsetof(struct tcphdr, check));
-
- swqe->tcp_end = (u16)skb->len - 1;
-}
-
-static inline void write_udp_offset_end(struct ehea_swqe *swqe,
- const struct sk_buff *skb)
-{
- swqe->tcp_offset =
- (u8)(swqe->ip_end + 1 + offsetof(struct udphdr, check));
-
- swqe->tcp_end = (u16)skb->len - 1;
-}
-
-
static void write_swqe2_TSO(struct sk_buff *skb,
struct ehea_swqe *swqe, u32 lkey)
{
@@ -2105,41 +2074,46 @@ static int ehea_change_mtu(struct net_device *dev, int new_mtu)
return 0;
}
-static void ehea_xmit2(struct sk_buff *skb, struct net_device *dev,
- struct ehea_swqe *swqe, u32 lkey)
+static void xmit_common(struct sk_buff *skb, struct ehea_swqe *swqe)
{
- if (skb->protocol == htons(ETH_P_IP)) {
- const struct iphdr *iph = ip_hdr(skb);
+ swqe->tx_control |= EHEA_SWQE_IMM_DATA_PRESENT | EHEA_SWQE_CRC;
- /* IPv4 */
- swqe->tx_control |= EHEA_SWQE_CRC
- | EHEA_SWQE_IP_CHECKSUM
- | EHEA_SWQE_TCP_CHECKSUM
- | EHEA_SWQE_IMM_DATA_PRESENT
- | EHEA_SWQE_DESCRIPTORS_PRESENT;
+ if (skb->protocol != htons(ETH_P_IP))
+ return;
- write_ip_start_end(swqe, skb);
+ if (skb->ip_summed == CHECKSUM_PARTIAL)
+ swqe->tx_control |= EHEA_SWQE_IP_CHECKSUM;
- if (iph->protocol == IPPROTO_UDP) {
- if ((iph->frag_off & IP_MF) ||
- (iph->frag_off & IP_OFFSET))
- /* IP fragment, so don't change cs */
- swqe->tx_control &= ~EHEA_SWQE_TCP_CHECKSUM;
- else
- write_udp_offset_end(swqe, skb);
- } else if (iph->protocol == IPPROTO_TCP) {
- write_tcp_offset_end(swqe, skb);
- }
+ swqe->ip_start = skb_network_offset(skb);
+ swqe->ip_end = swqe->ip_start + ip_hdrlen(skb) - 1;
- /* icmp (big data) and ip segmentation packets (all other ip
- packets) do not require any special handling */
+ switch (ip_hdr(skb)->protocol) {
+ case IPPROTO_UDP:
+ if (skb->ip_summed == CHECKSUM_PARTIAL)
+ swqe->tx_control |= EHEA_SWQE_TCP_CHECKSUM;
- } else {
- /* Other Ethernet Protocol */
- swqe->tx_control |= EHEA_SWQE_CRC
- | EHEA_SWQE_IMM_DATA_PRESENT
- | EHEA_SWQE_DESCRIPTORS_PRESENT;
+ swqe->tcp_offset = swqe->ip_end + 1 +
+ offsetof(struct udphdr, check);
+ swqe->tcp_end = skb->len - 1;
+ break;
+
+ case IPPROTO_TCP:
+ if (skb->ip_summed == CHECKSUM_PARTIAL)
+ swqe->tx_control |= EHEA_SWQE_TCP_CHECKSUM;
+
+ swqe->tcp_offset = swqe->ip_end + 1 +
+ offsetof(struct tcphdr, check);
+ swqe->tcp_end = skb->len - 1;
+ break;
}
+}
+
+static void ehea_xmit2(struct sk_buff *skb, struct net_device *dev,
+ struct ehea_swqe *swqe, u32 lkey)
+{
+ swqe->tx_control |= EHEA_SWQE_DESCRIPTORS_PRESENT;
+
+ xmit_common(skb, swqe);
write_swqe2_data(skb, dev, swqe, lkey);
}
@@ -2152,51 +2126,11 @@ static void ehea_xmit3(struct sk_buff *skb, struct net_device *dev,
skb_frag_t *frag;
int i;
- if (skb->protocol == htons(ETH_P_IP)) {
- const struct iphdr *iph = ip_hdr(skb);
+ xmit_common(skb, swqe);
- /* IPv4 */
- write_ip_start_end(swqe, skb);
-
- if (iph->protocol == IPPROTO_TCP) {
- swqe->tx_control |= EHEA_SWQE_CRC
- | EHEA_SWQE_IP_CHECKSUM
- | EHEA_SWQE_TCP_CHECKSUM
- | EHEA_SWQE_IMM_DATA_PRESENT;
-
- write_tcp_offset_end(swqe, skb);
-
- } else if (iph->protocol == IPPROTO_UDP) {
- if ((iph->frag_off & IP_MF) ||
- (iph->frag_off & IP_OFFSET))
- /* IP fragment, so don't change cs */
- swqe->tx_control |= EHEA_SWQE_CRC
- | EHEA_SWQE_IMM_DATA_PRESENT;
- else {
- swqe->tx_control |= EHEA_SWQE_CRC
- | EHEA_SWQE_IP_CHECKSUM
- | EHEA_SWQE_TCP_CHECKSUM
- | EHEA_SWQE_IMM_DATA_PRESENT;
-
- write_udp_offset_end(swqe, skb);
- }
- } else {
- /* icmp (big data) and
- ip segmentation packets (all other ip packets) */
- swqe->tx_control |= EHEA_SWQE_CRC
- | EHEA_SWQE_IP_CHECKSUM
- | EHEA_SWQE_IMM_DATA_PRESENT;
- }
- } else {
- /* Other Ethernet Protocol */
- swqe->tx_control |= EHEA_SWQE_CRC | EHEA_SWQE_IMM_DATA_PRESENT;
- }
- /* copy (immediate) data */
if (nfrags == 0) {
- /* data is in a single piece */
skb_copy_from_linear_data(skb, imm_data, skb->len);
} else {
- /* first copy data from the skb->data buffer ... */
skb_copy_from_linear_data(skb, imm_data,
skb_headlen(skb));
imm_data += skb_headlen(skb);
@@ -2208,6 +2142,7 @@ static void ehea_xmit3(struct sk_buff *skb, struct net_device *dev,
imm_data += frag->size;
}
}
+
swqe->immediate_data_length = skb->len;
dev_kfree_skb(skb);
}
@@ -3184,7 +3119,7 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter,
dev->netdev_ops = &ehea_netdev_ops;
ehea_set_ethtool_ops(dev);
- dev->hw_features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_TSO
+ dev->hw_features = NETIF_F_SG | NETIF_F_TSO
| NETIF_F_IP_CSUM | NETIF_F_HW_VLAN_TX | NETIF_F_LRO;
dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_TSO
| NETIF_F_HIGHDMA | NETIF_F_IP_CSUM | NETIF_F_HW_VLAN_TX
--
1.7.4.4
^ permalink raw reply related
* Re: [PATCH net-next] bnx2x: Disable LRO on FCoE or iSCSI boot device
From: Rick Jones @ 2011-10-14 15:31 UTC (permalink / raw)
To: Michael Chan; +Cc: davem, netdev, dmitry, eilong
In-Reply-To: <1318563481-19631-1-git-send-email-mchan@broadcom.com>
On 10/13/2011 08:38 PM, Michael Chan wrote:
> From: Dmitry Kravkov<dmitry@broadcom.com>
>
> For an FCoE or iSCSI boot device, the networking side must stay "up" all
> the time. Otherwise, the FCoE/iSCSI interface driven by bnx2i/bnx2fc
> will be reset and we'll lose the root file system.
>
> If LRO is enabled, scripts that enable IP forwarding or bridging will
> disable LRO and cause the device to be reset. Disabling LRO on these
> boot devices will prevent the reset.
Is this perhaps saying that a bnx2x-driven device being used for FCoE or
iSCSI boot must not permit *any* run-time configuration change which
leads to a NIC reset?
rick jones
^ permalink raw reply
* [PATCH 10/15] ehea: Simplify type 3 transmit routine
From: Thadeu Lima de Souza Cascardo @ 2011-10-14 15:31 UTC (permalink / raw)
To: netdev; +Cc: Anton Blanchard, Thadeu Lima de Souza Cascardo
In-Reply-To: <1318606272-27647-1-git-send-email-cascardo@linux.vnet.ibm.com>
From: Anton Blanchard <anton@samba.org>
If a nonlinear skb fits within the immediate area, use skb_copy_bits
instead of copying the frags by hand.
v3:
[cascardo] fixed conflict with use of skb frag API
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
---
drivers/net/ethernet/ibm/ehea/ehea_main.c | 19 +++----------------
1 files changed, 3 insertions(+), 16 deletions(-)
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
index 0fc0ae8..289ad4d 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -2087,27 +2087,14 @@ static void ehea_xmit2(struct sk_buff *skb, struct net_device *dev,
static void ehea_xmit3(struct sk_buff *skb, struct net_device *dev,
struct ehea_swqe *swqe)
{
- int nfrags = skb_shinfo(skb)->nr_frags;
u8 *imm_data = &swqe->u.immdata_nodesc.immediate_data[0];
- skb_frag_t *frag;
- int i;
xmit_common(skb, swqe);
- if (nfrags == 0) {
+ if (!skb->data_len)
skb_copy_from_linear_data(skb, imm_data, skb->len);
- } else {
- skb_copy_from_linear_data(skb, imm_data,
- skb_headlen(skb));
- imm_data += skb_headlen(skb);
-
- /* ... then copy data from the fragments */
- for (i = 0; i < nfrags; i++) {
- frag = &skb_shinfo(skb)->frags[i];
- memcpy(imm_data, skb_frag_address(frag), frag->size);
- imm_data += frag->size;
- }
- }
+ else
+ skb_copy_bits(skb, 0, imm_data, skb->len);
swqe->immediate_data_length = skb->len;
dev_kfree_skb(skb);
--
1.7.4.4
^ permalink raw reply related
* Re: iwlagn: WARN_ON() in iwl_get_idle_rx_chain_count()
From: wwguy @ 2011-10-14 15:29 UTC (permalink / raw)
To: Michał Mirosław
Cc: Intel Linux Wireless, linux-wireless@vger.kernel.org,
netdev@vger.kernel.org
In-Reply-To: <20111014150219.GA20672@rere.qmqm.pl>
[-- Attachment #1: Type: text/plain, Size: 23360 bytes --]
Hi Michal,
Could you try the attach patch and see if it fix your problem.
Thanks
Wey
On Fri, 2011-10-14 at 08:02 -0700, Michał Mirosław wrote:
> WARN_ON() in iwl_get_idle_rx_chain_count() gets triggered on system shutdown
> when WiFi card is associated to an AP. This is on kernel built from
> Linus' tree, commit 37cf95162af4036b4198756a590aab8126fa2ce4 (3.1.0-rc9+).
> It looks HT-related, I can't reproduce this on 802.11g network.
>
> Best Regards,
> Michał Mirosław
>
>
> 09:00.0 Network controller: Intel Corporation Centrino Wireless-N 1030 (rev 34)
> Subsystem: Intel Corporation Centrino Wireless-N 1030 BGN
> Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
> Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
> Latency: 0, Cache Line Size: 64 bytes
> Interrupt: pin A routed to IRQ 52
> Region 0: Memory at f7a00000 (64-bit, non-prefetchable) [size=8K]
> Capabilities: <access denied>
> Kernel driver in use: iwlagn
>
> Oct 14 00:04:26 oko kernel: [ 2796.354030] ------------[ cut here ]------------
> Oct 14 00:04:26 oko kernel: [ 2796.354996] WARNING: at /usr/src/linux-git/drivers/net/wireless/iwlwifi/iwl-agn-lib.c:1766 iwlagn_set_rxon_chain+0x107/0x1b2 [iwlagn]()
> Oct 14 00:04:26 oko kernel: [ 2796.355955] Hardware name: Vostro 3350
> Oct 14 00:04:26 oko kernel: [ 2796.356906] invalid SMPS mode 0
> Oct 14 00:04:26 oko kernel: [ 2796.356920] Modules linked in: acpi_cpufreq mperf cpufreq_conservative autofs4 rfcomm cpufreq_stats bnep cpufreq_powersave cpufreq_userspace pci_stub binfmt_misc microcode uinput nfs lockd auth_rpcgss nfs_acl sunrpc ext2 coretemp loop kvm_intel kvm aesni_intel cryptd aes_x86_64 aes_generic ecb btusb radeon bluetooth uvcvideo usb_storage videodev arc4 media uas iwlagn v4l2_compat_ioctl32 i915 crc16 snd_hda_codec_idt ttm drm_kms_helper mac80211 drm snd_hda_intel snd_hda_codec ehci_hcd snd_hwdep xhci_hcd snd_pcm snd_seq usbcore joydev sg cfg80211 snd_timer sr_mod snd_seq_device snd r8169 psmouse dell_wmi cdrom dell_laptop soundcore i2c_algo_bit pcspkr evdev sparse_keymap processor snd_page_alloc video cfbcopyarea mii dcdbas button cfbimgblt cfbfillrect wmi ac
battery ext3 jbd mbcache dm_mod sd_mod crc_t10dif ahci libahci libata scsi_mod thermal thermal_sys [last unloaded: vboxdrv]
> Oct 14 00:04:26 oko kernel: [ 2796.365031] Pid: 3017, comm: wpa_supplicant Not tainted 3.1.0-rc9+ #12
> Oct 14 00:04:26 oko kernel: [ 2796.366263] Call Trace:
> Oct 14 00:04:26 oko kernel: [ 2796.367490] [<ffffffff8103437f>] ? warn_slowpath_common+0x78/0x8c
> Oct 14 00:04:26 oko kernel: [ 2796.368673] [<ffffffff8103442b>] ? warn_slowpath_fmt+0x45/0x4a
> Oct 14 00:04:26 oko kernel: [ 2796.369836] [<ffffffffa0310733>] ? __sta_info_destroy+0x267/0x2af [mac80211]
> Oct 14 00:04:26 oko kernel: [ 2796.371046] [<ffffffffa03a93f1>] ? iwlagn_set_rxon_chain+0x107/0x1b2 [iwlagn]
> Oct 14 00:04:26 oko kernel: [ 2796.372274] [<ffffffffa03b2f9e>] ? iwlagn_bss_info_changed+0x245/0x4b3 [iwlagn]
> Oct 14 00:04:26 oko kernel: [ 2796.373753] [<ffffffff8102c1e5>] ? get_parent_ip+0x9/0x1b
> Oct 14 00:04:26 oko kernel: [ 2796.374990] [<ffffffffa031c03a>] ? __ieee80211_recalc_idle+0xef/0x194 [mac80211]
> Oct 14 00:04:26 oko kernel: [ 2796.376272] [<ffffffffa031cbee>] ? ieee80211_recalc_idle+0x1e/0x42 [mac80211]
> Oct 14 00:04:26 oko kernel: [ 2796.377506] [<ffffffffa0319690>] ? ieee80211_mgd_deauth+0x19c/0x1c0 [mac80211]
> Oct 14 00:04:26 oko kernel: [ 2796.378771] [<ffffffff812e96ed>] ? sub_preempt_count+0x83/0x94
> Oct 14 00:04:26 oko kernel: [ 2796.380083] [<ffffffffa01ca76c>] ? __cfg80211_mlme_deauth+0x107/0x116 [cfg80211]
> Oct 14 00:04:26 oko kernel: [ 2796.381293] [<ffffffff812e64d9>] ? schedule_hrtimeout_range_clock+0xc8/0x103
> Oct 14 00:04:26 oko kernel: [ 2796.382550] [<ffffffff8102c1e5>] ? get_parent_ip+0x9/0x1b
> Oct 14 00:04:26 oko kernel: [ 2796.383803] [<ffffffffa01ca7e4>] ? cfg80211_mlme_deauth+0x69/0x82 [cfg80211]
> Oct 14 00:04:26 oko kernel: [ 2796.385039] [<ffffffff81023735>] ? __wake_up_common+0x40/0x77
> Oct 14 00:04:26 oko kernel: [ 2796.386309] [<ffffffffa01c15ed>] ? nl80211_deauthenticate+0xbc/0xc7 [cfg80211]
> Oct 14 00:04:26 oko kernel: [ 2796.387607] [<ffffffffa01c35cb>] ? nl80211_pre_doit+0x85/0xfb [cfg80211]
> Oct 14 00:04:26 oko kernel: [ 2796.389171] [<ffffffff81250f71>] ? genl_rcv_msg+0x1cb/0x1f9
> Oct 14 00:04:26 oko kernel: [ 2796.390753] [<ffffffff81250da6>] ? genl_rcv+0x28/0x28
> Oct 14 00:04:26 oko kernel: [ 2796.392295] [<ffffffff81250a06>] ? netlink_rcv_skb+0x36/0x7a
> Oct 14 00:04:26 oko kernel: [ 2796.393896] [<ffffffff81250d9d>] ? genl_rcv+0x1f/0x28
> Oct 14 00:04:26 oko kernel: [ 2796.395521] [<ffffffff81250537>] ? netlink_unicast+0xe6/0x14e
> Oct 14 00:04:26 oko kernel: [ 2796.397095] [<ffffffff81250819>] ? netlink_sendmsg+0x27a/0x2b2
> Oct 14 00:04:26 oko kernel: [ 2796.398741] [<ffffffff810f45dc>] ? __pollwait+0xce/0xce
> Oct 14 00:04:26 oko kernel: [ 2796.400378] [<ffffffff8122172d>] ? sock_sendmsg+0xc1/0xde
> Oct 14 00:04:26 oko kernel: [ 2796.402042] [<ffffffff8122160e>] ? sock_recvmsg+0xcd/0xec
> Oct 14 00:04:26 oko kernel: [ 2796.403645] [<ffffffff8102c1e5>] ? get_parent_ip+0x9/0x1b
> Oct 14 00:04:26 oko kernel: [ 2796.405148] [<ffffffff8122160e>] ? sock_recvmsg+0xcd/0xec
> Oct 14 00:04:26 oko kernel: [ 2796.406650] [<ffffffff812228d4>] ? move_addr_to_kernel+0x24/0x46
> Oct 14 00:04:26 oko kernel: [ 2796.408098] [<ffffffff812219c5>] ? __sys_sendmsg+0x1e8/0x288
> Oct 14 00:04:26 oko kernel: [ 2796.408102] [<ffffffff812e9798>] ? add_preempt_count+0x9a/0x9c
> Oct 14 00:04:26 oko kernel: [ 2796.408107] [<ffffffff8102c1e5>] ? get_parent_ip+0x9/0x1b
> Oct 14 00:04:26 oko kernel: [ 2796.408109] [<ffffffff812e96ed>] ? sub_preempt_count+0x83/0x94
> Oct 14 00:04:26 oko kernel: [ 2796.408112] [<ffffffff812e6f14>] ? _raw_spin_unlock_irq+0x23/0x2f
> Oct 14 00:04:26 oko kernel: [ 2796.408115] [<ffffffff810022e1>] ? do_signal+0x51d/0x5f3
> Oct 14 00:04:26 oko kernel: [ 2796.408119] [<ffffffff81008f1b>] ? init_fpu+0x72/0x7f
> Oct 14 00:04:26 oko kernel: [ 2796.408122] [<ffffffff8100969f>] ? check_for_xstate+0x1c/0x6f
> Oct 14 00:04:26 oko kernel: [ 2796.408124] [<ffffffff81009966>] ? restore_i387_xstate+0x9e/0x17c
> Oct 14 00:04:26 oko kernel: [ 2796.408128] [<ffffffff81044e92>] ? do_sigaltstack+0xaa/0x13e
> Oct 14 00:04:26 oko kernel: [ 2796.408131] [<ffffffff812233c5>] ? sys_sendmsg+0x39/0x58
> Oct 14 00:04:26 oko kernel: [ 2796.408134] [<ffffffff812ec17b>] ? system_call_fastpath+0x16/0x1b
> Oct 14 00:04:26 oko kernel: [ 2796.408176] ---[ end trace 634279251cfb99d1 ]---
> Oct 14 00:04:26 oko kernel: [ 2796.409026] ------------[ cut here ]------------
> Oct 14 00:04:26 oko kernel: [ 2796.409046] WARNING: at /usr/src/linux-git/drivers/net/wireless/iwlwifi/iwl-agn-lib.c:1766 iwlagn_set_rxon_chain+0x107/0x1b2 [iwlagn]()
> Oct 14 00:04:26 oko kernel: [ 2796.409048] Hardware name: Vostro 3350
> Oct 14 00:04:26 oko kernel: [ 2796.409049] invalid SMPS mode 0
> Oct 14 00:04:26 oko kernel: [ 2796.409050] Modules linked in: acpi_cpufreq mperf cpufreq_conservative autofs4 rfcomm cpufreq_stats bnep cpufreq_powersave cpufreq_userspace pci_stub binfmt_misc microcode uinput nfs lockd auth_rpcgss nfs_acl sunrpc ext2 coretemp loop kvm_intel kvm aesni_intel cryptd aes_x86_64 aes_generic ecb btusb radeon bluetooth uvcvideo usb_storage videodev arc4 media uas iwlagn v4l2_compat_ioctl32 i915 crc16 snd_hda_codec_idt ttm drm_kms_helper mac80211 drm snd_hda_intel snd_hda_codec ehci_hcd snd_hwdep xhci_hcd snd_pcm snd_seq usbcore joydev sg cfg80211 snd_timer sr_mod snd_seq_device snd r8169 psmouse dell_wmi cdrom dell_laptop soundcore i2c_algo_bit pcspkr evdev sparse_keymap processor snd_page_alloc video cfbcopyarea mii dcdbas button cfbimgblt cfbfillrect wmi ac
battery ext3 jbd mbcache dm_mod sd_mod crc_t10dif ahci libahci libata scsi_mod thermal thermal_sys [last unloaded: vboxdrv]
> Oct 14 00:04:26 oko kernel: [ 2796.409109] Pid: 3017, comm: wpa_supplicant Tainted: G W 3.1.0-rc9+ #12
> Oct 14 00:04:26 oko kernel: [ 2796.409110] Call Trace:
> Oct 14 00:04:26 oko kernel: [ 2796.409116] [<ffffffff8103437f>] ? warn_slowpath_common+0x78/0x8c
> Oct 14 00:04:26 oko kernel: [ 2796.409119] [<ffffffff8103442b>] ? warn_slowpath_fmt+0x45/0x4a
> Oct 14 00:04:26 oko kernel: [ 2796.409133] [<ffffffffa03b78e7>] ? iwl_send_cmd+0x1a4/0x303 [iwlagn]
> Oct 14 00:04:26 oko kernel: [ 2796.409140] [<ffffffffa03a93f1>] ? iwlagn_set_rxon_chain+0x107/0x1b2 [iwlagn]
> Oct 14 00:04:26 oko kernel: [ 2796.409145] [<ffffffffa03a276d>] ? iwl_update_chain_flags+0x32/0x58 [iwlagn]
> Oct 14 00:04:26 oko kernel: [ 2796.409156] [<ffffffffa03af7cd>] ? iwl_power_set_mode+0xf4/0x157 [iwlagn]
> Oct 14 00:04:26 oko kernel: [ 2796.409163] [<ffffffffa03af9e0>] ? iwl_power_update_mode+0x1b0/0x1b9 [iwlagn]
> Oct 14 00:04:26 oko kernel: [ 2796.409170] [<ffffffffa03b2cd8>] ? iwlagn_mac_config+0x206/0x287 [iwlagn]
> Oct 14 00:04:26 oko kernel: [ 2796.409185] [<ffffffffa0319690>] ? ieee80211_mgd_deauth+0x19c/0x1c0 [mac80211]
> Oct 14 00:04:26 oko kernel: [ 2796.409188] [<ffffffff812e96ed>] ? sub_preempt_count+0x83/0x94
> Oct 14 00:04:26 oko kernel: [ 2796.409201] [<ffffffffa01ca76c>] ? __cfg80211_mlme_deauth+0x107/0x116 [cfg80211]
> Oct 14 00:04:26 oko kernel: [ 2796.409206] [<ffffffff812e64d9>] ? schedule_hrtimeout_range_clock+0xc8/0x103
> Oct 14 00:04:26 oko kernel: [ 2796.409208] [<ffffffff8102c1e5>] ? get_parent_ip+0x9/0x1b
> Oct 14 00:04:26 oko kernel: [ 2796.409216] [<ffffffffa01ca7e4>] ? cfg80211_mlme_deauth+0x69/0x82 [cfg80211]
> Oct 14 00:04:26 oko kernel: [ 2796.409220] [<ffffffff81023735>] ? __wake_up_common+0x40/0x77
> Oct 14 00:04:26 oko kernel: [ 2796.409228] [<ffffffffa01c15ed>] ? nl80211_deauthenticate+0xbc/0xc7 [cfg80211]
> Oct 14 00:04:26 oko kernel: [ 2796.409238] [<ffffffffa01c35cb>] ? nl80211_pre_doit+0x85/0xfb [cfg80211]
> Oct 14 00:04:26 oko kernel: [ 2796.409244] [<ffffffff81250f71>] ? genl_rcv_msg+0x1cb/0x1f9
> Oct 14 00:04:26 oko kernel: [ 2796.409246] [<ffffffff81250da6>] ? genl_rcv+0x28/0x28
> Oct 14 00:04:26 oko kernel: [ 2796.409249] [<ffffffff81250a06>] ? netlink_rcv_skb+0x36/0x7a
> Oct 14 00:04:26 oko kernel: [ 2796.409251] [<ffffffff81250d9d>] ? genl_rcv+0x1f/0x28
> Oct 14 00:04:26 oko kernel: [ 2796.409253] [<ffffffff81250537>] ? netlink_unicast+0xe6/0x14e
> Oct 14 00:04:26 oko kernel: [ 2796.409256] [<ffffffff81250819>] ? netlink_sendmsg+0x27a/0x2b2
> Oct 14 00:04:26 oko kernel: [ 2796.409262] [<ffffffff810f45dc>] ? __pollwait+0xce/0xce
> Oct 14 00:04:26 oko kernel: [ 2796.409266] [<ffffffff8122172d>] ? sock_sendmsg+0xc1/0xde
> Oct 14 00:04:26 oko kernel: [ 2796.409268] [<ffffffff8122160e>] ? sock_recvmsg+0xcd/0xec
> Oct 14 00:04:26 oko kernel: [ 2796.409271] [<ffffffff8102c1e5>] ? get_parent_ip+0x9/0x1b
> Oct 14 00:04:26 oko kernel: [ 2796.409273] [<ffffffff8122160e>] ? sock_recvmsg+0xcd/0xec
> Oct 14 00:04:26 oko kernel: [ 2796.409276] [<ffffffff812228d4>] ? move_addr_to_kernel+0x24/0x46
> Oct 14 00:04:26 oko kernel: [ 2796.409279] [<ffffffff812219c5>] ? __sys_sendmsg+0x1e8/0x288
> Oct 14 00:04:26 oko kernel: [ 2796.409282] [<ffffffff812e9798>] ? add_preempt_count+0x9a/0x9c
> Oct 14 00:04:26 oko kernel: [ 2796.409284] [<ffffffff8102c1e5>] ? get_parent_ip+0x9/0x1b
> Oct 14 00:04:26 oko kernel: [ 2796.409286] [<ffffffff812e96ed>] ? sub_preempt_count+0x83/0x94
> Oct 14 00:04:26 oko kernel: [ 2796.409289] [<ffffffff812e6f14>] ? _raw_spin_unlock_irq+0x23/0x2f
> Oct 14 00:04:26 oko kernel: [ 2796.409294] [<ffffffff810022e1>] ? do_signal+0x51d/0x5f3
> Oct 14 00:04:26 oko kernel: [ 2796.409297] [<ffffffff81008f1b>] ? init_fpu+0x72/0x7f
> Oct 14 00:04:26 oko kernel: [ 2796.409300] [<ffffffff8100969f>] ? check_for_xstate+0x1c/0x6f
> Oct 14 00:04:26 oko kernel: [ 2796.409303] [<ffffffff81009966>] ? restore_i387_xstate+0x9e/0x17c
> Oct 14 00:04:26 oko kernel: [ 2796.409305] [<ffffffff81044e92>] ? do_sigaltstack+0xaa/0x13e
> Oct 14 00:04:26 oko kernel: [ 2796.409308] [<ffffffff812233c5>] ? sys_sendmsg+0x39/0x58
> Oct 14 00:04:26 oko kernel: [ 2796.409312] [<ffffffff812ec17b>] ? system_call_fastpath+0x16/0x1b
> Oct 14 00:04:26 oko kernel: [ 2796.409314] ---[ end trace 634279251cfb99d2 ]---
> Oct 14 00:04:26 oko kernel: [ 2796.409315] ------------[ cut here ]------------
> Oct 14 00:04:26 oko kernel: [ 2796.409325] WARNING: at /usr/src/linux-git/drivers/net/wireless/iwlwifi/iwl-agn-lib.c:1766 iwlagn_set_rxon_chain+0x107/0x1b2 [iwlagn]()
> Oct 14 00:04:26 oko kernel: [ 2796.409327] Hardware name: Vostro 3350
> Oct 14 00:04:26 oko kernel: [ 2796.409328] invalid SMPS mode 0
> Oct 14 00:04:26 oko kernel: [ 2796.409329] Modules linked in: acpi_cpufreq mperf cpufreq_conservative autofs4 rfcomm cpufreq_stats bnep cpufreq_powersave cpufreq_userspace pci_stub binfmt_misc microcode uinput nfs lockd auth_rpcgss nfs_acl sunrpc ext2 coretemp loop kvm_intel kvm aesni_intel cryptd aes_x86_64 aes_generic ecb btusb radeon bluetooth uvcvideo usb_storage videodev arc4 media uas iwlagn v4l2_compat_ioctl32 i915 crc16 snd_hda_codec_idt ttm drm_kms_helper mac80211 drm snd_hda_intel snd_hda_codec ehci_hcd snd_hwdep xhci_hcd snd_pcm snd_seq usbcore joydev sg cfg80211 snd_timer sr_mod snd_seq_device snd r8169 psmouse dell_wmi cdrom dell_laptop soundcore i2c_algo_bit pcspkr evdev sparse_keymap processor snd_page_alloc video cfbcopyarea mii dcdbas button cfbimgblt cfbfillrect wmi ac
battery ext3 jbd mbcache dm_mod sd_mod crc_t10dif ahci libahci libata scsi_mod thermal thermal_sys [last unloaded: vboxdrv]
> Oct 14 00:04:26 oko kernel: [ 2796.409371] Pid: 3017, comm: wpa_supplicant Tainted: G W 3.1.0-rc9+ #12
> Oct 14 00:04:26 oko kernel: [ 2796.409372] Call Trace:
> Oct 14 00:04:26 oko kernel: [ 2796.409381] [<ffffffff8103437f>] ? warn_slowpath_common+0x78/0x8c
> Oct 14 00:04:26 oko kernel: [ 2796.409384] [<ffffffff8103442b>] ? warn_slowpath_fmt+0x45/0x4a
> Oct 14 00:04:26 oko kernel: [ 2796.409392] [<ffffffffa03b78e7>] ? iwl_send_cmd+0x1a4/0x303 [iwlagn]
> Oct 14 00:04:26 oko kernel: [ 2796.409399] [<ffffffffa03a93f1>] ? iwlagn_set_rxon_chain+0x107/0x1b2 [iwlagn]
> Oct 14 00:04:26 oko kernel: [ 2796.409408] [<ffffffffa03a276d>] ? iwl_update_chain_flags+0x32/0x58 [iwlagn]
> Oct 14 00:04:26 oko kernel: [ 2796.409415] [<ffffffffa03af7cd>] ? iwl_power_set_mode+0xf4/0x157 [iwlagn]
> Oct 14 00:04:26 oko kernel: [ 2796.409421] [<ffffffffa03af9e0>] ? iwl_power_update_mode+0x1b0/0x1b9 [iwlagn]
> Oct 14 00:04:26 oko kernel: [ 2796.409429] [<ffffffffa03b2cd8>] ? iwlagn_mac_config+0x206/0x287 [iwlagn]
> Oct 14 00:04:26 oko kernel: [ 2796.409439] [<ffffffffa0319690>] ? ieee80211_mgd_deauth+0x19c/0x1c0 [mac80211]
> Oct 14 00:04:26 oko kernel: [ 2796.409442] [<ffffffff812e96ed>] ? sub_preempt_count+0x83/0x94
> Oct 14 00:04:26 oko kernel: [ 2796.409457] [<ffffffffa01ca76c>] ? __cfg80211_mlme_deauth+0x107/0x116 [cfg80211]
> Oct 14 00:04:26 oko kernel: [ 2796.409460] [<ffffffff812e64d9>] ? schedule_hrtimeout_range_clock+0xc8/0x103
> Oct 14 00:04:26 oko kernel: [ 2796.409463] [<ffffffff8102c1e5>] ? get_parent_ip+0x9/0x1b
> Oct 14 00:04:26 oko kernel: [ 2796.409477] [<ffffffffa01ca7e4>] ? cfg80211_mlme_deauth+0x69/0x82 [cfg80211]
> Oct 14 00:04:26 oko kernel: [ 2796.409479] [<ffffffff81023735>] ? __wake_up_common+0x40/0x77
> Oct 14 00:04:26 oko kernel: [ 2796.409490] [<ffffffffa01c15ed>] ? nl80211_deauthenticate+0xbc/0xc7 [cfg80211]
> Oct 14 00:04:26 oko kernel: [ 2796.409498] [<ffffffffa01c35cb>] ? nl80211_pre_doit+0x85/0xfb [cfg80211]
> Oct 14 00:04:26 oko kernel: [ 2796.409502] [<ffffffff81250f71>] ? genl_rcv_msg+0x1cb/0x1f9
> Oct 14 00:04:26 oko kernel: [ 2796.409505] [<ffffffff81250da6>] ? genl_rcv+0x28/0x28
> Oct 14 00:04:26 oko kernel: [ 2796.409507] [<ffffffff81250a06>] ? netlink_rcv_skb+0x36/0x7a
> Oct 14 00:04:26 oko kernel: [ 2796.409509] [<ffffffff81250d9d>] ? genl_rcv+0x1f/0x28
> Oct 14 00:04:26 oko kernel: [ 2796.409511] [<ffffffff81250537>] ? netlink_unicast+0xe6/0x14e
> Oct 14 00:04:26 oko kernel: [ 2796.409514] [<ffffffff81250819>] ? netlink_sendmsg+0x27a/0x2b2
> Oct 14 00:04:26 oko kernel: [ 2796.409517] [<ffffffff810f45dc>] ? __pollwait+0xce/0xce
> Oct 14 00:04:26 oko kernel: [ 2796.409519] [<ffffffff8122172d>] ? sock_sendmsg+0xc1/0xde
> Oct 14 00:04:26 oko kernel: [ 2796.409521] [<ffffffff8122160e>] ? sock_recvmsg+0xcd/0xec
> Oct 14 00:04:26 oko kernel: [ 2796.409526] [<ffffffff8102c1e5>] ? get_parent_ip+0x9/0x1b
> Oct 14 00:04:26 oko kernel: [ 2796.409529] [<ffffffff8122160e>] ? sock_recvmsg+0xcd/0xec
> Oct 14 00:04:26 oko kernel: [ 2796.409532] [<ffffffff812228d4>] ? move_addr_to_kernel+0x24/0x46
> Oct 14 00:04:26 oko kernel: [ 2796.409534] [<ffffffff812219c5>] ? __sys_sendmsg+0x1e8/0x288
> Oct 14 00:04:26 oko kernel: [ 2796.409537] [<ffffffff812e9798>] ? add_preempt_count+0x9a/0x9c
> Oct 14 00:04:26 oko kernel: [ 2796.409539] [<ffffffff8102c1e5>] ? get_parent_ip+0x9/0x1b
> Oct 14 00:04:26 oko kernel: [ 2796.409542] [<ffffffff812e96ed>] ? sub_preempt_count+0x83/0x94
> Oct 14 00:04:26 oko kernel: [ 2796.409544] [<ffffffff812e6f14>] ? _raw_spin_unlock_irq+0x23/0x2f
> Oct 14 00:04:26 oko kernel: [ 2796.409548] [<ffffffff810022e1>] ? do_signal+0x51d/0x5f3
> Oct 14 00:04:26 oko kernel: [ 2796.409551] [<ffffffff81008f1b>] ? init_fpu+0x72/0x7f
> Oct 14 00:04:26 oko kernel: [ 2796.409554] [<ffffffff8100969f>] ? check_for_xstate+0x1c/0x6f
> Oct 14 00:04:26 oko kernel: [ 2796.409556] [<ffffffff81009966>] ? restore_i387_xstate+0x9e/0x17c
> Oct 14 00:04:26 oko kernel: [ 2796.409559] [<ffffffff81044e92>] ? do_sigaltstack+0xaa/0x13e
> Oct 14 00:04:26 oko kernel: [ 2796.409564] [<ffffffff812233c5>] ? sys_sendmsg+0x39/0x58
> Oct 14 00:04:26 oko kernel: [ 2796.409568] [<ffffffff812ec17b>] ? system_call_fastpath+0x16/0x1b
> Oct 14 00:04:26 oko kernel: [ 2796.409570] ---[ end trace 634279251cfb99d3 ]---
> Oct 14 00:04:26 oko kernel: [ 2796.409586] cfg80211: Calling CRDA for country: PL
> Oct 14 00:04:27 oko kernel: [ 2796.573759] ------------[ cut here ]------------
> Oct 14 00:04:27 oko kernel: [ 2796.575276] WARNING: at /usr/src/linux-git/drivers/net/wireless/iwlwifi/iwl-agn-lib.c:1766 iwlagn_set_rxon_chain+0x107/0x1b2 [iwlagn]()
> Oct 14 00:04:27 oko kernel: [ 2796.576866] Hardware name: Vostro 3350
> Oct 14 00:04:27 oko kernel: [ 2796.578449] invalid SMPS mode 0
> Oct 14 00:04:27 oko kernel: [ 2796.578488] Modules linked in: acpi_cpufreq mperf cpufreq_conservative autofs4 rfcomm cpufreq_stats bnep cpufreq_powersave cpufreq_userspace pci_stub binfmt_misc microcode uinput nfs lockd auth_rpcgss nfs_acl sunrpc ext2 coretemp loop kvm_intel kvm aesni_intel cryptd aes_x86_64 aes_generic ecb btusb radeon bluetooth uvcvideo usb_storage videodev arc4 media uas iwlagn v4l2_compat_ioctl32 i915 crc16 snd_hda_codec_idt ttm drm_kms_helper mac80211 drm snd_hda_intel snd_hda_codec ehci_hcd snd_hwdep xhci_hcd snd_pcm snd_seq usbcore joydev sg cfg80211 snd_timer sr_mod snd_seq_device snd r8169 psmouse dell_wmi cdrom dell_laptop soundcore i2c_algo_bit pcspkr evdev sparse_keymap processor snd_page_alloc video cfbcopyarea mii dcdbas button cfbimgblt cfbfillrect wmi ac
battery ext3 jbd mbcache dm_mod sd_mod crc_t10dif ahci libahci libata scsi_mod thermal thermal_sys [last unloaded: vboxdrv]
> Oct 14 00:04:27 oko kernel: [ 2796.591110] Pid: 2973, comm: NetworkManager Tainted: G W 3.1.0-rc9+ #12
> Oct 14 00:04:27 oko kernel: [ 2796.592295] Call Trace:
> Oct 14 00:04:27 oko kernel: [ 2796.593474] [<ffffffff8103437f>] ? warn_slowpath_common+0x78/0x8c
> Oct 14 00:04:27 oko kernel: [ 2796.594693] [<ffffffff8103442b>] ? warn_slowpath_fmt+0x45/0x4a
> Oct 14 00:04:27 oko kernel: [ 2796.595910] [<ffffffff812e96ed>] ? sub_preempt_count+0x83/0x94
> Oct 14 00:04:27 oko kernel: [ 2796.597087] [<ffffffffa03a93f1>] ? iwlagn_set_rxon_chain+0x107/0x1b2 [iwlagn]
> Oct 14 00:04:27 oko kernel: [ 2796.598296] [<ffffffff812e6f14>] ? _raw_spin_unlock_irq+0x23/0x2f
> Oct 14 00:04:27 oko kernel: [ 2796.599507] [<ffffffffa03adc8c>] ? iwl_teardown_interface+0x4a/0x7e [iwlagn]
> Oct 14 00:04:27 oko kernel: [ 2796.600697] [<ffffffffa03ae569>] ? iwl_mac_remove_interface+0x4e/0x5e [iwlagn]
> Oct 14 00:04:27 oko kernel: [ 2796.601914] [<ffffffffa031c3f3>] ? ieee80211_do_stop+0x314/0x465 [mac80211]
> Oct 14 00:04:27 oko kernel: [ 2796.603133] [<ffffffff81039618>] ? _local_bh_enable_ip.isra.12+0x94/0xa2
> Oct 14 00:04:27 oko kernel: [ 2796.604328] [<ffffffffa031c557>] ? ieee80211_stop+0x13/0x17 [mac80211]
> Oct 14 00:04:27 oko kernel: [ 2796.605523] [<ffffffff8122f754>] ? __dev_close_many+0x7f/0xab
> Oct 14 00:04:27 oko kernel: [ 2796.606752] [<ffffffff8122f7b0>] ? __dev_close+0x30/0x47
> Oct 14 00:04:27 oko kernel: [ 2796.607981] [<ffffffff812e96ed>] ? sub_preempt_count+0x83/0x94
> Oct 14 00:04:27 oko kernel: [ 2796.609179] [<ffffffff81233e6a>] ? __dev_change_flags+0x9d/0x118
> Oct 14 00:04:27 oko kernel: [ 2796.610406] [<ffffffff81233f4b>] ? dev_change_flags+0x12/0x42
> Oct 14 00:04:27 oko kernel: [ 2796.611639] [<ffffffff8123da18>] ? do_setlink+0x287/0x6f8
> Oct 14 00:04:27 oko kernel: [ 2796.612848] [<ffffffff810da6a2>] ? __kmalloc_node_track_caller+0xcb/0x105
> Oct 14 00:04:27 oko kernel: [ 2796.614089] [<ffffffff812263ef>] ? sock_rmalloc+0x2b/0x4b
> Oct 14 00:04:27 oko kernel: [ 2796.615338] [<ffffffff8123e20a>] ? __rtnl_unlock+0xc/0xc
> Oct 14 00:04:27 oko kernel: [ 2796.616549] [<ffffffff8123e0d2>] ? rtnl_setlink+0xc4/0xe6
> Oct 14 00:04:27 oko kernel: [ 2796.617799] [<ffffffff81250a06>] ? netlink_rcv_skb+0x36/0x7a
> Oct 14 00:04:27 oko kernel: [ 2796.619042] [<ffffffff8123d64d>] ? rtnetlink_rcv+0x1f/0x28
> Oct 14 00:04:27 oko kernel: [ 2796.620261] [<ffffffff81250537>] ? netlink_unicast+0xe6/0x14e
> Oct 14 00:04:27 oko kernel: [ 2796.621476] [<ffffffff81250819>] ? netlink_sendmsg+0x27a/0x2b2
> Oct 14 00:04:27 oko kernel: [ 2796.622718] [<ffffffff8122172d>] ? sock_sendmsg+0xc1/0xde
> Oct 14 00:04:27 oko kernel: [ 2796.623961] [<ffffffff8122160e>] ? sock_recvmsg+0xcd/0xec
> Oct 14 00:04:27 oko kernel: [ 2796.625173] [<ffffffff8122172d>] ? sock_sendmsg+0xc1/0xde
> Oct 14 00:04:27 oko kernel: [ 2796.626407] [<ffffffff8116d88c>] ? cpumask_any_but+0x24/0x34
> Oct 14 00:04:27 oko kernel: [ 2796.627641] [<ffffffff812228d4>] ? move_addr_to_kernel+0x24/0x46
> Oct 14 00:04:27 oko kernel: [ 2796.628853] [<ffffffff812219c5>] ? __sys_sendmsg+0x1e8/0x288
> Oct 14 00:04:27 oko kernel: [ 2796.630089] [<ffffffff812df81a>] ? __bad_area_nosemaphore+0x87/0x1f0
> Oct 14 00:04:27 oko kernel: [ 2796.631335] [<ffffffff810e79c6>] ? fget_light+0x85/0x8d
> Oct 14 00:04:27 oko kernel: [ 2796.632537] [<ffffffff812230a0>] ? sys_sendto+0x108/0x137
> Oct 14 00:04:27 oko kernel: [ 2796.633768] [<ffffffff810f6c44>] ? dput+0xe6/0xf3
> Oct 14 00:04:27 oko kernel: [ 2796.634992] [<ffffffff812233c5>] ? sys_sendmsg+0x39/0x58
> Oct 14 00:04:27 oko kernel: [ 2796.636194] [<ffffffff812ec17b>] ? system_call_fastpath+0x16/0x1b
> Oct 14 00:04:27 oko kernel: [ 2796.637398] ---[ end trace 634279251cfb99d4 ]---
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
[-- Attachment #2: 0001-iwlagn-check-for-SMPS-mode.patch --]
[-- Type: text/x-patch, Size: 1549 bytes --]
>From d52f49a327e7bfb4d07b056e16312ffd23477b8e Mon Sep 17 00:00:00 2001
From: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Date: Fri, 14 Oct 2011 08:26:07 -0700
Subject: [PATCH 1/1] iwlagn: check for SMPS mode
Check and report WARN only when its invalid
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
---
drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 1 +
drivers/net/wireless/iwlwifi/iwl-agn-rxon.c | 3 +++
2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index 1a52ed2..6465983 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -827,6 +827,7 @@ static int iwl_get_idle_rx_chain_count(struct iwl_priv *priv, int active_cnt)
case IEEE80211_SMPS_STATIC:
case IEEE80211_SMPS_DYNAMIC:
return IWL_NUM_IDLE_CHAINS_SINGLE;
+ case IEEE80211_SMPS_AUTOMATIC:
case IEEE80211_SMPS_OFF:
return active_cnt;
default:
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
index a580efe..94c7779 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
@@ -541,6 +541,9 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed)
mutex_lock(&priv->shrd->mutex);
+ if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status))
+ goto out;
+
if (unlikely(test_bit(STATUS_SCANNING, &priv->shrd->status))) {
IWL_DEBUG_MAC80211(priv, "leave - scanning\n");
goto out;
--
1.7.0.4
^ permalink raw reply related
* Re: [PATCH net-next] tcp: reduce memory needs of out of order queue
From: Rick Jones @ 2011-10-14 15:50 UTC (permalink / raw)
To: David Miller; +Cc: eric.dumazet, netdev
In-Reply-To: <20111014.034224.1197576516015404466.davem@davemloft.net>
On 10/14/2011 12:42 AM, David Miller wrote:
> No objection from me, although I wish wireless drivers were able to
> size their SKBs more appropriately. I wonder how many problems that
> look like "OMG we gotz da Buffer Bloat, arrr!" are actually due to
> this truesize issue.
I think the buffer bloat folks are looking at latency through transmit
queues - now perhaps some of their latency is really coming from
retransmissions thanks to packets being dropped thanks to overfilling
socket buffers, but I'm pretty sure they are clever enough to look for that.
> I think such large truesize SKBs will cause problems even in non loss
> situations, in that the receive buffer will hit it's limits more
> quickly. I not sure that the receive buffer autotuning is built to
> handle this sort of scenerio as a common occurance.
I believe that may be the case - at least during something like:
netperf -t TCP_RR -H <host> -l 30 -- -b 256 -D
which on an otherwise quiet test setup will report a non-trivial number
of retransmissions - either via looking at netstat -s output, or by
adding local_transport_retrans,remote_transport_retrans to an output
selector for netperf (eg -o
throughput,burst_size,local_transport_retrans,remote_transport_retrans,lss_size_end,rsr_size_end)
(I plan on providing more data after a laptop has gone through some
upgrades)
> You might want to check if this is the actual root cause of your
> problems. If the receive buffer autotuning doesn't expand the receive
> buffer enough to hold two windows worth of these large truesize SKBs,
> that's the real reason why we end up pruning.
>
> We have to decide if these kinds of SKBs are acceptable as a normal
> situation for MSS sized frames. And if they are then it's probably
> a good idea to adjust the receive buffer autotuning code too.
>
> Although I realize it might be difficult, getting rid of these weird
> SKBs in the first place would be ideal.
That means a semi-arbitrary alloc/copy in drivers, even when/if the
wasted space isn't going to be a problem no? That TCP_RR test above
would run "just fine" if the burst size was much smaller, but if there
was an arbitrary allocate/copy it would take a service demand and thus
transaction rate hit.
> It would also be a good idea to put the truesize inaccuracies into
> perspective when selecting how to fix this. It's trying to prevent
> 1 byte packets not accounting for the 256 byte SKB and metadata.
> That kind of case with such a high ratio of wastage is important.
>
> On the other hand, using 2048 bytes for a 1500 byte packet and claiming
> the truesize is 1500 + sizeof(metadata)... that might be an acceptable
> lie to tell :-) This is especially true if it allows an easy solution
> to this wireless problem.
Is the wireless problem strictly a wireless problem? Many of the
drivers where Eric has been fixing the truesize accounting have been
wired devices no?
rick jones
^ permalink raw reply
* Re: [PATCH net-next] bnx2x: Disable LRO on FCoE or iSCSI boot device
From: Michael Chan @ 2011-10-14 15:53 UTC (permalink / raw)
To: 'Rick Jones'
Cc: 'davem@davemloft.net', 'netdev@vger.kernel.org',
Dmitry Kravkov, Eilon Greenstein
In-Reply-To: <4E9855EC.1020509@hp.com>
Rick Jones wrote:
> Is this perhaps saying that a bnx2x-driven device being used for FCoE
> or
> iSCSI boot must not permit *any* run-time configuration change which
> leads to a NIC reset?
>
That is right. Unless you have a multipath configuration with multiple
ports, then you can reset one port at a time.
^ permalink raw reply
* Re: [PATCH net-next] tcp: reduce memory needs of out of order queue
From: Eric Dumazet @ 2011-10-14 16:00 UTC (permalink / raw)
To: Rick Jones; +Cc: David Miller, netdev
In-Reply-To: <4E985A3F.5080103@hp.com>
Le vendredi 14 octobre 2011 à 08:50 -0700, Rick Jones a écrit :
> Is the wireless problem strictly a wireless problem? Many of the
> drivers where Eric has been fixing the truesize accounting have been
> wired devices no?
Yes, but the goal of such fixes it to make bugs happen too with said
wired devices ;)
About WIFI, I get these TCP Collapses on two different machines, one
using drivers/net/wireless/rt2x00 driver
Extract from drivers/net/wireless/rt2x00/rt2x00queue.h
/**
* DOC: Entry frame size
*
* Ralink PCI devices demand the Frame size to be a multiple of 128 bytes,
* for USB devices this restriction does not apply, but the value of
* 2432 makes sense since it is big enough to contain the maximum fragment
* size according to the ieee802.11 specs.
* The aggregation size depends on support from the driver, but should
* be something around 3840 bytes.
*/
#define DATA_FRAME_SIZE 2432
#define MGMT_FRAME_SIZE 256
#define AGGREGATION_SIZE 3840
You understand why we endup using skb->truesize > 4096 buffers
I liked doing the copybreak only if needed, I found the OFO case was
most of the time responsible of the Collapses.
Now we also could do the copybreak for frames queued into regular
receive_queue, if current wmem_alloc is above 25% of rcvbuf space...
^ permalink raw reply
* Re: [PATCH net-next] bnx2x: Disable LRO on FCoE or iSCSI boot device
From: Rick Jones @ 2011-10-14 16:06 UTC (permalink / raw)
To: Michael Chan
Cc: 'davem@davemloft.net', 'netdev@vger.kernel.org',
Dmitry Kravkov, Eilon Greenstein
In-Reply-To: <C27F8246C663564A84BB7AB34397724266D2018303@IRVEXCHCCR01.corp.ad.broadcom.com>
On 10/14/2011 08:53 AM, Michael Chan wrote:
> Rick Jones wrote:
>
>> Is this perhaps saying that a bnx2x-driven device being used for
>> FCoE or iSCSI boot must not permit *any* run-time configuration
>> change which leads to a NIC reset?
>>
>
> That is right. Unless you have a multipath configuration with multiple
> ports, then you can reset one port at a time.
So, should there also be a "cnic_boot_device" check in many of the
"capital letter" ethtool paths?
rick
^ permalink raw reply
* Re: [PATCH net-next] tcp: reduce memory needs of out of order queue
From: Eric Dumazet @ 2011-10-14 16:11 UTC (permalink / raw)
To: Rick Jones; +Cc: David Miller, netdev
In-Reply-To: <1318608052.2223.35.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>
Le vendredi 14 octobre 2011 à 18:00 +0200, Eric Dumazet a écrit :
> Now we also could do the copybreak for frames queued into regular
> receive_queue, if current wmem_alloc is above 25% of rcvbuf space...
I mean rmem_alloc of course...
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index c1653fe..0fe0828 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4426,6 +4426,25 @@ static inline int tcp_try_rmem_schedule(struct sock *sk, unsigned int size)
return 0;
}
+/*
+ * Caller want to reduce memory needs before queueing skb
+ * The (expensive) copy should not be be done in fast path.
+ */
+static struct sk_buff *skb_reduce_truesize(struct sk_buff *skb)
+{
+ if (skb->truesize > 2 * SKB_TRUESIZE(skb->len)) {
+ struct sk_buff *nskb;
+
+ nskb = skb_copy_expand(skb, skb_headroom(skb), 0,
+ GFP_ATOMIC | __GFP_NOWARN);
+ if (nskb) {
+ __kfree_skb(skb);
+ skb = nskb;
+ }
+ }
+ return skb;
+}
+
static void tcp_data_queue(struct sock *sk, struct sk_buff *skb)
{
struct tcphdr *th = tcp_hdr(skb);
@@ -4475,6 +4494,10 @@ queue_and_out:
tcp_try_rmem_schedule(sk, skb->truesize))
goto drop;
+ if (atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf >> 2) {
+ skb = skb_reduce_truesize(skb);
+ th = tcp_hdr(skb);
+ }
skb_set_owner_r(skb, sk);
__skb_queue_tail(&sk->sk_receive_queue, skb);
}
@@ -4553,6 +4576,11 @@ drop:
SOCK_DEBUG(sk, "out of order segment: rcv_next %X seq %X - %X\n",
tp->rcv_nxt, TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq);
+ /* Since this skb might stay on ofo a long time, try to reduce
+ * its truesize (if its too big) to avoid future pruning.
+ * Many drivers allocate large buffers even to hold tiny frames.
+ */
+ skb = skb_reduce_truesize(skb);
skb_set_owner_r(skb, sk);
if (!skb_peek(&tp->out_of_order_queue)) {
^ permalink raw reply related
* Re: [PATCH net-next] bnx2x: Disable LRO on FCoE or iSCSI boot device
From: Michael Chan @ 2011-10-14 16:15 UTC (permalink / raw)
To: 'Rick Jones'
Cc: 'davem@davemloft.net', 'netdev@vger.kernel.org',
Dmitry Kravkov, Eilon Greenstein
In-Reply-To: <4E985DE8.3090308@hp.com>
Rick Jones wrote:
> On 10/14/2011 08:53 AM, Michael Chan wrote:
> > Rick Jones wrote:
> >
> >> Is this perhaps saying that a bnx2x-driven device being used for
> >> FCoE or iSCSI boot must not permit *any* run-time configuration
> >> change which leads to a NIC reset?
> >>
> >
> > That is right. Unless you have a multipath configuration with
> multiple
> > ports, then you can reset one port at a time.
>
> So, should there also be a "cnic_boot_device" check in many of the
> "capital letter" ethtool paths?
>
If the user is doing ethtool configuration changes or device shutdown,
it is more obvious what the consequence will be. The user may also be
careful to do it on a multipath setup.
The reset caused by the auto turn-off of LRO when you enable
ip_forward or bridging will not be obvious to the user. In addition,
all devices with LRO turned on will be reset at the same time so even
multipath will not survive.
^ permalink raw reply
* Re: [PATCH net-next] tcp: reduce memory needs of out of order queue
From: Eric Dumazet @ 2011-10-14 17:33 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <1318579509.2533.110.camel@edumazet-laptop>
Le vendredi 14 octobre 2011 à 10:05 +0200, Eric Dumazet a écrit :
> This patch specifically addresses the OFO problem, trying to lower
> memory usage for machines handling lot of sockets (proxies for example)
Well, thinking a bit more about it is needed, so zap the patch please.
Thanks
^ permalink raw reply
* Re: [PATCH 3/4] net/can: the mailinglist moved to vger.kernel.org
From: David Miller @ 2011-10-14 17:59 UTC (permalink / raw)
To: mkl; +Cc: netdev, linux-can
In-Reply-To: <1318581817-12352-4-git-send-email-mkl@pengutronix.de>
From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Fri, 14 Oct 2011 10:43:36 +0200
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Please, just remove these references from the source files, they
absolutely do not belong there.
The MAINTAINERS file is the place to obtain this kind of information
and automated tools can let you know which MAINTAINERS entry applies
to a particular source file as long as the entry has appropriate file
tags.
Thanks.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox