* Re.funds
From: rhumana @ 2011-05-13 7:36 UTC (permalink / raw)
My associate has helped me to send your first payment
of $7,500 USD to you as instructed by the Malaysian
Government and Mr. David Cameron the United Kingdom
prime minister after the last G20 meeting that was
held in Malaysia, making you one of the beneficiaries through
an email natural simple ballot selection.
He told Allan Davis to keep sending you $5,000 USD via Money Gram
twice a week until the FULL payment of ($820,000.00 )
is completed.
MONEY TRANSFER REFERENCE:2116-3297
SENDER'S NAME:Patrick Lee Chun
AMOUNT: US$5000
To track your funds forward money gram
Transfer agent Mr Allan Davis
Your Name.____________
Phone .______________
Contact Allan Davis for the funds clearance
certificate (FCC) neccessary for the realise of your funds
E-mail:money_gramlimited@mspil.edu.cn
D/L: Tel:+601-635-44376
You cannot pickup the money until the certificate is
obtained by you.
Regards
Mr. Allan Davis.
Tel: +601-635-44376
Best Regards,
Mr Allan Davis
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
^ permalink raw reply
* Re: [patch 1/9] [PATCH] qeth: convert to hw_features part 2
From: Michał Mirosław @ 2011-05-13 8:07 UTC (permalink / raw)
To: frank.blaschka; +Cc: davem, netdev, linux-s390
In-Reply-To: <20110513044547.424857838@de.ibm.com>
2011/5/13 <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.
[...]
> @@ -1482,32 +1478,34 @@ 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->features &= ~NETIF_F_RXCSUM;
> + netdev_update_features(card->dev);
> + rtnl_unlock();
> return rc;
> }
This will retry starting the RX checksumming via set_features(). Is
that the intention? If not, then just use something like my example in
qeth_l3_start_ipa_checksum().
Best Regards,
Michał Mirosław
^ permalink raw reply
* Re: [patch 1/9] [PATCH] qeth: convert to hw_features part 2
From: Frank Blaschka @ 2011-05-13 7:57 UTC (permalink / raw)
To: Michał Mirosław; +Cc: davem, netdev, linux-s390
In-Reply-To: <20110513073807.GA18312@rere.qmqm.pl>
On Fri, May 13, 2011 at 09:38:07AM +0200, Michał Mirosław wrote:
> On Fri, May 13, 2011 at 06:45:01AM +0200, frank.blaschka@de.ibm.com wrote:
> > 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.
>
> Please see following patch (replacing qeth_l3_main.c part of your patch) for
> an illustration of my earlier comments.
>
Thx for the illustration. I will review and do some more testing. For now
Dave should apply my latest patch set so we get this stuff into next merge
window.
^ permalink raw reply
* Re: [PATCHv1] e1000e: Allow ethtool to enable/disable loopback.
From: Michał Mirosław @ 2011-05-13 7:49 UTC (permalink / raw)
To: Mahesh Bandewar
Cc: Jeff Kirsher, e1000-devel, David Miller, netdev, Tom Herbert
In-Reply-To: <BANLkTimsUga1LEF1y61+2To2uQQGpxcPBg@mail.gmail.com>
W dniu 12 maja 2011 23:41 użytkownik Mahesh Bandewar
<maheshb@google.com> napisał:
> On Wed, May 11, 2011 at 10:50 PM, Michał Mirosław <mirqus@gmail.com> wrote:
>> 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:
>>>> 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.
> This is more of an API shortcoming. Callback will have to revert
> changes made (rollback) before returning non-zero value to keep it
> consistent.
It might just update dev->features to match instead of rollback. It
could also start some recovery process that eventually calls
netdev_update_features() again to try the change again.
IOW, the information what changes failed are returned implicitly in
modified dev->features. When callback returns 0,
netdev_update_features() assumes that all were set correctly and
updates dev->features itself.
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-13 7:38 UTC (permalink / raw)
To: frank.blaschka; +Cc: davem, netdev, linux-s390
In-Reply-To: <20110513044547.424857838@de.ibm.com>
On Fri, May 13, 2011 at 06:45:01AM +0200, frank.blaschka@de.ibm.com wrote:
> 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.
Please see following patch (replacing qeth_l3_main.c part of your patch) for
an illustration of my earlier comments.
Best Regards,
Michał Mirosław
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
index 1496661..9b8ce44 100644
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -1445,70 +1445,37 @@ static int qeth_l3_send_checksum_command(struct qeth_card *card)
return 0;
}
-int qeth_l3_set_rx_csum(struct qeth_card *card,
- enum qeth_checksum_types csum_type)
+static int qeth_l3_set_rx_csum(struct qeth_card *card, int on)
{
- int rc = 0;
+ int rc;
- 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 (rc)
- return -EIO;
- }
- 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;
- }
- }
- card->dev->features &= ~NETIF_F_RXCSUM;
+ if (on) {
+ rc = qeth_l3_send_checksum_command(card);
+ if (rc)
+ return -EIO;
+ } else
+ rc = qeth_l3_send_simple_setassparms(card,
+ IPA_INBOUND_CHECKSUM, IPA_CMD_ASS_STOP, 0);
+ if (rc)
+ return -EIO;
}
- card->options.checksum_type = csum_type;
- return rc;
+
+ return 0;
}
static int qeth_l3_start_ipa_checksum(struct qeth_card *card)
{
- int rc = 0;
-
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,
- "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;
+ if (card->dev->features & NETIF_F_RXCSUM) {
+ rtnl_lock();
+ /* force set_features call */
+ card->dev->features &= ~NETIF_F_RXCSUM;
+ netdev_update_features(card->dev);
+ rtnl_unlock();
}
- rc = qeth_l3_send_checksum_command(card);
- if (!rc)
- dev_info(&card->gdev->dev,
- "HW Checksumming (inbound) enabled\n");
- return rc;
+ return 0;
}
static int qeth_l3_start_ipa_tx_checksum(struct qeth_card *card)
@@ -2037,14 +2004,7 @@ static inline int qeth_l3_rebuild_skb(struct qeth_card *card,
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 +2013,8 @@ static inline int qeth_l3_rebuild_skb(struct qeth_card *card,
skb->ip_summed = CHECKSUM_UNNECESSARY;
else
skb->ip_summed = CHECKSUM_NONE;
- }
+ } else
+ skb->ip_summed = CHECKSUM_NONE;
return is_vlan;
}
@@ -3235,20 +3196,20 @@ static u32 qeth_l3_fix_features(struct net_device *dev, u32 features)
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;
- else
- csum_type = SW_CHECKSUMMING;
+ if (card->state == CARD_STATE_DOWN)
+ return 0;
+ /* commit other changes in case of error */
dev->features = features ^ NETIF_F_RXCSUM;
- return qeth_l3_set_rx_csum(card, csum_type);
+
+ return qeth_l3_set_rx_csum(card, features & NETIF_F_RXCSUM);
}
static const struct ethtool_ops qeth_l3_ethtool_ops = {
@@ -3342,6 +3303,12 @@ static int qeth_l3_setup_netdev(struct qeth_card *card)
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 +3324,6 @@ static int qeth_l3_setup_netdev(struct qeth_card *card)
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 +3347,6 @@ static int qeth_l3_probe_device(struct ccwgroup_device *gdev)
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;
}
^ permalink raw reply related
* Re: [PATCH net-next] net:set valid name before calling ndo_init()
From: Jiri Pirko @ 2011-05-13 7:15 UTC (permalink / raw)
To: Weiping Pan
Cc: David S. Miller, Eric Dumazet, Michał Mirosław,
Tom Herbert, Ben Hutchings, open list:NETWORKING [GENERAL],
open list
In-Reply-To: <1305251217-4254-1-git-send-email-panweiping3@gmail.com>
Fri, May 13, 2011 at 03:46:56AM CEST, panweiping3@gmail.com wrote:
>In commit 1c5cae815d19 (net: call dev_alloc_name from register_netdevice),
>a bug of bonding was invloved, see example 1 and 2.
>
>In register_netdevice(), the name of net_device is not valid until
>dev_get_valid_name() is called. But dev->netdev_ops->ndo_init(that is
>bond_init) is called before dev_get_valid_name(),
>and it uses the invalid name of net_device.
>
>I think register_netdevice() should make sure that the name of net_device is
>valid before calling ndo_init().
>
>example 1:
>modprobe bonding
>ls /proc/net/bonding/bond%d
>
>ps -eLf
>root 3398 2 3398 0 1 21:34 ? 00:00:00 [bond%d]
>
>example 2:
>modprobe bonding max_bonds=3
>
>[ 170.100292] bonding: Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
>[ 170.101090] bonding: Warning: either miimon or arp_interval and arp_ip_target module parameters must be specified, otherwise bonding will not detect link failures! see bonding.txt for details.
>[ 170.102469] ------------[ cut here ]------------
>[ 170.103150] WARNING: at /home/pwp/net-next-2.6/fs/proc/generic.c:586 proc_register+0x126/0x157()
>[ 170.104075] Hardware name: VirtualBox
>[ 170.105065] proc_dir_entry 'bonding/bond%d' already registered
>[ 170.105613] Modules linked in: bonding(+) sunrpc ipv6 uinput microcode ppdev parport_pc parport joydev e1000 pcspkr i2c_piix4 i2c_core [last unloaded: bonding]
>[ 170.108397] Pid: 3457, comm: modprobe Not tainted 2.6.39-rc2+ #14
>[ 170.108935] Call Trace:
>[ 170.109382] [<c0438f3b>] warn_slowpath_common+0x6a/0x7f
>[ 170.109911] [<c051a42a>] ? proc_register+0x126/0x157
>[ 170.110329] [<c0438fc3>] warn_slowpath_fmt+0x2b/0x2f
>[ 170.110846] [<c051a42a>] proc_register+0x126/0x157
>[ 170.111870] [<c051a4dd>] proc_create_data+0x82/0x98
>[ 170.112335] [<f94e6af6>] bond_create_proc_entry+0x3f/0x73 [bonding]
>[ 170.112905] [<f94dd806>] bond_init+0x77/0xa5 [bonding]
>[ 170.113319] [<c0721ac6>] register_netdevice+0x8c/0x1d3
>[ 170.113848] [<f94e0e30>] bond_create+0x6c/0x90 [bonding]
>[ 170.114322] [<f94f4763>] bonding_init+0x763/0x7b1 [bonding]
>[ 170.114879] [<c0401240>] do_one_initcall+0x76/0x122
>[ 170.115317] [<f94f4000>] ? 0xf94f3fff
>[ 170.115799] [<c0463f1e>] sys_init_module+0x1286/0x140d
>[ 170.116879] [<c07c6d9f>] sysenter_do_call+0x12/0x28
>[ 170.117404] ---[ end trace 64e4fac3ae5fff1a ]---
>[ 170.117924] bond%d: Warning: failed to register to debugfs
>[ 170.128728] ------------[ cut here ]------------
>[ 170.129360] WARNING: at /home/pwp/net-next-2.6/fs/proc/generic.c:586 proc_register+0x126/0x157()
>[ 170.130323] Hardware name: VirtualBox
>[ 170.130797] proc_dir_entry 'bonding/bond%d' already registered
>[ 170.131315] Modules linked in: bonding(+) sunrpc ipv6 uinput microcode ppdev parport_pc parport joydev e1000 pcspkr i2c_piix4 i2c_core [last unloaded: bonding]
>[ 170.133731] Pid: 3457, comm: modprobe Tainted: G W 2.6.39-rc2+ #14
>[ 170.134308] Call Trace:
>[ 170.134743] [<c0438f3b>] warn_slowpath_common+0x6a/0x7f
>[ 170.135305] [<c051a42a>] ? proc_register+0x126/0x157
>[ 170.135820] [<c0438fc3>] warn_slowpath_fmt+0x2b/0x2f
>[ 170.137168] [<c051a42a>] proc_register+0x126/0x157
>[ 170.137700] [<c051a4dd>] proc_create_data+0x82/0x98
>[ 170.138174] [<f94e6af6>] bond_create_proc_entry+0x3f/0x73 [bonding]
>[ 170.138745] [<f94dd806>] bond_init+0x77/0xa5 [bonding]
>[ 170.139278] [<c0721ac6>] register_netdevice+0x8c/0x1d3
>[ 170.139828] [<f94e0e30>] bond_create+0x6c/0x90 [bonding]
>[ 170.140361] [<f94f4763>] bonding_init+0x763/0x7b1 [bonding]
>[ 170.140927] [<c0401240>] do_one_initcall+0x76/0x122
>[ 170.141494] [<f94f4000>] ? 0xf94f3fff
>[ 170.141975] [<c0463f1e>] sys_init_module+0x1286/0x140d
>[ 170.142463] [<c07c6d9f>] sysenter_do_call+0x12/0x28
>[ 170.142974] ---[ end trace 64e4fac3ae5fff1b ]---
>[ 170.144949] bond%d: Warning: failed to register to debugfs
>
>Signed-off-by: Weiping Pan <panweiping3@gmail.com>
>---
> net/core/dev.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
>diff --git a/net/core/dev.c b/net/core/dev.c
>index ea23353..3ed09f8 100644
>--- a/net/core/dev.c
>+++ b/net/core/dev.c
>@@ -5437,6 +5437,10 @@ int register_netdevice(struct net_device *dev)
>
> dev->iflink = -1;
>
>+ ret = dev_get_valid_name(dev, dev->name);
>+ if (ret < 0)
>+ goto out;
>+
> /* Init, if this function is available */
> if (dev->netdev_ops->ndo_init) {
> ret = dev->netdev_ops->ndo_init(dev);
>@@ -5447,10 +5451,6 @@ int register_netdevice(struct net_device *dev)
> }
> }
>
>- ret = dev_get_valid_name(dev, dev->name);
>- if (ret < 0)
>- goto err_uninit;
>-
> dev->ifindex = dev_new_index(net);
> if (dev->iflink == -1)
> dev->iflink = dev->ifindex;
>--
>1.7.4.4
>
>--
>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
Reviewed-by: Jiri Pirko <jpirko@redhat.com>
^ permalink raw reply
* Re: [PATCH 1/2] net/stmmac: don't go through ethtool to start autonegociation
From: Giuseppe CAVALLARO @ 2011-05-13 6:31 UTC (permalink / raw)
To: David Decotigny
Cc: Giuseppe CAVALLARO, David S. Miller, Joe Perches,
Stanislaw Gruszka, netdev, linux-kernel
In-Reply-To: <4DC941D4.8030409@st.com>
On 5/10/2011 3:47 PM, Giuseppe CAVALLARO wrote:
> On 5/10/2011 2:19 AM, David Decotigny wrote:
>> The driver used to call phy's ethtool configuration routine to start
>> autonegociation. This change has it call directly phy's routine to
>> start autonegociation.
>>
>> IMPORTANT: initial version was hiding phy_start_aneg() return value,
>> this patch returns it (<0 upon error).
>>
>> Tested: module compiles, NOT tested on real hardware.
>> Signed-off-by: David Decotigny <decot@google.com>
>
> Sorry for the delay, I'm doing some tests with the stmmac on a "real"
> HW. I'll come back asap.
Hello.
I've tested the patch and, as discussed with David, I have sent it again
plus a new fix in the stmmac_set_pauseparam I have done while testing
ethtool -A|-a on my ST box.
Best Regards,
Peppe
>
> Regards
> Peppe
>
>> ---
>> drivers/net/stmmac/stmmac_ethtool.c | 13 ++-----------
>> 1 files changed, 2 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/net/stmmac/stmmac_ethtool.c b/drivers/net/stmmac/stmmac_ethtool.c
>> index 6f5aaeb..9c05cf0 100644
>> --- a/drivers/net/stmmac/stmmac_ethtool.c
>> +++ b/drivers/net/stmmac/stmmac_ethtool.c
>> @@ -236,17 +236,8 @@ stmmac_set_pauseparam(struct net_device *netdev,
>> priv->flow_ctrl = new_pause;
>>
>> if (phy->autoneg) {
>> - if (netif_running(netdev)) {
>> - struct ethtool_cmd cmd = { .cmd = ETHTOOL_SSET };
>> - /* auto-negotiation automatically restarted */
>> - cmd.supported = phy->supported;
>> - cmd.advertising = phy->advertising;
>> - cmd.autoneg = phy->autoneg;
>> - ethtool_cmd_speed_set(&cmd, phy->speed);
>> - cmd.duplex = phy->duplex;
>> - cmd.phy_address = phy->addr;
>> - ret = phy_ethtool_sset(phy, &cmd);
>> - }
>> + if (netif_running(netdev))
>> + ret = phy_start_aneg(phy);
>> } else
>> priv->hw->mac->flow_ctrl(priv->ioaddr, phy->duplex,
>> priv->flow_ctrl, priv->pause);
>
> --
> 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
* [net-next 2/2] stmmac: fix autoneg in set_pauseparam
From: Giuseppe CAVALLARO @ 2011-05-13 6:28 UTC (permalink / raw)
To: netdev; +Cc: Giuseppe Cavallaro
In-Reply-To: <1305268085-603-1-git-send-email-peppe.cavallaro@st.com>
This patch fixes a bug in the set_pauseparam
function that didn't well manage the ANE
field and returned broken values when use
ethtool -A|-a.
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
drivers/net/stmmac/stmmac_ethtool.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/net/stmmac/stmmac_ethtool.c b/drivers/net/stmmac/stmmac_ethtool.c
index 9c05cf0..ae5213a 100644
--- a/drivers/net/stmmac/stmmac_ethtool.c
+++ b/drivers/net/stmmac/stmmac_ethtool.c
@@ -234,6 +234,7 @@ stmmac_set_pauseparam(struct net_device *netdev,
new_pause |= FLOW_TX;
priv->flow_ctrl = new_pause;
+ phy->autoneg = pause->autoneg;
if (phy->autoneg) {
if (netif_running(netdev))
--
1.7.4.4
^ permalink raw reply related
* [net-next 1/2 (V2)] stmmac: don't go through ethtool to start auto-negotiation
From: Giuseppe CAVALLARO @ 2011-05-13 6:28 UTC (permalink / raw)
To: netdev; +Cc: David Decotigny, Giuseppe Cavallaro
From: David Decotigny <decot@google.com>
The driver used to call phy's ethtool configuration routine to start
auto-negotiation. This change has it call directly phy's routine to
start auto-negotiation.
The initial version was hiding phy_start_aneg() return value,
this patch returns it (<0 upon error).
Tested: module compiles, tested on STM HDK7108 STB.
Signed-off-by: David Decotigny <decot@google.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
drivers/net/stmmac/stmmac_ethtool.c | 13 ++-----------
1 files changed, 2 insertions(+), 11 deletions(-)
diff --git a/drivers/net/stmmac/stmmac_ethtool.c b/drivers/net/stmmac/stmmac_ethtool.c
index 6f5aaeb..9c05cf0 100644
--- a/drivers/net/stmmac/stmmac_ethtool.c
+++ b/drivers/net/stmmac/stmmac_ethtool.c
@@ -236,17 +236,8 @@ stmmac_set_pauseparam(struct net_device *netdev,
priv->flow_ctrl = new_pause;
if (phy->autoneg) {
- if (netif_running(netdev)) {
- struct ethtool_cmd cmd = { .cmd = ETHTOOL_SSET };
- /* auto-negotiation automatically restarted */
- cmd.supported = phy->supported;
- cmd.advertising = phy->advertising;
- cmd.autoneg = phy->autoneg;
- ethtool_cmd_speed_set(&cmd, phy->speed);
- cmd.duplex = phy->duplex;
- cmd.phy_address = phy->addr;
- ret = phy_ethtool_sset(phy, &cmd);
- }
+ if (netif_running(netdev))
+ ret = phy_start_aneg(phy);
} else
priv->hw->mac->flow_ctrl(priv->ioaddr, phy->duplex,
priv->flow_ctrl, priv->pause);
--
1.7.4.4
^ permalink raw reply related
* [PATCH] net: netlink: don't try unicast when dst_pid is zero for NETLINK_USERSOCK
From: Changli Gao @ 2011-05-13 6:24 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Changli Gao
For NETLINK_USERSOCK, no one listens on PID 0, so sending a message only to
to a multicast group should not return -ECONNREFUSED.
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
---
net/netlink/af_netlink.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index c8f35b5..ba89304 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1379,6 +1379,8 @@ static int netlink_sendmsg(struct kiocb *kiocb, struct socket *sock,
if (dst_group) {
atomic_inc(&skb->users);
netlink_broadcast(sk, skb, dst_pid, dst_group, GFP_KERNEL);
+ if (dst_pid == 0 && sk->sk_protocol == NETLINK_USERSOCK)
+ return len;
}
err = netlink_unicast(sk, skb, dst_pid, msg->msg_flags&MSG_DONTWAIT);
^ permalink raw reply related
* [PATCH 1/1] IPVS: seq_release_net should be used.
From: Hans Schillstrom @ 2011-05-13 6:03 UTC (permalink / raw)
To: horms, ja, lvs-devel, netdev, netfilter-devel; +Cc: hans, Hans Schillstrom
Without this patch every access to ip_vs in procfs will increase
the netns count i.e. an unbalanced get_net()/put_net().
(ipvsadm commands also use procfs.)
The result is you can't exit a netns if reading ip_vs_* procfs entries.
Signed-off-by: Hans Schillstrom <hans.schillstrom@ericsson.com>
---
net/netfilter/ipvs/ip_vs_app.c | 2 +-
net/netfilter/ipvs/ip_vs_conn.c | 4 ++--
net/netfilter/ipvs/ip_vs_ctl.c | 6 +++---
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/net/netfilter/ipvs/ip_vs_app.c b/net/netfilter/ipvs/ip_vs_app.c
index 51f3af7..059af31 100644
--- a/net/netfilter/ipvs/ip_vs_app.c
+++ b/net/netfilter/ipvs/ip_vs_app.c
@@ -572,7 +572,7 @@ static const struct file_operations ip_vs_app_fops = {
.open = ip_vs_app_open,
.read = seq_read,
.llseek = seq_lseek,
- .release = seq_release,
+ .release = seq_release_net,
};
#endif
diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c
index d3fd91b..bf28ac2 100644
--- a/net/netfilter/ipvs/ip_vs_conn.c
+++ b/net/netfilter/ipvs/ip_vs_conn.c
@@ -1046,7 +1046,7 @@ static const struct file_operations ip_vs_conn_fops = {
.open = ip_vs_conn_open,
.read = seq_read,
.llseek = seq_lseek,
- .release = seq_release,
+ .release = seq_release_net,
};
static const char *ip_vs_origin_name(unsigned flags)
@@ -1114,7 +1114,7 @@ static const struct file_operations ip_vs_conn_sync_fops = {
.open = ip_vs_conn_sync_open,
.read = seq_read,
.llseek = seq_lseek,
- .release = seq_release,
+ .release = seq_release_net,
};
#endif
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index 89842f0..699c79a 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -2066,7 +2066,7 @@ static const struct file_operations ip_vs_info_fops = {
.open = ip_vs_info_open,
.read = seq_read,
.llseek = seq_lseek,
- .release = seq_release_private,
+ .release = seq_release_net,
};
static int ip_vs_stats_show(struct seq_file *seq, void *v)
@@ -2106,7 +2106,7 @@ static const struct file_operations ip_vs_stats_fops = {
.open = ip_vs_stats_seq_open,
.read = seq_read,
.llseek = seq_lseek,
- .release = single_release,
+ .release = single_release_net,
};
static int ip_vs_stats_percpu_show(struct seq_file *seq, void *v)
@@ -2175,7 +2175,7 @@ static const struct file_operations ip_vs_stats_percpu_fops = {
.open = ip_vs_stats_percpu_seq_open,
.read = seq_read,
.llseek = seq_lseek,
- .release = single_release,
+ .release = single_release_net,
};
#endif
--
1.7.2.3
^ permalink raw reply related
* question about drivers/isdn/hisax/st5481_init.c
From: Julia Lawall @ 2011-05-13 5:53 UTC (permalink / raw)
To: Karsten Keil, netdev, linux-kernel
The function probe_st5481 allocates an adapter value using kzalloc, adds
it to adapter_list, and then performs various initialization operations,
which may fail. adapter_list is a static variable that is never otherwise
referenced in the file. There is a list_del that removes the adapter from
the list in the function disconnect_st5481. The presence of the adapter
on the list makes it possibly unsafe to free adapter in the failure cases.
Could the list just be removed, if it is not being used anywhere?
Or if the list should be kept because it is useful or it is planned to be
useful in the future, could the insertion into the list be moved to the
end of the function, after the potentially failing operations, so that
adapter can be freed when a failure occurs?
julia
^ permalink raw reply
* Re: [PATCH net-next 1/2 RESEND v3] net: use NETIF_F_ALL_TSO for vlan features
From: Shan Wei @ 2011-05-13 2:10 UTC (permalink / raw)
To: Dimitris Michailidis; +Cc: David Miller, netdev, eilong, leedom
In-Reply-To: <4DCC1372.3040607@chelsio.com>
Dimitris Michailidis wrote, at 2011年05月13日 01:05:
> But vlan_features doesn't indicate by itself what the device supports, and it is because of this that you can use NETIF_F_ALL_TSO in vlan_features without much future breakage risk. There's still the potential that in the future some additional TSO variant will be added that some of the drivers you're changing support, but not over VLANs, and then they'll need to undo you change.
For this part.
David, please discard this patch.
--
Best Regards
-----
Shan Wei
^ permalink raw reply
* Re: [PATCH 7/10] ipvs: Remove all remaining references to rt->rt_{src,dst}
From: Hans Schillstrom @ 2011-05-13 5:35 UTC (permalink / raw)
To: Julian Anastasov; +Cc: David Miller, netdev@vger.kernel.org
In-Reply-To: <alpine.LFD.2.00.1105110128100.4532@ja.ssi.bg>
On Wednesday 11 May 2011 00:46:05 Julian Anastasov wrote:
>
> Remove all remaining references to rt->rt_{src,dst}
> by using dest->dst_saddr to cache saddr (used for TUN mode).
> For ICMP in FORWARD hook just restrict the rt_mode for NAT
> to disable LOCALNODE. All other modes do not allow
> IP_VS_RT_MODE_RDR, so we should be safe with the ICMP
> forwarding. Using cp->daddr as replacement for rt_dst
> is safe for all modes except BYPASS, even when cp->dest is
> NULL because it is cp->daddr that is used to assign cp->dest
> for sync-ed connections.
>
No problems found after two days of testing.
> Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Hans Schillstrom <hans.schillstrom@ericsson.com>
> ---
>
> I'm proposing this patch as replacement for
> original patches 6 and 7, it can be number 7 again.
> The idea is to avoid storing flowi in cp.
>
> diff -urp net-next-2.6-7ef73bc/linux/include/net/ip_vs.h linux/include/net/ip_vs.h
> --- net-next-2.6-7ef73bc/linux/include/net/ip_vs.h 2011-05-09 07:24:07.000000000 +0300
> +++ linux/include/net/ip_vs.h 2011-05-11 00:46:02.510271856 +0300
> @@ -665,9 +665,7 @@ struct ip_vs_dest {
> struct dst_entry *dst_cache; /* destination cache entry */
> u32 dst_rtos; /* RT_TOS(tos) for dst */
> u32 dst_cookie;
> -#ifdef CONFIG_IP_VS_IPV6
> - struct in6_addr dst_saddr;
> -#endif
> + union nf_inet_addr dst_saddr;
>
> /* for virtual service */
> struct ip_vs_service *svc; /* service it belongs to */
> @@ -1236,7 +1234,8 @@ extern int ip_vs_tunnel_xmit
> extern int ip_vs_dr_xmit
> (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp);
> extern int ip_vs_icmp_xmit
> -(struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp, int offset);
> +(struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp,
> + int offset, unsigned int hooknum);
> extern void ip_vs_dst_reset(struct ip_vs_dest *dest);
>
> #ifdef CONFIG_IP_VS_IPV6
> @@ -1250,7 +1249,7 @@ extern int ip_vs_dr_xmit_v6
> (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp);
> extern int ip_vs_icmp_xmit_v6
> (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp,
> - int offset);
> + int offset, unsigned int hooknum);
> #endif
>
> #ifdef CONFIG_SYSCTL
> diff -urp net-next-2.6-7ef73bc/linux/net/netfilter/ipvs/ip_vs_core.c linux/net/netfilter/ipvs/ip_vs_core.c
> --- net-next-2.6-7ef73bc/linux/net/netfilter/ipvs/ip_vs_core.c 2011-05-09 07:24:07.000000000 +0300
> +++ linux/net/netfilter/ipvs/ip_vs_core.c 2011-05-11 01:07:29.429270382 +0300
> @@ -1378,15 +1378,7 @@ ip_vs_in_icmp(struct sk_buff *skb, int *
> ip_vs_in_stats(cp, skb);
> if (IPPROTO_TCP == cih->protocol || IPPROTO_UDP == cih->protocol)
> offset += 2 * sizeof(__u16);
> - verdict = ip_vs_icmp_xmit(skb, cp, pp, offset);
> - /* LOCALNODE from FORWARD hook is not supported */
> - if (verdict == NF_ACCEPT && hooknum == NF_INET_FORWARD &&
> - skb_rtable(skb)->rt_flags & RTCF_LOCAL) {
> - IP_VS_DBG(1, "%s(): "
> - "local delivery to %pI4 but in FORWARD\n",
> - __func__, &skb_rtable(skb)->rt_dst);
> - verdict = NF_DROP;
> - }
> + verdict = ip_vs_icmp_xmit(skb, cp, pp, offset, hooknum);
>
> out:
> __ip_vs_conn_put(cp);
> @@ -1408,7 +1400,6 @@ ip_vs_in_icmp_v6(struct sk_buff *skb, in
> struct ip_vs_protocol *pp;
> struct ip_vs_proto_data *pd;
> unsigned int offset, verdict;
> - struct rt6_info *rt;
>
> *related = 1;
>
> @@ -1470,23 +1461,12 @@ ip_vs_in_icmp_v6(struct sk_buff *skb, in
> if (!cp)
> return NF_ACCEPT;
>
> - verdict = NF_DROP;
> -
> /* do the statistics and put it back */
> ip_vs_in_stats(cp, skb);
> if (IPPROTO_TCP == cih->nexthdr || IPPROTO_UDP == cih->nexthdr ||
> IPPROTO_SCTP == cih->nexthdr)
> offset += 2 * sizeof(__u16);
> - verdict = ip_vs_icmp_xmit_v6(skb, cp, pp, offset);
> - /* LOCALNODE from FORWARD hook is not supported */
> - if (verdict == NF_ACCEPT && hooknum == NF_INET_FORWARD &&
> - (rt = (struct rt6_info *) skb_dst(skb)) &&
> - rt->rt6i_dev && rt->rt6i_dev->flags & IFF_LOOPBACK) {
> - IP_VS_DBG(1, "%s(): "
> - "local delivery to %pI6 but in FORWARD\n",
> - __func__, &rt->rt6i_dst);
> - verdict = NF_DROP;
> - }
> + verdict = ip_vs_icmp_xmit_v6(skb, cp, pp, offset, hooknum);
>
> __ip_vs_conn_put(cp);
>
> diff -urp net-next-2.6-7ef73bc/linux/net/netfilter/ipvs/ip_vs_xmit.c linux/net/netfilter/ipvs/ip_vs_xmit.c
> --- net-next-2.6-7ef73bc/linux/net/netfilter/ipvs/ip_vs_xmit.c 2011-05-10 23:52:06.000000000 +0300
> +++ linux/net/netfilter/ipvs/ip_vs_xmit.c 2011-05-11 01:08:21.837272458 +0300
> @@ -87,7 +87,7 @@ __ip_vs_dst_check(struct ip_vs_dest *des
> /* Get route to destination or remote server */
> static struct rtable *
> __ip_vs_get_out_rt(struct sk_buff *skb, struct ip_vs_dest *dest,
> - __be32 daddr, u32 rtos, int rt_mode)
> + __be32 daddr, u32 rtos, int rt_mode, __be32 *ret_saddr)
> {
> struct net *net = dev_net(skb_dst(skb)->dev);
> struct rtable *rt; /* Route to the other host */
> @@ -98,7 +98,12 @@ __ip_vs_get_out_rt(struct sk_buff *skb,
> spin_lock(&dest->dst_lock);
> if (!(rt = (struct rtable *)
> __ip_vs_dst_check(dest, rtos))) {
> - rt = ip_route_output(net, dest->addr.ip, 0, rtos, 0);
> + struct flowi4 fl4;
> +
> + memset(&fl4, 0, sizeof(fl4));
> + fl4.daddr = dest->addr.ip;
> + fl4.flowi4_tos = rtos;
> + rt = ip_route_output_key(net, &fl4);
> if (IS_ERR(rt)) {
> spin_unlock(&dest->dst_lock);
> IP_VS_DBG_RL("ip_route_output error, dest: %pI4\n",
> @@ -106,19 +111,30 @@ __ip_vs_get_out_rt(struct sk_buff *skb,
> return NULL;
> }
> __ip_vs_dst_set(dest, rtos, dst_clone(&rt->dst), 0);
> - IP_VS_DBG(10, "new dst %pI4, refcnt=%d, rtos=%X\n",
> - &dest->addr.ip,
> + dest->dst_saddr.ip = fl4.saddr;
> + IP_VS_DBG(10, "new dst %pI4, src %pI4, refcnt=%d, "
> + "rtos=%X\n",
> + &dest->addr.ip, &dest->dst_saddr.ip,
> atomic_read(&rt->dst.__refcnt), rtos);
> }
> daddr = dest->addr.ip;
> + if (ret_saddr)
> + *ret_saddr = dest->dst_saddr.ip;
> spin_unlock(&dest->dst_lock);
> } else {
> - rt = ip_route_output(net, daddr, 0, rtos, 0);
> + struct flowi4 fl4;
> +
> + memset(&fl4, 0, sizeof(fl4));
> + fl4.daddr = daddr;
> + fl4.flowi4_tos = rtos;
> + rt = ip_route_output_key(net, &fl4);
> if (IS_ERR(rt)) {
> IP_VS_DBG_RL("ip_route_output error, dest: %pI4\n",
> &daddr);
> return NULL;
> }
> + if (ret_saddr)
> + *ret_saddr = fl4.saddr;
> }
>
> local = rt->rt_flags & RTCF_LOCAL;
> @@ -249,7 +265,7 @@ __ip_vs_get_out_rt_v6(struct sk_buff *sk
> u32 cookie;
>
> dst = __ip_vs_route_output_v6(net, &dest->addr.in6,
> - &dest->dst_saddr,
> + &dest->dst_saddr.in6,
> do_xfrm);
> if (!dst) {
> spin_unlock(&dest->dst_lock);
> @@ -259,11 +275,11 @@ __ip_vs_get_out_rt_v6(struct sk_buff *sk
> cookie = rt->rt6i_node ? rt->rt6i_node->fn_sernum : 0;
> __ip_vs_dst_set(dest, 0, dst_clone(&rt->dst), cookie);
> IP_VS_DBG(10, "new dst %pI6, src %pI6, refcnt=%d\n",
> - &dest->addr.in6, &dest->dst_saddr,
> + &dest->addr.in6, &dest->dst_saddr.in6,
> atomic_read(&rt->dst.__refcnt));
> }
> if (ret_saddr)
> - ipv6_addr_copy(ret_saddr, &dest->dst_saddr);
> + ipv6_addr_copy(ret_saddr, &dest->dst_saddr.in6);
> spin_unlock(&dest->dst_lock);
> } else {
> dst = __ip_vs_route_output_v6(net, daddr, ret_saddr, do_xfrm);
> @@ -386,7 +402,7 @@ ip_vs_bypass_xmit(struct sk_buff *skb, s
> EnterFunction(10);
>
> if (!(rt = __ip_vs_get_out_rt(skb, NULL, iph->daddr, RT_TOS(iph->tos),
> - IP_VS_RT_MODE_NON_LOCAL)))
> + IP_VS_RT_MODE_NON_LOCAL, NULL)))
> goto tx_error_icmp;
>
> /* MTU checking */
> @@ -518,7 +534,7 @@ ip_vs_nat_xmit(struct sk_buff *skb, stru
> RT_TOS(iph->tos),
> IP_VS_RT_MODE_LOCAL |
> IP_VS_RT_MODE_NON_LOCAL |
> - IP_VS_RT_MODE_RDR)))
> + IP_VS_RT_MODE_RDR, NULL)))
> goto tx_error_icmp;
> local = rt->rt_flags & RTCF_LOCAL;
> /*
> @@ -540,7 +556,7 @@ ip_vs_nat_xmit(struct sk_buff *skb, stru
> #endif
>
> /* From world but DNAT to loopback address? */
> - if (local && ipv4_is_loopback(rt->rt_dst) &&
> + if (local && ipv4_is_loopback(cp->daddr.ip) &&
> rt_is_input_route(skb_rtable(skb))) {
> IP_VS_DBG_RL_PKT(1, AF_INET, pp, skb, 0, "ip_vs_nat_xmit(): "
> "stopping DNAT to loopback address");
> @@ -751,6 +767,7 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, s
> struct ip_vs_protocol *pp)
> {
> struct rtable *rt; /* Route to the other host */
> + __be32 saddr; /* Source for tunnel */
> struct net_device *tdev; /* Device to other host */
> struct iphdr *old_iph = ip_hdr(skb);
> u8 tos = old_iph->tos;
> @@ -764,7 +781,8 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, s
>
> if (!(rt = __ip_vs_get_out_rt(skb, cp->dest, cp->daddr.ip,
> RT_TOS(tos), IP_VS_RT_MODE_LOCAL |
> - IP_VS_RT_MODE_NON_LOCAL)))
> + IP_VS_RT_MODE_NON_LOCAL,
> + &saddr)))
> goto tx_error_icmp;
> if (rt->rt_flags & RTCF_LOCAL) {
> ip_rt_put(rt);
> @@ -832,8 +850,8 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, s
> iph->frag_off = df;
> iph->protocol = IPPROTO_IPIP;
> iph->tos = tos;
> - iph->daddr = rt->rt_dst;
> - iph->saddr = rt->rt_src;
> + iph->daddr = cp->daddr.ip;
> + iph->saddr = saddr;
> iph->ttl = old_iph->ttl;
> ip_select_ident(iph, &rt->dst, NULL);
>
> @@ -996,7 +1014,7 @@ ip_vs_dr_xmit(struct sk_buff *skb, struc
> if (!(rt = __ip_vs_get_out_rt(skb, cp->dest, cp->daddr.ip,
> RT_TOS(iph->tos),
> IP_VS_RT_MODE_LOCAL |
> - IP_VS_RT_MODE_NON_LOCAL)))
> + IP_VS_RT_MODE_NON_LOCAL, NULL)))
> goto tx_error_icmp;
> if (rt->rt_flags & RTCF_LOCAL) {
> ip_rt_put(rt);
> @@ -1114,12 +1132,13 @@ tx_error:
> */
> int
> ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
> - struct ip_vs_protocol *pp, int offset)
> + struct ip_vs_protocol *pp, int offset, unsigned int hooknum)
> {
> struct rtable *rt; /* Route to the other host */
> int mtu;
> int rc;
> int local;
> + int rt_mode;
>
> EnterFunction(10);
>
> @@ -1140,11 +1159,13 @@ ip_vs_icmp_xmit(struct sk_buff *skb, str
> * mangle and send the packet here (only for VS/NAT)
> */
>
> + /* LOCALNODE from FORWARD hook is not supported */
> + rt_mode = (hooknum != NF_INET_FORWARD) ?
> + IP_VS_RT_MODE_LOCAL | IP_VS_RT_MODE_NON_LOCAL |
> + IP_VS_RT_MODE_RDR : IP_VS_RT_MODE_NON_LOCAL;
> if (!(rt = __ip_vs_get_out_rt(skb, cp->dest, cp->daddr.ip,
> RT_TOS(ip_hdr(skb)->tos),
> - IP_VS_RT_MODE_LOCAL |
> - IP_VS_RT_MODE_NON_LOCAL |
> - IP_VS_RT_MODE_RDR)))
> + rt_mode, NULL)))
> goto tx_error_icmp;
> local = rt->rt_flags & RTCF_LOCAL;
>
> @@ -1167,7 +1188,7 @@ ip_vs_icmp_xmit(struct sk_buff *skb, str
> #endif
>
> /* From world but DNAT to loopback address? */
> - if (local && ipv4_is_loopback(rt->rt_dst) &&
> + if (local && ipv4_is_loopback(cp->daddr.ip) &&
> rt_is_input_route(skb_rtable(skb))) {
> IP_VS_DBG(1, "%s(): "
> "stopping DNAT to loopback %pI4\n",
> @@ -1232,12 +1253,13 @@ ip_vs_icmp_xmit(struct sk_buff *skb, str
> #ifdef CONFIG_IP_VS_IPV6
> int
> ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
> - struct ip_vs_protocol *pp, int offset)
> + struct ip_vs_protocol *pp, int offset, unsigned int hooknum)
> {
> struct rt6_info *rt; /* Route to the other host */
> int mtu;
> int rc;
> int local;
> + int rt_mode;
>
> EnterFunction(10);
>
> @@ -1258,10 +1280,12 @@ ip_vs_icmp_xmit_v6(struct sk_buff *skb,
> * mangle and send the packet here (only for VS/NAT)
> */
>
> + /* LOCALNODE from FORWARD hook is not supported */
> + rt_mode = (hooknum != NF_INET_FORWARD) ?
> + IP_VS_RT_MODE_LOCAL | IP_VS_RT_MODE_NON_LOCAL |
> + IP_VS_RT_MODE_RDR : IP_VS_RT_MODE_NON_LOCAL;
> if (!(rt = __ip_vs_get_out_rt_v6(skb, cp->dest, &cp->daddr.in6, NULL,
> - 0, (IP_VS_RT_MODE_LOCAL |
> - IP_VS_RT_MODE_NON_LOCAL |
> - IP_VS_RT_MODE_RDR))))
> + 0, rt_mode)))
> goto tx_error_icmp;
>
> local = __ip_vs_is_local_route6(rt);
> --
> 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
>
--
Regards
Hans Schillstrom <hans.schillstrom@ericsson.com>
^ permalink raw reply
* [PATCH net-next-2.6 0/2] signal reception fixes
From: Sathya Perla @ 2011-05-13 5:32 UTC (permalink / raw)
To: netdev; +Cc: Sathya Perla
Incorporated Ben's comment w.r.t replacing schedule_timeout() with msleep()
Sathya Perla (2):
be2net: handle signal reception while waiting for POST
be2net: fix mbox polling for signal reception
drivers/net/benet/be_cmds.c | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
--
1.7.4
^ permalink raw reply
* [PATCH net-next-2.6 2/2] be2net: fix mbox polling for signal reception
From: Sathya Perla @ 2011-05-13 5:32 UTC (permalink / raw)
To: netdev; +Cc: Sathya Perla
In-Reply-To: <1305264736-18358-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.
Use msleep() to not get interrupted.
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
---
drivers/net/benet/be_cmds.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c
index d558b90..f2c9099 100644
--- a/drivers/net/benet/be_cmds.c
+++ b/drivers/net/benet/be_cmds.c
@@ -298,8 +298,7 @@ static int be_mbox_db_ready_wait(struct be_adapter *adapter, void __iomem *db)
return -1;
}
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(msecs_to_jiffies(1));
+ msleep(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-13 5:32 UTC (permalink / raw)
To: netdev; +Cc: Sathya Perla
In-Reply-To: <1305264736-18358-1-git-send-email-sathya.perla@emulex.com>
If waiting on POST 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 | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c
index 0dbb4cb..d558b90 100644
--- a/drivers/net/benet/be_cmds.c
+++ b/drivers/net/benet/be_cmds.c
@@ -376,23 +376,25 @@ 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 (msleep_interruptible(2000)) {
+ 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 0/3] Fix 8390 regressions
From: Geert Uytterhoeven @ 2011-05-13 5:17 UTC (permalink / raw)
To: David Miller
Cc: shemminger, ysato, linux, fthain, netdev, linux-kernel,
linux-m68k
In-Reply-To: <20110512.170254.1553444447781324461.davem@davemloft.net>
On Thu, May 12, 2011 at 23:02, David Miller <davem@davemloft.net> wrote:
> From: Geert Uytterhoeven <geert@linux-m68k.org>
> Date: Thu, 12 May 2011 19:11:37 +0000
>
>> These patches fix regressions in 3 8390-based network drivers:
>> [1/3] zorro8390: Fix regression caused during net_device_ops conversion
>> [2/3] hydra: Fix regression caused during net_device_ops conversion
>> [3/3] ne-h8300: Fix regression caused during net_device_ops conversion
>>
>> The first one, for zorro8390, has been tested.
>> The second one, for hydra, has been compile-tested only.
>>
>> Based on commits 8cfd9e923be54ef66ce174a93f4592b444b96407 ("[ARM] RiscPC: Fix
>> etherh oops") and 217cbfa856dc1cbc2890781626c4032d9e3ec59f ("mac8390: fix
>> regression caused during net_device_ops conversion"), and the patch for
>> zorro8390, we have good reasons to believe hydra and ne-h8300 are affected
>> as well, as they all include lib8390.c.
>> Hence patches for those are also included, although I could not test them.
>
> All applied, thanks Geert, and I made the "From: " removals you requested.
Thanks a lot!
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply
* Re: [PATCH net-next V3] net: af_packet: Untangle packet_snd by adding vpacket_snd
From: Eric Dumazet @ 2011-05-13 5:11 UTC (permalink / raw)
To: Joe Perches; +Cc: linux-kernel, David S. Miller, netdev
In-Reply-To: <b174c9df4b7c39b4e951f1f309a4fd9086179c3c.1305242549.git.joe@perches.com>
Le jeudi 12 mai 2011 à 16:25 -0700, Joe Perches a écrit :
> The current packet_snd handles both vlan and non-vlan frames
> with initialization of a struct virtio_net_hdr that is unused
> by non-vlan frames.
>
> Create a new vpacket_snd that uses this virtio_net_hdr and
> remove it and the vlan and gso logic from packet_snd.
>
1) I find this kind of patches a real pain, frankly.
When I have to look around code and commits to find bugs and bugs
origins, I'll have to fully check this kind of patch, and this slow down
the process a _lot_, because I have no idea if "Joe Perches" actually
tested the patch, or if its yet another "code beautifier" process in the
wild.
You should have shooted when/before commit bfd5f4a3 (packet: Add
GSO/csum offload support) was accepted.
2) You did not CCed Sridhar Samudrala <sri@us.ibm.com>, the author of
above commit. I dont think David will take the time to test your patch.
3) You add some non codingstyle artifacts. I am afraid it makes me
nervous for patches bringing no real values but shuffling the code and
making maintainers life more difficult.
^ permalink raw reply
* Re: [Bridge] Bug#625914: linux-image-2.6.38-2-amd64: bridging is not interacting well with multicast in 2.6.38-4
From: Noah Meyerhans @ 2011-05-13 5:03 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Ben Hutchings, 625914, bridge, netdev
In-Reply-To: <20110512164322.45626683@nehalam>
[-- Attachment #1: Type: text/plain, Size: 1199 bytes --]
On Thu, May 12, 2011 at 04:43:22PM -0700, Stephen Hemminger wrote:
> > > There were two more follow on commits in stable related to this.
> > > I recommend merging 2.6.38.6 which includes these.
> >
> > The problem still exists in the current 2.6.38.6. Backing out 5f1c356a
> > still solves the problem there.
> >
> > I have not yet tried anything outside the stable-2.6.38.y tree, but it
> > seems like these same changes are present there, and it's unlikely that
> > other releases will work any better.
>
> Does this fix the problem? The tap driver allocates an skb and throws
> it into the receive path, but the skb does not have the same padding
> as normal skb's received.
>
> --- a/drivers/net/tun.c 2011-05-12 16:36:15.231347935 -0700
> +++ b/drivers/net/tun.c 2011-05-12 16:36:38.503464573 -0700
> @@ -614,7 +614,7 @@ static __inline__ ssize_t tun_get_user(s
> }
>
> if ((tun->flags & TUN_TYPE_MASK) == TUN_TAP_DEV) {
> - align = NET_IP_ALIGN;
> + align = NET_IP_ALIGN + NET_SKB_PAD;
> if (unlikely(len < ETH_HLEN ||
> (gso.hdr_len && gso.hdr_len < ETH_HLEN)))
> return -EINVAL;
>
Sorry, this does not fix the problem.
noah
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* [patch 2/9] [PATCH] qeth: add OSA concurrent hardware trap
From: frank.blaschka @ 2011-05-13 4:45 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390
In-Reply-To: <20110513044500.190198403@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",
@@ -3371,6 +3338,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;
@@ -3422,13 +3390,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);
@@ -3530,6 +3503,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));
@@ -3585,6 +3562,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);
}
@@ -3600,6 +3579,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 1/9] [PATCH] qeth: convert to hw_features part 2
From: frank.blaschka @ 2011-05-13 4:45 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390
In-Reply-To: <20110513044500.190198403@de.ibm.com>
[-- Attachment #1: qeth_hw_feat2.patch --]
[-- Type: text/plain, Size: 11996 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 | 104 +++++++++++++++++--------------------
drivers/s390/net/qeth_l3_sys.c | 106 --------------------------------------
7 files changed, 49 insertions(+), 178 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;
} 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->options.checksum_type = csum_type;
+
return rc;
}
@@ -1482,32 +1478,34 @@ 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->features &= ~NETIF_F_RXCSUM;
+ netdev_update_features(card->dev);
+ rtnl_unlock();
return rc;
}
@@ -2037,14 +2035,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 +2044,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 +3227,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 +3333,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 +3354,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 +3377,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 9/9] [PATCH] convert old cpumask API into new one
From: frank.blaschka @ 2011-05-13 4:45 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390, KOSAKI Motohiro
In-Reply-To: <20110513044500.190198403@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 4/9] [PATCH] claw: remove unused return code handling
From: frank.blaschka @ 2011-05-13 4:45 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390, Heiko Carstens
In-Reply-To: <20110513044500.190198403@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 7/9] [PATCH] iucv: get rid of compile warning
From: frank.blaschka @ 2011-05-13 4:45 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390, Ursula Braun
In-Reply-To: <20110513044500.190198403@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
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