* Changing the default for net.ipv6.conf.*.use_tempaddr
From: Arnd Hannemann @ 2011-05-12 7:57 UTC (permalink / raw)
To: netdev
Hi,
while reading all the pro and cons mentioned in a recent discussion[1]
on debian-devel I wonder if there was a particular reason why
Privacy Extensions are disabled by default in linux?
Maybe it is time to reconsider the default?
Best regards
Arnd
[1] http://lists.debian.org/debian-devel/2011/05/msg00462.html
^ permalink raw reply
* Re: [patch 1/9] [PATCH] qeth: convert to hw_features part 2
From: Frank Blaschka @ 2011-05-12 7:21 UTC (permalink / raw)
To: Michał Mirosław; +Cc: davem, netdev, linux-s390
In-Reply-To: <BANLkTinO4Hity5++152Ff-RuACFDtoAV2Q@mail.gmail.com>
On Thu, May 12, 2011 at 07:59:45AM +0200, Michał Mirosław wrote:
> 2011/5/12 <frank.blaschka@de.ibm.com>:
> > From: Frank Blaschka <frank.blaschka@de.ibm.com>
> >
> > Set rx csum default to hw checksumming again.
> > Remove sysfs interface for rx csum (checksumming) and TSO (large_send).
> > With the new hw_features it does not work to keep the old sysfs
> > interface in parallel. Convert options.checksum_type to new hw_features.
> [...]
> > + /* hw may have changed during offline or recovery */
> > + if (!qeth_is_supported(card, IPA_INBOUND_CHECKSUM)) {
> [...]
>
> This check should go to ndo_fix_features callback. If it fails then
> just return features &~NETIF_F_RXCSUM from there ...
>
> > +update_feature:
> > + rtnl_lock();
> > + card->dev->hw_features &= ~NETIF_F_RXCSUM;
> > + card->dev->features &= ~NETIF_F_RXCSUM;
> > + netdev_update_features(card->dev);
> > + rtnl_unlock();
>
> ... and then this should be just:
> rtnl_lock();
> netdev_update_features(card->dev);
> rtnl_unlock();
>
This code is part of the recovery, assuming the recovery detects the hw
has lost it's rx csum capability I still don't understand how ndo_fix_features
come into play?
> BTW, How is the recovery process protected from interface removal if
> it's not run under rtnl_lock?
>
The s/390 devices have a two stage device concept. For each netdevice there is
a corresponding ccw_group device. Removing the netdevice is controlled by the
ccw_group device. The recovery process is synchronized with the ccw_group
device.
> Best Regards,
> Michał Mirosław
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH v4 1/1] can: add pruss CAN driver.
From: Wolfgang Grandegger @ 2011-05-12 7:13 UTC (permalink / raw)
To: Arnd Bergmann
Cc: sachi-EvXpCiN+lbve9wHmmfpqLFaTQe2KTcn/,
davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/,
Subhasish Ghosh, nsekhar-l0cyMroinI0, open list,
CAN NETWORK DRIVERS, Marc Kleine-Budde,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
Netdev-u79uwXL29TY76Z2rM5mHXA, m-watkins-l0cyMroinI0, Alan Cox
In-Reply-To: <201105112344.44171.arnd-r2nGTMty4D4@public.gmane.org>
On 05/11/2011 11:44 PM, Arnd Bergmann wrote:
> On Wednesday 11 May 2011, Arnd Bergmann wrote:
>> If that interpretation is right, I would seriously recommend rethinking
>> the design of the CAN firmware for pruss, so you can start doing something
>> useful with the offload engine that fits into the Socket CAN API, or that
>> would be a useful extension to Socket CAN that is also implementable in
>> the kernel for all other drivers in a meaningful way.
>
> I've looked some more into the CAN socket implementation, and I suppose that
> the idea of the pruss driver was really to help do the work from the
> can_rcv_filter function in hardware.
That software filter is per socket while the hardware filter will be per
device.
> Doing this right would really mean supporting both a mode where any new
> filter that gets added to socket can ends up being added to the hardware
> as long as it fits, similar to how we can add additional unicast mac
> addresses to an ethernet NIC. However, when the filters from all user
> sockets combined can not be represented in the hardware driver, the hardware
> needs to be put into a less efficient mode where all packets are returned
> to the kernel and processed in software.
Well, that seems sophisticated resulting in a complex implementation
(may code line) also because hardware filters are very hardware
dependent. Usually just one global filter can be defined. I think that's
overkill. A simple interface using:
ip link set can0 type can filter <id>:<mask> [<id>:<mask> ...]
would just be fine.
Wolfgang.
^ permalink raw reply
* Re: [PATCH v4 1/1] can: add pruss CAN driver.
From: Wolfgang Grandegger @ 2011-05-12 7:04 UTC (permalink / raw)
To: Arnd Bergmann
Cc: sachi-EvXpCiN+lbve9wHmmfpqLFaTQe2KTcn/,
davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/,
Subhasish Ghosh, nsekhar-l0cyMroinI0, open list,
CAN NETWORK DRIVERS, Marc Kleine-Budde,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
Netdev-u79uwXL29TY76Z2rM5mHXA, m-watkins-l0cyMroinI0, Alan Cox
In-Reply-To: <201105112331.47954.arnd-r2nGTMty4D4@public.gmane.org>
On 05/11/2011 11:31 PM, Arnd Bergmann wrote:
> On Tuesday 10 May 2011, Subhasish Ghosh wrote:
>>
>>>> Yes, In case if we allow the ALL implementation, it hogs the CPU.
>>>> In that case we do not need the PRU. The whole purpose of the PRU
>>>> is to offload the processor for any such implementations.
>>>
>>> So the kernel presumably needs to switch between using the PRU and native
>>> according to the number of ids being requested at the time ?
>>
>> All the IDs are programmed into the PRU data RAM.
>> The Kernel receives interrupts based upon these IDs.
>> I could not clearly follow "PRU and native", could you please elaborate.
>
> We would really like all CAN drivers to behave the same way. All other
> drivers are able to work without filters, so pruss_can should allow that
> too, even if it becomes a CPU hog at that time.
>
> It seems to me that the pruss can implementation has one thing backwards:
> it assumes a specific usage model for CAN that it is trying to do offload
> for. However, that usage model is currently not even supported by Socket
> CAN. If I understand Wolfgang correctly, it is in fact considered an
> unwanted limitation of the pruss can driver, instead of a useful feature.
"Unwanted" is not the right word. I see it as a piece of CAN hardware
with some serious limitations and I doubt that it will make real CAN
users happy. But well, I might be wrong.
> If that interpretation is right, I would seriously recommend rethinking
> the design of the CAN firmware for pruss, so you can start doing something
> useful with the offload engine that fits into the Socket CAN API, or that
> would be a useful extension to Socket CAN that is also implementable in
> the kernel for all other drivers in a meaningful way.
It would be really nice if they could provide a better firmware. Anyway,
the generic CAN hardware filter interface we spoke about in a previous
mail would fit for the PRUSS CAN hardware as well. It just needs to be
implemented.
Wolfgang.
^ permalink raw reply
* [PATCH net-next-2.6 2/2] be2net: fix mbox polling for signal reception
From: Sathya Perla @ 2011-05-12 6:11 UTC (permalink / raw)
To: netdev; +Cc: Sathya Perla
In-Reply-To: <1305180663-12140-1-git-send-email-sathya.perla@emulex.com>
Sending mbox cmds require multiple steps of writing to the DB register and polling
for an ack. Gettting interrupted in the middle by a signal breaks the mbox protocol.
So, set the task to UNINTERRUPTIBLE for mbox polling.
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
---
drivers/net/benet/be_cmds.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c
index bff41ed..55c8301 100644
--- a/drivers/net/benet/be_cmds.c
+++ b/drivers/net/benet/be_cmds.c
@@ -297,7 +297,7 @@ static int be_mbox_db_ready_wait(struct be_adapter *adapter, void __iomem *db)
return -1;
}
- set_current_state(TASK_INTERRUPTIBLE);
+ set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(msecs_to_jiffies(1));
msecs++;
} while (true);
--
1.7.4
^ permalink raw reply related
* [PATCH net-next-2.6 1/2] be2net: handle signal reception while waiting for POST
From: Sathya Perla @ 2011-05-12 6:11 UTC (permalink / raw)
To: netdev; +Cc: Sathya Perla
If schedule_timeout() returns prematurely (due to a signal), abort polling and return an error.
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
---
drivers/net/benet/be_cmds.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c
index 5fedc27..bff41ed 100644
--- a/drivers/net/benet/be_cmds.c
+++ b/drivers/net/benet/be_cmds.c
@@ -375,23 +375,26 @@ int be_cmd_POST(struct be_adapter *adapter)
{
u16 stage;
int status, timeout = 0;
+ struct device *dev = &adapter->pdev->dev;
do {
status = be_POST_stage_get(adapter, &stage);
if (status) {
- dev_err(&adapter->pdev->dev, "POST error; stage=0x%x\n",
- stage);
+ dev_err(dev, "POST error; stage=0x%x\n", stage);
return -1;
} else if (stage != POST_STAGE_ARMFW_RDY) {
set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(2 * HZ);
+ if (schedule_timeout(2 * HZ)) {
+ dev_err(dev, "Waiting for POST aborted\n");
+ return -EINTR;
+ }
timeout += 2;
} else {
return 0;
}
} while (timeout < 40);
- dev_err(&adapter->pdev->dev, "POST timeout; stage=0x%x\n", stage);
+ dev_err(dev, "POST timeout; stage=0x%x\n", stage);
return -1;
}
--
1.7.4
^ permalink raw reply related
* Re: [PATCH 14/15] ehea: Add GRO support
From: Michał Mirosław @ 2011-05-12 6:03 UTC (permalink / raw)
To: Anton Blanchard; +Cc: leitao, michael, jesse, bhutchings, netdev
In-Reply-To: <20110512005623.766530798@samba.org>
2011/5/12 Anton Blanchard <anton@samba.org>:
> Add GRO support to the ehea driver.
[...]
> --- linux-net.orig/drivers/net/ehea/ehea_main.c 2011-05-12 07:48:03.810341336 +1000
> +++ linux-net/drivers/net/ehea/ehea_main.c 2011-05-12 07:48:05.100361788 +1000
[...]
> @@ -3041,7 +3034,7 @@ struct ehea_port *ehea_setup_single_port
> dev->netdev_ops = &ehea_netdev_ops;
> ehea_set_ethtool_ops(dev);
>
> - dev->hw_features = NETIF_F_SG | NETIF_F_TSO
> + dev->hw_features = NETIF_F_SG | NETIF_F_TSO | NETIF_F_GRO
> | 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
GRO is now enabled by default, so no need to put it in hw_features or features.
Best Regards,
Michał Mirosław
^ permalink raw reply
* Re: [patch 1/9] [PATCH] qeth: convert to hw_features part 2
From: Michał Mirosław @ 2011-05-12 5:59 UTC (permalink / raw)
To: frank.blaschka; +Cc: davem, netdev, linux-s390
In-Reply-To: <20110512054415.435611676@de.ibm.com>
2011/5/12 <frank.blaschka@de.ibm.com>:
> From: Frank Blaschka <frank.blaschka@de.ibm.com>
>
> Set rx csum default to hw checksumming again.
> Remove sysfs interface for rx csum (checksumming) and TSO (large_send).
> With the new hw_features it does not work to keep the old sysfs
> interface in parallel. Convert options.checksum_type to new hw_features.
[...]
> + /* hw may have changed during offline or recovery */
> + if (!qeth_is_supported(card, IPA_INBOUND_CHECKSUM)) {
[...]
This check should go to ndo_fix_features callback. If it fails then
just return features &~NETIF_F_RXCSUM from there ...
> +update_feature:
> + rtnl_lock();
> + card->dev->hw_features &= ~NETIF_F_RXCSUM;
> + card->dev->features &= ~NETIF_F_RXCSUM;
> + netdev_update_features(card->dev);
> + rtnl_unlock();
... and then this should be just:
rtnl_lock();
netdev_update_features(card->dev);
rtnl_unlock();
BTW, How is the recovery process protected from interface removal if
it's not run under rtnl_lock?
Best Regards,
Michał Mirosław
^ permalink raw reply
* Re: [PATCHv1] e1000e: Allow ethtool to enable/disable loopback.
From: Michał Mirosław @ 2011-05-12 5:50 UTC (permalink / raw)
To: Mahesh Bandewar
Cc: Jeff Kirsher, e1000-devel, David Miller, netdev, Tom Herbert
In-Reply-To: <BANLkTimfF4EJ_B=Y-ssjkzmtG123P+HMTA@mail.gmail.com>
W dniu 12 maja 2011 01:11 użytkownik Mahesh Bandewar
<maheshb@google.com> napisał:
> On Wed, May 11, 2011 at 12:15 PM, Michał Mirosław <mirqus@gmail.com> wrote:
>> 2011/5/11 Mahesh Bandewar <maheshb@google.com>:
>>> This patch adds e1000_set_features() to handle loopback mode. When loopback
>>> is enabled, it enables internal-MAC loopback.
>> Please wait for this driver's conversion to hw_features. One comment
>> below, though.
> This is not intrusive so should not create problems when that happens.
Fine by me then.
>> [...]
>>> --- a/drivers/net/e1000e/netdev.c
>>> +++ b/drivers/net/e1000e/netdev.c
>> [...]
>>> +static int e1000_set_features(struct net_device *dev, u32 features)
>>> +{
>>> + u32 changed = dev->features ^ features;
>>> +
>>> + if ((changed & NETIF_F_LOOPBACK) && netif_running(dev))
>>> + e1000_set_loopback(dev, features);
>>> +
>>> + return 0;
>>> +}
>> [...]
>>
>> If e1000_set_loopback() fails, this should set dev->features to passed
>> features (but keeping NETIF_F_LOOPBACK unchanged in dev->features) to
>> keep the state consistent.
> set_features() can return the return code of set_loopback() instead of
> 0; this way the consistency will be maintained.
Only as long as NETIF_F_LOOPBACK is the only bit set in hw_features.
netdev_update_features() can't really know which features were changed
and which failed when ndo_set_features callback returns non-zero.
Best Regards,
Michał Mirosław
^ permalink raw reply
* [patch 5/9] [PATCH] lcs: get rid of compile warning
From: frank.blaschka @ 2011-05-12 5:43 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390, Heiko Carstens
In-Reply-To: <20110512054318.241733700@de.ibm.com>
[-- Attachment #1: 604-lcs-compile-warning.diff --]
[-- Type: text/plain, Size: 1658 bytes --]
From: Heiko Carstens <heiko.carstens@de.ibm.com>
-Wunused-but-set-variable generates a compile warning for lcs' tasklet
function. Invoked functions contain already error handling; thus
additional return code checking is not needed here.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
---
drivers/s390/net/lcs.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff -urpN linux-2.6/drivers/s390/net/lcs.c linux-2.6-patched/drivers/s390/net/lcs.c
--- linux-2.6/drivers/s390/net/lcs.c 2011-05-10 09:14:06.000000000 +0200
+++ linux-2.6-patched/drivers/s390/net/lcs.c 2011-05-10 09:14:25.000000000 +0200
@@ -1483,7 +1483,6 @@ lcs_tasklet(unsigned long data)
struct lcs_channel *channel;
struct lcs_buffer *iob;
int buf_idx;
- int rc;
channel = (struct lcs_channel *) data;
LCS_DBF_TEXT_(5, trace, "tlet%s", dev_name(&channel->ccwdev->dev));
@@ -1500,14 +1499,11 @@ lcs_tasklet(unsigned long data)
channel->buf_idx = buf_idx;
if (channel->state == LCS_CH_STATE_STOPPED)
- // FIXME: what if rc != 0 ??
- rc = lcs_start_channel(channel);
+ lcs_start_channel(channel);
spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags);
if (channel->state == LCS_CH_STATE_SUSPENDED &&
- channel->iob[channel->io_idx].state == LCS_BUF_STATE_READY) {
- // FIXME: what if rc != 0 ??
- rc = __lcs_resume_channel(channel);
- }
+ channel->iob[channel->io_idx].state == LCS_BUF_STATE_READY)
+ __lcs_resume_channel(channel);
spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags);
/* Something happened on the channel. Wake up waiters. */
^ permalink raw reply
* [patch 2/9] [PATCH] qeth: add OSA concurrent hardware trap
From: frank.blaschka @ 2011-05-12 5:43 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390
In-Reply-To: <20110512054318.241733700@de.ibm.com>
[-- Attachment #1: 601-qeth-hardware-trap.diff --]
[-- Type: text/plain, Size: 15659 bytes --]
From: Frank Blaschka <frank.blaschka@de.ibm.com>
This patch improves FFDC (first failure data capture) by requesting
a hardware trace in case the device driver, the hardware or a user
detects an error.
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
---
drivers/s390/net/qeth_core.h | 18 ++++
drivers/s390/net/qeth_core_main.c | 148 ++++++++++++++++++++++++++++++++++++++
drivers/s390/net/qeth_core_mpc.h | 9 ++
drivers/s390/net/qeth_core_sys.c | 61 +++++++++++++++
drivers/s390/net/qeth_l2_main.c | 16 ++++
drivers/s390/net/qeth_l3_main.c | 53 ++++---------
6 files changed, 268 insertions(+), 37 deletions(-)
--- a/drivers/s390/net/qeth_core.h
+++ b/drivers/s390/net/qeth_core.h
@@ -631,6 +631,8 @@ struct qeth_card_info {
__u32 csum_mask;
__u32 tx_csum_mask;
enum qeth_ipa_promisc_modes promisc_mode;
+ __u32 diagass_support;
+ __u32 hwtrap;
};
struct qeth_card_options {
@@ -752,6 +754,14 @@ struct qeth_card_list_struct {
rwlock_t rwlock;
};
+struct qeth_trap_id {
+ __u16 lparnr;
+ char vmname[8];
+ __u8 chpid;
+ __u8 ssid;
+ __u16 devno;
+} __packed;
+
/*some helper functions*/
#define QETH_CARD_IFNAME(card) (((card)->dev)? (card)->dev->name : "")
@@ -786,6 +796,12 @@ static inline void qeth_put_buffer_pool_
list_add_tail(&entry->list, &card->qdio.in_buf_pool.entry_list);
}
+static inline int qeth_is_diagass_supported(struct qeth_card *card,
+ enum qeth_diags_cmds cmd)
+{
+ return card->info.diagass_support & (__u32)cmd;
+}
+
extern struct ccwgroup_driver qeth_l2_ccwgroup_driver;
extern struct ccwgroup_driver qeth_l3_ccwgroup_driver;
const char *qeth_get_cardname_short(struct qeth_card *);
@@ -871,6 +887,8 @@ void qeth_dbf_longtext(debug_info_t *id,
int qeth_core_ethtool_get_settings(struct net_device *, struct ethtool_cmd *);
int qeth_set_access_ctrl_online(struct qeth_card *card);
int qeth_hdr_chk_and_bounce(struct sk_buff *, int);
+int qeth_hw_trap(struct qeth_card *, enum qeth_diags_trap_action);
+int qeth_query_ipassists(struct qeth_card *, enum qeth_prot_versions prot);
/* exports for OSN */
int qeth_osn_assist(struct net_device *, void *, int);
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -24,6 +24,7 @@
#include <asm/ebcdic.h>
#include <asm/io.h>
+#include <asm/sysinfo.h>
#include "qeth_core.h"
@@ -349,6 +350,8 @@ static struct qeth_ipa_cmd *qeth_check_i
card->info.chpid);
netif_carrier_on(card->dev);
card->lan_online = 1;
+ if (card->info.hwtrap)
+ card->info.hwtrap = 2;
qeth_schedule_recovery(card);
return NULL;
case IPA_CMD_MODCCID:
@@ -2573,6 +2576,142 @@ int qeth_query_setadapterparms(struct qe
}
EXPORT_SYMBOL_GPL(qeth_query_setadapterparms);
+static int qeth_query_ipassists_cb(struct qeth_card *card,
+ struct qeth_reply *reply, unsigned long data)
+{
+ struct qeth_ipa_cmd *cmd;
+
+ QETH_DBF_TEXT(SETUP, 2, "qipasscb");
+
+ cmd = (struct qeth_ipa_cmd *) data;
+ if (cmd->hdr.prot_version == QETH_PROT_IPV4) {
+ card->options.ipa4.supported_funcs = cmd->hdr.ipa_supported;
+ card->options.ipa4.enabled_funcs = cmd->hdr.ipa_enabled;
+ } else {
+ card->options.ipa6.supported_funcs = cmd->hdr.ipa_supported;
+ card->options.ipa6.enabled_funcs = cmd->hdr.ipa_enabled;
+ }
+ QETH_DBF_TEXT(SETUP, 2, "suppenbl");
+ QETH_DBF_TEXT_(SETUP, 2, "%x", cmd->hdr.ipa_supported);
+ QETH_DBF_TEXT_(SETUP, 2, "%x", cmd->hdr.ipa_enabled);
+ return 0;
+}
+
+int qeth_query_ipassists(struct qeth_card *card, enum qeth_prot_versions prot)
+{
+ int rc;
+ struct qeth_cmd_buffer *iob;
+
+ QETH_DBF_TEXT_(SETUP, 2, "qipassi%i", prot);
+ iob = qeth_get_ipacmd_buffer(card, IPA_CMD_QIPASSIST, prot);
+ rc = qeth_send_ipa_cmd(card, iob, qeth_query_ipassists_cb, NULL);
+ return rc;
+}
+EXPORT_SYMBOL_GPL(qeth_query_ipassists);
+
+static int qeth_query_setdiagass_cb(struct qeth_card *card,
+ struct qeth_reply *reply, unsigned long data)
+{
+ struct qeth_ipa_cmd *cmd;
+ __u16 rc;
+
+ cmd = (struct qeth_ipa_cmd *)data;
+ rc = cmd->hdr.return_code;
+ if (rc)
+ QETH_CARD_TEXT_(card, 2, "diagq:%x", rc);
+ else
+ card->info.diagass_support = cmd->data.diagass.ext;
+ return 0;
+}
+
+static int qeth_query_setdiagass(struct qeth_card *card)
+{
+ struct qeth_cmd_buffer *iob;
+ struct qeth_ipa_cmd *cmd;
+
+ QETH_DBF_TEXT(SETUP, 2, "qdiagass");
+ iob = qeth_get_ipacmd_buffer(card, IPA_CMD_SET_DIAG_ASS, 0);
+ cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
+ cmd->data.diagass.subcmd_len = 16;
+ cmd->data.diagass.subcmd = QETH_DIAGS_CMD_QUERY;
+ return qeth_send_ipa_cmd(card, iob, qeth_query_setdiagass_cb, NULL);
+}
+
+static void qeth_get_trap_id(struct qeth_card *card, struct qeth_trap_id *tid)
+{
+ unsigned long info = get_zeroed_page(GFP_KERNEL);
+ struct sysinfo_2_2_2 *info222 = (struct sysinfo_2_2_2 *)info;
+ struct sysinfo_3_2_2 *info322 = (struct sysinfo_3_2_2 *)info;
+ struct ccw_dev_id ccwid;
+ int level, rc;
+
+ tid->chpid = card->info.chpid;
+ ccw_device_get_id(CARD_RDEV(card), &ccwid);
+ tid->ssid = ccwid.ssid;
+ tid->devno = ccwid.devno;
+ if (!info)
+ return;
+
+ rc = stsi(NULL, 0, 0, 0);
+ if (rc == -ENOSYS)
+ level = rc;
+ else
+ level = (((unsigned int) rc) >> 28);
+
+ if ((level >= 2) && (stsi(info222, 2, 2, 2) != -ENOSYS))
+ tid->lparnr = info222->lpar_number;
+
+ if ((level >= 3) && (stsi(info322, 3, 2, 2) != -ENOSYS)) {
+ EBCASC(info322->vm[0].name, sizeof(info322->vm[0].name));
+ memcpy(tid->vmname, info322->vm[0].name, sizeof(tid->vmname));
+ }
+ free_page(info);
+ return;
+}
+
+static int qeth_hw_trap_cb(struct qeth_card *card,
+ struct qeth_reply *reply, unsigned long data)
+{
+ struct qeth_ipa_cmd *cmd;
+ __u16 rc;
+
+ cmd = (struct qeth_ipa_cmd *)data;
+ rc = cmd->hdr.return_code;
+ if (rc)
+ QETH_CARD_TEXT_(card, 2, "trapc:%x", rc);
+ return 0;
+}
+
+int qeth_hw_trap(struct qeth_card *card, enum qeth_diags_trap_action action)
+{
+ struct qeth_cmd_buffer *iob;
+ struct qeth_ipa_cmd *cmd;
+
+ QETH_DBF_TEXT(SETUP, 2, "diagtrap");
+ iob = qeth_get_ipacmd_buffer(card, IPA_CMD_SET_DIAG_ASS, 0);
+ cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
+ cmd->data.diagass.subcmd_len = 80;
+ cmd->data.diagass.subcmd = QETH_DIAGS_CMD_TRAP;
+ cmd->data.diagass.type = 1;
+ cmd->data.diagass.action = action;
+ switch (action) {
+ case QETH_DIAGS_TRAP_ARM:
+ cmd->data.diagass.options = 0x0003;
+ cmd->data.diagass.ext = 0x00010000 +
+ sizeof(struct qeth_trap_id);
+ qeth_get_trap_id(card,
+ (struct qeth_trap_id *)cmd->data.diagass.cdata);
+ break;
+ case QETH_DIAGS_TRAP_DISARM:
+ cmd->data.diagass.options = 0x0001;
+ break;
+ case QETH_DIAGS_TRAP_CAPTURE:
+ break;
+ }
+ return qeth_send_ipa_cmd(card, iob, qeth_hw_trap_cb, NULL);
+}
+EXPORT_SYMBOL_GPL(qeth_hw_trap);
+
int qeth_check_qdio_errors(struct qeth_card *card, struct qdio_buffer *buf,
unsigned int qdio_error, const char *dbftext)
{
@@ -3983,6 +4122,15 @@ retriable:
QETH_DBF_TEXT_(SETUP, 2, "5err%d", rc);
goto out;
}
+
+ card->options.ipa4.supported_funcs = 0;
+ card->options.adp.supported_funcs = 0;
+ card->info.diagass_support = 0;
+ qeth_query_ipassists(card, QETH_PROT_IPV4);
+ if (qeth_is_supported(card, IPA_SETADAPTERPARMS))
+ qeth_query_setadapterparms(card);
+ if (qeth_adp_supported(card, IPA_SETADP_SET_DIAG_ASSIST))
+ qeth_query_setdiagass(card);
return 0;
out:
dev_warn(&card->gdev->dev, "The qeth device driver failed to recover "
--- a/drivers/s390/net/qeth_core_mpc.h
+++ b/drivers/s390/net/qeth_core_mpc.h
@@ -448,6 +448,12 @@ enum qeth_diags_trace_cmds {
QETH_DIAGS_CMD_TRACE_QUERY = 0x0010,
};
+enum qeth_diags_trap_action {
+ QETH_DIAGS_TRAP_ARM = 0x01,
+ QETH_DIAGS_TRAP_DISARM = 0x02,
+ QETH_DIAGS_TRAP_CAPTURE = 0x04,
+};
+
struct qeth_ipacmd_diagass {
__u32 host_tod2;
__u32:32;
@@ -457,7 +463,8 @@ struct qeth_ipacmd_diagass {
__u8 type;
__u8 action;
__u16 options;
- __u32:32;
+ __u32 ext;
+ __u8 cdata[64];
} __attribute__ ((packed));
/* Header for each IPA command */
--- a/drivers/s390/net/qeth_core_sys.c
+++ b/drivers/s390/net/qeth_core_sys.c
@@ -530,6 +530,66 @@ out:
static DEVICE_ATTR(isolation, 0644, qeth_dev_isolation_show,
qeth_dev_isolation_store);
+static ssize_t qeth_hw_trap_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct qeth_card *card = dev_get_drvdata(dev);
+
+ if (!card)
+ return -EINVAL;
+ if (card->info.hwtrap)
+ return snprintf(buf, 5, "arm\n");
+ else
+ return snprintf(buf, 8, "disarm\n");
+}
+
+static ssize_t qeth_hw_trap_store(struct device *dev,
+ struct device_attribute *attr, const char *buf, size_t count)
+{
+ struct qeth_card *card = dev_get_drvdata(dev);
+ int rc = 0;
+ char *tmp, *curtoken;
+ int state = 0;
+ curtoken = (char *)buf;
+
+ if (!card)
+ return -EINVAL;
+
+ mutex_lock(&card->conf_mutex);
+ if (card->state == CARD_STATE_SOFTSETUP || card->state == CARD_STATE_UP)
+ state = 1;
+ tmp = strsep(&curtoken, "\n");
+
+ if (!strcmp(tmp, "arm") && !card->info.hwtrap) {
+ if (state) {
+ if (qeth_is_diagass_supported(card,
+ QETH_DIAGS_CMD_TRAP)) {
+ rc = qeth_hw_trap(card, QETH_DIAGS_TRAP_ARM);
+ if (!rc)
+ card->info.hwtrap = 1;
+ } else
+ rc = -EINVAL;
+ } else
+ card->info.hwtrap = 1;
+ } else if (!strcmp(tmp, "disarm") && card->info.hwtrap) {
+ if (state) {
+ rc = qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM);
+ if (!rc)
+ card->info.hwtrap = 0;
+ } else
+ card->info.hwtrap = 0;
+ } else if (!strcmp(tmp, "trap") && state && card->info.hwtrap)
+ rc = qeth_hw_trap(card, QETH_DIAGS_TRAP_CAPTURE);
+ else
+ rc = -EINVAL;
+
+ mutex_unlock(&card->conf_mutex);
+ return rc ? rc : count;
+}
+
+static DEVICE_ATTR(hw_trap, 0644, qeth_hw_trap_show,
+ qeth_hw_trap_store);
+
static ssize_t qeth_dev_blkt_show(char *buf, struct qeth_card *card, int value)
{
@@ -653,6 +713,7 @@ static struct attribute *qeth_device_att
&dev_attr_performance_stats.attr,
&dev_attr_layer2.attr,
&dev_attr_isolation.attr,
+ &dev_attr_hw_trap.attr,
NULL,
};
--- a/drivers/s390/net/qeth_l2_main.c
+++ b/drivers/s390/net/qeth_l2_main.c
@@ -876,6 +876,7 @@ static int qeth_l2_probe_device(struct c
INIT_LIST_HEAD(&card->vid_list);
INIT_LIST_HEAD(&card->mc_list);
card->options.layer2 = 1;
+ card->info.hwtrap = 0;
card->discipline.start_poll = qeth_qdio_start_poll;
card->discipline.input_handler = (qdio_handler_t *)
qeth_qdio_input_handler;
@@ -994,6 +995,13 @@ static int __qeth_l2_set_online(struct c
if (card->info.type != QETH_CARD_TYPE_OSN)
qeth_l2_send_setmac(card, &card->dev->dev_addr[0]);
+ if (qeth_is_diagass_supported(card, QETH_DIAGS_CMD_TRAP)) {
+ if (card->info.hwtrap &&
+ qeth_hw_trap(card, QETH_DIAGS_TRAP_ARM))
+ card->info.hwtrap = 0;
+ } else
+ card->info.hwtrap = 0;
+
card->state = CARD_STATE_HARDSETUP;
memset(&card->rx, 0, sizeof(struct qeth_rx));
qeth_print_status_message(card);
@@ -1092,6 +1100,10 @@ static int __qeth_l2_set_offline(struct
if (card->dev && netif_carrier_ok(card->dev))
netif_carrier_off(card->dev);
recover_flag = card->state;
+ if ((!recovery_mode && card->info.hwtrap) || card->info.hwtrap == 2) {
+ qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM);
+ card->info.hwtrap = 1;
+ }
qeth_l2_stop_card(card, recovery_mode);
rc = ccw_device_set_offline(CARD_DDEV(card));
rc2 = ccw_device_set_offline(CARD_WDEV(card));
@@ -1157,6 +1169,8 @@ static void __exit qeth_l2_exit(void)
static void qeth_l2_shutdown(struct ccwgroup_device *gdev)
{
struct qeth_card *card = dev_get_drvdata(&gdev->dev);
+ if ((gdev->state == CCWGROUP_ONLINE) && card->info.hwtrap)
+ qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM);
qeth_qdio_clear_card(card, 0);
qeth_clear_qdio_buffers(card);
}
@@ -1172,6 +1186,8 @@ static int qeth_l2_pm_suspend(struct ccw
if (gdev->state == CCWGROUP_OFFLINE)
return 0;
if (card->state == CARD_STATE_UP) {
+ if (card->info.hwtrap)
+ qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM);
__qeth_l2_set_offline(card->gdev, 1);
} else
__qeth_l2_set_offline(card->gdev, 0);
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -1277,39 +1277,6 @@ static int qeth_l3_start_ipa_multicast(s
return rc;
}
-static int qeth_l3_query_ipassists_cb(struct qeth_card *card,
- struct qeth_reply *reply, unsigned long data)
-{
- struct qeth_ipa_cmd *cmd;
-
- QETH_DBF_TEXT(SETUP, 2, "qipasscb");
-
- cmd = (struct qeth_ipa_cmd *) data;
- if (cmd->hdr.prot_version == QETH_PROT_IPV4) {
- card->options.ipa4.supported_funcs = cmd->hdr.ipa_supported;
- card->options.ipa4.enabled_funcs = cmd->hdr.ipa_enabled;
- } else {
- card->options.ipa6.supported_funcs = cmd->hdr.ipa_supported;
- card->options.ipa6.enabled_funcs = cmd->hdr.ipa_enabled;
- }
- QETH_DBF_TEXT(SETUP, 2, "suppenbl");
- QETH_DBF_TEXT_(SETUP, 2, "%x", cmd->hdr.ipa_supported);
- QETH_DBF_TEXT_(SETUP, 2, "%x", cmd->hdr.ipa_enabled);
- return 0;
-}
-
-static int qeth_l3_query_ipassists(struct qeth_card *card,
- enum qeth_prot_versions prot)
-{
- int rc;
- struct qeth_cmd_buffer *iob;
-
- QETH_DBF_TEXT_(SETUP, 2, "qipassi%i", prot);
- iob = qeth_get_ipacmd_buffer(card, IPA_CMD_QIPASSIST, prot);
- rc = qeth_send_ipa_cmd(card, iob, qeth_l3_query_ipassists_cb, NULL);
- return rc;
-}
-
#ifdef CONFIG_QETH_IPV6
static int qeth_l3_softsetup_ipv6(struct qeth_card *card)
{
@@ -1320,7 +1287,7 @@ static int qeth_l3_softsetup_ipv6(struct
if (card->info.type == QETH_CARD_TYPE_IQD)
goto out;
- rc = qeth_l3_query_ipassists(card, QETH_PROT_IPV6);
+ rc = qeth_query_ipassists(card, QETH_PROT_IPV6);
if (rc) {
dev_err(&card->gdev->dev,
"Activating IPv6 support for %s failed\n",
@@ -3372,6 +3339,7 @@ static int qeth_l3_probe_device(struct c
qeth_l3_create_device_attributes(&gdev->dev);
card->options.layer2 = 0;
+ card->info.hwtrap = 0;
card->discipline.start_poll = qeth_qdio_start_poll;
card->discipline.input_handler = (qdio_handler_t *)
qeth_qdio_input_handler;
@@ -3423,13 +3391,18 @@ static int __qeth_l3_set_online(struct c
goto out_remove;
}
- qeth_l3_query_ipassists(card, QETH_PROT_IPV4);
-
if (!card->dev && qeth_l3_setup_netdev(card)) {
rc = -ENODEV;
goto out_remove;
}
+ if (qeth_is_diagass_supported(card, QETH_DIAGS_CMD_TRAP)) {
+ if (card->info.hwtrap &&
+ qeth_hw_trap(card, QETH_DIAGS_TRAP_ARM))
+ card->info.hwtrap = 0;
+ } else
+ card->info.hwtrap = 0;
+
card->state = CARD_STATE_HARDSETUP;
memset(&card->rx, 0, sizeof(struct qeth_rx));
qeth_print_status_message(card);
@@ -3531,6 +3504,10 @@ static int __qeth_l3_set_offline(struct
if (card->dev && netif_carrier_ok(card->dev))
netif_carrier_off(card->dev);
recover_flag = card->state;
+ if ((!recovery_mode && card->info.hwtrap) || card->info.hwtrap == 2) {
+ qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM);
+ card->info.hwtrap = 1;
+ }
qeth_l3_stop_card(card, recovery_mode);
rc = ccw_device_set_offline(CARD_DDEV(card));
rc2 = ccw_device_set_offline(CARD_WDEV(card));
@@ -3586,6 +3563,8 @@ static int qeth_l3_recover(void *ptr)
static void qeth_l3_shutdown(struct ccwgroup_device *gdev)
{
struct qeth_card *card = dev_get_drvdata(&gdev->dev);
+ if ((gdev->state == CCWGROUP_ONLINE) && card->info.hwtrap)
+ qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM);
qeth_qdio_clear_card(card, 0);
qeth_clear_qdio_buffers(card);
}
@@ -3601,6 +3580,8 @@ static int qeth_l3_pm_suspend(struct ccw
if (gdev->state == CCWGROUP_OFFLINE)
return 0;
if (card->state == CARD_STATE_UP) {
+ if (card->info.hwtrap)
+ qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM);
__qeth_l3_set_offline(card->gdev, 1);
} else
__qeth_l3_set_offline(card->gdev, 0);
^ permalink raw reply
* [patch 7/9] [PATCH] iucv: get rid of compile warning
From: frank.blaschka @ 2011-05-12 5:43 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390, Ursula Braun
In-Reply-To: <20110512054318.241733700@de.ibm.com>
[-- Attachment #1: 606-iucv-compile-warning.diff --]
[-- Type: text/plain, Size: 990 bytes --]
From: Ursula Braun <ursula.braun@de.ibm.com>
-Wunused-but-set-variable generates a compile warning. The affected
variable is removed.
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
---
net/iucv/iucv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff -urpN linux-2.6/net/iucv/iucv.c linux-2.6-patched/net/iucv/iucv.c
--- linux-2.6/net/iucv/iucv.c 2011-05-10 09:14:08.000000000 +0200
+++ linux-2.6-patched/net/iucv/iucv.c 2011-05-10 09:14:26.000000000 +0200
@@ -828,14 +828,14 @@ EXPORT_SYMBOL(iucv_unregister);
static int iucv_reboot_event(struct notifier_block *this,
unsigned long event, void *ptr)
{
- int i, rc;
+ int i;
get_online_cpus();
on_each_cpu(iucv_block_cpu, NULL, 1);
preempt_disable();
for (i = 0; i < iucv_max_pathid; i++) {
if (iucv_path_table[i])
- rc = iucv_sever_pathid(i, NULL);
+ iucv_sever_pathid(i, NULL);
}
preempt_enable();
put_online_cpus();
^ permalink raw reply
* [patch 1/9] [PATCH] qeth: convert to hw_features part 2
From: frank.blaschka @ 2011-05-12 5:43 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390
In-Reply-To: <20110512054318.241733700@de.ibm.com>
[-- Attachment #1: qeth_hw_feat2.patch --]
[-- Type: text/plain, Size: 12127 bytes --]
From: Frank Blaschka <frank.blaschka@de.ibm.com>
Set rx csum default to hw checksumming again.
Remove sysfs interface for rx csum (checksumming) and TSO (large_send).
With the new hw_features it does not work to keep the old sysfs
interface in parallel. Convert options.checksum_type to new hw_features.
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
---
drivers/s390/net/qeth_core.h | 1
drivers/s390/net/qeth_core_main.c | 1
drivers/s390/net/qeth_core_mpc.h | 8 --
drivers/s390/net/qeth_l2_main.c | 5 -
drivers/s390/net/qeth_l3.h | 2
drivers/s390/net/qeth_l3_main.c | 109 +++++++++++++++++---------------------
drivers/s390/net/qeth_l3_sys.c | 106 ------------------------------------
7 files changed, 52 insertions(+), 180 deletions(-)
--- a/drivers/s390/net/qeth_core.h
+++ b/drivers/s390/net/qeth_core.h
@@ -639,7 +639,6 @@ struct qeth_card_options {
struct qeth_ipa_info adp; /*Adapter parameters*/
struct qeth_routing_info route6;
struct qeth_ipa_info ipa6;
- enum qeth_checksum_types checksum_type;
int broadcast_mode;
int macaddr_mode;
int fake_broadcast;
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -1039,7 +1039,6 @@ static void qeth_set_intial_options(stru
{
card->options.route4.type = NO_ROUTER;
card->options.route6.type = NO_ROUTER;
- card->options.checksum_type = QETH_CHECKSUM_DEFAULT;
card->options.broadcast_mode = QETH_TR_BROADCAST_ALLRINGS;
card->options.macaddr_mode = QETH_TR_MACADDR_NONCANONICAL;
card->options.fake_broadcast = 0;
--- a/drivers/s390/net/qeth_core_mpc.h
+++ b/drivers/s390/net/qeth_core_mpc.h
@@ -80,14 +80,6 @@ enum qeth_tr_broadcast_modes {
QETH_TR_BROADCAST_LOCAL = 1,
};
-/* these values match CHECKSUM_* in include/linux/skbuff.h */
-enum qeth_checksum_types {
- SW_CHECKSUMMING = 0, /* TODO: set to bit flag used in IPA Command */
- HW_CHECKSUMMING = 1,
- NO_CHECKSUMMING = 2,
-};
-#define QETH_CHECKSUM_DEFAULT SW_CHECKSUMMING
-
/*
* Routing stuff
*/
--- a/drivers/s390/net/qeth_l2_main.c
+++ b/drivers/s390/net/qeth_l2_main.c
@@ -420,10 +420,7 @@ static int qeth_l2_process_inbound_buffe
case QETH_HEADER_TYPE_LAYER2:
skb->pkt_type = PACKET_HOST;
skb->protocol = eth_type_trans(skb, skb->dev);
- if (card->options.checksum_type == NO_CHECKSUMMING)
- skb->ip_summed = CHECKSUM_UNNECESSARY;
- else
- skb->ip_summed = CHECKSUM_NONE;
+ skb->ip_summed = CHECKSUM_NONE;
if (skb->protocol == htons(ETH_P_802_2))
*((__u32 *)skb->cb) = ++card->seqno.pkt_seqno;
len = skb->len;
--- a/drivers/s390/net/qeth_l3.h
+++ b/drivers/s390/net/qeth_l3.h
@@ -62,8 +62,6 @@ void qeth_l3_del_vipa(struct qeth_card *
int qeth_l3_add_rxip(struct qeth_card *, enum qeth_prot_versions, const u8 *);
void qeth_l3_del_rxip(struct qeth_card *card, enum qeth_prot_versions,
const u8 *);
-int qeth_l3_set_large_send(struct qeth_card *, enum qeth_large_send_types);
-int qeth_l3_set_rx_csum(struct qeth_card *, enum qeth_checksum_types);
int qeth_l3_is_addr_covered_by_ipato(struct qeth_card *, struct qeth_ipaddr *);
#endif /* __QETH_L3_H__ */
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -1445,34 +1445,30 @@ static int qeth_l3_send_checksum_command
return 0;
}
-int qeth_l3_set_rx_csum(struct qeth_card *card,
- enum qeth_checksum_types csum_type)
+int qeth_l3_set_rx_csum(struct qeth_card *card, int on)
{
int rc = 0;
- if (card->options.checksum_type == HW_CHECKSUMMING) {
- if ((csum_type != HW_CHECKSUMMING) &&
- (card->state != CARD_STATE_DOWN)) {
- rc = qeth_l3_send_simple_setassparms(card,
- IPA_INBOUND_CHECKSUM, IPA_CMD_ASS_STOP, 0);
+ if (on) {
+ if (card->state != CARD_STATE_DOWN) {
+ if (!qeth_is_supported(card,
+ IPA_INBOUND_CHECKSUM))
+ return -EPERM;
+ rc = qeth_l3_send_checksum_command(card);
if (rc)
return -EIO;
+ card->dev->features |= NETIF_F_RXCSUM;
}
- card->dev->features |= NETIF_F_RXCSUM;
} else {
- if (csum_type == HW_CHECKSUMMING) {
- if (card->state != CARD_STATE_DOWN) {
- if (!qeth_is_supported(card,
- IPA_INBOUND_CHECKSUM))
- return -EPERM;
- rc = qeth_l3_send_checksum_command(card);
- if (rc)
- return -EIO;
- }
+ if (card->state != CARD_STATE_DOWN) {
+ rc = qeth_l3_send_simple_setassparms(card,
+ IPA_INBOUND_CHECKSUM, IPA_CMD_ASS_STOP, 0);
+ if (rc)
+ return -EIO;
+ card->dev->features &= ~NETIF_F_RXCSUM;
}
- card->dev->features &= ~NETIF_F_RXCSUM;
}
- card->options.checksum_type = csum_type;
+
return rc;
}
@@ -1482,32 +1478,35 @@ static int qeth_l3_start_ipa_checksum(st
QETH_CARD_TEXT(card, 3, "strtcsum");
- if (card->options.checksum_type == NO_CHECKSUMMING) {
- dev_info(&card->gdev->dev,
- "Using no checksumming on %s.\n",
- QETH_CARD_IFNAME(card));
- return 0;
- }
- if (card->options.checksum_type == SW_CHECKSUMMING) {
- dev_info(&card->gdev->dev,
- "Using SW checksumming on %s.\n",
- QETH_CARD_IFNAME(card));
- return 0;
- }
- if (!qeth_is_supported(card, IPA_INBOUND_CHECKSUM)) {
- dev_info(&card->gdev->dev,
+ if (card->dev->features & NETIF_F_RXCSUM) {
+ /* hw may have changed during offline or recovery */
+ if (!qeth_is_supported(card, IPA_INBOUND_CHECKSUM)) {
+ dev_info(&card->gdev->dev,
"Inbound HW Checksumming not "
"supported on %s,\ncontinuing "
"using Inbound SW Checksumming\n",
QETH_CARD_IFNAME(card));
- card->options.checksum_type = SW_CHECKSUMMING;
- return 0;
- }
- rc = qeth_l3_send_checksum_command(card);
- if (!rc)
- dev_info(&card->gdev->dev,
+ goto update_feature;
+ }
+
+ rc = qeth_l3_send_checksum_command(card);
+ if (!rc)
+ dev_info(&card->gdev->dev,
"HW Checksumming (inbound) enabled\n");
+ else
+ goto update_feature;
+ } else
+ dev_info(&card->gdev->dev,
+ "Using SW checksumming on %s.\n",
+ QETH_CARD_IFNAME(card));
+ return 0;
+update_feature:
+ rtnl_lock();
+ card->dev->hw_features &= ~NETIF_F_RXCSUM;
+ card->dev->features &= ~NETIF_F_RXCSUM;
+ netdev_update_features(card->dev);
+ rtnl_unlock();
return rc;
}
@@ -2037,14 +2036,7 @@ static inline int qeth_l3_rebuild_skb(st
is_vlan = 1;
}
- switch (card->options.checksum_type) {
- case SW_CHECKSUMMING:
- skb->ip_summed = CHECKSUM_NONE;
- break;
- case NO_CHECKSUMMING:
- skb->ip_summed = CHECKSUM_UNNECESSARY;
- break;
- case HW_CHECKSUMMING:
+ if (card->dev->features & NETIF_F_RXCSUM) {
if ((hdr->hdr.l3.ext_flags &
(QETH_HDR_EXT_CSUM_HDR_REQ |
QETH_HDR_EXT_CSUM_TRANSP_REQ)) ==
@@ -2053,7 +2045,8 @@ static inline int qeth_l3_rebuild_skb(st
skb->ip_summed = CHECKSUM_UNNECESSARY;
else
skb->ip_summed = CHECKSUM_NONE;
- }
+ } else
+ skb->ip_summed = CHECKSUM_NONE;
return is_vlan;
}
@@ -3235,20 +3228,19 @@ static u32 qeth_l3_fix_features(struct n
static int qeth_l3_set_features(struct net_device *dev, u32 features)
{
- enum qeth_checksum_types csum_type;
struct qeth_card *card = dev->ml_priv;
u32 changed = dev->features ^ features;
+ int on;
if (!(changed & NETIF_F_RXCSUM))
return 0;
if (features & NETIF_F_RXCSUM)
- csum_type = HW_CHECKSUMMING;
+ on = 1;
else
- csum_type = SW_CHECKSUMMING;
+ on = 0;
- dev->features = features ^ NETIF_F_RXCSUM;
- return qeth_l3_set_rx_csum(card, csum_type);
+ return qeth_l3_set_rx_csum(card, on);
}
static const struct ethtool_ops qeth_l3_ethtool_ops = {
@@ -3342,6 +3334,12 @@ static int qeth_l3_setup_netdev(struct q
if (!(card->info.unique_id & UNIQUE_ID_NOT_BY_CARD))
card->dev->dev_id = card->info.unique_id &
0xffff;
+ if (!card->info.guestlan) {
+ card->dev->hw_features = NETIF_F_SG |
+ NETIF_F_RXCSUM | NETIF_F_IP_CSUM |
+ NETIF_F_TSO;
+ card->dev->features = NETIF_F_RXCSUM;
+ }
}
} else if (card->info.type == QETH_CARD_TYPE_IQD) {
card->dev = alloc_netdev(0, "hsi%d", ether_setup);
@@ -3357,8 +3355,6 @@ static int qeth_l3_setup_netdev(struct q
card->dev->watchdog_timeo = QETH_TX_TIMEOUT;
card->dev->mtu = card->info.initial_mtu;
SET_ETHTOOL_OPS(card->dev, &qeth_l3_ethtool_ops);
- card->dev->hw_features = NETIF_F_SG | NETIF_F_RXCSUM |
- NETIF_F_IP_CSUM | NETIF_F_TSO;
card->dev->features |= NETIF_F_HW_VLAN_TX |
NETIF_F_HW_VLAN_RX |
NETIF_F_HW_VLAN_FILTER;
@@ -3382,9 +3378,6 @@ static int qeth_l3_probe_device(struct c
card->discipline.output_handler = (qdio_handler_t *)
qeth_qdio_output_handler;
card->discipline.recover = qeth_l3_recover;
- if ((card->info.type == QETH_CARD_TYPE_OSD) ||
- (card->info.type == QETH_CARD_TYPE_OSX))
- card->options.checksum_type = HW_CHECKSUMMING;
return 0;
}
--- a/drivers/s390/net/qeth_l3_sys.c
+++ b/drivers/s390/net/qeth_l3_sys.c
@@ -15,16 +15,6 @@
#define QETH_DEVICE_ATTR(_id, _name, _mode, _show, _store) \
struct device_attribute dev_attr_##_id = __ATTR(_name, _mode, _show, _store)
-static const char *qeth_l3_get_checksum_str(struct qeth_card *card)
-{
- if (card->options.checksum_type == SW_CHECKSUMMING)
- return "sw";
- else if (card->options.checksum_type == HW_CHECKSUMMING)
- return "hw";
- else
- return "no";
-}
-
static ssize_t qeth_l3_dev_route_show(struct qeth_card *card,
struct qeth_routing_info *route, char *buf)
{
@@ -295,51 +285,6 @@ out:
static DEVICE_ATTR(canonical_macaddr, 0644, qeth_l3_dev_canonical_macaddr_show,
qeth_l3_dev_canonical_macaddr_store);
-static ssize_t qeth_l3_dev_checksum_show(struct device *dev,
- struct device_attribute *attr, char *buf)
-{
- struct qeth_card *card = dev_get_drvdata(dev);
-
- if (!card)
- return -EINVAL;
-
- return sprintf(buf, "%s checksumming\n",
- qeth_l3_get_checksum_str(card));
-}
-
-static ssize_t qeth_l3_dev_checksum_store(struct device *dev,
- struct device_attribute *attr, const char *buf, size_t count)
-{
- struct qeth_card *card = dev_get_drvdata(dev);
- enum qeth_checksum_types csum_type;
- char *tmp;
- int rc = 0;
-
- if (!card)
- return -EINVAL;
-
- mutex_lock(&card->conf_mutex);
- tmp = strsep((char **) &buf, "\n");
- if (!strcmp(tmp, "sw_checksumming"))
- csum_type = SW_CHECKSUMMING;
- else if (!strcmp(tmp, "hw_checksumming"))
- csum_type = HW_CHECKSUMMING;
- else if (!strcmp(tmp, "no_checksumming"))
- csum_type = NO_CHECKSUMMING;
- else {
- rc = -EINVAL;
- goto out;
- }
-
- rc = qeth_l3_set_rx_csum(card, csum_type);
-out:
- mutex_unlock(&card->conf_mutex);
- return rc ? rc : count;
-}
-
-static DEVICE_ATTR(checksumming, 0644, qeth_l3_dev_checksum_show,
- qeth_l3_dev_checksum_store);
-
static ssize_t qeth_l3_dev_sniffer_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
@@ -402,64 +347,13 @@ out:
static DEVICE_ATTR(sniffer, 0644, qeth_l3_dev_sniffer_show,
qeth_l3_dev_sniffer_store);
-static ssize_t qeth_l3_dev_large_send_show(struct device *dev,
- struct device_attribute *attr, char *buf)
-{
- struct qeth_card *card = dev_get_drvdata(dev);
-
- if (!card)
- return -EINVAL;
-
- if (!(card->dev->features & NETIF_F_TSO))
- return sprintf(buf, "%s\n", "no");
- else
- return sprintf(buf, "%s\n", "TSO");
-}
-
-static ssize_t qeth_l3_dev_large_send_store(struct device *dev,
- struct device_attribute *attr, const char *buf, size_t count)
-{
- struct qeth_card *card;
- char *tmp;
- int enable;
-
- if (!card)
- return -EINVAL;
- tmp = strsep((char **) &buf, "\n");
- if (!strcmp(tmp, "no"))
- enable = 0;
- else if (!strcmp(tmp, "TSO"))
- enable = 1;
- else
- return -EINVAL;
-
- rtnl_lock();
-
- card = dev_get_drvdata(dev);
-
- if (enable)
- card->dev->wanted_features |= NETIF_F_TSO;
- else
- card->dev->wanted_features &= ~NETIF_F_TSO;
- netdev_update_features(card->dev);
-
- rtnl_unlock();
-
- return count;
-}
-
-static DEVICE_ATTR(large_send, 0644, qeth_l3_dev_large_send_show,
- qeth_l3_dev_large_send_store);
-
static struct attribute *qeth_l3_device_attrs[] = {
&dev_attr_route4.attr,
&dev_attr_route6.attr,
&dev_attr_fake_broadcast.attr,
&dev_attr_broadcast_mode.attr,
&dev_attr_canonical_macaddr.attr,
- &dev_attr_checksumming.attr,
&dev_attr_sniffer.attr,
- &dev_attr_large_send.attr,
NULL,
};
^ permalink raw reply
* [patch 4/9] [PATCH] claw: remove unused return code handling
From: frank.blaschka @ 2011-05-12 5:43 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390, Heiko Carstens
In-Reply-To: <20110512054318.241733700@de.ibm.com>
[-- Attachment #1: 603-claw-unused-rc.diff --]
[-- Type: text/plain, Size: 3801 bytes --]
From: Heiko Carstens <heiko.carstens@de.ibm.com>
Remove unused return code handling. The claw driver is mostly dead, so
just make sure it keeps compiling without warnings.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
---
drivers/s390/net/claw.c | 22 +++-------------------
1 file changed, 3 insertions(+), 19 deletions(-)
diff -urpN linux-2.6/drivers/s390/net/claw.c linux-2.6-patched/drivers/s390/net/claw.c
--- linux-2.6/drivers/s390/net/claw.c 2011-05-10 09:14:06.000000000 +0200
+++ linux-2.6-patched/drivers/s390/net/claw.c 2011-05-10 09:14:25.000000000 +0200
@@ -845,12 +845,10 @@ claw_irq_tasklet ( unsigned long data )
{
struct chbk * p_ch;
struct net_device *dev;
- struct claw_privbk * privptr;
p_ch = (struct chbk *) data;
dev = (struct net_device *)p_ch->ndev;
CLAW_DBF_TEXT(4, trace, "IRQtask");
- privptr = (struct claw_privbk *)dev->ml_priv;
unpack_read(dev);
clear_bit(CLAW_BH_ACTIVE, (void *)&p_ch->flag_a);
CLAW_DBF_TEXT(4, trace, "TskletXt");
@@ -1026,7 +1024,6 @@ claw_write_next ( struct chbk * p_ch )
struct net_device *dev;
struct claw_privbk *privptr=NULL;
struct sk_buff *pk_skb;
- int rc;
CLAW_DBF_TEXT(4, trace, "claw_wrt");
if (p_ch->claw_state == CLAW_STOP)
@@ -1038,7 +1035,7 @@ claw_write_next ( struct chbk * p_ch )
!skb_queue_empty(&p_ch->collect_queue)) {
pk_skb = claw_pack_skb(privptr);
while (pk_skb != NULL) {
- rc = claw_hw_tx( pk_skb, dev,1);
+ claw_hw_tx(pk_skb, dev, 1);
if (privptr->write_free_count > 0) {
pk_skb = claw_pack_skb(privptr);
} else
@@ -1322,15 +1319,12 @@ claw_hw_tx(struct sk_buff *skb, struct n
unsigned char *pDataAddress;
struct endccw *pEnd;
struct ccw1 tempCCW;
- struct chbk *p_ch;
struct claw_env *p_env;
- int lock;
struct clawph *pk_head;
struct chbk *ch;
CLAW_DBF_TEXT(4, trace, "hw_tx");
privptr = (struct claw_privbk *)(dev->ml_priv);
- p_ch = (struct chbk *)&privptr->channel[WRITE_CHANNEL];
p_env =privptr->p_env;
claw_free_wrt_buf(dev); /* Clean up free chain if posible */
/* scan the write queue to free any completed write packets */
@@ -1511,12 +1505,6 @@ claw_hw_tx(struct sk_buff *skb, struct n
} /* endif (p_first_ccw!=NULL) */
dev_kfree_skb_any(skb);
- if (linkid==0) {
- lock=LOCK_NO;
- }
- else {
- lock=LOCK_YES;
- }
claw_strt_out_IO(dev );
/* if write free count is zero , set NOBUFFER */
if (privptr->write_free_count==0) {
@@ -2821,15 +2809,11 @@ claw_free_wrt_buf( struct net_device *de
{
struct claw_privbk *privptr = (struct claw_privbk *)dev->ml_priv;
- struct ccwbk*p_first_ccw;
- struct ccwbk*p_last_ccw;
struct ccwbk*p_this_ccw;
struct ccwbk*p_next_ccw;
CLAW_DBF_TEXT(4, trace, "freewrtb");
/* scan the write queue to free any completed write packets */
- p_first_ccw=NULL;
- p_last_ccw=NULL;
p_this_ccw=privptr->p_write_active_first;
while ( (p_this_ccw!=NULL) && (p_this_ccw->header.flag!=CLAW_PENDING))
{
@@ -3072,7 +3056,7 @@ claw_shutdown_device(struct ccwgroup_dev
{
struct claw_privbk *priv;
struct net_device *ndev;
- int ret;
+ int ret = 0;
CLAW_DBF_TEXT_(2, setup, "%s", dev_name(&cgdev->dev));
priv = dev_get_drvdata(&cgdev->dev);
@@ -3095,7 +3079,7 @@ claw_shutdown_device(struct ccwgroup_dev
}
ccw_device_set_offline(cgdev->cdev[1]);
ccw_device_set_offline(cgdev->cdev[0]);
- return 0;
+ return ret;
}
static void
^ permalink raw reply
* [patch 8/9] [PATCH] af_iucv: get rid of compile warning
From: frank.blaschka @ 2011-05-12 5:43 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390, Ursula Braun
In-Reply-To: <20110512054318.241733700@de.ibm.com>
[-- Attachment #1: 607-af_iucv-compile-warning.diff --]
[-- Type: text/plain, Size: 1811 bytes --]
From: Ursula Braun <ursula.braun@de.ibm.com>
-Wunused-but-set-variable generates compile warnings. The affected
variables are removed.
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
---
net/iucv/af_iucv.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
@@ -190,7 +190,6 @@ static int afiucv_pm_freeze(struct devic
*/
static int afiucv_pm_restore_thaw(struct device *dev)
{
- struct iucv_sock *iucv;
struct sock *sk;
struct hlist_node *node;
@@ -199,7 +198,6 @@ static int afiucv_pm_restore_thaw(struct
#endif
read_lock(&iucv_sk_list.lock);
sk_for_each(sk, node, &iucv_sk_list.head) {
- iucv = iucv_sk(sk);
switch (sk->sk_state) {
case IUCV_CONNECTED:
sk->sk_err = EPIPE;
@@ -381,7 +379,6 @@ static void iucv_sock_close(struct sock
{
unsigned char user_data[16];
struct iucv_sock *iucv = iucv_sk(sk);
- int err;
unsigned long timeo;
iucv_sock_clear_timer(sk);
@@ -394,8 +391,6 @@ static void iucv_sock_close(struct sock
case IUCV_CONNECTED:
case IUCV_DISCONN:
- err = 0;
-
sk->sk_state = IUCV_CLOSING;
sk->sk_state_change(sk);
@@ -404,7 +399,7 @@ static void iucv_sock_close(struct sock
timeo = sk->sk_lingertime;
else
timeo = IUCV_DISCONN_TIMEOUT;
- err = iucv_sock_wait(sk,
+ iucv_sock_wait(sk,
iucv_sock_in_state(sk, IUCV_CLOSED, 0),
timeo);
}
@@ -417,7 +412,7 @@ static void iucv_sock_close(struct sock
low_nmcpy(user_data, iucv->src_name);
high_nmcpy(user_data, iucv->dst_name);
ASCEBC(user_data, sizeof(user_data));
- err = iucv_path_sever(iucv->path, user_data);
+ iucv_path_sever(iucv->path, user_data);
iucv_path_free(iucv->path);
iucv->path = NULL;
}
^ permalink raw reply
* [patch 9/9] [PATCH] convert old cpumask API into new one
From: frank.blaschka @ 2011-05-12 5:43 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390, KOSAKI Motohiro
In-Reply-To: <20110512054318.241733700@de.ibm.com>
[-- Attachment #1: 608-cpumask-api.diff --]
[-- Type: text/plain, Size: 8375 bytes --]
From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Adapt new API.
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
---
net/iucv/iucv.c | 73 ++++++++++++++++++++++++++++----------------------------
1 file changed, 37 insertions(+), 36 deletions(-)
diff -urpN linux-2.6/net/iucv/iucv.c linux-2.6-patched/net/iucv/iucv.c
--- linux-2.6/net/iucv/iucv.c 2011-05-10 09:14:27.000000000 +0200
+++ linux-2.6-patched/net/iucv/iucv.c 2011-05-10 09:14:27.000000000 +0200
@@ -128,8 +128,8 @@ struct iucv_irq_list {
};
static struct iucv_irq_data *iucv_irq_data[NR_CPUS];
-static cpumask_t iucv_buffer_cpumask = CPU_MASK_NONE;
-static cpumask_t iucv_irq_cpumask = CPU_MASK_NONE;
+static cpumask_t iucv_buffer_cpumask = { CPU_BITS_NONE };
+static cpumask_t iucv_irq_cpumask = { CPU_BITS_NONE };
/*
* Queue of interrupt buffers lock for delivery via the tasklet
@@ -406,7 +406,7 @@ static void iucv_allow_cpu(void *data)
parm->set_mask.ipmask = 0xf8;
iucv_call_b2f0(IUCV_SETCONTROLMASK, parm);
/* Set indication that iucv interrupts are allowed for this cpu. */
- cpu_set(cpu, iucv_irq_cpumask);
+ cpumask_set_cpu(cpu, &iucv_irq_cpumask);
}
/**
@@ -426,7 +426,7 @@ static void iucv_block_cpu(void *data)
iucv_call_b2f0(IUCV_SETMASK, parm);
/* Clear indication that iucv interrupts are allowed for this cpu. */
- cpu_clear(cpu, iucv_irq_cpumask);
+ cpumask_clear_cpu(cpu, &iucv_irq_cpumask);
}
/**
@@ -451,7 +451,7 @@ static void iucv_block_cpu_almost(void *
iucv_call_b2f0(IUCV_SETCONTROLMASK, parm);
/* Clear indication that iucv interrupts are allowed for this cpu. */
- cpu_clear(cpu, iucv_irq_cpumask);
+ cpumask_clear_cpu(cpu, &iucv_irq_cpumask);
}
/**
@@ -466,7 +466,7 @@ static void iucv_declare_cpu(void *data)
union iucv_param *parm;
int rc;
- if (cpu_isset(cpu, iucv_buffer_cpumask))
+ if (cpumask_test_cpu(cpu, &iucv_buffer_cpumask))
return;
/* Declare interrupt buffer. */
@@ -499,9 +499,9 @@ static void iucv_declare_cpu(void *data)
}
/* Set indication that an iucv buffer exists for this cpu. */
- cpu_set(cpu, iucv_buffer_cpumask);
+ cpumask_set_cpu(cpu, &iucv_buffer_cpumask);
- if (iucv_nonsmp_handler == 0 || cpus_empty(iucv_irq_cpumask))
+ if (iucv_nonsmp_handler == 0 || cpumask_empty(&iucv_irq_cpumask))
/* Enable iucv interrupts on this cpu. */
iucv_allow_cpu(NULL);
else
@@ -520,7 +520,7 @@ static void iucv_retrieve_cpu(void *data
int cpu = smp_processor_id();
union iucv_param *parm;
- if (!cpu_isset(cpu, iucv_buffer_cpumask))
+ if (!cpumask_test_cpu(cpu, &iucv_buffer_cpumask))
return;
/* Block iucv interrupts. */
@@ -531,7 +531,7 @@ static void iucv_retrieve_cpu(void *data
iucv_call_b2f0(IUCV_RETRIEVE_BUFFER, parm);
/* Clear indication that an iucv buffer exists for this cpu. */
- cpu_clear(cpu, iucv_buffer_cpumask);
+ cpumask_clear_cpu(cpu, &iucv_buffer_cpumask);
}
/**
@@ -546,8 +546,8 @@ static void iucv_setmask_mp(void)
get_online_cpus();
for_each_online_cpu(cpu)
/* Enable all cpus with a declared buffer. */
- if (cpu_isset(cpu, iucv_buffer_cpumask) &&
- !cpu_isset(cpu, iucv_irq_cpumask))
+ if (cpumask_test_cpu(cpu, &iucv_buffer_cpumask) &&
+ !cpumask_test_cpu(cpu, &iucv_irq_cpumask))
smp_call_function_single(cpu, iucv_allow_cpu,
NULL, 1);
put_online_cpus();
@@ -564,9 +564,9 @@ static void iucv_setmask_up(void)
int cpu;
/* Disable all cpu but the first in cpu_irq_cpumask. */
- cpumask = iucv_irq_cpumask;
- cpu_clear(first_cpu(iucv_irq_cpumask), cpumask);
- for_each_cpu_mask_nr(cpu, cpumask)
+ cpumask_copy(&cpumask, &iucv_irq_cpumask);
+ cpumask_clear_cpu(cpumask_first(&iucv_irq_cpumask), &cpumask);
+ for_each_cpu(cpu, &cpumask)
smp_call_function_single(cpu, iucv_block_cpu, NULL, 1);
}
@@ -593,7 +593,7 @@ static int iucv_enable(void)
rc = -EIO;
for_each_online_cpu(cpu)
smp_call_function_single(cpu, iucv_declare_cpu, NULL, 1);
- if (cpus_empty(iucv_buffer_cpumask))
+ if (cpumask_empty(&iucv_buffer_cpumask))
/* No cpu could declare an iucv buffer. */
goto out;
put_online_cpus();
@@ -675,15 +675,16 @@ static int __cpuinit iucv_cpu_notify(str
case CPU_DOWN_PREPARE_FROZEN:
if (!iucv_path_table)
break;
- cpumask = iucv_buffer_cpumask;
- cpu_clear(cpu, cpumask);
- if (cpus_empty(cpumask))
+ cpumask_copy(&cpumask, &iucv_buffer_cpumask);
+ cpumask_clear_cpu(cpu, &cpumask);
+ if (cpumask_empty(&cpumask))
/* Can't offline last IUCV enabled cpu. */
return notifier_from_errno(-EINVAL);
smp_call_function_single(cpu, iucv_retrieve_cpu, NULL, 1);
- if (cpus_empty(iucv_irq_cpumask))
- smp_call_function_single(first_cpu(iucv_buffer_cpumask),
- iucv_allow_cpu, NULL, 1);
+ if (cpumask_empty(&iucv_irq_cpumask))
+ smp_call_function_single(
+ cpumask_first(&iucv_buffer_cpumask),
+ iucv_allow_cpu, NULL, 1);
break;
}
return NOTIFY_OK;
@@ -866,7 +867,7 @@ int iucv_path_accept(struct iucv_path *p
int rc;
local_bh_disable();
- if (cpus_empty(iucv_buffer_cpumask)) {
+ if (cpumask_empty(&iucv_buffer_cpumask)) {
rc = -EIO;
goto out;
}
@@ -915,7 +916,7 @@ int iucv_path_connect(struct iucv_path *
spin_lock_bh(&iucv_table_lock);
iucv_cleanup_queue();
- if (cpus_empty(iucv_buffer_cpumask)) {
+ if (cpumask_empty(&iucv_buffer_cpumask)) {
rc = -EIO;
goto out;
}
@@ -975,7 +976,7 @@ int iucv_path_quiesce(struct iucv_path *
int rc;
local_bh_disable();
- if (cpus_empty(iucv_buffer_cpumask)) {
+ if (cpumask_empty(&iucv_buffer_cpumask)) {
rc = -EIO;
goto out;
}
@@ -1007,7 +1008,7 @@ int iucv_path_resume(struct iucv_path *p
int rc;
local_bh_disable();
- if (cpus_empty(iucv_buffer_cpumask)) {
+ if (cpumask_empty(&iucv_buffer_cpumask)) {
rc = -EIO;
goto out;
}
@@ -1036,7 +1037,7 @@ int iucv_path_sever(struct iucv_path *pa
int rc;
preempt_disable();
- if (cpus_empty(iucv_buffer_cpumask)) {
+ if (cpumask_empty(&iucv_buffer_cpumask)) {
rc = -EIO;
goto out;
}
@@ -1070,7 +1071,7 @@ int iucv_message_purge(struct iucv_path
int rc;
local_bh_disable();
- if (cpus_empty(iucv_buffer_cpumask)) {
+ if (cpumask_empty(&iucv_buffer_cpumask)) {
rc = -EIO;
goto out;
}
@@ -1162,7 +1163,7 @@ int __iucv_message_receive(struct iucv_p
if (msg->flags & IUCV_IPRMDATA)
return iucv_message_receive_iprmdata(path, msg, flags,
buffer, size, residual);
- if (cpus_empty(iucv_buffer_cpumask)) {
+ if (cpumask_empty(&iucv_buffer_cpumask)) {
rc = -EIO;
goto out;
}
@@ -1235,7 +1236,7 @@ int iucv_message_reject(struct iucv_path
int rc;
local_bh_disable();
- if (cpus_empty(iucv_buffer_cpumask)) {
+ if (cpumask_empty(&iucv_buffer_cpumask)) {
rc = -EIO;
goto out;
}
@@ -1274,7 +1275,7 @@ int iucv_message_reply(struct iucv_path
int rc;
local_bh_disable();
- if (cpus_empty(iucv_buffer_cpumask)) {
+ if (cpumask_empty(&iucv_buffer_cpumask)) {
rc = -EIO;
goto out;
}
@@ -1324,7 +1325,7 @@ int __iucv_message_send(struct iucv_path
union iucv_param *parm;
int rc;
- if (cpus_empty(iucv_buffer_cpumask)) {
+ if (cpumask_empty(&iucv_buffer_cpumask)) {
rc = -EIO;
goto out;
}
@@ -1411,7 +1412,7 @@ int iucv_message_send2way(struct iucv_pa
int rc;
local_bh_disable();
- if (cpus_empty(iucv_buffer_cpumask)) {
+ if (cpumask_empty(&iucv_buffer_cpumask)) {
rc = -EIO;
goto out;
}
@@ -1888,7 +1889,7 @@ static int iucv_pm_freeze(struct device
printk(KERN_WARNING "iucv_pm_freeze\n");
#endif
if (iucv_pm_state != IUCV_PM_FREEZING) {
- for_each_cpu_mask_nr(cpu, iucv_irq_cpumask)
+ for_each_cpu(cpu, &iucv_irq_cpumask)
smp_call_function_single(cpu, iucv_block_cpu_almost,
NULL, 1);
cancel_work_sync(&iucv_work);
@@ -1928,7 +1929,7 @@ static int iucv_pm_thaw(struct device *d
if (rc)
goto out;
}
- if (cpus_empty(iucv_irq_cpumask)) {
+ if (cpumask_empty(&iucv_irq_cpumask)) {
if (iucv_nonsmp_handler)
/* enable interrupts on one cpu */
iucv_allow_cpu(NULL);
@@ -1961,7 +1962,7 @@ static int iucv_pm_restore(struct device
pr_warning("Suspending Linux did not completely close all IUCV "
"connections\n");
iucv_pm_state = IUCV_PM_RESTORING;
- if (cpus_empty(iucv_irq_cpumask)) {
+ if (cpumask_empty(&iucv_irq_cpumask)) {
rc = iucv_query_maxconn();
rc = iucv_enable();
if (rc)
^ permalink raw reply
* [patch 6/9] [PATCH] ctcm: get rid of compile warning
From: frank.blaschka @ 2011-05-12 5:43 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390, Ursula Braun
In-Reply-To: <20110512054318.241733700@de.ibm.com>
[-- Attachment #1: 605-ctcm-compile-warning.diff --]
[-- Type: text/plain, Size: 2987 bytes --]
From: Ursula Braun <ursula.braun@de.ibm.com>
-Wunused-but-set-variable generates compile warnings. The affected
variables are removed.
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
---
drivers/s390/net/ctcm_main.c | 2 --
drivers/s390/net/ctcm_mpc.c | 13 ++++---------
2 files changed, 4 insertions(+), 11 deletions(-)
diff -urpN linux-2.6/drivers/s390/net/ctcm_main.c linux-2.6-patched/drivers/s390/net/ctcm_main.c
--- linux-2.6/drivers/s390/net/ctcm_main.c 2011-05-10 09:14:06.000000000 +0200
+++ linux-2.6-patched/drivers/s390/net/ctcm_main.c 2011-05-10 09:14:26.000000000 +0200
@@ -672,7 +672,6 @@ static int ctcmpc_transmit_skb(struct ch
int ccw_idx;
unsigned long hi;
unsigned long saveflags = 0; /* avoids compiler warning */
- __u16 block_len;
CTCM_PR_DEBUG("Enter %s: %s, cp=%i ch=0x%p id=%s state=%s\n",
__func__, dev->name, smp_processor_id(), ch,
@@ -719,7 +718,6 @@ static int ctcmpc_transmit_skb(struct ch
*/
atomic_inc(&skb->users);
- block_len = skb->len + TH_HEADER_LENGTH + PDU_HEADER_LENGTH;
/*
* IDAL support in CTCM is broken, so we have to
* care about skb's above 2G ourselves.
diff -urpN linux-2.6/drivers/s390/net/ctcm_mpc.c linux-2.6-patched/drivers/s390/net/ctcm_mpc.c
--- linux-2.6/drivers/s390/net/ctcm_mpc.c 2011-03-15 02:20:32.000000000 +0100
+++ linux-2.6-patched/drivers/s390/net/ctcm_mpc.c 2011-05-10 09:14:26.000000000 +0200
@@ -653,7 +653,6 @@ static void ctcmpc_send_sweep_resp(struc
struct net_device *dev = rch->netdev;
struct ctcm_priv *priv = dev->ml_priv;
struct mpc_group *grp = priv->mpcg;
- int rc = 0;
struct th_sweep *header;
struct sk_buff *sweep_skb;
struct channel *ch = priv->channel[CTCM_WRITE];
@@ -665,16 +664,14 @@ static void ctcmpc_send_sweep_resp(struc
CTCM_DBF_TEXT_(MPC_ERROR, CTC_DBF_ERROR,
"%s(%s): sweep_skb allocation ERROR\n",
CTCM_FUNTAIL, rch->id);
- rc = -ENOMEM;
- goto done;
+ goto done;
}
header = kmalloc(sizeof(struct th_sweep), gfp_type());
if (!header) {
dev_kfree_skb_any(sweep_skb);
- rc = -ENOMEM;
- goto done;
+ goto done;
}
header->th.th_seg = 0x00 ;
@@ -1370,8 +1367,7 @@ static void mpc_action_go_inop(fsm_insta
struct net_device *dev = arg;
struct ctcm_priv *priv;
struct mpc_group *grp;
- int rc = 0;
- struct channel *wch, *rch;
+ struct channel *wch;
BUG_ON(dev == NULL);
CTCM_PR_DEBUG("Enter %s: %s\n", __func__, dev->name);
@@ -1396,7 +1392,6 @@ static void mpc_action_go_inop(fsm_insta
fsm_deltimer(&priv->restart_timer);
wch = priv->channel[CTCM_WRITE];
- rch = priv->channel[CTCM_READ];
switch (grp->saved_state) {
case MPCG_STATE_RESET:
@@ -1435,7 +1430,7 @@ static void mpc_action_go_inop(fsm_insta
if (grp->send_qllc_disc == 1) {
grp->send_qllc_disc = 0;
- rc = mpc_send_qllc_discontact(dev);
+ mpc_send_qllc_discontact(dev);
}
/* DO NOT issue DEV_EVENT_STOP directly out of this code */
^ permalink raw reply
* [patch 3/9] [PATCH] qeth: add owner to ccw driver
From: frank.blaschka @ 2011-05-12 5:43 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390, Sebastian Ott
In-Reply-To: <20110512054318.241733700@de.ibm.com>
[-- Attachment #1: 602-qeth-add-ccw-driver-owner.diff --]
[-- Type: text/plain, Size: 563 bytes --]
From: Sebastian Ott <sebott@linux.vnet.ibm.com>
Fill in the owner of qeth's ccw device driver.
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
---
drivers/s390/net/qeth_core_main.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -4041,6 +4041,7 @@ MODULE_DEVICE_TABLE(ccw, qeth_ids);
static struct ccw_driver qeth_ccw_driver = {
.driver = {
+ .owner = THIS_MODULE,
.name = "qeth",
},
.ids = qeth_ids,
^ permalink raw reply
* [patch 0/9] [resend] s390: network feature patches for net-next
From: frank.blaschka @ 2011-05-12 5:43 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390
Hi Dave,
I have updated the hw_features patch with feedback from Michal
and respined the patch set.
shortlog:
Frank Blaschka (2)
qeth: convert to hw_features part 2
qeth: add OSA concurrent hardware trap
Sebastian Ott (1)
qeth: add owner to ccw driver
Heiko Carstens (2)
claw: remove unused return code handling
lcs: get rid of compile warning
Ursula Braun (3)
ctcm: get rid of compile warning
iucv: get rid of compile warning
af_iucv: get rid of compile warning
KOSAKI Motohiro (1)
convert old cpumask API into new one
Thanks,
Frank
^ permalink raw reply
* Re: [PATCH 4/10] ipvs: Use IP_VS_RT_MODE_* instead of magic constants.
From: Hans Schillstrom @ 2011-05-12 5:28 UTC (permalink / raw)
To: Julian Anastasov; +Cc: David Miller, netdev@vger.kernel.org
In-Reply-To: <alpine.LFD.2.00.1105120212150.2431@ja.ssi.bg>
On Thursday 12 May 2011 01:32:09 Julian Anastasov wrote:
>
> Hello,
>
> On Tue, 10 May 2011, David Miller wrote:
>
> > > Following patch can be used after patch 4, eg. as
> > > number 6 because patches 4 and 5 are ok and we are going to replace
> > > patches 6 and 7.
> >
> > Thanks Julian.
> >
> > What I'm going to do is hold back the IPVS parts of the patches I
> > posted last night. In particular, I'll integrate this into the
> > original patch #4.
> >
> > And then we can work through the reimplementation ideas you posted to
> > me in private email.
>
> My simple tests do not show any problems with patches
> 4, 5 and the new 6 and 7. I tested TUN mode for rt_src/rt_dst
> and DR/NAT for rt_dst replacement, related ICMP is relayed properly.
> So, we should be ok but I'll do more tests in the following
> days because the list with possible combinations for testing
> is too long: different forwarding mode (DR/TUN/NAT),
> local or remote real server, local or remote client,
> In or Out related ICMP, Passive or Active FTP...
>
I will try to test the Backup/Failover aspects of above
--
Regards
Hans Schillstrom <hans.schillstrom@ericsson.com>
^ permalink raw reply
* Re: [PATCH net-next 2/4] tulip: Convert printks to netdev_<level>
From: Joe Perches @ 2011-05-12 4:59 UTC (permalink / raw)
To: Grant Grundler; +Cc: Tobias Ringstrom, netdev, linux-kernel
In-Reply-To: <20110512040906.GB8885@parisc-linux.org>
On Wed, 2011-05-11 at 22:09 -0600, Grant Grundler wrote:
> Some additional clean ups to consider in a future patch:
> o replace "if (skb == NULL)" with "if (!skb)"
Hey Grant.
I generally don't change those.
While I prefer (!ptr), others prefer explicit comparisons.
I do have a script that does the conversion though.
(de4x5.c is a mess and I didn't change it)
Here's the output with hoisted assigns from if too.
(and a spelling fix I noticed)
drivers/net/tulip/de2104x.c | 3 ++-
drivers/net/tulip/dmfe.c | 11 ++++++-----
drivers/net/tulip/eeprom.c | 6 +++---
drivers/net/tulip/interrupt.c | 18 +++++++++---------
drivers/net/tulip/timer.c | 2 +-
drivers/net/tulip/tulip_core.c | 15 +++++++++------
drivers/net/tulip/uli526x.c | 15 +++++++--------
drivers/net/tulip/winbond-840.c | 14 ++++++++------
drivers/net/tulip/xircom_cb.c | 12 ++++++------
9 files changed, 51 insertions(+), 45 deletions(-)
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c
index e2f6923..45a4843 100644
--- a/drivers/net/tulip/de2104x.c
+++ b/drivers/net/tulip/de2104x.c
@@ -2170,7 +2170,8 @@ static int de_resume (struct pci_dev *pdev)
goto out;
if (!netif_running(dev))
goto out_attach;
- if ((retval = pci_enable_device(pdev))) {
+ retval = pci_enable_device(pdev);
+ if (retval) {
netdev_err(dev, "pci_enable_device failed in resume\n");
goto out;
}
diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c
index 4685127..588d6b4 100644
--- a/drivers/net/tulip/dmfe.c
+++ b/drivers/net/tulip/dmfe.c
@@ -400,7 +400,7 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev,
/* Init network device */
dev = alloc_etherdev(sizeof(*db));
- if (dev == NULL)
+ if (!dev)
return -ENOMEM;
SET_NETDEV_DEV(dev, &pdev->dev);
@@ -1009,10 +1009,10 @@ static void dmfe_rx_packet(struct DEVICE *dev, struct dmfe_board_info * db)
db->dm910x_chk_mode = 3;
} else {
/* Good packet, send to upper layer */
- /* Shorst packet used new SKB */
+ /* Short packet used new SKB */
if ((rxlen < RX_COPY_SIZE) &&
- ((newskb = dev_alloc_skb(rxlen + 2))
- != NULL)) {
+ (newskb =
+ dev_alloc_skb(rxlen + 2))) {
skb = newskb;
/* size less than COPY_SIZE, allocate a rxlen SKB */
@@ -1561,7 +1561,8 @@ static void allocate_rx_buffer(struct dmfe_board_info *db)
rxptr = db->rx_insert_ptr;
while(db->rx_avail_cnt < RX_DESC_CNT) {
- if ( ( skb = dev_alloc_skb(RX_ALLOC_SIZE) ) == NULL )
+ skb = dev_alloc_skb(RX_ALLOC_SIZE);
+ if (!skb)
break;
rxptr->rx_skb_ptr = skb; /* FIXME (?) */
rxptr->rdes2 = cpu_to_le32( pci_map_single(db->pdev, skb->data,
diff --git a/drivers/net/tulip/eeprom.c b/drivers/net/tulip/eeprom.c
index fa5eee9..a11eb73 100644
--- a/drivers/net/tulip/eeprom.c
+++ b/drivers/net/tulip/eeprom.c
@@ -123,7 +123,7 @@ static void __devinit tulip_build_fake_mediatable(struct tulip_private *tp)
tp->mtable = kmalloc(sizeof(struct mediatable) +
sizeof(struct medialeaf), GFP_KERNEL);
- if (tp->mtable == NULL)
+ if (!tp->mtable)
return; /* Horrible, impossible failure. */
tp->mtable->defaultmedia = 0x800;
@@ -192,7 +192,7 @@ void __devinit tulip_parse_eeprom(struct net_device *dev)
break;
}
}
- if (eeprom_fixups[i].name == NULL) { /* No fixup found. */
+ if (!eeprom_fixups[i].name) { /* No fixup found. */
pr_info("%s: Old style EEPROM with no media selection information\n",
dev->name);
return;
@@ -230,7 +230,7 @@ subsequent_board:
mtable = kmalloc(sizeof(struct mediatable) +
count * sizeof(struct medialeaf),
GFP_KERNEL);
- if (mtable == NULL)
+ if (!mtable)
return; /* Horrible, impossible failure. */
last_mediatable = tp->mtable = mtable;
mtable->defaultmedia = media;
diff --git a/drivers/net/tulip/interrupt.c b/drivers/net/tulip/interrupt.c
index 5350d75..1a1bff5 100644
--- a/drivers/net/tulip/interrupt.c
+++ b/drivers/net/tulip/interrupt.c
@@ -68,12 +68,12 @@ int tulip_refill_rx(struct net_device *dev)
/* Refill the Rx ring buffers. */
for (; tp->cur_rx - tp->dirty_rx > 0; tp->dirty_rx++) {
entry = tp->dirty_rx % RX_RING_SIZE;
- if (tp->rx_buffers[entry].skb == NULL) {
+ if (!tp->rx_buffers[entry].skb) {
struct sk_buff *skb;
dma_addr_t mapping;
skb = tp->rx_buffers[entry].skb = dev_alloc_skb(PKT_BUF_SZ);
- if (skb == NULL)
+ if (!skb)
break;
mapping = pci_map_single(tp->pdev, skb->data, PKT_BUF_SZ,
@@ -205,7 +205,7 @@ int tulip_poll(struct napi_struct *napi, int budget)
/* Check if the packet is long enough to accept without copying
to a minimally-sized skbuff. */
if (pkt_len < tulip_rx_copybreak &&
- (skb = dev_alloc_skb(pkt_len + 2)) != NULL) {
+ (skb = dev_alloc_skb(pkt_len + 2))) {
skb_reserve(skb, 2); /* 16 byte align the IP header */
pci_dma_sync_single_for_cpu(tp->pdev,
tp->rx_buffers[entry].mapping,
@@ -311,7 +311,7 @@ int tulip_poll(struct napi_struct *napi, int budget)
tulip_refill_rx(dev);
/* If RX ring is not full we are out of memory. */
- if (tp->rx_buffers[tp->dirty_rx % RX_RING_SIZE].skb == NULL)
+ if (!tp->rx_buffers[tp->dirty_rx % RX_RING_SIZE].skb)
goto oom;
/* Remove us from polling list and enable RX intr. */
@@ -334,10 +334,10 @@ int tulip_poll(struct napi_struct *napi, int budget)
not_done:
if (tp->cur_rx - tp->dirty_rx > RX_RING_SIZE/2 ||
- tp->rx_buffers[tp->dirty_rx % RX_RING_SIZE].skb == NULL)
+ !tp->rx_buffers[tp->dirty_rx % RX_RING_SIZE].skb)
tulip_refill_rx(dev);
- if (tp->rx_buffers[tp->dirty_rx % RX_RING_SIZE].skb == NULL)
+ if (!tp->rx_buffers[tp->dirty_rx % RX_RING_SIZE].skb)
goto oom;
return work_done;
@@ -431,7 +431,7 @@ static int tulip_rx(struct net_device *dev)
/* Check if the packet is long enough to accept without copying
to a minimally-sized skbuff. */
if (pkt_len < tulip_rx_copybreak &&
- (skb = dev_alloc_skb(pkt_len + 2)) != NULL) {
+ (skb = dev_alloc_skb(pkt_len + 2))) {
skb_reserve(skb, 2); /* 16 byte align the IP header */
pci_dma_sync_single_for_cpu(tp->pdev,
tp->rx_buffers[entry].mapping,
@@ -591,7 +591,7 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance)
break; /* It still has not been Txed */
/* Check for Rx filter setup frames. */
- if (tp->tx_buffers[entry].skb == NULL) {
+ if (!tp->tx_buffers[entry].skb) {
/* test because dummy frames not mapped */
if (tp->tx_buffers[entry].mapping)
pci_unmap_single(tp->pdev,
@@ -775,7 +775,7 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance)
/* check if the card is in suspend mode */
entry = tp->dirty_rx % RX_RING_SIZE;
- if (tp->rx_buffers[entry].skb == NULL) {
+ if (!tp->rx_buffers[entry].skb) {
if (tulip_debug > 1)
dev_warn(&dev->dev,
"in rx suspend mode: (%lu) (tp->cur_rx = %u, ttimer = %d, rx = %d) go/stay in suspend mode\n",
diff --git a/drivers/net/tulip/timer.c b/drivers/net/tulip/timer.c
index 2017faf..afc5445 100644
--- a/drivers/net/tulip/timer.c
+++ b/drivers/net/tulip/timer.c
@@ -43,7 +43,7 @@ void tulip_media_task(struct work_struct *work)
default: {
struct medialeaf *mleaf;
unsigned char *p;
- if (tp->mtable == NULL) { /* No EEPROM info, use generic code. */
+ if (!tp->mtable) { /* No EEPROM info, use generic code. */
/* Not much that can be done.
Assume this a generic MII or SYM transceiver. */
next_tick = 60*HZ;
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c
index 82f8764..0ab2465 100644
--- a/drivers/net/tulip/tulip_core.c
+++ b/drivers/net/tulip/tulip_core.c
@@ -384,7 +384,7 @@ static void tulip_up(struct net_device *dev)
/* Allow selecting a default media. */
i = 0;
- if (tp->mtable == NULL)
+ if (!tp->mtable)
goto media_picked;
if (dev->if_port) {
int looking_for = tulip_media_cap[dev->if_port] & MediaIsMII ? 11 :
@@ -642,7 +642,7 @@ static void tulip_init_ring(struct net_device *dev)
use skb_reserve() to align the IP header! */
struct sk_buff *skb = dev_alloc_skb(PKT_BUF_SZ);
tp->rx_buffers[i].skb = skb;
- if (skb == NULL)
+ if (!skb)
break;
mapping = pci_map_single(tp->pdev, skb->data,
PKT_BUF_SZ, PCI_DMA_FROMDEVICE);
@@ -728,7 +728,7 @@ static void tulip_clean_tx_ring(struct tulip_private *tp)
}
/* Check for Tx filter setup frames. */
- if (tp->tx_buffers[entry].skb == NULL) {
+ if (!tp->tx_buffers[entry].skb) {
/* test because dummy frames not mapped */
if (tp->tx_buffers[entry].mapping)
pci_unmap_single(tp->pdev,
@@ -821,7 +821,7 @@ static void tulip_free_ring (struct net_device *dev)
for (i = 0; i < TX_RING_SIZE; i++) {
struct sk_buff *skb = tp->tx_buffers[i].skb;
- if (skb != NULL) {
+ if (skb) {
pci_unmap_single(tp->pdev, tp->tx_buffers[i].mapping,
skb->len, PCI_DMA_TODEVICE);
dev_kfree_skb (skb);
@@ -1900,12 +1900,15 @@ static int tulip_resume(struct pci_dev *pdev)
if (!netif_running(dev))
return 0;
- if ((retval = pci_enable_device(pdev))) {
+ retval = pci_enable_device(pdev);
+ if (retval) {
pr_err("pci_enable_device failed in resume\n");
return retval;
}
- if ((retval = request_irq(dev->irq, tulip_interrupt, IRQF_SHARED, dev->name, dev))) {
+ retval = request_irq(dev->irq, tulip_interrupt, IRQF_SHARED,
+ dev->name, dev);
+ if (retval) {
pr_err("request_irq failed in resume\n");
return retval;
}
diff --git a/drivers/net/tulip/uli526x.c b/drivers/net/tulip/uli526x.c
index 9e63f40..a6f6a9e 100644
--- a/drivers/net/tulip/uli526x.c
+++ b/drivers/net/tulip/uli526x.c
@@ -286,7 +286,7 @@ static int __devinit uli526x_init_one (struct pci_dev *pdev,
/* Init network device */
dev = alloc_etherdev(sizeof(*db));
- if (dev == NULL)
+ if (!dev)
return -ENOMEM;
SET_NETDEV_DEV(dev, &pdev->dev);
@@ -324,14 +324,12 @@ static int __devinit uli526x_init_one (struct pci_dev *pdev,
/* Allocate Tx/Rx descriptor memory */
db->desc_pool_ptr = pci_alloc_consistent(pdev, sizeof(struct tx_desc) * DESC_ALL_CNT + 0x20, &db->desc_pool_dma_ptr);
- if(db->desc_pool_ptr == NULL)
- {
+ if (!db->desc_pool_ptr) {
err = -ENOMEM;
goto err_out_nomem;
}
db->buf_pool_ptr = pci_alloc_consistent(pdev, TX_BUF_ALLOC * TX_DESC_CNT + 4, &db->buf_pool_dma_ptr);
- if(db->buf_pool_ptr == NULL)
- {
+ if (!db->buf_pool_ptr) {
err = -ENOMEM;
goto err_out_nomem;
}
@@ -404,7 +402,7 @@ err_out_nomem:
pci_free_consistent(pdev, sizeof(struct tx_desc) * DESC_ALL_CNT + 0x20,
db->desc_pool_ptr, db->desc_pool_dma_ptr);
- if(db->buf_pool_ptr != NULL)
+ if (db->buf_pool_ptr)
pci_free_consistent(pdev, TX_BUF_ALLOC * TX_DESC_CNT + 4,
db->buf_pool_ptr, db->buf_pool_dma_ptr);
err_out_disable:
@@ -844,7 +842,7 @@ static void uli526x_rx_packet(struct net_device *dev, struct uli526x_board_info
/* Good packet, send to upper layer */
/* Shorst packet used new SKB */
if ((rxlen < RX_COPY_SIZE) &&
- (((new_skb = dev_alloc_skb(rxlen + 2)) != NULL))) {
+ (new_skb = dev_alloc_skb(rxlen + 2))) {
skb = new_skb;
/* size less than COPY_SIZE, allocate a rxlen SKB */
skb_reserve(skb, 2); /* 16byte align */
@@ -1440,7 +1438,8 @@ static void allocate_rx_buffer(struct uli526x_board_info *db)
rxptr = db->rx_insert_ptr;
while(db->rx_avail_cnt < RX_DESC_CNT) {
- if ( ( skb = dev_alloc_skb(RX_ALLOC_SIZE) ) == NULL )
+ skb = dev_alloc_skb(RX_ALLOC_SIZE);
+ if (!skb)
break;
rxptr->rx_skb_ptr = skb; /* FIXME (?) */
rxptr->rdes2 = cpu_to_le32(pci_map_single(db->pdev,
diff --git a/drivers/net/tulip/winbond-840.c b/drivers/net/tulip/winbond-840.c
index 862eadf..a957e72 100644
--- a/drivers/net/tulip/winbond-840.c
+++ b/drivers/net/tulip/winbond-840.c
@@ -647,7 +647,8 @@ static int netdev_open(struct net_device *dev)
if (debug > 1)
netdev_dbg(dev, "w89c840_open() irq %d\n", dev->irq);
- if((i=alloc_ringdesc(dev)))
+ i = alloc_ringdesc(dev);
+ if (i)
goto out_err;
spin_lock_irq(&np->lock);
@@ -817,7 +818,7 @@ static void init_rxtx_rings(struct net_device *dev)
for (i = 0; i < RX_RING_SIZE; i++) {
struct sk_buff *skb = dev_alloc_skb(np->rx_buf_sz);
np->rx_skbuff[i] = skb;
- if (skb == NULL)
+ if (!skb)
break;
np->rx_addr[i] = pci_map_single(np->pci_dev,skb->data,
np->rx_buf_sz,PCI_DMA_FROMDEVICE);
@@ -1231,7 +1232,7 @@ static int netdev_rx(struct net_device *dev)
/* Check if the packet is long enough to accept without copying
to a minimally-sized skbuff. */
if (pkt_len < rx_copybreak &&
- (skb = dev_alloc_skb(pkt_len + 2)) != NULL) {
+ (skb = dev_alloc_skb(pkt_len + 2))) {
skb_reserve(skb, 2); /* 16 byte align the IP header */
pci_dma_sync_single_for_cpu(np->pci_dev,np->rx_addr[entry],
np->rx_skbuff[entry]->len,
@@ -1269,10 +1270,10 @@ static int netdev_rx(struct net_device *dev)
for (; np->cur_rx - np->dirty_rx > 0; np->dirty_rx++) {
struct sk_buff *skb;
entry = np->dirty_rx % RX_RING_SIZE;
- if (np->rx_skbuff[entry] == NULL) {
+ if (!np->rx_skbuff[entry]) {
skb = dev_alloc_skb(np->rx_buf_sz);
np->rx_skbuff[entry] = skb;
- if (skb == NULL)
+ if (!skb)
break; /* Better luck next round. */
np->rx_addr[entry] = pci_map_single(np->pci_dev,
skb->data,
@@ -1618,7 +1619,8 @@ static int w840_resume (struct pci_dev *pdev)
if (netif_device_present(dev))
goto out; /* device not suspended */
if (netif_running(dev)) {
- if ((retval = pci_enable_device(pdev))) {
+ retval = pci_enable_device(pdev);
+ if (retval) {
dev_err(&dev->dev,
"pci_enable_device failed in resume\n");
goto out;
diff --git a/drivers/net/tulip/xircom_cb.c b/drivers/net/tulip/xircom_cb.c
index 988b8eb..1cb7208 100644
--- a/drivers/net/tulip/xircom_cb.c
+++ b/drivers/net/tulip/xircom_cb.c
@@ -230,12 +230,12 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_
/* Allocate the send/receive buffers */
private->rx_buffer = pci_alloc_consistent(pdev,8192,&private->rx_dma_handle);
- if (private->rx_buffer == NULL) {
+ if (!private->rx_buffer) {
pr_err("%s: no memory for rx buffer\n", __func__);
goto rx_buf_fail;
}
private->tx_buffer = pci_alloc_consistent(pdev,8192,&private->tx_dma_handle);
- if (private->tx_buffer == NULL) {
+ if (!private->tx_buffer) {
pr_err("%s: no memory for tx buffer\n", __func__);
goto tx_buf_fail;
}
@@ -546,8 +546,8 @@ static void setup_descriptors(struct xircom_private *card)
u32 address;
int i;
- BUG_ON(card->rx_buffer == NULL);
- BUG_ON(card->tx_buffer == NULL);
+ BUG_ON(!card->rx_buffer);
+ BUG_ON(!card->tx_buffer);
/* Receive descriptors */
memset(card->rx_buffer, 0, 128); /* clear the descriptors */
@@ -1086,7 +1086,7 @@ investigate_read_descriptor(struct net_device *dev, struct xircom_private *card,
}
skb = dev_alloc_skb(pkt_len + 2);
- if (skb == NULL) {
+ if (!skb) {
dev->stats.rx_dropped++;
goto out;
}
@@ -1125,7 +1125,7 @@ investigate_write_descriptor(struct net_device *dev,
}
#endif
if (status > 0) { /* bit 31 is 0 when done */
- if (card->tx_skb[descnr]!=NULL) {
+ if (card->tx_skb[descnr]) {
dev->stats.tx_bytes += card->tx_skb[descnr]->len;
dev_kfree_skb_irq(card->tx_skb[descnr]);
}
> o in general, HW doesn't return signed integer values. Where possible,
> I prefer to see "unsigned int status;" and "if (status)".
That one is yours to change if you want.
^ permalink raw reply related
* Re: [PATCHv1] e1000e: Allow ethtool to enable/disable loopback.
From: David Miller @ 2011-05-12 4:45 UTC (permalink / raw)
To: maheshb; +Cc: mirqus, jeffrey.t.kirsher, e1000-devel, netdev, therbert
In-Reply-To: <BANLkTimfF4EJ_B=Y-ssjkzmtG123P+HMTA@mail.gmail.com>
From: Mahesh Bandewar <maheshb@google.com>
Date: Wed, 11 May 2011 16:11:21 -0700
> On Wed, May 11, 2011 at 12:15 PM, Michał Mirosław <mirqus@gmail.com> wrote:
>> 2011/5/11 Mahesh Bandewar <maheshb@google.com>:
>>> This patch adds e1000_set_features() to handle loopback mode. When loopback
>>> is enabled, it enables internal-MAC loopback.
>>
>> Please wait for this driver's conversion to hw_features. One comment
>> below, though.
>>
> This is not intrusive so should not create problems when that happens.
Right and the Intel maintainer folks can resolve such conflicts
anyways.
^ permalink raw reply
* Re: [PATCH] iproute2: use IFLA_TXQLEN when it is available
From: Eric Dumazet @ 2011-05-12 4:40 UTC (permalink / raw)
To: Changli Gao; +Cc: shemminger, netdev, kuznet
In-Reply-To: <1305170886.3232.13.camel@edumazet-laptop>
Le jeudi 12 mai 2011 à 05:28 +0200, Eric Dumazet a écrit :
> Le jeudi 12 mai 2011 à 10:47 +0800, Changli Gao a écrit :
> > Use IFLA_TXQLEN when it is available, to avoid additional system calls.
> >
> > Signed-off-by: Changli Gao <xiaosuo@gmail.com>
> > ---
> > ip/ipaddress.c | 12 ++++++++++--
> > 1 file changed, 10 insertions(+), 2 deletions(-)
> > diff --git a/ip/ipaddress.c b/ip/ipaddress.c
> > index a1f78b9..59afafd 100644
> > --- a/ip/ipaddress.c
> > +++ b/ip/ipaddress.c
> > @@ -285,8 +285,16 @@ int print_linkinfo(const struct sockaddr_nl *who,
> > if (tb[IFLA_OPERSTATE])
> > print_operstate(fp, *(__u8 *)RTA_DATA(tb[IFLA_OPERSTATE]));
> >
> > - if (filter.showqueue)
> > - print_queuelen(fp, (char*)RTA_DATA(tb[IFLA_IFNAME]));
> > + if (filter.showqueue) {
> > + if (tb[IFLA_TXQLEN]) {
> > + __u32 txqlen = *(__u32 *)RTA_DATA(tb[IFLA_TXQLEN]);
> > +
> > + if (txqlen)
> > + fprintf(fp, "qlen %u", txqlen);
> > + } else {
> > + print_queuelen(fp, (char*)RTA_DATA(tb[IFLA_IFNAME]));
> > + }
> > + }
> >
> > if (!filter.family || filter.family == AF_PACKET) {
> > SPRINT_BUF(b1);
>
> Hmm, what iproute2 version do you use ???
>
> commit 62a5e0668e2920b7f09896abd884753255712a46
> Author: Eric Dumazet <dada1@cosmosbay.com>
> Date: Fri Oct 23 06:25:53 2009 +0200
>
> ip: Support IFLA_TXQLEN in ip link show command
>
> We currently use an expensive ioctl() to get device txqueuelen, while
> rtnetlink gave it to us for free. This patch speeds up ip link operation
> when many devices are registered.
>
>
Apparently my patch was somehow lost
http://patchwork.ozlabs.org/patch/36762/
Strange thing is it's in my git tree.
Stephen, any idea of what happened ?
Thanks
commit 62a5e0668e2920b7f09896abd884753255712a46
Author: Eric Dumazet <dada1@cosmosbay.com>
Date: Fri Oct 23 06:25:53 2009 +0200
[PATCH iproute2] ip: Support IFLA_TXQLEN in ip link show command
We currently use an expensive ioctl() to get device txqueuelen, while
rtnetlink gave it to us for free. This patch speeds up ip link operation
when many devices are registered.
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index 267ecb3..cadc1a3 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -131,26 +131,31 @@ static void print_operstate(FILE *f, __u8 state)
fprintf(f, "state %s ", oper_states[state]);
}
-static void print_queuelen(FILE *f, const char *name)
+static void print_queuelen(FILE *f, struct rtattr *tb[IFLA_MAX + 1])
{
- struct ifreq ifr;
- int s;
-
- s = socket(AF_INET, SOCK_STREAM, 0);
- if (s < 0)
- return;
-
- memset(&ifr, 0, sizeof(ifr));
- strcpy(ifr.ifr_name, name);
- if (ioctl(s, SIOCGIFTXQLEN, &ifr) < 0) {
- fprintf(f, "ioctl(SIOCGIFXQLEN) failed: %s\n", strerror(errno));
+ int qlen;
+
+ if (tb[IFLA_TXQLEN])
+ qlen = *(int *)RTA_DATA(tb[IFLA_TXQLEN]);
+ else {
+ struct ifreq ifr;
+ int s = socket(AF_INET, SOCK_STREAM, 0);
+
+ if (s < 0)
+ return;
+
+ memset(&ifr, 0, sizeof(ifr));
+ strcpy(ifr.ifr_name, (char *)RTA_DATA(tb[IFLA_IFNAME]));
+ if (ioctl(s, SIOCGIFTXQLEN, &ifr) < 0) {
+ fprintf(f, "ioctl(SIOCGIFXQLEN) failed: %s\n", strerror(errno));
+ close(s);
+ return;
+ }
close(s);
- return;
+ qlen = ifr.ifr_qlen;
}
- close(s);
-
- if (ifr.ifr_qlen)
- fprintf(f, "qlen %d", ifr.ifr_qlen);
+ if (qlen)
+ fprintf(f, "qlen %d", qlen);
}
static void print_linktype(FILE *fp, struct rtattr *tb)
@@ -253,7 +258,7 @@ int print_linkinfo(const struct sockaddr_nl *who,
print_operstate(fp, *(__u8 *)RTA_DATA(tb[IFLA_OPERSTATE]));
if (filter.showqueue)
- print_queuelen(fp, (char*)RTA_DATA(tb[IFLA_IFNAME]));
+ print_queuelen(fp, tb);
if (!filter.family || filter.family == AF_PACKET) {
SPRINT_BUF(b1);
^ permalink raw reply related
* Re: [PATCH] ehea: Fix memory hotplug oops
From: David Miller @ 2011-05-12 4:38 UTC (permalink / raw)
To: leitao; +Cc: anton, netdev
In-Reply-To: <4DCA853B.6060904@linux.vnet.ibm.com>
From: Breno Leitao <leitao@linux.vnet.ibm.com>
Date: Wed, 11 May 2011 09:46:51 -0300
> On 05/10/2011 11:17 PM, Anton Blanchard wrote:
>>
>> The ehea driver oopses during memory hotplug if the ports are not
>> up. A simple testcase:
>>
>> # ifconfig ethX down
>> # echo offline > /sys/devices/system/memory/memory32/state
>>
>> Oops: Kernel access of bad area, sig: 11 [#1]
>> last sysfs file: /sys/devices/system/memory/memory32/state
>> REGS: c000000709393110 TRAP: 0300 Not tainted
> (2.6.39-rc2-01385-g7ef73bc-dirty)
>> DAR: 0000000000000000, DSISR: 40000000
>> ...
>> NIP [c000000000067c98] .__wake_up_common+0x48/0xf0
>> LR [c00000000006d034] .__wake_up+0x54/0x90
>> Call Trace:
>> [c00000000006d034] .__wake_up+0x54/0x90
>> [d000000006bb6270] .ehea_rereg_mrs+0x140/0x730 [ehea]
>> [d000000006bb69c4] .ehea_mem_notifier+0x164/0x170 [ehea]
>> [c0000000006fc8a8] .notifier_call_chain+0x78/0xf0
>> [c0000000000b3d70] .__blocking_notifier_call_chain+0x70/0xb0
>> [c000000000458d78] .memory_notify+0x28/0x40
>> [c0000000001871d8] .remove_memory+0x208/0x6d0
>> [c000000000458264] .memory_section_action+0x94/0x140
>> [c0000000004583ec] .memory_block_change_state+0xdc/0x1d0
>> [c0000000004585cc] .store_mem_state+0xec/0x160
>> [c00000000044768c] .sysdev_store+0x3c/0x50
>> [c00000000020b48c] .sysfs_write_file+0xec/0x1f0
>> [c00000000018f86c] .vfs_write+0xec/0x1e0
>> [c00000000018fa88] .SyS_write+0x58/0xd0
>>
>> To fix this, initialise the waitqueues during port probe instead
>> of port open.
>>
>> Signed-off-by: Anton Blanchard <anton@samba.org>
> Acked-by: Breno Leitao <leitao@linux.vnet.ibm.com>
Applied to net-2.6, thanks.
^ permalink raw reply
* [PATCH net-next-2.6] l2tp: fix potential rcu race
From: Eric Dumazet @ 2011-05-12 4:22 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Paul E. McKenney, James Chapman
While trying to remove useless synchronize_rcu() calls, I found l2tp is
indeed incorrectly using two of such calls, but also bumps tunnel
refcount after list insertion.
tunnel refcount must be incremented before being made publically visible
by rcu readers.
This fix can be applied to 2.6.35+ and might need a backport for older
kernels, since things were shuffled in commit fd558d186df2c
(l2tp: Split pppol2tp patch into separate l2tp and ppp parts)
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
CC: James Chapman <jchapman@katalix.com>
---
I based this patch on net-next-2.6 because of recent commits in this
file and linux-2.6 being on late RC phase. But its a stable candidate.
net/l2tp/l2tp_core.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c
index 9be095e..ed8a233 100644
--- a/net/l2tp/l2tp_core.c
+++ b/net/l2tp/l2tp_core.c
@@ -1435,16 +1435,15 @@ int l2tp_tunnel_create(struct net *net, int fd, int version, u32 tunnel_id, u32
/* Add tunnel to our list */
INIT_LIST_HEAD(&tunnel->list);
- spin_lock_bh(&pn->l2tp_tunnel_list_lock);
- list_add_rcu(&tunnel->list, &pn->l2tp_tunnel_list);
- spin_unlock_bh(&pn->l2tp_tunnel_list_lock);
- synchronize_rcu();
atomic_inc(&l2tp_tunnel_count);
/* Bump the reference count. The tunnel context is deleted
- * only when this drops to zero.
+ * only when this drops to zero. Must be done before list insertion
*/
l2tp_tunnel_inc_refcount(tunnel);
+ spin_lock_bh(&pn->l2tp_tunnel_list_lock);
+ list_add_rcu(&tunnel->list, &pn->l2tp_tunnel_list);
+ spin_unlock_bh(&pn->l2tp_tunnel_list_lock);
err = 0;
err:
@@ -1636,7 +1635,6 @@ struct l2tp_session *l2tp_session_create(int priv_size, struct l2tp_tunnel *tunn
hlist_add_head_rcu(&session->global_hlist,
l2tp_session_id_hash_2(pn, session_id));
spin_unlock_bh(&pn->l2tp_session_hlist_lock);
- synchronize_rcu();
}
/* Ignore management session in session count value */
^ permalink raw reply related
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