* [PATCH net-next 12/15] be2net: fix be_suspend/resume/shutdown
From: Ajit Khaparde @ 2011-02-11 23:38 UTC (permalink / raw)
To: netdev, davem
> call pci msix disable in be_suspend
> call pci msix enable in be_resume
> stop worker thread in be_suspend
> start worker thread in be_resume
> stop worker thread in be_shutdown
Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com>
---
drivers/net/benet/be_main.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index 824d420..7e83c06 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -3023,6 +3023,7 @@ static int be_suspend(struct pci_dev *pdev, pm_message_t state)
struct be_adapter *adapter = pci_get_drvdata(pdev);
struct net_device *netdev = adapter->netdev;
+ cancel_delayed_work_sync(&adapter->work);
if (adapter->wol)
be_setup_wol(adapter, true);
@@ -3035,6 +3036,7 @@ static int be_suspend(struct pci_dev *pdev, pm_message_t state)
be_cmd_get_flow_control(adapter, &adapter->tx_fc, &adapter->rx_fc);
be_clear(adapter);
+ be_msix_disable(adapter);
pci_save_state(pdev);
pci_disable_device(pdev);
pci_set_power_state(pdev, pci_choose_state(pdev, state));
@@ -3056,6 +3058,7 @@ static int be_resume(struct pci_dev *pdev)
pci_set_power_state(pdev, 0);
pci_restore_state(pdev);
+ be_msix_enable(adapter);
/* tell fw we're ready to fire cmds */
status = be_cmd_fw_init(adapter);
if (status)
@@ -3071,6 +3074,8 @@ static int be_resume(struct pci_dev *pdev)
if (adapter->wol)
be_setup_wol(adapter, false);
+
+ schedule_delayed_work(&adapter->work, msecs_to_jiffies(100));
return 0;
}
@@ -3082,6 +3087,9 @@ static void be_shutdown(struct pci_dev *pdev)
struct be_adapter *adapter = pci_get_drvdata(pdev);
struct net_device *netdev = adapter->netdev;
+ if (netif_running(netdev))
+ cancel_delayed_work_sync(&adapter->work);
+
netif_device_detach(netdev);
be_cmd_reset_function(adapter);
--
1.7.1
^ permalink raw reply related
* [PATCH net-next 13/15] be2net: gracefully handle situations when UE is detected
From: Ajit Khaparde @ 2011-02-11 23:38 UTC (permalink / raw)
To: netdev, davem
Avoid accessing the hardware when UE is detected.
Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com>
---
drivers/net/benet/be_cmds.c | 15 +++++++++++++++
drivers/net/benet/be_main.c | 1 +
2 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c
index 8fa9a70..619ebc2 100644
--- a/drivers/net/benet/be_cmds.c
+++ b/drivers/net/benet/be_cmds.c
@@ -23,6 +23,12 @@ static void be_mcc_notify(struct be_adapter *adapter)
struct be_queue_info *mccq = &adapter->mcc_obj.q;
u32 val = 0;
+ if (adapter->eeh_err) {
+ dev_info(&adapter->pdev->dev,
+ "Error in Card Detected! Cannot issue commands\n");
+ return;
+ }
+
val |= mccq->id & DB_MCCQ_RING_ID_MASK;
val |= 1 << DB_MCCQ_NUM_POSTED_SHIFT;
@@ -217,6 +223,9 @@ static int be_mcc_wait_compl(struct be_adapter *adapter)
int i, num, status = 0;
struct be_mcc_obj *mcc_obj = &adapter->mcc_obj;
+ if (adapter->eeh_err)
+ return -EIO;
+
for (i = 0; i < mcc_timeout; i++) {
num = be_process_mcc(adapter, &status);
if (num)
@@ -246,6 +255,12 @@ static int be_mbox_db_ready_wait(struct be_adapter *adapter, void __iomem *db)
int msecs = 0;
u32 ready;
+ if (adapter->eeh_err) {
+ dev_err(&adapter->pdev->dev,
+ "Error detected in card.Cannot issue commands\n");
+ return -EIO;
+ }
+
do {
ready = ioread32(db);
if (ready == 0xffffffff) {
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index 7e83c06..1f5e342 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -1827,6 +1827,7 @@ void be_detect_dump_ue(struct be_adapter *adapter)
if (ue_status_lo || ue_status_hi) {
adapter->ue_detected = true;
+ adapter->eeh_err = true;
dev_err(&adapter->pdev->dev, "UE Detected!!\n");
}
--
1.7.1
^ permalink raw reply related
* [PATCH net-next 14/15] be2net: detect a UE even when a interface is down.
From: Ajit Khaparde @ 2011-02-11 23:38 UTC (permalink / raw)
To: netdev, davem
Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com>
---
drivers/net/benet/be_main.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index 1f5e342..aad7ea3 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -1866,6 +1866,10 @@ static void be_worker(struct work_struct *work)
struct be_mcc_obj *mcc_obj = &adapter->mcc_obj;
be_cq_notify(adapter, mcc_obj->cq.id, false, mcc_compl);
}
+
+ if (!adapter->ue_detected && !lancer_chip(adapter))
+ be_detect_dump_ue(adapter);
+
goto reschedule;
}
--
1.7.1
^ permalink raw reply related
* [PATCH net-next 15/15] be2net: restrict WOL to PFs only.
From: Ajit Khaparde @ 2011-02-11 23:39 UTC (permalink / raw)
To: netdev, davem
WOL is not supported for Vrtual Functions.
Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com>
---
drivers/net/benet/be_ethtool.c | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c
index 0c99314..07b4ab9 100644
--- a/drivers/net/benet/be_ethtool.c
+++ b/drivers/net/benet/be_ethtool.c
@@ -516,12 +516,23 @@ be_phys_id(struct net_device *netdev, u32 data)
return status;
}
+static bool
+be_is_wol_supported(struct be_adapter *adapter)
+{
+ if (!be_physfn(adapter))
+ return false;
+ else
+ return true;
+}
+
static void
be_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
{
struct be_adapter *adapter = netdev_priv(netdev);
- wol->supported = WAKE_MAGIC;
+ if (be_is_wol_supported(adapter))
+ wol->supported = WAKE_MAGIC;
+
if (adapter->wol)
wol->wolopts = WAKE_MAGIC;
else
@@ -537,7 +548,7 @@ be_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
if (wol->wolopts & ~WAKE_MAGIC)
return -EINVAL;
- if (wol->wolopts & WAKE_MAGIC)
+ if ((wol->wolopts & WAKE_MAGIC) && be_is_wol_supported(adapter))
adapter->wol = true;
else
adapter->wol = false;
--
1.7.1
^ permalink raw reply related
* [PATCH 0/2] net: RX queue weights
From: Tom Herbert @ 2011-02-12 0:00 UTC (permalink / raw)
To: davem, netdev
This patch series adds support for RX queue weights and implements
this for bnx2x driver. This was motivated primarily by the need to
change number of receive queues after modprobe, and turning this into
a weight attribute was straightforward anyway and may have some
interesting uses.
^ permalink raw reply
* [PATCH 1/2] net: Add RX queue weights
From: Tom Herbert @ 2011-02-12 0:00 UTC (permalink / raw)
To: davem, netdev
This patch adds a weight attribute to the netdev RX queues. This allows
control over the relative receive packet load for each queue. These
values are set in sysfs variable 'weight' in the rxq directory for
a device. When a weight is set, a new netdev operation is called to
inform the driver of the changed weight. The driver is expected to
apply the queue weights in a logical manner to the RSS indirection table
of the device to achieve the desired weighting. The driver
implementation for this is unspecified.
If a weight for a queue is zero, this effectively disables that queue
for RSS (but possibly still usable by accelerated RFS, etc.), except
in the case that all queue weights are zero, then all queues are
considered equally weighted (the default).
Example configuration:
echo 1 > /sys/class/net/eth4/queues/rx-0/weight
echo 1 > /sys/class/net/eth4/queues/rx-1/weight
echo 5 > /sys/class/net/eth4/queues/rx-2/weight
echo 0 > /sys/class/net/eth4/queues/rx-3/weight
So rx queue 0 and 1 have equal weight, queue 2 is 5X in weight and
queue 3 is disabled for RSS.
Signed-off-by: Tom Herbert <therbert@google.com>
---
include/linux/netdevice.h | 29 +++++++++++++++++++++++++++++
net/core/net-sysfs.c | 36 ++++++++++++++++++++++++++++++++++++
2 files changed, 65 insertions(+), 0 deletions(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index c7d7074..9b02bd3 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -624,6 +624,7 @@ struct netdev_rx_queue {
struct rps_dev_flow_table __rcu *rps_flow_table;
struct kobject kobj;
struct net_device *dev;
+ u32 weight;
} ____cacheline_aligned_in_smp;
#endif /* CONFIG_RPS */
@@ -783,6 +784,11 @@ struct netdev_tc_txq {
* Set hardware filter for RFS. rxq_index is the target queue index;
* flow_id is a flow ID to be passed to rps_may_expire_flow() later.
* Return the filter ID on success, or a negative error code.
+ *
+ * void (*ndo_set_rxq_weight)(struct net_device *dev, u16 rxq, u32 weight);
+ * An rx queue weight has been modified. rxq is the queue index whose
+ * weight has changed, weight is the new weight. This is called after
+ * the weight has been updated in the netdev_rx_queue structure.
*/
#define HAVE_NET_DEVICE_OPS
struct net_device_ops {
@@ -862,6 +868,10 @@ struct net_device_ops {
u16 rxq_index,
u32 flow_id);
#endif
+#ifdef CONFIG_RPS
+ void (*ndo_set_rxq_weight)(struct net_device *dev,
+ u16 rxq, u32 weight);
+#endif
};
/*
@@ -1279,6 +1289,25 @@ static inline void netdev_for_each_tx_queue(struct net_device *dev,
f(dev, &dev->_tx[i], arg);
}
+#ifdef CONFIG_RPS
+static inline u16 netdev_rx_queue_to_index(struct netdev_rx_queue *queue)
+{
+ return (u16)(queue - queue->dev->_rx);
+}
+#endif /* CONFIG_RPS */
+
+static inline u32 netdev_rxq_weight(struct net_device *dev, u16 index)
+{
+#ifdef CONFIG_RPS
+ if (index >= dev->real_num_rx_queues)
+ return 0;
+
+ return (dev->_rx + index)->weight;
+#else
+ return 0;
+#endif
+}
+
/*
* Net namespace inlines
*/
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 5ceb257..e1fe54a 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -625,6 +625,41 @@ static ssize_t store_rps_map(struct netdev_rx_queue *queue,
return len;
}
+static ssize_t show_rxq_weight(struct netdev_rx_queue *queue,
+ struct rx_queue_attribute *attribute, char *buf)
+{
+ return sprintf(buf, fmt_dec, queue->weight);
+}
+
+static ssize_t store_rxq_weight(struct netdev_rx_queue *queue,
+ struct rx_queue_attribute *attribute, char *buf)
+{
+ char *endp;
+ u32 new;
+ static DEFINE_MUTEX(weight_mutex);
+ const struct net_device_ops *ops = queue->dev->netdev_ops;
+
+ if (!capable(CAP_NET_ADMIN))
+ return -EPERM;
+
+ new = simple_strtoul(buf, &endp, 0);
+ if (endp == buf)
+ return -EINVAL;
+
+ if (!ops->ndo_set_rxq_weight)
+ return -ENOENT;
+
+ mutex_lock(&weight_mutex);
+ queue->weight = new;
+ ops->ndo_set_rxq_weight(queue->dev,
+ netdev_rx_queue_to_index(queue), new);
+ mutex_unlock(&weight_mutex);
+}
+
+static struct rx_queue_attribute rxq_weight_attribute =
+ __ATTR(weight, S_IRUGO | S_IWUSR,
+ show_rxq_weight, store_rxq_weight);
+
static ssize_t show_rps_dev_flow_table_cnt(struct netdev_rx_queue *queue,
struct rx_queue_attribute *attr,
char *buf)
@@ -715,6 +750,7 @@ static struct rx_queue_attribute rps_dev_flow_table_cnt_attribute =
static struct attribute *rx_queue_default_attrs[] = {
&rps_cpus_attribute.attr,
&rps_dev_flow_table_cnt_attribute.attr,
+ &rxq_weight_attribute.attr,
NULL
};
--
1.7.3.1
^ permalink raw reply related
* [PATCH 2/2] bnx2x: Support for RX queue weights
From: Tom Herbert @ 2011-02-12 0:00 UTC (permalink / raw)
To: davem, eilong, netdev
Apply relative weights to populate the RSS indirection table.
Signed-off-by: Tom Herbert <therbert@google.com>
---
drivers/net/bnx2x/bnx2x_main.c | 76 +++++++++++++++++++++++++++++++++++----
1 files changed, 68 insertions(+), 8 deletions(-)
diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c
index c238c4d..3fb83ee 100644
--- a/drivers/net/bnx2x/bnx2x_main.c
+++ b/drivers/net/bnx2x/bnx2x_main.c
@@ -4257,18 +4257,65 @@ static void bnx2x_init_eq_ring(struct bnx2x *bp)
static void bnx2x_init_ind_table(struct bnx2x *bp)
{
int func = BP_FUNC(bp);
- int i;
+ int i, j, num_queues, slots;
+ int index = 0, max_weight_queue = 0;
+ u32 weight, max_weight = 0;
+ u64 frac = 0, sum = 0;
if (bp->multi_mode == ETH_RSS_MODE_DISABLED)
return;
- DP(NETIF_MSG_IFUP,
- "Initializing indirection table multi_mode %d\n", bp->multi_mode);
- for (i = 0; i < TSTORM_INDIRECTION_TABLE_SIZE; i++)
- REG_WR8(bp, BAR_TSTRORM_INTMEM +
- TSTORM_INDIRECTION_TABLE_OFFSET(func) + i,
- bp->fp->cl_id + (i % (bp->num_queues -
- NONE_ETH_CONTEXT_USE)));
+ num_queues = bp->num_queues - NONE_ETH_CONTEXT_USE;
+ for (i = 0; i < num_queues; i++)
+ sum += netdev_rxq_weight(bp->dev, i);
+
+ if (!sum) {
+ /* All weights zero. Just apply equal weighting */
+ for (i = 0; i < TSTORM_INDIRECTION_TABLE_SIZE; i++)
+ REG_WR8(bp, BAR_TSTRORM_INTMEM +
+ TSTORM_INDIRECTION_TABLE_OFFSET(func) + i,
+ bp->fp->cl_id + (i % (bp->num_queues -
+ NONE_ETH_CONTEXT_USE)));
+ } else {
+ /*
+ * For each queue, compute number of slots to allocate
+ * based on the relative weights. This is essentially:
+ *
+ * num_slots = (weight / sum_of_weights) * table_size + frac
+ *
+ * frac is the fraction carried over from the previous
+ * queue's calculation. At the end if there's any fraction
+ * remaining, the queue with highest weight is assigned to the
+ * last slot.
+ *
+ * This algorithm should result in all slots always being
+ * set. Note that this recomputes the whole table after
+ * each weight change, this should not be an issue if this
+ * operation is fairly rare.
+ */
+ for (i = 0; i < bp->num_queues; i++) {
+ weight = netdev_rxq_weight(bp->dev, i);
+ if (weight > max_weight) {
+ max_weight = weight;
+ max_weight_queue = i;
+ }
+ frac = (((u64)weight << 32) / sum) *
+ TSTORM_INDIRECTION_TABLE_SIZE + frac;
+ slots = frac >> 32;
+ frac -= (u64)slots << 32;
+ for (j = 0; j < slots; j++, index++)
+ REG_WR8(bp, BAR_TSTRORM_INTMEM +
+ TSTORM_INDIRECTION_TABLE_OFFSET(func) +
+ index, bp->fp->cl_id + i);
+ }
+ if (frac) {
+ REG_WR8(bp, BAR_TSTRORM_INTMEM +
+ TSTORM_INDIRECTION_TABLE_OFFSET(func) + index,
+ bp->fp->cl_id + max_weight_queue);
+ index++;
+ }
+ BUG_ON(index != TSTORM_INDIRECTION_TABLE_SIZE);
+ }
}
void bnx2x_set_storm_rx_mode(struct bnx2x *bp)
@@ -9278,6 +9325,16 @@ static void poll_bnx2x(struct net_device *dev)
}
#endif
+#ifdef CONFIG_RPS
+void bnx2x_set_rxq_weight(struct net_device *dev, u16 rxq, u32 weight)
+{
+ struct bnx2x *bp = netdev_priv(dev);
+
+ /* Reinitialize the whole table */
+ bnx2x_init_ind_table(bp);
+}
+#endif
+
static const struct net_device_ops bnx2x_netdev_ops = {
.ndo_open = bnx2x_open,
.ndo_stop = bnx2x_close,
@@ -9292,6 +9349,9 @@ static const struct net_device_ops bnx2x_netdev_ops = {
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = poll_bnx2x,
#endif
+#ifdef CONFIG_RPS
+ .ndo_set_rxq_weight = bnx2x_set_rxq_weight,
+#endif
};
static int __devinit bnx2x_init_dev(struct pci_dev *pdev,
--
1.7.3.1
^ permalink raw reply related
* Re: [PATCH] tcp: undo_retrans counter fixes
From: Yuchung Cheng @ 2011-02-12 0:10 UTC (permalink / raw)
To: David Miller; +Cc: Netdev, Ilpo Järvinen
In-Reply-To: <alpine.DEB.2.00.1102081110050.26191@melkinpaasi.cs.helsinki.fi>
On Tue, Feb 8, 2011 at 1:54 AM, Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> wrote:
>
> On Mon, 7 Feb 2011, Yuchung Cheng wrote:
>
> > On Mon, Feb 7, 2011 at 3:36 PM, Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> wrote:
> > >
> > > On Mon, 7 Feb 2011, David Miller wrote:
> > >
> > > > From: Yuchung Cheng <ycheng@google.com>
> > > > Date: Mon, 7 Feb 2011 14:57:04 -0800
> > > >
> > > > > Fix a bug that undo_retrans is incorrectly decremented when undo_marker is
> > > > > not set or undo_retrans is already 0. This happens when sender receives
> > > > > more DSACK ACKs than packets retransmitted during the current
> > > > > undo phase. This may also happen when sender receives DSACK after
> > > > > the undo operation is completed or cancelled.
> > > > >
> > > > > Fix another bug that undo_retrans is incorrectly incremented when
> > > > > sender retransmits an skb and tcp_skb_pcount(skb) > 1 (TSO). This case
> > > > > is rare but not impossible.
> > > > >
> > > > > Signed-off-by: Yuchung Cheng <ycheng@google.com>
> > >
> > > Neither is harmful to "fix" but I think they're partially also checking
> > > for things which shouldn't cause problems... E.g., undo_retrans is only
> > > used after checking undo_marker's validity first so I don't think
> > > undo_marker check is exactly necessary there (but on the other hand it
> > > does no harm)...
> >
> > logically we should check the validity of undo_marker/undo_retrans
> > before we use them? The current code has no problem if
> > tcp_fastretrans_alert() always call tcp_try_undo_* functions whenever
> > undo_marker != 0 and undo_retrans == 0. I don't think that's always
> > true.
>
> We certainly should be letting the undo_retrans to underflow that in this
> your patch has merit (the added tp->undo_retrans check).
>
> However, the only users are:
>
> static inline int tcp_may_undo(struct tcp_sock *tp)
> {
> return tp->undo_marker && (!tp->undo_retrans ...)
>
> and:
>
> static void tcp_try_undo_dsack(struct sock *sk)
> {
> struct tcp_sock *tp = tcp_sk(sk);
>
> if (tp->undo_marker && !tp->undo_retrans) {
>
>
> ...which check that undo_retrans is valid.
>
> > > The tcp_retransmit_skb problem I don't understand at all as we should be
> > > fragmenting or resetting pcount to 1 (the latter is true only if all
> > > bugfixes were included to the kernel where >1 pcount for a rexmitted skb
> > > was seen). If pcount is indeed >1 we might have other issues too somewhere
> >
> > We found that sometimes pcount > 1 on real servers. This change keeps
> > the retrans_out/undo_retrans counters consistent.
>
> There's still some bug then I guess... It might be related to the issues
> seen by those other guys who were complaining about small segments with
> >1 pcount breaking their hardware (few months ago). For the record, the
> last fix is from 2.6.31 or so.
>
> Like I said, I don't oppose this change anyway:
>
> > > but I fail to remember immediately what they would be. That change is not
> > > bad though since using +/-1 is something we should be getting rid of
> > > anyway and on long term it would be nice to make tcp_retransmit_skb to be
> > > able to take advantage of TSO anyway whenever possible.
>
> ...it certainly won't hurt to be on the safe side here if/when something
> else is wrong.
>
> > > I also noticed that the undo_retrans code in sacktag side is still doing
> > > undo_retrans-- ops which could certainly cause real miscounts, though
> > > it is extremely unlikely due to the fact that DSACK should be sent
> > > immediately for a single segment at a time (so the sender would need to
> > > split+recollapse in between).
> >
> > I have the same doubt but our servers never hit this condition (pcount
> > 1). So I keep this part intact.
>
> I could think of some scenario you cannot even reproduce in a large scale
> tests, unlikely indeed :-). ...Or too stable connectivity on the sender
> side. But I've changed my mind... the -1 operation is the correct one as
> we could otherwise overestimate due to pcount=1->2 split after the
> retransmission that triggered the DSACK (now that I remember this, I think
> I've once thought this line through already earlier... I'll try to write a
> comment one day there).
>
> For -rc/next purposes I don't see any big enough reasons to withhold:
>
> Acked-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
>
> ...but if you want this to stables too I don't think it's minimal w.r.t.
> undo_marker check.
>
Dave/Ilpo: can this patch get applied or it needs more
clarification/justification? Thanks.
Yuchung
^ permalink raw reply
* [PATCH net-26 5/5] cxgb4vf: Use defined Mailbox Timeout
From: Casey Leedom @ 2011-02-12 1:00 UTC (permalink / raw)
To: netdev; +Cc: davem, Casey Leedom
In-Reply-To: <1297472423-15672-1-git-send-email-leedom@chelsio.com>
VF Driver should use mailbox command timeout specified in t4fw_interface.h
rather than hard-coded value of 500ms.
Signed-off-by: Casey Leedom <leedom@chelsio.com>
---
drivers/net/cxgb4vf/t4vf_hw.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/cxgb4vf/t4vf_hw.c b/drivers/net/cxgb4vf/t4vf_hw.c
index 0f51c80..192db22 100644
--- a/drivers/net/cxgb4vf/t4vf_hw.c
+++ b/drivers/net/cxgb4vf/t4vf_hw.c
@@ -171,7 +171,7 @@ int t4vf_wr_mbox_core(struct adapter *adapter, const void *cmd, int size,
delay_idx = 0;
ms = delay[0];
- for (i = 0; i < 500; i += ms) {
+ for (i = 0; i < FW_CMD_MAX_TIMEOUT; i += ms) {
if (sleep_ok) {
ms = delay[delay_idx];
if (delay_idx < ARRAY_SIZE(delay) - 1)
--
1.7.0.4
^ permalink raw reply related
* [PATCH net-26 1/5] cxgb4vf: Virtual Interfaces are always up ...
From: Casey Leedom @ 2011-02-12 1:00 UTC (permalink / raw)
To: netdev; +Cc: davem, Casey Leedom
In-Reply-To: <1297472423-15672-1-git-send-email-leedom@chelsio.com>
Implement new default mode of always reporting the Virtual Interface link as
being "up". This allows different Virtual Interfaces on the same port to
continue to communicate with each other even when the physical port link is
down. This new behavior is controlled via the module parameter
force_link_up (default 1). The old behavior can be achieved by setting
force_link_up=0.
Signed-off-by: Casey Leedom <leedom@chelsio.com>
---
drivers/net/cxgb4vf/cxgb4vf_main.c | 30 +++++++++++++++++++++++++++---
1 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/drivers/net/cxgb4vf/cxgb4vf_main.c b/drivers/net/cxgb4vf/cxgb4vf_main.c
index 56166ae..08c2b29 100644
--- a/drivers/net/cxgb4vf/cxgb4vf_main.c
+++ b/drivers/net/cxgb4vf/cxgb4vf_main.c
@@ -96,6 +96,18 @@ module_param(msi, int, 0644);
MODULE_PARM_DESC(msi, "whether to use MSI-X or MSI");
/*
+ * The Virtual Interfaces are connected to an internal switch on the chip
+ * which allows VIs attached to the same port to talk to each other even when
+ * the port link is down. As a result, we generally want to always report a
+ * VI's link as being "up".
+ */
+static int force_link_up = 1;
+
+module_param(force_link_up, int, 0644);
+MODULE_PARM_DESC(force_link_up, "always report link up");
+
+
+/*
* Fundamental constants.
* ======================
*/
@@ -151,7 +163,8 @@ void t4vf_os_link_changed(struct adapter *adapter, int pidx, int link_ok)
return;
/*
- * Tell the OS that the link status has changed and print a short
+ * Tell the OS that the link status has changed (if we're not
+ * operating in the forced link "up" mode) and print a short
* informative message on the console about the event.
*/
if (link_ok) {
@@ -159,7 +172,8 @@ void t4vf_os_link_changed(struct adapter *adapter, int pidx, int link_ok)
const char *fc;
const struct port_info *pi = netdev_priv(dev);
- netif_carrier_on(dev);
+ if (!force_link_up)
+ netif_carrier_on(dev);
switch (pi->link_cfg.speed) {
case SPEED_10000:
@@ -200,7 +214,9 @@ void t4vf_os_link_changed(struct adapter *adapter, int pidx, int link_ok)
printk(KERN_INFO "%s: link up, %s, full-duplex, %s PAUSE\n",
dev->name, s, fc);
} else {
- netif_carrier_off(dev);
+ if (!force_link_up)
+ netif_carrier_off(dev);
+
printk(KERN_INFO "%s: link down\n", dev->name);
}
}
@@ -254,6 +270,14 @@ static int link_start(struct net_device *dev)
*/
if (ret == 0)
ret = t4vf_enable_vi(pi->adapter, pi->viid, true, true);
+
+ /*
+ * If we didn't experience any error and we're always reporting the
+ * link as being "up", tell the OS that the link is up.
+ */
+ if (ret == 0 && force_link_up)
+ netif_carrier_on(dev);
+
return ret;
}
--
1.7.0.4
^ permalink raw reply related
* [PATCH net-26 3/5] cxgb4vf: Behave properly when CONFIG_DEBUG_FS isn't defined ...
From: Casey Leedom @ 2011-02-12 1:00 UTC (permalink / raw)
To: netdev; +Cc: davem, Casey Leedom
In-Reply-To: <1297472423-15672-1-git-send-email-leedom@chelsio.com>
When CONFIG_DEBUG_FS we get "ERR_PTR()"s back from the debugfs routines
instead of NULL. Use the right predicates to check for this.
Signed-off-by: Casey Leedom <leedom@chelsio.com>
---
drivers/net/cxgb4vf/cxgb4vf_main.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/net/cxgb4vf/cxgb4vf_main.c b/drivers/net/cxgb4vf/cxgb4vf_main.c
index b12c169..daac6ed 100644
--- a/drivers/net/cxgb4vf/cxgb4vf_main.c
+++ b/drivers/net/cxgb4vf/cxgb4vf_main.c
@@ -2064,7 +2064,7 @@ static int __devinit setup_debugfs(struct adapter *adapter)
{
int i;
- BUG_ON(adapter->debugfs_root == NULL);
+ BUG_ON(IS_ERR_OR_NULL(adapter->debugfs_root));
/*
* Debugfs support is best effort.
@@ -2085,7 +2085,7 @@ static int __devinit setup_debugfs(struct adapter *adapter)
*/
static void cleanup_debugfs(struct adapter *adapter)
{
- BUG_ON(adapter->debugfs_root == NULL);
+ BUG_ON(IS_ERR_OR_NULL(adapter->debugfs_root));
/*
* Unlike our sister routine cleanup_proc(), we don't need to remove
@@ -2724,11 +2724,11 @@ static int __devinit cxgb4vf_pci_probe(struct pci_dev *pdev,
/*
* Set up our debugfs entries.
*/
- if (cxgb4vf_debugfs_root) {
+ if (!IS_ERR_OR_NULL(cxgb4vf_debugfs_root)) {
adapter->debugfs_root =
debugfs_create_dir(pci_name(pdev),
cxgb4vf_debugfs_root);
- if (adapter->debugfs_root == NULL)
+ if (IS_ERR_OR_NULL(adapter->debugfs_root))
dev_warn(&pdev->dev, "could not create debugfs"
" directory");
else
@@ -2783,7 +2783,7 @@ static int __devinit cxgb4vf_pci_probe(struct pci_dev *pdev,
*/
err_free_debugfs:
- if (adapter->debugfs_root) {
+ if (!IS_ERR_OR_NULL(adapter->debugfs_root)) {
cleanup_debugfs(adapter);
debugfs_remove_recursive(adapter->debugfs_root);
}
@@ -2852,7 +2852,7 @@ static void __devexit cxgb4vf_pci_remove(struct pci_dev *pdev)
/*
* Tear down our debugfs entries.
*/
- if (adapter->debugfs_root) {
+ if (!IS_ERR_OR_NULL(adapter->debugfs_root)) {
cleanup_debugfs(adapter);
debugfs_remove_recursive(adapter->debugfs_root);
}
@@ -2940,12 +2940,12 @@ static int __init cxgb4vf_module_init(void)
/* Debugfs support is optional, just warn if this fails */
cxgb4vf_debugfs_root = debugfs_create_dir(KBUILD_MODNAME, NULL);
- if (!cxgb4vf_debugfs_root)
+ if (IS_ERR_OR_NULL(cxgb4vf_debugfs_root))
printk(KERN_WARNING KBUILD_MODNAME ": could not create"
" debugfs entry, continuing\n");
ret = pci_register_driver(&cxgb4vf_driver);
- if (ret < 0)
+ if (ret < 0 && !IS_ERR_OR_NULL(cxgb4vf_debugfs_root))
debugfs_remove(cxgb4vf_debugfs_root);
return ret;
}
--
1.7.0.4
^ permalink raw reply related
* [PATCH net-26 0/5] cxgb4vf: minor bug fixes
From: Casey Leedom @ 2011-02-12 1:00 UTC (permalink / raw)
To: netdev; +Cc: davem
Several minor bug fixes in the cxgb4vf driver ...
[01/05]: Virtual Interfaces are always up ...
[02/05]: Check driver parameters in the right place ...
[03/05]: Behave properly when CONFIG_DEBUG_FS isn't defined ...
[04/05]: Quiesce Virtual Interfaces on shutdown ...
[05/05]: Use defined Mailbox Timeout
drivers/net/cxgb4vf/cxgb4vf_main.c | 110 ++++++++++++++++++++++++++++--------
drivers/net/cxgb4vf/t4vf_hw.c | 2 +-
2 files changed, 88 insertions(+), 24 deletions(-)
^ permalink raw reply
* [PATCH net-26 2/5] cxgb4vf: Check driver parameters in the right place ...
From: Casey Leedom @ 2011-02-12 1:00 UTC (permalink / raw)
To: netdev; +Cc: davem, Casey Leedom
In-Reply-To: <1297472423-15672-1-git-send-email-leedom@chelsio.com>
Check module parameter validity in the module initialization routine instead
of the PCI Device Probe routine.
Signed-off-by: Casey Leedom <leedom@chelsio.com>
---
drivers/net/cxgb4vf/cxgb4vf_main.c | 23 +++++++++++------------
1 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/drivers/net/cxgb4vf/cxgb4vf_main.c b/drivers/net/cxgb4vf/cxgb4vf_main.c
index 08c2b29..b12c169 100644
--- a/drivers/net/cxgb4vf/cxgb4vf_main.c
+++ b/drivers/net/cxgb4vf/cxgb4vf_main.c
@@ -2513,17 +2513,6 @@ static int __devinit cxgb4vf_pci_probe(struct pci_dev *pdev,
struct net_device *netdev;
/*
- * Vet our module parameters.
- */
- if (msi != MSI_MSIX && msi != MSI_MSI) {
- dev_err(&pdev->dev, "bad module parameter msi=%d; must be %d"
- " (MSI-X or MSI) or %d (MSI)\n", msi, MSI_MSIX,
- MSI_MSI);
- err = -EINVAL;
- goto err_out;
- }
-
- /*
* Print our driver banner the first time we're called to initialize a
* device.
*/
@@ -2826,7 +2815,6 @@ err_release_regions:
err_disable_device:
pci_disable_device(pdev);
-err_out:
return err;
}
@@ -2939,6 +2927,17 @@ static int __init cxgb4vf_module_init(void)
{
int ret;
+ /*
+ * Vet our module parameters.
+ */
+ if (msi != MSI_MSIX && msi != MSI_MSI) {
+ printk(KERN_WARNING KBUILD_MODNAME
+ ": bad module parameter msi=%d; must be %d"
+ " (MSI-X or MSI) or %d (MSI)\n",
+ msi, MSI_MSIX, MSI_MSI);
+ return -EINVAL;
+ }
+
/* Debugfs support is optional, just warn if this fails */
cxgb4vf_debugfs_root = debugfs_create_dir(KBUILD_MODNAME, NULL);
if (!cxgb4vf_debugfs_root)
--
1.7.0.4
^ permalink raw reply related
* [PATCH net-26 4/5] cxgb4vf: Quiesce Virtual Interfaces on shutdown ...
From: Casey Leedom @ 2011-02-12 1:00 UTC (permalink / raw)
To: netdev; +Cc: davem, Casey Leedom
In-Reply-To: <1297472423-15672-1-git-send-email-leedom@chelsio.com>
When a Virtual Machine is rebooted, KVM currently fails to issue a Function
Level Reset against any "Attached PCI Devices" (AKA "PCI Passthrough"). In
addition to leaving the attached device in a random state in the next booted
kernel (which sort of violates the entire idea of a reboot reseting hardware
state), this leaves our peer thinking that the link is still up. (Note that
a bug has been filed with the KVM folks, #25332, but there's been no
response on that as of yet.) So, we add a "->shutdown()" method for the
Virtual Function PCI Device to handle administrative shutdowns like a
reboot.
Signed-off-by: Casey Leedom <leedom@chelsio.com>
---
drivers/net/cxgb4vf/cxgb4vf_main.c | 41 ++++++++++++++++++++++++++++++++++++
1 files changed, 41 insertions(+), 0 deletions(-)
diff --git a/drivers/net/cxgb4vf/cxgb4vf_main.c b/drivers/net/cxgb4vf/cxgb4vf_main.c
index daac6ed..f78d6e1 100644
--- a/drivers/net/cxgb4vf/cxgb4vf_main.c
+++ b/drivers/net/cxgb4vf/cxgb4vf_main.c
@@ -2886,6 +2886,46 @@ static void __devexit cxgb4vf_pci_remove(struct pci_dev *pdev)
}
/*
+ * "Shutdown" quiesce the device, stopping Ingress Packet and Interrupt
+ * delivery.
+ */
+static void __devexit cxgb4vf_pci_shutdown(struct pci_dev *pdev)
+{
+ struct adapter *adapter;
+ int pidx;
+
+ adapter = pci_get_drvdata(pdev);
+ if (!adapter)
+ return;
+
+ /*
+ * Disable all Virtual Interfaces. This will shut down the
+ * delivery of all ingress packets into the chip for these
+ * Virtual Interfaces.
+ */
+ for_each_port(adapter, pidx) {
+ struct net_device *netdev;
+ struct port_info *pi;
+
+ if (!test_bit(pidx, &adapter->registered_device_map))
+ continue;
+
+ netdev = adapter->port[pidx];
+ if (!netdev)
+ continue;
+
+ pi = netdev_priv(netdev);
+ t4vf_enable_vi(adapter, pi->viid, false, false);
+ }
+
+ /*
+ * Free up all Queues which will prevent further DMA and
+ * Interrupts allowing various internal pathways to drain.
+ */
+ t4vf_free_sge_resources(adapter);
+}
+
+/*
* PCI Device registration data structures.
*/
#define CH_DEVICE(devid, idx) \
@@ -2918,6 +2958,7 @@ static struct pci_driver cxgb4vf_driver = {
.id_table = cxgb4vf_pci_tbl,
.probe = cxgb4vf_pci_probe,
.remove = __devexit_p(cxgb4vf_pci_remove),
+ .shutdown = __devexit_p(cxgb4vf_pci_shutdown),
};
/*
--
1.7.0.4
^ permalink raw reply related
* [PATCH 08/17] timberdale: mfd_cell is now implicitly available to drivers
From: Andres Salomon @ 2011-02-12 2:10 UTC (permalink / raw)
To: Samuel Ortiz
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, Mark Brown, Dan Williams,
Peter Korsgaard, khali-PUYAD+kWke1g9hUCZPvPmw,
ben-linux-elnMNo+KYs3YtjvyW6yDsg, Mauro Carvalho Chehab,
David Brownell, Grant Likely, Andrew Morton, David S. Miller,
linux-i2c-u79uwXL29TY76Z2rM5mHXA,
linux-media-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
The cell's platform_data is now accessed with a helper function;
change clients to use that, and remove the now-unused data_size.
Note that the mfd's platform_data is marked __devinitdata. This
is still correct in all cases except for the timbgpio driver, whose
remove hook has been changed to no longer reference the pdata.
Signed-off-by: Andres Salomon <dilinger-pFFUokh25LWsTnJN9+BGXg@public.gmane.org>
---
drivers/dma/timb_dma.c | 2 +-
drivers/gpio/timbgpio.c | 5 ++---
drivers/i2c/busses/i2c-ocores.c | 2 +-
drivers/i2c/busses/i2c-xiic.c | 2 +-
drivers/media/radio/radio-timb.c | 2 +-
drivers/media/video/timblogiw.c | 2 +-
drivers/mfd/timberdale.c | 27 ---------------------------
drivers/net/ks8842.c | 2 +-
drivers/spi/xilinx_spi.c | 2 +-
9 files changed, 9 insertions(+), 37 deletions(-)
diff --git a/drivers/dma/timb_dma.c b/drivers/dma/timb_dma.c
index 3b88a4e..77bc4c2 100644
--- a/drivers/dma/timb_dma.c
+++ b/drivers/dma/timb_dma.c
@@ -684,7 +684,7 @@ static irqreturn_t td_irq(int irq, void *devid)
static int __devinit td_probe(struct platform_device *pdev)
{
- struct timb_dma_platform_data *pdata = pdev->dev.platform_data;
+ struct timb_dma_platform_data *pdata = mfd_get_data(pdev);
struct timb_dma *td;
struct resource *iomem;
int irq;
diff --git a/drivers/gpio/timbgpio.c b/drivers/gpio/timbgpio.c
index 58c8f30..63527b8 100644
--- a/drivers/gpio/timbgpio.c
+++ b/drivers/gpio/timbgpio.c
@@ -228,7 +228,7 @@ static int __devinit timbgpio_probe(struct platform_device *pdev)
struct gpio_chip *gc;
struct timbgpio *tgpio;
struct resource *iomem;
- struct timbgpio_platform_data *pdata = pdev->dev.platform_data;
+ struct timbgpio_platform_data *pdata = mfd_get_data(pdev);
int irq = platform_get_irq(pdev, 0);
if (!pdata || pdata->nr_pins > 32) {
@@ -319,14 +319,13 @@ err_mem:
static int __devexit timbgpio_remove(struct platform_device *pdev)
{
int err;
- struct timbgpio_platform_data *pdata = pdev->dev.platform_data;
struct timbgpio *tgpio = platform_get_drvdata(pdev);
struct resource *iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
int irq = platform_get_irq(pdev, 0);
if (irq >= 0 && tgpio->irq_base > 0) {
int i;
- for (i = 0; i < pdata->nr_pins; i++) {
+ for (i = 0; i < tgpio->gpio.ngpio; i++) {
set_irq_chip(tgpio->irq_base + i, NULL);
set_irq_chip_data(tgpio->irq_base + i, NULL);
}
diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c
index ef3bcb1..4b7dbc3 100644
--- a/drivers/i2c/busses/i2c-ocores.c
+++ b/drivers/i2c/busses/i2c-ocores.c
@@ -305,7 +305,7 @@ static int __devinit ocores_i2c_probe(struct platform_device *pdev)
return -EIO;
}
- pdata = pdev->dev.platform_data;
+ pdata = mfd_get_data(pdev);
if (pdata) {
i2c->regstep = pdata->regstep;
i2c->clock_khz = pdata->clock_khz;
diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index a9c419e..f3299bb 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -704,7 +704,7 @@ static int __devinit xiic_i2c_probe(struct platform_device *pdev)
if (irq < 0)
goto resource_missing;
- pdata = (struct xiic_i2c_platform_data *) pdev->dev.platform_data;
+ pdata = mfd_get_data(pdev);
if (!pdata)
return -EINVAL;
diff --git a/drivers/media/radio/radio-timb.c b/drivers/media/radio/radio-timb.c
index a185610..d7ba57f 100644
--- a/drivers/media/radio/radio-timb.c
+++ b/drivers/media/radio/radio-timb.c
@@ -148,7 +148,7 @@ static const struct v4l2_file_operations timbradio_fops = {
static int __devinit timbradio_probe(struct platform_device *pdev)
{
- struct timb_radio_platform_data *pdata = pdev->dev.platform_data;
+ struct timb_radio_platform_data *pdata = mfd_get_data(pdev);
struct timbradio *tr;
int err;
diff --git a/drivers/media/video/timblogiw.c b/drivers/media/video/timblogiw.c
index fc611eb..5e9ca25 100644
--- a/drivers/media/video/timblogiw.c
+++ b/drivers/media/video/timblogiw.c
@@ -790,7 +790,7 @@ static int __devinit timblogiw_probe(struct platform_device *pdev)
{
int err;
struct timblogiw *lw = NULL;
- struct timb_video_platform_data *pdata = pdev->dev.platform_data;
+ struct timb_video_platform_data *pdata = mfd_get_data(pdev);
if (!pdata) {
dev_err(&pdev->dev, "No platform data\n");
diff --git a/drivers/mfd/timberdale.c b/drivers/mfd/timberdale.c
index 6ad8a7f..6353921 100644
--- a/drivers/mfd/timberdale.c
+++ b/drivers/mfd/timberdale.c
@@ -385,7 +385,6 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg0[] = {
.num_resources = ARRAY_SIZE(timberdale_dma_resources),
.resources = timberdale_dma_resources,
.platform_data = &timb_dma_platform_data,
- .data_size = sizeof(timb_dma_platform_data),
},
{
.name = "timb-uart",
@@ -397,42 +396,36 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg0[] = {
.num_resources = ARRAY_SIZE(timberdale_xiic_resources),
.resources = timberdale_xiic_resources,
.platform_data = &timberdale_xiic_platform_data,
- .data_size = sizeof(timberdale_xiic_platform_data),
},
{
.name = "timb-gpio",
.num_resources = ARRAY_SIZE(timberdale_gpio_resources),
.resources = timberdale_gpio_resources,
.platform_data = &timberdale_gpio_platform_data,
- .data_size = sizeof(timberdale_gpio_platform_data),
},
{
.name = "timb-video",
.num_resources = ARRAY_SIZE(timberdale_video_resources),
.resources = timberdale_video_resources,
.platform_data = &timberdale_video_platform_data,
- .data_size = sizeof(timberdale_video_platform_data),
},
{
.name = "timb-radio",
.num_resources = ARRAY_SIZE(timberdale_radio_resources),
.resources = timberdale_radio_resources,
.platform_data = &timberdale_radio_platform_data,
- .data_size = sizeof(timberdale_radio_platform_data),
},
{
.name = "xilinx_spi",
.num_resources = ARRAY_SIZE(timberdale_spi_resources),
.resources = timberdale_spi_resources,
.platform_data = &timberdale_xspi_platform_data,
- .data_size = sizeof(timberdale_xspi_platform_data),
},
{
.name = "ks8842",
.num_resources = ARRAY_SIZE(timberdale_eth_resources),
.resources = timberdale_eth_resources,
.platform_data = &timberdale_ks8842_platform_data,
- .data_size = sizeof(timberdale_ks8842_platform_data)
},
};
@@ -442,7 +435,6 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg1[] = {
.num_resources = ARRAY_SIZE(timberdale_dma_resources),
.resources = timberdale_dma_resources,
.platform_data = &timb_dma_platform_data,
- .data_size = sizeof(timb_dma_platform_data),
},
{
.name = "timb-uart",
@@ -459,14 +451,12 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg1[] = {
.num_resources = ARRAY_SIZE(timberdale_xiic_resources),
.resources = timberdale_xiic_resources,
.platform_data = &timberdale_xiic_platform_data,
- .data_size = sizeof(timberdale_xiic_platform_data),
},
{
.name = "timb-gpio",
.num_resources = ARRAY_SIZE(timberdale_gpio_resources),
.resources = timberdale_gpio_resources,
.platform_data = &timberdale_gpio_platform_data,
- .data_size = sizeof(timberdale_gpio_platform_data),
},
{
.name = "timb-mlogicore",
@@ -478,28 +468,24 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg1[] = {
.num_resources = ARRAY_SIZE(timberdale_video_resources),
.resources = timberdale_video_resources,
.platform_data = &timberdale_video_platform_data,
- .data_size = sizeof(timberdale_video_platform_data),
},
{
.name = "timb-radio",
.num_resources = ARRAY_SIZE(timberdale_radio_resources),
.resources = timberdale_radio_resources,
.platform_data = &timberdale_radio_platform_data,
- .data_size = sizeof(timberdale_radio_platform_data),
},
{
.name = "xilinx_spi",
.num_resources = ARRAY_SIZE(timberdale_spi_resources),
.resources = timberdale_spi_resources,
.platform_data = &timberdale_xspi_platform_data,
- .data_size = sizeof(timberdale_xspi_platform_data),
},
{
.name = "ks8842",
.num_resources = ARRAY_SIZE(timberdale_eth_resources),
.resources = timberdale_eth_resources,
.platform_data = &timberdale_ks8842_platform_data,
- .data_size = sizeof(timberdale_ks8842_platform_data)
},
};
@@ -509,7 +495,6 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg2[] = {
.num_resources = ARRAY_SIZE(timberdale_dma_resources),
.resources = timberdale_dma_resources,
.platform_data = &timb_dma_platform_data,
- .data_size = sizeof(timb_dma_platform_data),
},
{
.name = "timb-uart",
@@ -521,35 +506,30 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg2[] = {
.num_resources = ARRAY_SIZE(timberdale_xiic_resources),
.resources = timberdale_xiic_resources,
.platform_data = &timberdale_xiic_platform_data,
- .data_size = sizeof(timberdale_xiic_platform_data),
},
{
.name = "timb-gpio",
.num_resources = ARRAY_SIZE(timberdale_gpio_resources),
.resources = timberdale_gpio_resources,
.platform_data = &timberdale_gpio_platform_data,
- .data_size = sizeof(timberdale_gpio_platform_data),
},
{
.name = "timb-video",
.num_resources = ARRAY_SIZE(timberdale_video_resources),
.resources = timberdale_video_resources,
.platform_data = &timberdale_video_platform_data,
- .data_size = sizeof(timberdale_video_platform_data),
},
{
.name = "timb-radio",
.num_resources = ARRAY_SIZE(timberdale_radio_resources),
.resources = timberdale_radio_resources,
.platform_data = &timberdale_radio_platform_data,
- .data_size = sizeof(timberdale_radio_platform_data),
},
{
.name = "xilinx_spi",
.num_resources = ARRAY_SIZE(timberdale_spi_resources),
.resources = timberdale_spi_resources,
.platform_data = &timberdale_xspi_platform_data,
- .data_size = sizeof(timberdale_xspi_platform_data),
},
};
@@ -559,7 +539,6 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg3[] = {
.num_resources = ARRAY_SIZE(timberdale_dma_resources),
.resources = timberdale_dma_resources,
.platform_data = &timb_dma_platform_data,
- .data_size = sizeof(timb_dma_platform_data),
},
{
.name = "timb-uart",
@@ -571,42 +550,36 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg3[] = {
.num_resources = ARRAY_SIZE(timberdale_ocores_resources),
.resources = timberdale_ocores_resources,
.platform_data = &timberdale_ocores_platform_data,
- .data_size = sizeof(timberdale_ocores_platform_data),
},
{
.name = "timb-gpio",
.num_resources = ARRAY_SIZE(timberdale_gpio_resources),
.resources = timberdale_gpio_resources,
.platform_data = &timberdale_gpio_platform_data,
- .data_size = sizeof(timberdale_gpio_platform_data),
},
{
.name = "timb-video",
.num_resources = ARRAY_SIZE(timberdale_video_resources),
.resources = timberdale_video_resources,
.platform_data = &timberdale_video_platform_data,
- .data_size = sizeof(timberdale_video_platform_data),
},
{
.name = "timb-radio",
.num_resources = ARRAY_SIZE(timberdale_radio_resources),
.resources = timberdale_radio_resources,
.platform_data = &timberdale_radio_platform_data,
- .data_size = sizeof(timberdale_radio_platform_data),
},
{
.name = "xilinx_spi",
.num_resources = ARRAY_SIZE(timberdale_spi_resources),
.resources = timberdale_spi_resources,
.platform_data = &timberdale_xspi_platform_data,
- .data_size = sizeof(timberdale_xspi_platform_data),
},
{
.name = "ks8842",
.num_resources = ARRAY_SIZE(timberdale_eth_resources),
.resources = timberdale_eth_resources,
.platform_data = &timberdale_ks8842_platform_data,
- .data_size = sizeof(timberdale_ks8842_platform_data)
},
};
diff --git a/drivers/net/ks8842.c b/drivers/net/ks8842.c
index 928b2b8..58e16b4 100644
--- a/drivers/net/ks8842.c
+++ b/drivers/net/ks8842.c
@@ -1145,7 +1145,7 @@ static int __devinit ks8842_probe(struct platform_device *pdev)
struct resource *iomem;
struct net_device *netdev;
struct ks8842_adapter *adapter;
- struct ks8842_platform_data *pdata = pdev->dev.platform_data;
+ struct ks8842_platform_data *pdata = mfd_get_data(pdev);
u16 id;
unsigned i;
diff --git a/drivers/spi/xilinx_spi.c b/drivers/spi/xilinx_spi.c
index 7adaef6..401d97d 100644
--- a/drivers/spi/xilinx_spi.c
+++ b/drivers/spi/xilinx_spi.c
@@ -474,7 +474,7 @@ static int __devinit xilinx_spi_probe(struct platform_device *dev)
struct spi_master *master;
u8 i;
- pdata = dev->dev.platform_data;
+ pdata = mfd_get_data(dev);
if (pdata) {
num_cs = pdata->num_chipselect;
little_endian = pdata->little_endian;
--
1.7.2.3
^ permalink raw reply related
* [PATCH 15/17] janz: mfd_cell is now implicitly available to drivers
From: Andres Salomon @ 2011-02-12 2:17 UTC (permalink / raw)
To: Samuel Ortiz
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
netdev-u79uwXL29TY76Z2rM5mHXA, Mark Brown,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Wolfgang Grandegger
The cell's platform_data is now accessed with a helper function;
change clients to use that, and remove the now-unused data_size.
Signed-off-by: Andres Salomon <dilinger-pFFUokh25LWsTnJN9+BGXg@public.gmane.org>
---
drivers/gpio/janz-ttl.c | 2 +-
drivers/mfd/janz-cmodio.c | 1 -
drivers/net/can/janz-ican3.c | 2 +-
3 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/gpio/janz-ttl.c b/drivers/gpio/janz-ttl.c
index 813ac07..ef399ee 100644
--- a/drivers/gpio/janz-ttl.c
+++ b/drivers/gpio/janz-ttl.c
@@ -149,7 +149,7 @@ static int __devinit ttl_probe(struct platform_device *pdev)
struct resource *res;
int ret;
- pdata = pdev->dev.platform_data;
+ pdata = mfd_get_data(pdev);
if (!pdata) {
dev_err(dev, "no platform data\n");
ret = -ENXIO;
diff --git a/drivers/mfd/janz-cmodio.c b/drivers/mfd/janz-cmodio.c
index 36a166b..58de1e2 100644
--- a/drivers/mfd/janz-cmodio.c
+++ b/drivers/mfd/janz-cmodio.c
@@ -87,7 +87,6 @@ static int __devinit cmodio_setup_subdevice(struct cmodio_device *priv,
/* Add platform data */
pdata->modno = modno;
cell->platform_data = pdata;
- cell->data_size = sizeof(*pdata);
/* MODULbus registers -- PCI BAR3 is big-endian MODULbus access */
res->flags = IORESOURCE_MEM;
diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c
index 366f5cc..bc2b15b 100644
--- a/drivers/net/can/janz-ican3.c
+++ b/drivers/net/can/janz-ican3.c
@@ -1643,7 +1643,7 @@ static int __devinit ican3_probe(struct platform_device *pdev)
struct device *dev;
int ret;
- pdata = pdev->dev.platform_data;
+ pdata = mfd_get_data(pdev);
if (!pdata)
return -ENXIO;
--
1.7.2.3
^ permalink raw reply related
* Re: [RFD][PATCH] Add JMEMCMP to Berkeley Packet Filters
From: Paul Mackerras @ 2011-02-12 2:14 UTC (permalink / raw)
To: Ian Molton; +Cc: netdev, rdunlap, isdn, arnd, davem, herbert, ebiederm
In-Reply-To: <1297340087-10963-1-git-send-email-ian.molton@collabora.co.uk>
On Thu, Feb 10, 2011 at 12:14:46PM +0000, Ian Molton wrote:
> This patch implements an extension for BPF to allow filter programs to use a
> data section, along with a MEMCMP instruction.
>
> There are a few issues noted in the patch itself, which can easily be
> addressed, and I would like to check wether sk_run_filter is ever expected to
> be called from a context that cannot sleep (I dont think it is).
The ppp driver (ppp_generic.c) calls sk_run_filter inside a region
protected by spin_lock_bh, so we can't sleep there. Having sk_run_filter
potentially sleep would make it useless for ppp.
Paul.
^ permalink raw reply
* Re: [PATCH 1/2] net: Add RX queue weights
From: Dimitris Michailidis @ 2011-02-12 3:49 UTC (permalink / raw)
To: Tom Herbert; +Cc: davem, netdev
In-Reply-To: <alpine.DEB.2.00.1102111552090.2793@pokey.mtv.corp.google.com>
Tom Herbert wrote:
> This patch adds a weight attribute to the netdev RX queues. This allows
> control over the relative receive packet load for each queue. These
> values are set in sysfs variable 'weight' in the rxq directory for
> a device. When a weight is set, a new netdev operation is called to
> inform the driver of the changed weight. The driver is expected to
> apply the queue weights in a logical manner to the RSS indirection table
> of the device to achieve the desired weighting. The driver
> implementation for this is unspecified.
>
> If a weight for a queue is zero, this effectively disables that queue
> for RSS (but possibly still usable by accelerated RFS, etc.), except
> in the case that all queue weights are zero, then all queues are
> considered equally weighted (the default).
>
> Example configuration:
> echo 1 > /sys/class/net/eth4/queues/rx-0/weight
> echo 1 > /sys/class/net/eth4/queues/rx-1/weight
> echo 5 > /sys/class/net/eth4/queues/rx-2/weight
> echo 0 > /sys/class/net/eth4/queues/rx-3/weight
>
> So rx queue 0 and 1 have equal weight, queue 2 is 5X in weight and
> queue 3 is disabled for RSS.
Doesn't ethtool -X already do this? With the added benefit that ethtool
doesn't need each driver to provide its own weight handling arithmetic.
^ permalink raw reply
* Re: [PATCH net-next 00/15] be2net: patch series
From: David Miller @ 2011-02-12 5:15 UTC (permalink / raw)
To: ajit.khaparde; +Cc: netdev
In-Reply-To: <20110211233215.GA18258@akhaparde-VBox>
From: Ajit Khaparde <ajit.khaparde@emulex.com>
Date: Fri, 11 Feb 2011 17:32:15 -0600
> Patch series for the be2net driver.
>
> [01/15]: While configuring QOS for VF, pass proper domain id
> [02/15]: endianness fix in be_cmd_set_qos().
> [03/15]: Use domain id when be_cmd_if_destroy is called.
> [04/15]: Initialize and cleanup sriov resources only if pci_enable_sriov has succeeded.
> [05/15]: call be_vf_eth_addr_config() after register_netdev
> [06/15]: Cleanup the VF interface handles
> [07/15]: For the VF MAC, use the OUI from current MAC address
> [08/15]: pass domain numbers for pmac_add/del functions
> [09/15]: Allow VFs to call be_cmd_reset_function.
> [10/15]: Fix broken priority setting when vlan tagging is enabled.
> [11/15]: pass proper hdr_size while flashing redboot.
> [12/15]: fix be_suspend/resume/shutdown
> [13/15]: gracefully handle situations when UE is detected
> [14/15]: detect a UE even when a interface is down.
> [15/15]: restrict WOL to PFs only.
>
> Please Apply.
All applied, thanks.
^ permalink raw reply
* Re: [net-next-2.6 v2 00/15][pull request] Intel Wired LAN Driver Updates
From: David Miller @ 2011-02-12 5:15 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, bphilips
In-Reply-To: <1297444862-32091-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 11 Feb 2011 09:20:47 -0800
> The following series contains e1000e cleanup patches, the addition of igb
> PF support for i350 devices and several ixgbe cleanup patches.
>
> v2 - drop "e1000e: do not wakeup Tx queue until ready" while Bruce takes a
> second look at the patch.
>
> The following are changes since commit 6431cbc25fa21635ee04eb0516ba6c51389fbfac:
> inet: Create a mechanism for upward inetpeer propagation into routes.
>
> and are available in the git repository at:
> master.kernel.org:/pub/scm/linux/kernel/git/jkirsher/net-next-2.6 master
Pulled, thanks Jeff.
^ permalink raw reply
* Re: [PATCH net-26 1/5] cxgb4vf: Virtual Interfaces are always up ...
From: David Miller @ 2011-02-12 5:19 UTC (permalink / raw)
To: leedom; +Cc: netdev
In-Reply-To: <1297472423-15672-2-git-send-email-leedom@chelsio.com>
From: Casey Leedom <leedom@chelsio.com>
Date: Fri, 11 Feb 2011 17:00:19 -0800
> Implement new default mode of always reporting the Virtual Interface link as
> being "up". This allows different Virtual Interfaces on the same port to
> continue to communicate with each other even when the physical port link is
> down. This new behavior is controlled via the module parameter
> force_link_up (default 1). The old behavior can be achieved by setting
> force_link_up=0.
>
> Signed-off-by: Casey Leedom <leedom@chelsio.com>
No driver specific module parameters! Add something generic and common
so other drivers can use it too.
Otherwise every user has to learn a different way to control this
attribute, depending upon the device type, which is rediculious.
How many times do we have to tell driver authors this?
^ permalink raw reply
* Re: pull request: batman-adv 2011-02-12
From: David Miller @ 2011-02-12 5:21 UTC (permalink / raw)
To: sven; +Cc: netdev, b.a.t.m.a.n
In-Reply-To: <1297466503-13246-1-git-send-email-sven@narfation.org>
From: Sven Eckelmann <sven@narfation.org>
Date: Sat, 12 Feb 2011 00:21:39 +0100
> Hi,
>
> I would like propose following changes for net-next-2.6.git. Two of them are
> minor code style changes and the other two change minor issues in the
> routing/fragmentation code.
>
> thanks,
> Sven
>
> The following changes since commit 091b948306d2628320e77977eb7ae4a757b12180:
>
> batman-adv: Merge README of v2011.0.0 release (2011-01-31 14:57:13 +0100)
>
> are available in the git repository at:
> git://git.open-mesh.org/ecsv/linux-merge.git batman-adv/next
Pulled, thanks Sven.
^ permalink raw reply
* Re: [PATCH 02/14] net/fec: release mem_region requested in probe in error path and remove
From: David Miller @ 2011-02-12 5:25 UTC (permalink / raw)
To: u.kleine-koenig; +Cc: netdev, shawn.guo, kernel
In-Reply-To: <20110211110339.GH27982@pengutronix.de>
From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date: Fri, 11 Feb 2011 12:03:39 +0100
> Hello,
>
> On Fri, Feb 11, 2011 at 11:32:10AM +0100, Uwe Kleine-König wrote:
>> Noticed-by: Lothar Waßmann <LW@KARO-electronics.de>
> I changed that to Reported-by: in this and the other patches.
> (this was Reported-by: Wolfram Sang via irc). The updated patches can
> be found at
>
> git://git.pengutronix.de/git/ukl/linux-2.6.git fec
I can't pull from that tree because it is _NOT_ based upon net-next-2.6
and therefore brings in all kinds of commits not related to your work.
^ permalink raw reply
* Re: [PATCH 2/2 v2] network: Allow af_packet to transmit +4 bytes for VLAN packets.
From: David Miller @ 2011-02-12 5:26 UTC (permalink / raw)
To: eric.dumazet; +Cc: greearb, netdev
In-Reply-To: <1297462718.2510.10.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 11 Feb 2011 23:18:38 +0100
> Le vendredi 11 février 2011 à 11:35 -0800, greearb@candelatech.com a
> écrit :
>> From: Ben Greear <greearb@candelatech.com>
>>
>> This allows user-space to send a '1500' MTU VLAN packet on a
>> 1500 MTU ethernet frame. The extra 4 bytes of a VLAN header is
>> not usually charged against the MTU when other parts of the
>> network stack is transmitting vlans...
>>
>> Signed-off-by: Ben Greear <greearb@candelatech.com>
>> ---
>
> Reviewed-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied to net-next-2.6, thanks.
^ permalink raw reply
* Re: [PATCH 1/2] net: Add RX queue weights
From: Tom Herbert @ 2011-02-12 5:32 UTC (permalink / raw)
To: Dimitris Michailidis; +Cc: davem, netdev
In-Reply-To: <4D560350.5080002@chelsio.com>
> Doesn't ethtool -X already do this? With the added benefit that ethtool doesn't need each driver to provide its own weight handling arithmetic.
>
Indeed. Patches withdrawn.
Tom
^ 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