* [PATCHv3 net-next-2.6 2/3] qlcnic: Take FW dump via ethtool
From: Anirban Chakraborty @ 2011-05-12 22:48 UTC (permalink / raw)
To: netdev; +Cc: Ben Hutchings, David Miller, Anirban Chakraborty
In-Reply-To: <1305240515-29237-1-git-send-email-anirban.chakraborty@qlogic.com>
Driver checks if the previous dump has been cleared before taking the dump.
It doesn't take the dump if it is not cleared.
Changes from v2:
Added lock to protect dump data structures from being mangled while
dumping or setting them via ethtool.
Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
---
drivers/net/qlcnic/qlcnic_ethtool.c | 81 +++++++++++++++++++++++++++++++++++
1 files changed, 81 insertions(+), 0 deletions(-)
diff --git a/drivers/net/qlcnic/qlcnic_ethtool.c b/drivers/net/qlcnic/qlcnic_ethtool.c
index c541461..9efc690 100644
--- a/drivers/net/qlcnic/qlcnic_ethtool.c
+++ b/drivers/net/qlcnic/qlcnic_ethtool.c
@@ -965,6 +965,84 @@ static void qlcnic_set_msglevel(struct net_device *netdev, u32 msglvl)
adapter->msg_enable = msglvl;
}
+static int
+qlcnic_get_dump_flag(struct net_device *netdev, struct ethtool_dump *dump)
+{
+ struct qlcnic_adapter *adapter = netdev_priv(netdev);
+ struct qlcnic_fw_dump *fw_dump = &adapter->ahw->fw_dump;
+
+ dump->len = fw_dump->tmpl_hdr->size + fw_dump->size;
+ dump->flag = fw_dump->tmpl_hdr->drv_cap_mask;
+ dump->version = adapter->fw_version;
+ return 0;
+}
+
+static int
+qlcnic_get_dump_data(struct net_device *netdev, struct ethtool_dump *dump,
+ void *buffer)
+{
+ int i, copy_sz;
+ u32 *hdr_ptr, *data;
+ struct qlcnic_adapter *adapter = netdev_priv(netdev);
+ struct qlcnic_fw_dump *fw_dump = &adapter->ahw->fw_dump;
+
+ if (qlcnic_api_lock(adapter))
+ return -EIO;
+ if (!fw_dump->clr) {
+ netdev_info(netdev, "Dump not available\n");
+ qlcnic_api_unlock(adapter);
+ return -EINVAL;
+ }
+ /* Copy template header first */
+ copy_sz = fw_dump->tmpl_hdr->size;
+ hdr_ptr = (u32 *) fw_dump->tmpl_hdr;
+ data = (u32 *) buffer;
+ for (i = 0; i < copy_sz/sizeof(u32); i++)
+ *data++ = cpu_to_le32(*hdr_ptr++);
+
+ /* Copy captured dump data */
+ memcpy(buffer + copy_sz, fw_dump->data, fw_dump->size);
+ dump->len = copy_sz + fw_dump->size;
+ dump->flag = fw_dump->tmpl_hdr->drv_cap_mask;
+
+ /* Free dump area once data has been captured */
+ vfree(fw_dump->data);
+ fw_dump->data = NULL;
+ fw_dump->clr = 0;
+ qlcnic_api_unlock(adapter);
+
+ return 0;
+}
+
+static int
+qlcnic_set_dump(struct net_device *netdev, struct ethtool_dump *val)
+{
+ int ret = 0;
+ struct qlcnic_adapter *adapter = netdev_priv(netdev);
+ struct qlcnic_fw_dump *fw_dump = &adapter->ahw->fw_dump;
+
+ if (val->flag == QLCNIC_FORCE_FW_DUMP_KEY) {
+ netdev_info(netdev, "Forcing a FW dump\n");
+ qlcnic_dev_request_reset(adapter);
+ } else {
+ if (val->flag > QLCNIC_DUMP_MASK_MAX ||
+ val->flag < QLCNIC_DUMP_MASK_MIN) {
+ netdev_info(netdev,
+ "Invalid dump level: 0x%x\n", val->flag);
+ ret = -EINVAL;
+ goto out;
+ }
+ if (qlcnic_api_lock(adapter))
+ return -EIO;
+ fw_dump->tmpl_hdr->drv_cap_mask = val->flag & 0xff;
+ qlcnic_api_unlock(adapter);
+ netdev_info(netdev, "Driver mask changed to: 0x%x\n",
+ fw_dump->tmpl_hdr->drv_cap_mask);
+ }
+out:
+ return ret;
+}
+
const struct ethtool_ops qlcnic_ethtool_ops = {
.get_settings = qlcnic_get_settings,
.set_settings = qlcnic_set_settings,
@@ -991,4 +1069,7 @@ const struct ethtool_ops qlcnic_ethtool_ops = {
.set_phys_id = qlcnic_set_led,
.set_msglevel = qlcnic_set_msglevel,
.get_msglevel = qlcnic_get_msglevel,
+ .get_dump_flag = qlcnic_get_dump_flag,
+ .get_dump_data = qlcnic_get_dump_data,
+ .set_dump = qlcnic_set_dump,
};
--
1.7.4.1
^ permalink raw reply related
* [PATCHv3 net-next-2.6 3/3] qlcnic: Bumped up version number to 5.0.18
From: Anirban Chakraborty @ 2011-05-12 22:48 UTC (permalink / raw)
To: netdev; +Cc: Ben Hutchings, David Miller, Anirban Chakraborty
In-Reply-To: <1305240515-29237-1-git-send-email-anirban.chakraborty@qlogic.com>
Update driver version number
Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
---
drivers/net/qlcnic/qlcnic.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h
index 689adea..480ef5c 100644
--- a/drivers/net/qlcnic/qlcnic.h
+++ b/drivers/net/qlcnic/qlcnic.h
@@ -36,8 +36,8 @@
#define _QLCNIC_LINUX_MAJOR 5
#define _QLCNIC_LINUX_MINOR 0
-#define _QLCNIC_LINUX_SUBVERSION 17
-#define QLCNIC_LINUX_VERSIONID "5.0.17"
+#define _QLCNIC_LINUX_SUBVERSION 18
+#define QLCNIC_LINUX_VERSIONID "5.0.18"
#define QLCNIC_DRV_IDC_VER 0x01
#define QLCNIC_DRIVER_VERSION ((_QLCNIC_LINUX_MAJOR << 16) |\
(_QLCNIC_LINUX_MINOR << 8) | (_QLCNIC_LINUX_SUBVERSION))
--
1.7.4.1
^ permalink raw reply related
* Re: [Bugme-new] [Bug 34322] New: No ECN marking in IPv6
From: David Miller @ 2011-05-12 22:52 UTC (permalink / raw)
To: sgunderson
Cc: eric.dumazet, akpm, netdev, bugzilla-daemon, bugme-daemon,
yoshfuji
In-Reply-To: <20110507095910.GC30492@uio.no>
From: "Steinar H. Gunderson" <sgunderson@bigfoot.com>
Date: Sat, 7 May 2011 11:59:10 +0200
> On Sat, May 07, 2011 at 11:44:46AM +0200, Eric Dumazet wrote:
>> I cooked for you the official patch and made sure it worked with a RED
>> ECN setup, and one ipv6 tcp xmit.
>
> Great, thanks :-) This looks good to me.
Applied, thanks everyone.
^ permalink raw reply
* Re: [PATCH v2] bonding: convert to ndo_fix_features
From: David Miller @ 2011-05-12 22:46 UTC (permalink / raw)
To: mirq-linux; +Cc: netdev, fubar, andy
In-Reply-To: <20110507132217.0CB5A13A69@rere.qmqm.pl>
From: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Date: Sat, 7 May 2011 15:22:17 +0200 (CEST)
> This should also fix updating of vlan_features and propagating changes to
> VLAN devices on the bond.
>
> Side effect: it allows user to force-disable some offloads on the bond
> interface.
>
> Note: NETIF_F_VLAN_CHALLENGED is managed by bond_fix_features() now.
>
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Applied.
^ permalink raw reply
* Re: [PATCH] net: introduce netdev_change_features()
From: David Miller @ 2011-05-12 22:40 UTC (permalink / raw)
To: mirq-linux; +Cc: netdev
In-Reply-To: <20110507132217.0938E13A6A@rere.qmqm.pl>
From: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Date: Sat, 7 May 2011 15:22:17 +0200 (CEST)
> It will be needed by bonding and other drivers changing vlan_features
> after ndo_init callback.
>
> As a bonus, this includes kernel-doc for netdev_update_features().
>
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Applied.
^ permalink raw reply
* Re: [PATCH] CDC NCM: Add mising short packet in cdc_ncm driver
From: David Miller @ 2011-05-12 22:30 UTC (permalink / raw)
To: alexey.orishko; +Cc: netdev, linux-usb, gregkh, alexey.orishko
In-Reply-To: <1304686890-2543-1-git-send-email-alexey.orishko@stericsson.com>
From: Alexey Orishko <alexey.orishko@gmail.com>
Date: Fri, 6 May 2011 15:01:30 +0200
> Changes:
> - while making NTB, driver shall check if device dwNtbOutMaxSize is higher than
> host value and shall add a short packet if this is the case
> - previous temporary patch for this issue is replaced by this one
>
> Signed-off-by: Alexey Orishko <alexey.orishko@stericsson.com>
Applied to net-next-2.6, thanks.
^ permalink raw reply
* Re: [PATCH 4/10] ipvs: Use IP_VS_RT_MODE_* instead of magic constants.
From: David Miller @ 2011-05-12 22:28 UTC (permalink / raw)
To: ja; +Cc: netdev
In-Reply-To: <alpine.LFD.2.00.1105120212150.2431@ja.ssi.bg>
From: Julian Anastasov <ja@ssi.bg>
Date: Thu, 12 May 2011 02:32:09 +0300 (EEST)
> 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...
Julian, I integrated your work and pushed 3 patches to net-next-2.6
1) Original patch #4 with your followup integrated
2) Original patch #5
3) You're replacement for original patch #6 and #7
Let me know if there are any followup fixes that we need to work
on.
Thanks!
^ permalink raw reply
* Re: [PATCH net-next] netdevice.h: Align struct netdevices members
From: David Miller @ 2011-05-12 22:05 UTC (permalink / raw)
To: joe; +Cc: eric.dumazet, netdev
In-Reply-To: <1305001325.19586.110.camel@Joe-Laptop>
From: Joe Perches <joe@perches.com>
Date: Mon, 09 May 2011 21:22:05 -0700
> On Tue, 2011-05-10 at 05:53 +0200, Eric Dumazet wrote:
>> Le lundi 09 mai 2011 à 20:42 -0700, Joe Perches a écrit :
>> > Save a bit of space.
>> Hmm... correct alignements are far more important for this structure.
>
> I agree. I aligned these members on "natural" boundaries.
> 4 consecutive chars rather than 2 chars, unsigned long.
>
>> Did you run benchmarks on 32bit and 64bit platforms ?
>
> Nope.
>
>> BTW we have ____cacheline_aligned_in_smp markers, I am not even sure
>> this patch saves space.
>
> That depends on whether or not CONFIG_SMP is defined and
> all of the changes are before any ____cacheline_aligned markers.
I think this is sane, Eric do you still have objections?
^ permalink raw reply
* Re: [PATCHv6 2/2] tg3: Allow ethtool to enable/disable loopback.
From: David Miller @ 2011-05-12 22:04 UTC (permalink / raw)
To: maheshb; +Cc: mcarlson, netdev, mchan, therbert
In-Reply-To: <1304873508-24307-1-git-send-email-maheshb@google.com>
From: Mahesh Bandewar <maheshb@google.com>
Date: Sun, 8 May 2011 09:51:48 -0700
> This patch adds tg3_set_features() to handle loopback mode. Currently the
> capability is added for the devices which support internal MAC loopback mode.
> So when enabled, it enables internal-MAC loopback.
>
> Signed-off-by: Mahesh Bandewar <maheshb@google.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH] net/irda/ircomm_tty.c: Use flip buffers to deliver data
From: David Miller @ 2011-05-12 22:03 UTC (permalink / raw)
To: alan
Cc: amit.virdi, samuel, alan, eric.dumazet, netdev, linux-kernel,
shiraz.hashim, armando.visconti, viresh.kumar
In-Reply-To: <20110512121751.61d62446@lxorguk.ukuu.org.uk>
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
Date: Thu, 12 May 2011 12:17:51 +0100
> On Thu, 12 May 2011 16:34:40 +0530
> Amit Virdi <amit.virdi@st.com> wrote:
>
>> use tty_insert_flip_string and tty_flip_buffer_push to deliver incoming data
>> packets from the IrDA device instead of delivering the packets directly to the
>> line discipline. Following later approach resulted in warning "Sleeping function
>> called from invalid context".
>>
>> Signed-off-by: Amit Virdi <amit.virdi@st.com>
>
> Acked-by: Alan Cox <alan@linux.intel.com>
Applied to net-next-2.6, thanks.
^ permalink raw reply
* Re: [patch 1/9] [PATCH] qeth: convert to hw_features part 2
From: David Miller @ 2011-05-12 22:02 UTC (permalink / raw)
To: blaschka; +Cc: mirqus, netdev, linux-s390
In-Reply-To: <20110512115959.GA37368@tuxmaker.boeblingen.de.ibm.com>
From: Frank Blaschka <blaschka@linux.vnet.ibm.com>
Date: Thu, 12 May 2011 13:59:59 +0200
> Since this is RX processing there is nothing queued during recovery. But
> you are right for tx csum or TSO we have to think about this. For now
> I would like to complete this patch.
Can you guys resolve this quickly so that I can apply this patch
series?
^ permalink raw reply
* Re: [PATCH] net: af_packet: Don't initialize vnet_hdr
From: David Miller @ 2011-05-12 21:59 UTC (permalink / raw)
To: joe; +Cc: linux-kernel, netdev
In-Reply-To: <1305237348.6124.72.camel@Joe-Laptop>
From: Joe Perches <joe@perches.com>
Date: Thu, 12 May 2011 14:55:48 -0700
> Save an initialization because when this structure
> is used it's completely filled by memcpy_fromiovec.
>
> Add a new variable used for the 0 sized allocation
> when this structure is not used.
>
> Signed-off-by: Joe Perches <joe@perches.com>
>
> ---
>
> On Thu, 2011-05-12 at 17:36 -0400, David Miller wrote:
>> I would rather see the code rearranged such that this sort of
>> hackish scheme isn't necessary.
You misunderstood me.
It's this:
struct virtio_net_hdr vnet_hdr;
if (po->has_vnet_hdr) {
initialize &vnet_hdr
}
...
if (po->has_vnet_hdr) {
use vnet_hdr
}
which I'm talking about when I say "hackish scheme".
The compiler cannot conclusively see that the control flow always
goes to the code that initialized vnet_hdr every time it reaches
the code that uses it.
I want _that_ part rearranged, not what you decided to tackle
here.
For the third time, I'm not applying your patch.
^ permalink raw reply
* Re: [PATCH v2] net: group FCoE related feature flags
From: David Miller @ 2011-05-12 21:55 UTC (permalink / raw)
To: yi.zou; +Cc: netdev, mirq-linux, jeffrey.t.kirsher, devel
In-Reply-To: <20110509215133.4346.14504.stgit@localhost6.localdomain6>
From: Yi Zou <yi.zou@intel.com>
Date: Mon, 09 May 2011 14:53:27 -0700
> Michał Mirosław's patch (http://patchwork.ozlabs.org/patch/94421/) fixes the
> issue (http://patchwork.ozlabs.org/patch/94188/) about not populating FCoE related
> flags correctly on vlan devices. However, only NETIF_F_FCOE_CRC is part of the
> NETIF_F_ALL_TX_OFFLOADS right now, where weed NETIF_F_FCOE_MTU and NETIF_F_FSO
> as well.
>
> Therefore, add NETIF_F_ALL_FCOE to indicate feature flags used by FCoE TX offloads.
> These include NETIF_F_FCOE_CRC, NETIF_F_FCOE_MTU, and NETIF_F_FSO and add them to
> be part of NETIF_F_ALL_TX_OFFLOADS. This would eventually make sure all FCoE needed
> flags are populated properly to vlan devices.
>
> Signed-off-by: Yi Zou <yi.zou@intel.com>
Applied.
^ permalink raw reply
* Re: [PATCH] net: Fix vlan_features propagation
From: David Miller @ 2011-05-12 21:55 UTC (permalink / raw)
To: mirq-linux; +Cc: netdev, kaber
In-Reply-To: <20110506175629.AF59713A6A@rere.qmqm.pl>
From: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Date: Fri, 6 May 2011 19:56:29 +0200 (CEST)
> Fix VLAN features propagation for devices which change vlan_features.
> For this to work, driver needs to make sure netdev_features_changed()
> gets called after the change (it is e.g. after ndo_set_features()).
>
> Side effect is that a user might request features that will never
> be enabled on a VLAN device.
>
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Applied.
^ permalink raw reply
* Re: [PATCH] net: af_packet: Don't initialize vnet_hdr
From: Joe Perches @ 2011-05-12 21:55 UTC (permalink / raw)
To: David Miller; +Cc: linux-kernel, netdev
In-Reply-To: <20110512.173608.1652572492952866283.davem@davemloft.net>
Save an initialization because when this structure
is used it's completely filled by memcpy_fromiovec.
Add a new variable used for the 0 sized allocation
when this structure is not used.
Signed-off-by: Joe Perches <joe@perches.com>
---
On Thu, 2011-05-12 at 17:36 -0400, David Miller wrote:
> I would rather see the code rearranged such that this sort of
> hackish scheme isn't necessary.
net/packet/af_packet.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 549527b..cc1e83d 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -1123,9 +1123,10 @@ static int packet_snd(struct socket *sock,
__be16 proto;
unsigned char *addr;
int ifindex, err, reserve = 0;
- struct virtio_net_hdr vnet_hdr = { 0 };
+ struct virtio_net_hdr vnet_hdr;
int offset = 0;
int vnet_hdr_len;
+ size_t alloc_vnet_hdr_len;
struct packet_sock *po = pkt_sk(sk);
unsigned short gso_type = 0;
@@ -1206,7 +1207,10 @@ static int packet_snd(struct socket *sock,
goto out_unlock;
}
- }
+ alloc_vnet_hdr_len = vnet_hdr.hdr_len;
+ } else
+ alloc_vnet_hdr_len = 0;
+
err = -EMSGSIZE;
if (!gso_type && (len > dev->mtu + reserve + VLAN_HLEN))
@@ -1214,7 +1218,7 @@ static int packet_snd(struct socket *sock,
err = -ENOBUFS;
skb = packet_alloc_skb(sk, LL_ALLOCATED_SPACE(dev),
- LL_RESERVED_SPACE(dev), len, vnet_hdr.hdr_len,
+ LL_RESERVED_SPACE(dev), len, alloc_vnet_hdr_len,
msg->msg_flags & MSG_DONTWAIT, &err);
if (skb == NULL)
goto out_unlock;
^ permalink raw reply related
* Re: [PATCH RESEND net-next] ethtool: bring back missing comma in netdev features strings
From: David Miller @ 2011-05-12 21:50 UTC (permalink / raw)
To: mirqus; +Cc: franco, netdev, maheshb
In-Reply-To: <BANLkTikW=vURi7sAQ9ZJdgy=JDv+JacTQQ@mail.gmail.com>
From: Michał Mirosław <mirqus@gmail.com>
Date: Thu, 12 May 2011 18:45:12 +0200
> 2011/5/12 <franco@lastsummer.de>:
>> The issue was introduced in commit eed2a12f1ed9aabf.
>>
>> Signed-off-by: Franco Fichtner <franco@lastsummer.de>
>> ---
>> net/core/ethtool.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/net/core/ethtool.c b/net/core/ethtool.c
>> index b6f4058..b8c2b10 100644
>> --- a/net/core/ethtool.c
>> +++ b/net/core/ethtool.c
>> @@ -361,7 +361,7 @@ static const char
>> netdev_features_strings[ETHTOOL_DEV_FEATURE_WORDS * 32][ETH_GS
>> /* NETIF_F_NTUPLE */ "rx-ntuple-filter",
>> /* NETIF_F_RXHASH */ "rx-hashing",
>> /* NETIF_F_RXCSUM */ "rx-checksum",
>> - /* NETIF_F_NOCACHE_COPY */ "tx-nocache-copy"
>> + /* NETIF_F_NOCACHE_COPY */ "tx-nocache-copy",
>> /* NETIF_F_LOOPBACK */ "loopback",
>> };
>
> Acked-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Applied, but this patch was significantly mangled by your email
client. Please correct this problem before submitting future
patches, as I will just push them back to you if this happens
again.
Thanks.
^ permalink raw reply
* Re: [PATCH net-next-2.6] garp: remove last synchronize_rcu() call
From: David Miller @ 2011-05-12 21:47 UTC (permalink / raw)
To: eric.dumazet; +Cc: kaber, greearb, netdev, paulmck
In-Reply-To: <1305206957.3795.21.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 12 May 2011 15:29:17 +0200
> [PATCH net-next-2.6] garp: remove last synchronize_rcu() call
>
> When removing last vlan from a device, garp_uninit_applicant() calls
> synchronize_rcu() to make sure no user can still manipulate struct
> garp_applicant before we free it.
>
> Use call_rcu() instead, as a step to further net_device dismantle
> optimizations.
>
> Add the temporary garp_cleanup_module() function to make sure no pending
> call_rcu() are left at module unload time [ this will be removed when
> kfree_rcu() is available ]
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Looks good, applied, thanks Eric.
^ permalink raw reply
* Re: [PATCHv1] e1000e: Allow ethtool to enable/disable loopback.
From: Mahesh Bandewar @ 2011-05-12 21:41 UTC (permalink / raw)
To: Michał Mirosław; +Cc: e1000-devel, netdev, Tom Herbert, David Miller
In-Reply-To: <BANLkTi=YbTgy0cNJRvcg1QkWCv9sNKkvUQ@mail.gmail.com>
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:
>>> 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.
>
This is more of an API shortcoming. Callback will have to revert
changes made (rollback) before returning non-zero value to keep it
consistent.
Thanks,
--mahesh..
> Best Regards,
> Michał Mirosław
>
------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply
* Re: [PATCH net-next] vmxnet3: Use single tx queue when CONFIG_PCI_MSI not defined
From: David Miller @ 2011-05-12 21:37 UTC (permalink / raw)
To: sbhatewara; +Cc: netdev, linux-kernel, pv-drivers
In-Reply-To: <alpine.LRH.2.00.1105100903110.1095@sbhatewara-dev1.eng.vmware.com>
From: Shreyas Bhatewara <sbhatewara@vmware.com>
Date: Tue, 10 May 2011 09:13:56 -0700 (PDT)
>
> Resending this patch with few changes.
>
>
> Avoid multiple queues when MSI or MSI-X not available
>
> Limit number of Tx queues to 1 if MSI/MSI-X support is not configured in
> the kernel. This will make number of tx and rx queues equal when MSI/X
> is not configured thus providing better performance.
>
> Signed-off-by: Bhavesh Davda <bhavesh@vmware.com>
> Signed-off-by: Shreyas N Bhatewara <sbhatewara@vmware.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH net-next] net:set valid name before calling ndo_init()
From: David Miller @ 2011-05-12 21:37 UTC (permalink / raw)
To: eric.dumazet
Cc: panweiping3, therbert, mirq-linux, bhutchings, netdev,
linux-kernel
In-Reply-To: <1305214382.3795.28.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 12 May 2011 17:33:02 +0200
> Le jeudi 12 mai 2011 à 21:39 +0800, Weiping Pan(潘卫平) a écrit :
>> From: Pan Weiping <panweiping3@gmail.com>
>>
>> A bug of bonding was invloved by e815d19ffe02bdfda1260949ef2b1806171,
>> see example 1 and 2.
>>
>
> I cant find e815d19ffe02bdfda1260949ef2b1806171 in net-next-2.6
>
> but I do find 1c5cae815d19ffe02bdfda1260949ef2b1806171
>
> Please always use following when referring to a commit :
>
> ... in commit 1c5cae815d19 (net: call dev_alloc_name from
> register_netdevice) ...
>
> - just limit to _first_ 12 chars, no need to have full length
> - give the commit title
Pan, please fix this commit reference up and resubmit your patch.
^ permalink raw reply
* Re: [PATCH] net: af_packet: Don't initialize vnet_hdr
From: David Miller @ 2011-05-12 21:36 UTC (permalink / raw)
To: joe; +Cc: linux-kernel, netdev
In-Reply-To: <1305236000.6124.67.camel@Joe-Laptop>
From: Joe Perches <joe@perches.com>
Date: Thu, 12 May 2011 14:33:20 -0700
> On Thu, 2011-05-12 at 17:26 -0400, David Miller wrote:
>> From: Joe Perches <joe@perches.com>
>> Date: Thu, 12 May 2011 13:36:10 -0700
>>
>> > Save a memset, initialize only the portion necessary.
>> >
>> > packet_snd either gets this structure completely from
>> > memcpy_fromiovec or uses only the hdr_len set to 0,
>> > so don't always initialize the structure to 0.
>> >
>> > Signed-off-by: Joe Perches <joe@perches.com>
>>
>> On ARM this won't be tightly packed, therefore you'll leave
>> uninitialized pieces of padding in this structure and this
>> thing is an "on-the-wire" network header.
>>
>> I'm not applying this.
>
> I believe that it's only sent when po->has_vnet_hdr
> is set. In that case, it's completely filled from
> memcpy_fromiovec. In the not set po->has_vnet_hdr case,
> only vnet_hdr.hdr_len is accessed by packet_alloc_skb.
I think with the way this code is protecting accesses to vnet_hdr,
it's going to start warning that some parts "may" be use
uninitialized.
It's also slightly ugly to partially initialize these on-stack things.
I would rather see the code rearranged such that this sort of
hackish scheme isn't necessary.
Again, I'm not applying this.
^ permalink raw reply
* Re: [PATCH] net: af_packet: Don't initialize vnet_hdr
From: Joe Perches @ 2011-05-12 21:33 UTC (permalink / raw)
To: David Miller; +Cc: linux-kernel, netdev
In-Reply-To: <20110512.172623.220889608152651989.davem@davemloft.net>
On Thu, 2011-05-12 at 17:26 -0400, David Miller wrote:
> From: Joe Perches <joe@perches.com>
> Date: Thu, 12 May 2011 13:36:10 -0700
>
> > Save a memset, initialize only the portion necessary.
> >
> > packet_snd either gets this structure completely from
> > memcpy_fromiovec or uses only the hdr_len set to 0,
> > so don't always initialize the structure to 0.
> >
> > Signed-off-by: Joe Perches <joe@perches.com>
>
> On ARM this won't be tightly packed, therefore you'll leave
> uninitialized pieces of padding in this structure and this
> thing is an "on-the-wire" network header.
>
> I'm not applying this.
I believe that it's only sent when po->has_vnet_hdr
is set. In that case, it's completely filled from
memcpy_fromiovec. In the not set po->has_vnet_hdr case,
only vnet_hdr.hdr_len is accessed by packet_alloc_skb.
cheers, Joe
^ permalink raw reply
* Re: [PATCH 2/2] sctp: sctp_sendmsg: Don't test known non-null sinfo
From: David Miller @ 2011-05-12 21:31 UTC (permalink / raw)
To: joe; +Cc: vladislav.yasevich, sri, linux-sctp, netdev, linux-kernel
In-Reply-To: <b6372a0ac574e3fd110de57eb3e41d97c73d5423.1305227621.git.joe@perches.com>
From: Joe Perches <joe@perches.com>
Date: Thu, 12 May 2011 12:19:10 -0700
> It's already known non-null above.
>
> Signed-off-by: Joe Perches <joe@perches.com>
Applied.
^ permalink raw reply
* Re: [PATCH 1/2 v2] sctp: sctp_sendmsg: Don't initialize default_sinfo
From: David Miller @ 2011-05-12 21:31 UTC (permalink / raw)
To: joe; +Cc: vladislav.yasevich, sri, linux-sctp, netdev, linux-kernel
In-Reply-To: <1305235641.6124.64.camel@Joe-Laptop>
From: Joe Perches <joe@perches.com>
Date: Thu, 12 May 2011 14:27:20 -0700
> This variable only needs initialization when cmsgs.info
> is NULL.
>
> Use memset to ensure padding is also zeroed so
> kernel doesn't leak any data.
>
> Signed-off-by: Joe Perches <joe@perches.com>
This looks a lot better, applied.
^ permalink raw reply
* Re: [PATCH net-next-2.6 2/2] be2net: fix mbox polling for signal reception
From: David Miller @ 2011-05-12 21:29 UTC (permalink / raw)
To: bhutchings; +Cc: sathya.perla, netdev
In-Reply-To: <1305204546.4065.395.camel@localhost>
From: Ben Hutchings <bhutchings@solarflare.com>
Date: Thu, 12 May 2011 13:49:06 +0100
> On Thu, 2011-05-12 at 11:41 +0530, Sathya Perla wrote:
>> 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));
>
> msleep(1) is a lot more readable.
Agreed.
Sathya, please make this change and resubmit this patch series.
Thanks.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox