* RE: [PATCH NEXT 1/2] net: add external loopback test in ethtool self test
From: Amit Salecha @ 2011-06-30 5:26 UTC (permalink / raw)
To: Ben Hutchings; +Cc: David Miller, netdev, Ameen Rahman, Sucheta Chakraborty
In-Reply-To: <1309372139.2714.6.camel@bwh-desktop>
> From: Ben Hutchings [mailto:bhutchings@solarflare.com]
>
> Subject: Re: [PATCH NEXT 1/2] net: add external loopback test in
> ethtool self test
>
> >
> > So adding explicit flag in ethtool self test, which will specify
> interface
> > to perform external loopback test.
>
> The trouble with adding flags to enum ethtool_test_flags is that there
> is really no general way to tell whether the driver understood the
> flag.
>
> I think you need to add a second flag which the driver sets to confirm
> that it *did* use external loopback.
>
If I understood correctly:
You are concern about drives which doesn't support external loopback test.
In this case application doesn't have no general way to know, whether driver has
performed external loopback test.
Though the test case will be mention in test set. (return by .get_strings)
I will add it and send revised patch.
> > +/*
> > + * Flags definition of ethtool_test
> > + *
> > + * ETH_TEST_FL_OFFLINE: online / offline
> > + * ETH_TEST_FL_FAILED: test passed / failed
> > + * ETH_TEST_FL_EXTERNAL_LB: perform external loopback test
> > + */
> > +
>
> Replacing the inline comments with a block comment is fine, but please
> use kernel-doc format.
>
I will fix it.
-Amit
^ permalink raw reply
* [PATCHv2 NEXT 1/2] net: add external loopback test in ethtool self test
From: amit.salecha @ 2011-06-30 6:00 UTC (permalink / raw)
To: davem, bhutchings
Cc: netdev, ameen.rahman, sucheta.chakraborty, Amit Kumar Salecha
In-Reply-To: <1309413650-15952-1-git-send-email-amit.salecha@qlogic.com>
From: Amit Kumar Salecha <amit.salecha@qlogic.com>
External loopback test can be performed by application without any driver
support on normal Ethernet cards.
But on CNA devices, where multiple functions share same physical port.
Here internal loopback test and external loopback test can be initiated by
multiple functions at same time. To co exist all functions, firmware need
to regulate what test can be run by which function. So before performing external
loopback test, command need to send to firmware, which will quiescent other functions.
User may not want to run external loopback test always. As special cable need to be
connected for this test.
So adding explicit flag in ethtool self test, which will specify interface
to perform external loopback test.
ETH_TEST_FL_EXTERNAL_LB: Application set to request external loopback test
ETH_TEST_FL_EXTERNAL_LB_DONE: Driver ack if test performed
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
---
include/linux/ethtool.h | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 048d0fa..c6e427a 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -310,9 +310,21 @@ struct ethtool_sset_info {
__u32's, etc. */
};
+/**
+ * enum ethtool_test_flags - flags definition of ethtool_test
+ * @ETH_TEST_FL_OFFLINE: if set perform online and offline tests, otherwise
+ * only online tests.
+ * @ETH_TEST_FL_FAILED: Driver set this flag if test fails.
+ * @ETH_TEST_FL_EXTERNAL_LB: Application request to perform external loopback
+ * test.
+ * @ETH_TEST_FL_EXTERNAL_LB_DONE: Driver performed the external loopback test
+ */
+
enum ethtool_test_flags {
- ETH_TEST_FL_OFFLINE = (1 << 0), /* online / offline */
- ETH_TEST_FL_FAILED = (1 << 1), /* test passed / failed */
+ ETH_TEST_FL_OFFLINE = (1 << 0),
+ ETH_TEST_FL_FAILED = (1 << 1),
+ ETH_TEST_FL_EXTERNAL_LB = (1 << 2),
+ ETH_TEST_FL_EXTERNAL_LB_DONE = (1 << 3),
};
/* for requesting NIC test and getting results*/
--
1.7.3.3
^ permalink raw reply related
* [PATCHv2 NEXT 0/2]net: external loopback suport in ethtool
From: amit.salecha @ 2011-06-30 6:00 UTC (permalink / raw)
To: davem, bhutchings; +Cc: netdev, ameen.rahman, sucheta.chakraborty
Hi,
Sending revised patch incorporating Ben Hutchings comment.
Comment in kernel-doc format and adding one more flag to convey
that driver performed the external loopback test.
-Amit
^ permalink raw reply
* [PATCHv2 NEXT 2/2] qlcnic: add external loopback support
From: amit.salecha @ 2011-06-30 6:00 UTC (permalink / raw)
To: davem, bhutchings
Cc: netdev, ameen.rahman, sucheta.chakraborty, Amit Kumar Salecha
In-Reply-To: <1309413650-15952-1-git-send-email-amit.salecha@qlogic.com>
From: Amit Kumar Salecha <amit.salecha@qlogic.com>
o Add external loopback test in self test:
- Send set external loopback mode request to fw.
To quiscent other storage functions.
- Perform test
- Send unset loopback mode request to fw.
o Rename ilb to lb.
o Update driver version 5.0.20.
Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
---
drivers/net/qlcnic/qlcnic.h | 5 +++--
drivers/net/qlcnic/qlcnic_ethtool.c | 26 +++++++++++++++++---------
drivers/net/qlcnic/qlcnic_init.c | 3 ++-
3 files changed, 22 insertions(+), 12 deletions(-)
diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h
index e545450..9899a79 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 19
-#define QLCNIC_LINUX_VERSIONID "5.0.19"
+#define _QLCNIC_LINUX_SUBVERSION 20
+#define QLCNIC_LINUX_VERSIONID "5.0.20"
#define QLCNIC_DRV_IDC_VER 0x01
#define QLCNIC_DRIVER_VERSION ((_QLCNIC_LINUX_MAJOR << 16) |\
(_QLCNIC_LINUX_MINOR << 8) | (_QLCNIC_LINUX_SUBVERSION))
@@ -782,6 +782,7 @@ struct qlcnic_mac_list_s {
#define QLCNIC_IP_DOWN 3
#define QLCNIC_ILB_MODE 0x1
+#define QLCNIC_ELB_MODE 0x2
#define QLCNIC_LINKEVENT 0x1
#define QLCNIC_LB_RESPONSE 0x2
diff --git a/drivers/net/qlcnic/qlcnic_ethtool.c b/drivers/net/qlcnic/qlcnic_ethtool.c
index 743035e..3ea04e7 100644
--- a/drivers/net/qlcnic/qlcnic_ethtool.c
+++ b/drivers/net/qlcnic/qlcnic_ethtool.c
@@ -85,7 +85,8 @@ static const char qlcnic_gstrings_test[][ETH_GSTRING_LEN] = {
"Register_Test_on_offline",
"Link_Test_on_offline",
"Interrupt_Test_offline",
- "Loopback_Test_offline"
+ "Internal_Loopback_offline",
+ "External_Loopback_offline"
};
#define QLCNIC_TEST_LEN ARRAY_SIZE(qlcnic_gstrings_test)
@@ -709,7 +710,7 @@ int qlcnic_check_loopback_buff(unsigned char *data, u8 mac[])
return memcmp(data, buff, QLCNIC_ILB_PKT_SIZE);
}
-static int qlcnic_do_ilb_test(struct qlcnic_adapter *adapter)
+static int qlcnic_do_lb_test(struct qlcnic_adapter *adapter)
{
struct qlcnic_recv_context *recv_ctx = adapter->recv_ctx;
struct qlcnic_host_sds_ring *sds_ring = &recv_ctx->sds_rings[0];
@@ -735,19 +736,19 @@ static int qlcnic_do_ilb_test(struct qlcnic_adapter *adapter)
dev_kfree_skb_any(skb);
if (!adapter->diag_cnt)
- dev_warn(&adapter->pdev->dev, "ILB Test: %dth packet"
+ dev_warn(&adapter->pdev->dev, "LB Test: %dth packet"
" not recevied\n", i + 1);
else
cnt++;
}
if (cnt != i) {
- dev_warn(&adapter->pdev->dev, "ILB Test failed\n");
+ dev_warn(&adapter->pdev->dev, "LB Test failed\n");
return -1;
}
return 0;
}
-static int qlcnic_iloopback_test(struct net_device *netdev)
+static int qlcnic_loopback_test(struct net_device *netdev, u8 mode)
{
struct qlcnic_adapter *adapter = netdev_priv(netdev);
int max_sds_rings = adapter->max_sds_rings;
@@ -755,7 +756,8 @@ static int qlcnic_iloopback_test(struct net_device *netdev)
int loop = 0;
int ret;
- netdev_info(netdev, "%s: in progress\n", __func__);
+ netdev_info(netdev, "%s loopback test in progress\n",
+ mode == QLCNIC_ILB_MODE ? "internal" : "external");
if (adapter->op_mode == QLCNIC_NON_PRIV_FUNC) {
netdev_warn(netdev, "Loopback test not supported for non "
"privilege function\n");
@@ -772,7 +774,7 @@ static int qlcnic_iloopback_test(struct net_device *netdev)
sds_ring = &adapter->recv_ctx->sds_rings[0];
- ret = qlcnic_set_lb_mode(adapter, QLCNIC_ILB_MODE);
+ ret = qlcnic_set_lb_mode(adapter, mode);
if (ret)
goto free_res;
@@ -790,7 +792,7 @@ static int qlcnic_iloopback_test(struct net_device *netdev)
goto free_res;
}
- ret = qlcnic_do_ilb_test(adapter);
+ ret = qlcnic_do_lb_test(adapter);
qlcnic_clear_lb_mode(adapter);
@@ -822,10 +824,16 @@ qlcnic_diag_test(struct net_device *dev, struct ethtool_test *eth_test,
if (data[2])
eth_test->flags |= ETH_TEST_FL_FAILED;
- data[3] = qlcnic_iloopback_test(dev);
+ data[3] = qlcnic_loopback_test(dev, QLCNIC_ILB_MODE);
if (data[3])
eth_test->flags |= ETH_TEST_FL_FAILED;
+ if (eth_test->flags & ETH_TEST_FL_EXTERNAL_LB) {
+ data[4] = qlcnic_loopback_test(dev, QLCNIC_ELB_MODE);
+ if (data[4])
+ eth_test->flags |= ETH_TEST_FL_FAILED;
+ eth_test->flags |= ETH_TEST_FL_EXTERNAL_LB_DONE;
+ }
}
}
diff --git a/drivers/net/qlcnic/qlcnic_init.c b/drivers/net/qlcnic/qlcnic_init.c
index 9d5bee0..6ec1baa 100644
--- a/drivers/net/qlcnic/qlcnic_init.c
+++ b/drivers/net/qlcnic/qlcnic_init.c
@@ -1303,7 +1303,8 @@ qlcnic_handle_linkevent(struct qlcnic_adapter *adapter,
dev_info(&netdev->dev, "unsupported cable length %d\n",
cable_len);
- if (!link_status && (lb_status == 1))
+ if (!link_status && (lb_status == QLCNIC_ILB_MODE ||
+ lb_status == QLCNIC_ELB_MODE))
adapter->ahw->loopback_state |= QLCNIC_LINKEVENT;
qlcnic_advert_link_change(adapter, link_status);
--
1.7.3.3
^ permalink raw reply related
* [PATCH] bluetooth: Add bt_printk
From: Joe Perches @ 2011-06-30 7:19 UTC (permalink / raw)
To: Marcel Holtmann, Gustavo F. Padovan
Cc: David S. Miller, linux-bluetooth-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20110630033119.GA3438@joana>
Add a local logging function to emit bluetooth specific
messages. Using vsprintf extension %pV saves code/text
space.
Convert the current BT_INFO and BT_ERR macros to use bt_printk.
Remove __func__ from BT_ERR macro (and the uses).
Prefix "Bluetooth: " to BT_ERR
Remove __func__ from BT_DBG as function can be prefixed when
using dynamic_debug.
With allyesconfig:
text data bss dec hex filename
129956 8632 36096 174684 2aa5c drivers/bluetooth/built-in.o.new2
134402 8632 36064 179098 2bb9a drivers/bluetooth/built-in.o.old
14778 1012 3408 19198 4afe net/bluetooth/bnep/built-in.o.new2
15067 1012 3408 19487 4c1f net/bluetooth/bnep/built-in.o.old
346595 19163 86080 451838 6e4fe net/bluetooth/built-in.o.new2
353751 19163 86064 458978 700e2 net/bluetooth/built-in.o.old
18483 1172 4264 23919 5d6f net/bluetooth/cmtp/built-in.o.new2
18927 1172 4264 24363 5f2b net/bluetooth/cmtp/built-in.o.old
19237 1172 5152 25561 63d9 net/bluetooth/hidp/built-in.o.new2
19581 1172 5152 25905 6531 net/bluetooth/hidp/built-in.o.old
59461 3884 14464 77809 12ff1 net/bluetooth/rfcomm/built-in.o.new2
61206 3884 14464 79554 136c2 net/bluetooth/rfcomm/built-in.o.old
with x86 defconfig (and just bluetooth):
$ size net/bluetooth/built-in.o.defconfig.*
text data bss dec hex filename
66358 933 100 67391 1073f net/bluetooth/built-in.o.defconfig.new
66643 933 100 67676 1085c net/bluetooth/built-in.o.defconfig.old
Signed-off-by: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
---
include/net/bluetooth/bluetooth.h | 9 ++++++---
net/bluetooth/lib.c | 19 +++++++++++++++++++
2 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index 7bccaf9..042591c 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -76,9 +76,12 @@ struct bt_power {
#define BT_POWER_FORCE_ACTIVE_OFF 0
#define BT_POWER_FORCE_ACTIVE_ON 1
-#define BT_INFO(fmt, arg...) printk(KERN_INFO "Bluetooth: " fmt "\n" , ## arg)
-#define BT_ERR(fmt, arg...) printk(KERN_ERR "%s: " fmt "\n" , __func__ , ## arg)
-#define BT_DBG(fmt, arg...) pr_debug("%s: " fmt "\n" , __func__ , ## arg)
+__attribute__((format (printf, 2, 3)))
+int bt_printk(const char *level, const char *fmt, ...);
+
+#define BT_INFO(fmt, arg...) bt_printk(KERN_INFO, pr_fmt(fmt), ##arg)
+#define BT_ERR(fmt, arg...) bt_printk(KERN_ERR, pr_fmt(fmt), ##arg)
+#define BT_DBG(fmt, arg...) pr_debug(fmt "\n", ##arg)
/* Connection and socket states */
enum {
diff --git a/net/bluetooth/lib.c b/net/bluetooth/lib.c
index b826d1b..fdb3ec3 100644
--- a/net/bluetooth/lib.c
+++ b/net/bluetooth/lib.c
@@ -150,3 +150,22 @@ int bt_err(__u16 code)
}
}
EXPORT_SYMBOL(bt_err);
+
+int bt_printk(const char *level, const char *format, ...)
+{
+ struct va_format vaf;
+ va_list args;
+ int r;
+
+ va_start(args, format);
+
+ vaf.fmt = format;
+ vaf.va = &args;
+
+ r = printk("%sbluetooth: %pV\n", level, &vaf);
+
+ va_end(args);
+
+ return r;
+}
+EXPORT_SYMBOL(bt_printk);
--
1.7.6.rc1
^ permalink raw reply related
* possible bridge regression in "bridge: implement [add/del]_slave ops"?
From: Alexander Stein @ 2011-06-30 8:33 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: David S. Miller, bridge, netdev, linux-kernel
Hello,
I tried using the rstpd daemon from
http://git.kernel.org/?p=linux/kernel/git/shemminger/rstp.git;a=summary which
worked fine on my desktop.
I then tried doing the same on my embedded atom baord and failed.
It turned out the used kernel 2.6.38-gentoo-r6 had not the problem the kernel
v2.6.39 used on atomboard had. After trying a 2.6.39 based kernel on my
desktop the same problem occured.
After bisecting I ended up at commit
afc6151a78a43bdca5f64a8bd3e3c13837580c54
"bridge: implement [add/del]_slave ops"
My /sbin/bridge-stp is the one from commit
b27ab0efa4ecf7a839f750ec1e9b9092c577ebbb in the rstpd repository.
My steps to reproduce:
* start rstpd (I used rstpd -d -v2 from a different terminal to see the error
messages)
* echo $(pgrep rstpd) > /var/run/rstpd.pid
* brctl addbr br1
* echo 1 > /sys/class/net/br1/bridge/stp_state
* brctl addif br1 eth1
* brctl addif br1 eth2
* ifconfig br1 up 192.168.0.20
* ifconfig eth1 up
* ifconfig eth2 up
Then I get the following output from rstpd:
7: br1
2011-06-30 09:08:01 create_if: Add bridge br1
2011-06-30 09:08:01 CTL_enable_bridge_rstp: bridge 7, enable 1
3: eth1 master br1
2011-06-30 09:08:01 stp_enabled: STP on br1 state 2
2011-06-30 09:08:01 set_br_up: br1 was up stp was down
2011-06-30 09:08:01 set_br_up: Set bridge br1 up stp up
2011-06-30 09:08:01 create_if: Add iface eth1 to bridge br1
2: eth2 master br1
2011-06-30 09:08:01 create_if: Add iface eth2 to bridge br1
7: br1
2011-06-30 09:08:01 Error in bridge_bpdu_rcv at bridge_track.c:585 verifying
ifc->up.
2: eth2 master br1
2011-06-30 09:08:03 Error in bridge_bpdu_rcv at bridge_track.c:585 verifying
ifc->up.
2011-06-30 09:08:03 Error in bridge_bpdu_rcv at bridge_track.c:585 verifying
ifc->up.
2011-06-30 09:08:05 Error in bridge_bpdu_rcv at bridge_track.c:585 verifying
ifc->up.
2011-06-30 09:08:05 Error in bridge_bpdu_rcv at bridge_track.c:585 verifying
ifc->up.
The last error messages are printed for each BPDU received at the bridge.
Reverting the named commit on v2.6.39.2 restores the old behavior and I get a
working RSTP again.
BTW: I noticed that in 2.6.39.2 independently from this patch revert this
bridge didn't show up RUNNING ifconfg. Is this intended? Another bridge I
have, which doesn't use (R)STP, is shown as RUNNING like before.
Regards,
Alexander
^ permalink raw reply
* Re: Skipping past TCP lost packet in userspace
From: Josh Lehan @ 2011-06-30 8:38 UTC (permalink / raw)
To: janardhan.iyengar
Cc: Janardhan Iyengar, rick.jones2, Josh Lehan, Yuchung Cheng, netdev,
Bryan Ford
In-Reply-To: <4E04A609.7010206@fandm.edu>
On 06/24/2011 07:58 AM, Janardhan Iyengar wrote:
> Thanks for your note. I agree that it does seem like we're simply
> adding to the metaphorical pile. And my first knee-jerk response would
> be that there's not much else one can do in the modern IPv4 Internet :-)
Thanks, I also appreciate you reviving this thread. I was surprised at
the hostility here, towards an idea that we both think is necessary and
practical, given the realities of today's Internet.
TCP is at the middle of the hourglass, as you said. Even UDP isn't
universally allowed (it's not all that uncommon to see UDP blocked,
except for DNS packets to whitelisted DNS servers). At least one ISP,
"AT&T U-Verse", no longer allows the customer their choice of Internet
router, and the ISP's mandated router will filter all traffic in both
directions, so if the packet isn't recognized by its simple little
stateful firewall, into the bit bucket it goes. Have fun trying to pass
SCTP or DCCP through that!
> Changes to the API, which is what we're proposing, is not a modification
> to the transport layer protocol per se. In other words, we are changing
> the service that TCP offers to apps, and not the protocol.
Agreed, and the freedom of Linux to do this is what makes it great. API
compatibility with other OS's is not an issue, since as you said the app
can always fall back to classical TCP behavior, and since nothing on the
wire changes, it won't break the other OS on the other side of the wire.
> Note: I'm talking largely about the v4 Internet. The v6 Internet will
> hopefully have fewer devices that interpose on the transport layer, esp.
> NAPTs; however, I expect fully that firewalls and PEPs will still use
> transport layer information, requiring them to be able to
> read/understand transport header information.
Like IPv4, most (all?) IPv6 firewalls are stateful, so the firewall has
to be aware of the transport protocol in order to know which packets to
allow back through as replies. And, for servers behind the firewall,
the firewall must offer a way to punch a hole through it without opening
too wide of a hole, and keep state for incoming connections, so
transport protocol awareness is important there as well.
So, even though we're vastly outnumbered on this mailing list, I remain
interested in your "Minion" paper and its ideas for providing a richer
API to make TCP more versatile to suit a wide variety of needs.
Josh Lehan
^ permalink raw reply
* [PATCH] ethtool : NFC corrections again
From: Sebastian Pöhn @ 2011-06-30 8:41 UTC (permalink / raw)
To: Ben Hutchings, Linux Netdev; +Cc: Sebastian Pöhn
This patch:
# Adds an alias for ip4 called l4data pointing to spi (first 4 Layer 4
bytes)
# [TRIVIAL] Corrects the permutation of dst and src for ethernet
# Suggests to always set the ip_ver field of usr_ip to ETH_RX_NFC_IP4 at
least as long there is no opportunity to use others than IPv4 and there
is no frontend option to enter ip_ver.
Signed-off-by: Sebastian Poehn <sebastian.poehn@belden.com>
---
ethtool.8.in | 5 +++++
rxclass.c | 11 ++++++++---
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/ethtool.8.in b/ethtool.8.in
index 7b1cdf5..0a64d75 100644
--- a/ethtool.8.in
+++ b/ethtool.8.in
@@ -296,6 +296,7 @@ ethtool \- query or control network driver and
hardware settings
.BM src\-port
.BM dst\-port
.BM spi
+.BM l4data
.BM vlan\-etype
.BM vlan
.BM user\-def
@@ -718,6 +719,10 @@ Specify the value of the security parameter index
field (applicable to
AH/ESP packets)in the incoming packet to match along with an optional
mask. Valid for flow-types ip4, ah4, and esp4.
.TP
+.BI l4data \ N \\fR\ [\\fPm \ N \\fR]\\fP
+Specify the value of the first 4 Bytes of Layer 4 in the incoming
packet to
+match along with an optional mask. Valid for ip4 flow-type.
+.TP
.BI vlan\-etype \ N \\fR\ [\\fPm \ N \\fR]\\fP
Includes the VLAN tag Ethertype and an optional mask.
.TP
diff --git a/rxclass.c b/rxclass.c
index ee486f7..b227901 100644
--- a/rxclass.c
+++ b/rxclass.c
@@ -622,6 +622,9 @@ static struct rule_opts rule_nfc_usr_ip4[] = {
{ "l4proto", OPT_U8, NFC_FLAG_PROTO,
offsetof(struct ethtool_rx_flow_spec, h_u.usr_ip4_spec.proto),
offsetof(struct ethtool_rx_flow_spec, m_u.usr_ip4_spec.proto) },
+ { "l4data", OPT_BE32, NFC_FLAG_SPI,
+ offsetof(struct ethtool_rx_flow_spec, h_u.usr_ip4_spec.l4_4_bytes),
+ offsetof(struct ethtool_rx_flow_spec,
m_u.usr_ip4_spec.l4_4_bytes) },
{ "spi", OPT_BE32, NFC_FLAG_SPI,
offsetof(struct ethtool_rx_flow_spec, h_u.usr_ip4_spec.l4_4_bytes),
offsetof(struct ethtool_rx_flow_spec,
m_u.usr_ip4_spec.l4_4_bytes) },
@@ -648,11 +651,11 @@ static struct rule_opts rule_nfc_usr_ip4[] = {
static struct rule_opts rule_nfc_ether[] = {
{ "src", OPT_MAC, NFC_FLAG_SADDR,
- offsetof(struct ethtool_rx_flow_spec, h_u.ether_spec.h_dest),
- offsetof(struct ethtool_rx_flow_spec, m_u.ether_spec.h_dest) },
- { "dst", OPT_MAC, NFC_FLAG_DADDR,
offsetof(struct ethtool_rx_flow_spec, h_u.ether_spec.h_source),
offsetof(struct ethtool_rx_flow_spec, m_u.ether_spec.h_source) },
+ { "dst", OPT_MAC, NFC_FLAG_DADDR,
+ offsetof(struct ethtool_rx_flow_spec, h_u.ether_spec.h_dest),
+ offsetof(struct ethtool_rx_flow_spec, m_u.ether_spec.h_dest) },
{ "proto", OPT_BE16, NFC_FLAG_PROTO,
offsetof(struct ethtool_rx_flow_spec, h_u.ether_spec.h_proto),
offsetof(struct ethtool_rx_flow_spec, m_u.ether_spec.h_proto) },
@@ -1062,6 +1065,8 @@ int rxclass_parse_ruleopts(char **argp, int argc,
}
}
+ if (flow_type == IP_USER_FLOW)
+ fsp->h_u.usr_ip4_spec.ip_ver = ETH_RX_NFC_IP4;
if (flags & (NTUPLE_FLAG_VLAN | NTUPLE_FLAG_UDEF | NTUPLE_FLAG_VETH))
fsp->flow_type |= FLOW_EXT;
^ permalink raw reply related
* Re: [PATCH] sctp: Enforce maximum retransmissions during shutdown
From: Thomas Graf @ 2011-06-30 8:49 UTC (permalink / raw)
To: Vladislav Yasevich
Cc: netdev, davem, Wei Yongjun, Sridhar Samudrala, linux-sctp
In-Reply-To: <4E0B4F71.4020108@hp.com>
On Wed, Jun 29, 2011 at 12:14:41PM -0400, Vladislav Yasevich wrote:
> Right. The lack of ABORT from the receive of data is a bug. I was trying to point out
> that instead of modified the sender of data to send the ABORT, you modify the receiver
> to send the ABORT when it is being closed while having data queued.
Agreed. This makes a good procedure if there is data is on
sk_receive_queue and gets us in line with TCP although I don't see this
in the spec at all :-)
> But we don't even get to sending the SHUTDOWN, so from the wire protocol, we
> do not violated it. We have bad behavior in that when both sender and receiver
> are dead, the association is hung.
So how do we get out if ...
1) there is nothing queued on sk_receive_queue but the window still
remains 0 forver?
2) the receiver is an older Linux without the above fix or another stack
that does not ABORT?
I agree that using ABORT on the receiver is the ideal way whenver
possible but we still need to fix this if the receiver does not do so.
What sideeffects are you worried about resulting from my proposal?
^ permalink raw reply
* Re: [PATCH 2/3] ipv4: Fix packet size calculation for IPsec packets in __ip_append_data
From: Steffen Klassert @ 2011-06-30 9:06 UTC (permalink / raw)
To: David Miller; +Cc: eric.dumazet, herbert, netdev
In-Reply-To: <20110627.203938.1899202479649578621.davem@davemloft.net>
On Mon, Jun 27, 2011 at 08:39:38PM -0700, David Miller wrote:
> From: Steffen Klassert <steffen.klassert@secunet.com>
> Date: Wed, 22 Jun 2011 13:02:19 +0200
>
> > While reading through the code of __ip_append_data() I noticed that we
> > might use ip_ufo_append_data() for packets that will be IPsec transformed
> > later, is this ok? I don't know how ufo handling works, but I would guess
> > that it expects an udp header and not an IPsec header as the packets
> > transport header.
>
> Indeed, it could be a real problem.
Ok, so I'll send a patch to fix it up.
>
> > The IPsec mtu is 1438 here, so the first packet is too big.
> > xfrm4_tunnel_check_size() notices this and sends a ICMP_FRAG_NEEDED
> > packet that announces a mtu of 1438 to the original sender of the ping
> > packet. Unfortunately the sender is a local address, it's the IPsec
> > tunnel entry point. So we update the mtu for this connection to 1438.
> > Now, with the next packet xfrm_bundle_ok() notices that the path mtu has
> > changed, so it subtracts the IPsec overhead from the mtu a second time
> > and we end up with a mtu of 1374. This game goes until we reach a minimal
> > mtu of 494.
> >
> > Unfortunately I don't know how to fix this. Any ideas?
>
> If the generic PMTU handling in net/ipv4/route.c is adjusting the MTU
> for the IPSEC path's route, that would be the problem.
>
Yes, this is exactly what happens. We use icmp_send() to notify about
message size errors even for locally generated packets, this leads to
an incorrect pmtu update. Changing this to use ip_local_error() if we
have socket context fixes the problem. I'll send a patch for this too.
^ permalink raw reply
* [PATCH 1/3] xfrm: Remove family arg from xfrm_bundle_ok
From: Steffen Klassert @ 2011-06-30 9:18 UTC (permalink / raw)
To: David Miller; +Cc: Herbert Xu, netdev
The family arg is not used any more, so remove it.
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
net/xfrm/xfrm_policy.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 9bec2e8..5ce74a3 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -50,7 +50,7 @@ static struct xfrm_policy_afinfo *xfrm_policy_get_afinfo(unsigned short family);
static void xfrm_policy_put_afinfo(struct xfrm_policy_afinfo *afinfo);
static void xfrm_init_pmtu(struct dst_entry *dst);
static int stale_bundle(struct dst_entry *dst);
-static int xfrm_bundle_ok(struct xfrm_dst *xdst, int family);
+static int xfrm_bundle_ok(struct xfrm_dst *xdst);
static struct xfrm_policy *__xfrm_policy_unlink(struct xfrm_policy *pol,
@@ -2241,7 +2241,7 @@ static struct dst_entry *xfrm_dst_check(struct dst_entry *dst, u32 cookie)
static int stale_bundle(struct dst_entry *dst)
{
- return !xfrm_bundle_ok((struct xfrm_dst *)dst, AF_UNSPEC);
+ return !xfrm_bundle_ok((struct xfrm_dst *)dst);
}
void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev)
@@ -2313,7 +2313,7 @@ static void xfrm_init_pmtu(struct dst_entry *dst)
* still valid.
*/
-static int xfrm_bundle_ok(struct xfrm_dst *first, int family)
+static int xfrm_bundle_ok(struct xfrm_dst *first)
{
struct dst_entry *dst = &first->u.dst;
struct xfrm_dst *last;
--
1.7.0.4
^ permalink raw reply related
* [PATCH 2/3] ipv4: Don't use ufo handling on later transformed packets
From: Steffen Klassert @ 2011-06-30 9:19 UTC (permalink / raw)
To: David Miller; +Cc: Herbert Xu, netdev
In-Reply-To: <20110630091820.GB13201@secunet.com>
We might call ip_ufo_append_data() for packets that will be IPsec
transformed later. This function should be used just for real
udp packets. So we check for rt->dst.header_len which is only
nonzero on IPsec handling and call ip_ufo_append_data() just
if rt->dst.header_len is zero.
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
net/ipv4/ip_output.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 4a7e16b..84f26e8 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -828,7 +828,7 @@ static int __ip_append_data(struct sock *sk,
cork->length += length;
if (((length > mtu) || (skb && skb_is_gso(skb))) &&
(sk->sk_protocol == IPPROTO_UDP) &&
- (rt->dst.dev->features & NETIF_F_UFO)) {
+ (rt->dst.dev->features & NETIF_F_UFO) && !rt->dst.header_len) {
err = ip_ufo_append_data(sk, queue, getfrag, from, length,
hh_len, fragheaderlen, transhdrlen,
mtu, flags);
--
1.7.0.4
^ permalink raw reply related
* [PATCH 3/3] xfrm4: Don't call icmp_send on local error
From: Steffen Klassert @ 2011-06-30 9:20 UTC (permalink / raw)
To: David Miller; +Cc: Herbert Xu, netdev
In-Reply-To: <20110630091820.GB13201@secunet.com>
Calling icmp_send() on a local message size error leads to
an incorrect update of the path mtu. So use ip_local_error()
instead to notify the socket about the error.
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
net/ipv4/xfrm4_output.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/net/ipv4/xfrm4_output.c b/net/ipv4/xfrm4_output.c
index 2d51840..327a617 100644
--- a/net/ipv4/xfrm4_output.c
+++ b/net/ipv4/xfrm4_output.c
@@ -32,7 +32,12 @@ static int xfrm4_tunnel_check_size(struct sk_buff *skb)
dst = skb_dst(skb);
mtu = dst_mtu(dst);
if (skb->len > mtu) {
- icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, htonl(mtu));
+ if (skb->sk)
+ ip_local_error(skb->sk, EMSGSIZE, ip_hdr(skb)->daddr,
+ inet_sk(skb->sk)->inet_dport, mtu);
+ else
+ icmp_send(skb, ICMP_DEST_UNREACH,
+ ICMP_FRAG_NEEDED, htonl(mtu));
ret = -EMSGSIZE;
}
out:
--
1.7.0.4
^ permalink raw reply related
* Re: [PATCH net-next] net: am79c961a: Omit check for multicast bit in netdev_for_each_mc_addr
From: Russell King - ARM Linux @ 2011-06-30 9:23 UTC (permalink / raw)
To: Tobias Klauser; +Cc: David S. Miller, netdev, linux-arm-kernel
In-Reply-To: <1309349686-1506-1-git-send-email-tklauser@distanz.ch>
On Wed, Jun 29, 2011 at 02:14:46PM +0200, Tobias Klauser wrote:
> There is no need to check for the address being a multicast address in
> the netdev_for_each_mc_addr loop, so remove it.
>
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Thanks.
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
> ---
> drivers/net/arm/am79c961a.c | 14 ++++++--------
> 1 files changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/arm/am79c961a.c b/drivers/net/arm/am79c961a.c
> index 7b3e23f..52fe21e 100644
> --- a/drivers/net/arm/am79c961a.c
> +++ b/drivers/net/arm/am79c961a.c
> @@ -199,17 +199,15 @@ am79c961_ramtest(struct net_device *dev, unsigned int val)
>
> static void am79c961_mc_hash(char *addr, u16 *hash)
> {
> - if (addr[0] & 0x01) {
> - int idx, bit;
> - u32 crc;
> + int idx, bit;
> + u32 crc;
>
> - crc = ether_crc_le(ETH_ALEN, addr);
> + crc = ether_crc_le(ETH_ALEN, addr);
>
> - idx = crc >> 30;
> - bit = (crc >> 26) & 15;
> + idx = crc >> 30;
> + bit = (crc >> 26) & 15;
>
> - hash[idx] |= 1 << bit;
> - }
> + hash[idx] |= 1 << bit;
> }
>
> static unsigned int am79c961_get_rx_mode(struct net_device *dev, u16 *hash)
> --
> 1.7.5.4
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* [PATCH net-next-2.6 0/3] be2net fixes
From: Sathya Perla @ 2011-06-30 9:31 UTC (permalink / raw)
To: netdev
Pls apply.
Sathya Perla (3):
be2net: fix certain cmd failure logging
be2net: create/destroy rx-queues on interface open/close
be2net: clear intr bit in be_probe()
drivers/net/benet/be_cmds.c | 74 +++++++++++++++++++++++------
drivers/net/benet/be_cmds.h | 19 +++----
drivers/net/benet/be_main.c | 111 ++++++++++++++++++++++++++++--------------
3 files changed, 141 insertions(+), 63 deletions(-)
--
1.7.4
^ permalink raw reply
* [PATCH net-next-2.6 1/3] be2net: fix certain cmd failure logging
From: Sathya Perla @ 2011-06-30 9:32 UTC (permalink / raw)
To: netdev
Some (older)versions of cards/fw may not recognize certain cmds and
return illegal/unsupported errors. As long as the driver can handle
this gracefully there is no need to log an error msg.
Also finetuned 2 existing error log messages.
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
---
drivers/net/benet/be_cmds.c | 24 +++++++++++++++++-------
drivers/net/benet/be_cmds.h | 17 ++++++-----------
2 files changed, 23 insertions(+), 18 deletions(-)
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c
index 30719f5..7e7ea51 100644
--- a/drivers/net/benet/be_cmds.c
+++ b/drivers/net/benet/be_cmds.c
@@ -106,14 +106,24 @@ static int be_mcc_compl_process(struct be_adapter *adapter,
netdev_stats_update(adapter);
adapter->stats_cmd_sent = false;
}
- } else if ((compl_status != MCC_STATUS_NOT_SUPPORTED) &&
- (compl->tag0 != OPCODE_COMMON_NTWK_MAC_QUERY)) {
- extd_status = (compl->status >> CQE_STATUS_EXTD_SHIFT) &
- CQE_STATUS_EXTD_MASK;
- dev_warn(&adapter->pdev->dev,
- "Error in cmd completion - opcode %d, compl %d, extd %d\n",
- compl->tag0, compl_status, extd_status);
+ } else {
+ if (compl_status == MCC_STATUS_NOT_SUPPORTED ||
+ compl_status == MCC_STATUS_ILLEGAL_REQUEST)
+ goto done;
+
+ if (compl_status == MCC_STATUS_UNAUTHORIZED_REQUEST) {
+ dev_warn(&adapter->pdev->dev, "This domain(VM) is not "
+ "permitted to execute this cmd (opcode %d)\n",
+ compl->tag0);
+ } else {
+ extd_status = (compl->status >> CQE_STATUS_EXTD_SHIFT) &
+ CQE_STATUS_EXTD_MASK;
+ dev_err(&adapter->pdev->dev, "Cmd (opcode %d) failed:"
+ "status %d, extd-status %d\n",
+ compl->tag0, compl_status, extd_status);
+ }
}
+done:
return compl_status;
}
diff --git a/drivers/net/benet/be_cmds.h b/drivers/net/benet/be_cmds.h
index d08289e..f0d7457 100644
--- a/drivers/net/benet/be_cmds.h
+++ b/drivers/net/benet/be_cmds.h
@@ -51,17 +51,12 @@ struct be_mcc_wrb {
/* Completion Status */
enum {
- MCC_STATUS_SUCCESS = 0x0,
-/* The client does not have sufficient privileges to execute the command */
- MCC_STATUS_INSUFFICIENT_PRIVILEGES = 0x1,
-/* A parameter in the command was invalid. */
- MCC_STATUS_INVALID_PARAMETER = 0x2,
-/* There are insufficient chip resources to execute the command */
- MCC_STATUS_INSUFFICIENT_RESOURCES = 0x3,
-/* The command is completing because the queue was getting flushed */
- MCC_STATUS_QUEUE_FLUSHING = 0x4,
-/* The command is completing with a DMA error */
- MCC_STATUS_DMA_FAILED = 0x5,
+ MCC_STATUS_SUCCESS = 0,
+ MCC_STATUS_FAILED = 1,
+ MCC_STATUS_ILLEGAL_REQUEST = 2,
+ MCC_STATUS_ILLEGAL_FIELD = 3,
+ MCC_STATUS_INSUFFICIENT_BUFFER = 4,
+ MCC_STATUS_UNAUTHORIZED_REQUEST = 5,
MCC_STATUS_NOT_SUPPORTED = 66
};
--
1.7.4
^ permalink raw reply related
* [PATCH net-next-2.6 2/3] be2net: create/destroy rx-queues on interface open/close
From: Sathya Perla @ 2011-06-30 9:33 UTC (permalink / raw)
To: netdev
On some skews, the BE card sends pause frames (and not drop pkts) if there are
no more posted buffers available for packet reception. This behaviour has a
side effect: When an interface is disabled, buffers are no longer posted on the
corresponding RX rings. All broadcast and multicast traffic being received on
the port will quickly fill up the PMEM and cause pause push back. As the PMEM
is shared by both the ports, all traffic being received on the other (enabled)
port also gets stalled.
The fix is to destroy RX rings when the interface is disabled. If there is no
RX ring match in the RXF lookup, the packets are discarded and so don't hog the
PMEM.
The RXQ creation cmd must now use MCC instead of MBOX as they are are called
post MCC queue creation.
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
---
drivers/net/benet/be_cmds.c | 50 +++++++++++++++++---
drivers/net/benet/be_cmds.h | 2 +
drivers/net/benet/be_main.c | 105 ++++++++++++++++++++++++++++---------------
3 files changed, 112 insertions(+), 45 deletions(-)
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c
index 7e7ea51..0d9bd5b 100644
--- a/drivers/net/benet/be_cmds.c
+++ b/drivers/net/benet/be_cmds.c
@@ -984,7 +984,7 @@ int be_cmd_txq_create(struct be_adapter *adapter,
return status;
}
-/* Uses mbox */
+/* Uses MCC */
int be_cmd_rxq_create(struct be_adapter *adapter,
struct be_queue_info *rxq, u16 cq_id, u16 frag_size,
u16 max_frame_size, u32 if_id, u32 rss, u8 *rss_id)
@@ -994,10 +994,13 @@ int be_cmd_rxq_create(struct be_adapter *adapter,
struct be_dma_mem *q_mem = &rxq->dma_mem;
int status;
- if (mutex_lock_interruptible(&adapter->mbox_lock))
- return -1;
+ spin_lock_bh(&adapter->mcc_lock);
- wrb = wrb_from_mbox(adapter);
+ wrb = wrb_from_mccq(adapter);
+ if (!wrb) {
+ status = -EBUSY;
+ goto err;
+ }
req = embedded_payload(wrb);
be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0,
@@ -1014,7 +1017,7 @@ int be_cmd_rxq_create(struct be_adapter *adapter,
req->max_frame_size = cpu_to_le16(max_frame_size);
req->rss_queue = cpu_to_le32(rss);
- status = be_mbox_notify_wait(adapter);
+ status = be_mcc_notify_wait(adapter);
if (!status) {
struct be_cmd_resp_eth_rx_create *resp = embedded_payload(wrb);
rxq->id = le16_to_cpu(resp->id);
@@ -1022,8 +1025,8 @@ int be_cmd_rxq_create(struct be_adapter *adapter,
*rss_id = resp->rss_id;
}
- mutex_unlock(&adapter->mbox_lock);
-
+err:
+ spin_unlock_bh(&adapter->mcc_lock);
return status;
}
@@ -1078,9 +1081,40 @@ int be_cmd_q_destroy(struct be_adapter *adapter, struct be_queue_info *q,
req->id = cpu_to_le16(q->id);
status = be_mbox_notify_wait(adapter);
-
+ if (!status)
+ q->created = false;
+
mutex_unlock(&adapter->mbox_lock);
+ return status;
+}
+
+/* Uses MCC */
+int be_cmd_rxq_destroy(struct be_adapter *adapter, struct be_queue_info *q)
+{
+ struct be_mcc_wrb *wrb;
+ struct be_cmd_req_q_destroy *req;
+ int status;
+
+ spin_lock_bh(&adapter->mcc_lock);
+ wrb = wrb_from_mccq(adapter);
+ if (!wrb) {
+ status = -EBUSY;
+ goto err;
+ }
+ req = embedded_payload(wrb);
+
+ be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0, OPCODE_ETH_RX_DESTROY);
+ be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ETH, OPCODE_ETH_RX_DESTROY,
+ sizeof(*req));
+ req->id = cpu_to_le16(q->id);
+
+ status = be_mcc_notify_wait(adapter);
+ if (!status)
+ q->created = false;
+
+err:
+ spin_unlock_bh(&adapter->mcc_lock);
return status;
}
diff --git a/drivers/net/benet/be_cmds.h b/drivers/net/benet/be_cmds.h
index f0d7457..1151df6 100644
--- a/drivers/net/benet/be_cmds.h
+++ b/drivers/net/benet/be_cmds.h
@@ -1482,6 +1482,8 @@ extern int be_cmd_rxq_create(struct be_adapter *adapter,
u32 rss, u8 *rss_id);
extern int be_cmd_q_destroy(struct be_adapter *adapter, struct be_queue_info *q,
int type);
+extern int be_cmd_rxq_destroy(struct be_adapter *adapter,
+ struct be_queue_info *q);
extern int be_cmd_link_status_query(struct be_adapter *adapter,
bool *link_up, u8 *mac_speed, u16 *link_speed, u32 dom);
extern int be_cmd_reset(struct be_adapter *adapter);
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index ae281de..5b319d7 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -1572,6 +1572,7 @@ static void be_rx_q_clean(struct be_adapter *adapter, struct be_rx_obj *rxo)
memset(page_info, 0, sizeof(*page_info));
}
BUG_ON(atomic_read(&rxq->used));
+ rxq->tail = rxq->head = 0;
}
static void be_tx_compl_clean(struct be_adapter *adapter,
@@ -1752,29 +1753,16 @@ static void be_rx_queues_destroy(struct be_adapter *adapter)
int i;
for_all_rx_queues(adapter, rxo, i) {
- q = &rxo->q;
- if (q->created) {
- be_cmd_q_destroy(adapter, q, QTYPE_RXQ);
- /* After the rxq is invalidated, wait for a grace time
- * of 1ms for all dma to end and the flush compl to
- * arrive
- */
- mdelay(1);
- be_rx_q_clean(adapter, rxo);
- }
- be_queue_free(adapter, q);
+ be_queue_free(adapter, &rxo->q);
q = &rxo->cq;
if (q->created)
be_cmd_q_destroy(adapter, q, QTYPE_CQ);
be_queue_free(adapter, q);
- /* Clear any residual events */
q = &rxo->rx_eq.q;
- if (q->created) {
- be_eq_clean(adapter, &rxo->rx_eq);
+ if (q->created)
be_cmd_q_destroy(adapter, q, QTYPE_EQ);
- }
be_queue_free(adapter, q);
}
}
@@ -1833,30 +1821,14 @@ static int be_rx_queues_create(struct be_adapter *adapter)
rc = be_cmd_cq_create(adapter, cq, eq, false, false, 3);
if (rc)
goto err;
- /* Rx Q */
+
+ /* Rx Q - will be created in be_open() */
q = &rxo->q;
rc = be_queue_alloc(adapter, q, RX_Q_LEN,
sizeof(struct be_eth_rx_d));
if (rc)
goto err;
- rc = be_cmd_rxq_create(adapter, q, cq->id, rx_frag_size,
- BE_MAX_JUMBO_FRAME_SIZE, adapter->if_handle,
- (i > 0) ? 1 : 0/* rss enable */, &rxo->rss_id);
- if (rc)
- goto err;
- }
-
- if (be_multi_rxq(adapter)) {
- u8 rsstable[MAX_RSS_QS];
-
- for_all_rss_queues(adapter, rxo, i)
- rsstable[i] = rxo->rss_id;
-
- rc = be_cmd_rss_config(adapter, rsstable,
- adapter->num_rx_qs - 1);
- if (rc)
- goto err;
}
return 0;
@@ -2302,6 +2274,31 @@ done:
adapter->isr_registered = false;
}
+static void be_rx_queues_clear(struct be_adapter *adapter)
+{
+ struct be_queue_info *q;
+ struct be_rx_obj *rxo;
+ int i;
+
+ for_all_rx_queues(adapter, rxo, i) {
+ q = &rxo->q;
+ if (q->created) {
+ be_cmd_rxq_destroy(adapter, q);
+ /* After the rxq is invalidated, wait for a grace time
+ * of 1ms for all dma to end and the flush compl to
+ * arrive
+ */
+ mdelay(1);
+ be_rx_q_clean(adapter, rxo);
+ }
+
+ /* Clear any residual events */
+ q = &rxo->rx_eq.q;
+ if (q->created)
+ be_eq_clean(adapter, &rxo->rx_eq);
+ }
+}
+
static int be_close(struct net_device *netdev)
{
struct be_adapter *adapter = netdev_priv(netdev);
@@ -2350,6 +2347,40 @@ static int be_close(struct net_device *netdev)
for_all_tx_queues(adapter, txo, i)
be_tx_compl_clean(adapter, txo);
+ be_rx_queues_clear(adapter);
+ return 0;
+}
+
+static int be_rx_queues_setup(struct be_adapter *adapter)
+{
+ struct be_rx_obj *rxo;
+ int rc, i;
+ u8 rsstable[MAX_RSS_QS];
+
+ for_all_rx_queues(adapter, rxo, i) {
+ rc = be_cmd_rxq_create(adapter, &rxo->q, rxo->cq.id,
+ rx_frag_size, BE_MAX_JUMBO_FRAME_SIZE,
+ adapter->if_handle,
+ (i > 0) ? 1 : 0/* rss enable */, &rxo->rss_id);
+ if (rc)
+ return rc;
+ }
+
+ if (be_multi_rxq(adapter)) {
+ for_all_rss_queues(adapter, rxo, i)
+ rsstable[i] = rxo->rss_id;
+
+ rc = be_cmd_rss_config(adapter, rsstable,
+ adapter->num_rx_qs - 1);
+ if (rc)
+ return rc;
+ }
+
+ /* First time posting */
+ for_all_rx_queues(adapter, rxo, i) {
+ be_post_rx_frags(rxo, GFP_KERNEL);
+ napi_enable(&rxo->rx_eq.napi);
+ }
return 0;
}
@@ -2363,10 +2394,10 @@ static int be_open(struct net_device *netdev)
u8 mac_speed;
u16 link_speed;
- for_all_rx_queues(adapter, rxo, i) {
- be_post_rx_frags(rxo, GFP_KERNEL);
- napi_enable(&rxo->rx_eq.napi);
- }
+ status = be_rx_queues_setup(adapter);
+ if (status)
+ goto err;
+
napi_enable(&tx_eq->napi);
be_irq_register(adapter);
--
1.7.4
^ permalink raw reply related
* [PATCH net-next-2.6 3/3] be2net: clear intr bit in be_probe()
From: Sathya Perla @ 2011-06-30 9:33 UTC (permalink / raw)
To: netdev
It may be set in the card while the driver is probed by kdump kernel after a
crash.
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
---
drivers/net/benet/be_main.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index 5b319d7..375924f 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -3417,6 +3417,12 @@ static int __devinit be_probe(struct pci_dev *pdev,
if (status)
goto stats_clean;
+ /* The INTR bit may be set in the card when probed by a kdump kernel
+ * after a crash.
+ */
+ if (!lancer_chip(adapter))
+ be_intr_set(adapter, false);
+
be_msix_enable(adapter);
INIT_DELAYED_WORK(&adapter->work, be_worker);
--
1.7.4
^ permalink raw reply related
* [GIT] Networking
From: David Miller @ 2011-06-30 9:40 UTC (permalink / raw)
To: torvalds; +Cc: akpm, netdev, linux-kernel
1) Bridge flooding fix from Herbert Xu.
2) ip_rt_bug can trigger in certain TPROXY situations, fix
from Julian Anastasov.
3) Fix bluetooth L2CAP security check, from Luiz Augusto von Dentz.
4) zlib inflate buffer alloc can result in order-4 allocation, use
vmalloc instead.
5) ipv6 UDP checks wrong variable for non-blocking condition, fix
from Xufeng Zhang.
6) If UDP recvmsg ends up retrying, we need to clear the MSG_TRUNC
flag as the next packet we're going to try might fit. Fix
from Xufeng Zhang.
7) Fix OOPS in rionet_remove, from Yinglin Luan.
8) Packet length calculation fixes in the ipv4 output path from
Steffen Klassert.
9) Fix Kconfig deps for netconsole, from Randy Dunlap.
10) CAN Kconfig files were using "default Y" instead of "default y",
fix from marc Kleine-Budde.
Please pull, thanks a lot!
The following changes since commit ca56a95eedcc95f8fea7b49c87565cd961d74fe2:
Merge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 (2011-06-29 18:18:48 -0700)
are available in the git repository at:
master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6.git master
Dan Carpenter (1):
net/usb/kalmia: signedness bug in kalmia_bind()
Dave Jones (1):
usbnet: Remove over-broad module alias from zaurus.
David S. Miller (2):
Merge branch 'davem.r8169' of git://git.kernel.org/.../romieu/netdev-2.6
net+crypto: Use vmalloc for zlib inflate buffers.
Francois Romieu (1):
r8169: fix wrong register use.
Herbert Xu (1):
bridge: Only flood unregistered groups to routers
Ilia Kolomisnky (1):
Bluetooth: Fix L2CAP connection establishment
Johan Hedberg (1):
Bluetooth: Fix accepting connect requests for defer_setup
John (Jay) Hernandez (1):
cxgb3: skb_record_rx_queue now records the queue index relative to the net_device.
John W. Linville (2):
Merge branch 'master' of master.kernel.org:/.../padovan/bluetooth-2.6
Merge branch 'master' of git://git.kernel.org/.../linville/wireless-2.6 into for-davem
Julian Anastasov (1):
netfilter: Fix ip_route_me_harder triggering ip_rt_bug
Larry Finger (2):
rtlwifi: rtl8192se: Handle duplicate PCI ID 0x10ec:0x8192 conflict with r8192e_pci
rtl8192cu: Fix missing firmware load
Luiz Augusto von Dentz (1):
Bluetooth: Fix L2CAP security check
Marc Kleine-Budde (1):
net/can: activate bit-timing calculation and netlink based drivers by default
Marius B. Kotsbak (1):
net/usb: kalmia: Various fixes for better support of non-x86 architectures.
Mike Frysinger (2):
MAINTAINERS: mark socketcan-core lists as subscribers-only
MAINTAINERS: drop Michael from bfin_mac driver
Randy Dunlap (1):
netconsole: fix build when CONFIG_NETCONSOLE_DYNAMIC is turned on
Ron Mercer (1):
qlge: Add maintainer.
Steffen Klassert (2):
ipv4: Fix packet size calculation in __ip_append_data
ipv4: Fix IPsec slowpath fragmentation problem
Sven Eckelmann (1):
MAINTAINERS: Remove Sven Eckelmann from BATMAN ADVANCED
Xufeng Zhang (2):
ipv6/udp: Use the correct variable to determine non-blocking condition
udp/recvmsg: Clear MSG_TRUNC flag when starting over for a new packet
Yinglin Luan (1):
rionet: fix NULL pointer dereference in rionet_remove
MAINTAINERS | 7 +--
crypto/deflate.c | 7 +--
crypto/zlib.c | 7 +--
drivers/net/Kconfig | 3 +-
drivers/net/bnx2x/bnx2x_main.c | 6 +-
drivers/net/can/Kconfig | 4 +-
drivers/net/cxgb3/sge.c | 4 +-
drivers/net/ppp_deflate.c | 5 +-
drivers/net/r8169.c | 2 +-
drivers/net/rionet.c | 28 +++++++------
drivers/net/usb/kalmia.c | 42 +++++++++++--------
drivers/net/usb/zaurus.c | 10 ----
drivers/net/wireless/rtlwifi/pci.c | 13 +++++-
drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | 20 +++++++++
net/bluetooth/hci_conn.c | 6 +-
net/bluetooth/l2cap_core.c | 21 +++++++---
net/bridge/br_multicast.c | 5 ++-
net/ipv4/ip_output.c | 17 +++----
net/ipv4/netfilter.c | 60 ++++++++++-----------------
net/ipv4/netfilter/ipt_REJECT.c | 14 ++----
net/ipv4/udp.c | 3 +
net/ipv6/udp.c | 5 ++-
22 files changed, 155 insertions(+), 134 deletions(-)
^ permalink raw reply
* Re: [PATCH] net/core: Convert to current logging forms
From: WANG Cong @ 2011-06-30 9:55 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
In-Reply-To: <385ebf7e98e377e6e6c384beb961b65d4a95fb18.1309289792.git.joe@perches.com>
On Tue, 28 Jun 2011 12:40:10 -0700, Joe Perches wrote:
> Use pr_fmt, pr_<level>, and netdev_<level> as appropriate.
>
> Coalesce long formats.
...
> + np->name, np->local_port);
> + pr_info("%s: local IP %pI4\n",
> + np->name, &np->local_ip);
> + pr_info("%s: interface '%s'\n",
> + np->name, np->dev_name);
> + pr_info("%s: remote port %d\n",
> + np->name, np->remote_port);
> + pr_info("%s: remote IP %pI4\n",
> + np->name, &np->remote_ip);
> + pr_info("%s: remote ethernet address %pM\n", + np->name,
> np->remote_mac);
> }
This doesn't have much value, because the name of the netpoll
user (np->name) is already logged. If we changed it,
we would see "netconsole: netconsole: blah blah...".
Thanks.
^ permalink raw reply
* Re: [PATCH] Exclude duplicated checking for iface-up. This flags is checked in 'is_skb_forwardable' function, which is subroutine of 'dev_forward_skb'.
From: WANG Cong @ 2011-06-30 12:07 UTC (permalink / raw)
To: netdev
In-Reply-To: <1309267844-29334-1-git-send-email-alex.bluesman.smirnov@gmail.com>
On Tue, 28 Jun 2011 17:30:44 +0400, alex.bluesman.smirnov wrote:
> From: Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
>
Please add the description here, instead of in $subject.
> Signed-off-by: Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
> ---
The patch itself looks fine,
Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com>
Thanks.
^ permalink raw reply
* [NEXT][PATCH 0/5] Updates for net-next for IEEE 802.15.4 code
From: Dmitry Eremin-Solenikov @ 2011-06-30 12:37 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
Hello,
Please merge the following changes into the net-next repo:
The following changes since commit 1049f6413f6e52572a768ca1590fa479ef0a48e8:
myri10ge: Update MAINTAINERS (2011-06-29 06:02:05 -0700)
are available in the git repository at:
git://git2.kernel.org/pub/scm/linux/kernel/git/lowpan/lowpan.git for-next
Alexander Smirnov (1):
ieee802154: free skb buffer if dev isn't running
Dmitry Eremin-Solenikov (3):
fakehard: stop setting platform_data as it's unused anymore
ieee802154: support specifying hw address for created devices
ieee802154: it's IEEE 802.15.4, not ZigBee
Werner Almesberger (1):
IEEE 802.15.4: do not enable driver debugging by default
drivers/ieee802154/Makefile | 2 --
drivers/ieee802154/fakehard.c | 2 --
net/ieee802154/af_ieee802154.c | 2 +-
net/ieee802154/dgram.c | 2 +-
net/ieee802154/nl-phy.c | 31 +++++++++++++++++++++++++++++++
5 files changed, 33 insertions(+), 6 deletions(-)
^ permalink raw reply
* [PATCH 1/5] fakehard: stop setting platform_data as it's unused anymore
From: Dmitry Eremin-Solenikov @ 2011-06-30 12:37 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
In-Reply-To: <1309437468-31021-1-git-send-email-dbaryshkov@gmail.com>
Previously dev.platform_data was used to store a pointer to net device.
Now this code was gone. Drop it.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
drivers/ieee802154/fakehard.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/drivers/ieee802154/fakehard.c b/drivers/ieee802154/fakehard.c
index a5a49a1..eb0e2cc 100644
--- a/drivers/ieee802154/fakehard.c
+++ b/drivers/ieee802154/fakehard.c
@@ -370,8 +370,6 @@ static int __devinit ieee802154fake_probe(struct platform_device *pdev)
return -ENOMEM;
}
- phy->dev.platform_data = dev;
-
memcpy(dev->dev_addr, "\xba\xbe\xca\xfe\xde\xad\xbe\xef",
dev->addr_len);
memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
--
1.7.5.4
^ permalink raw reply related
* [PATCH 2/5] ieee802154: support specifying hw address for created devices
From: Dmitry Eremin-Solenikov @ 2011-06-30 12:37 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
In-Reply-To: <1309437468-31021-1-git-send-email-dbaryshkov@gmail.com>
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
net/ieee802154/nl-phy.c | 31 +++++++++++++++++++++++++++++++
1 files changed, 31 insertions(+), 0 deletions(-)
diff --git a/net/ieee802154/nl-phy.c b/net/ieee802154/nl-phy.c
index 02548b2..c64a38d 100644
--- a/net/ieee802154/nl-phy.c
+++ b/net/ieee802154/nl-phy.c
@@ -24,6 +24,7 @@
#include <linux/kernel.h>
#include <linux/slab.h>
+#include <linux/if_arp.h>
#include <net/netlink.h>
#include <net/genetlink.h>
#include <net/wpan-phy.h>
@@ -213,12 +214,37 @@ static int ieee802154_add_iface(struct sk_buff *skb,
goto nla_put_failure;
}
+ if (info->attrs[IEEE802154_ATTR_HW_ADDR] &&
+ nla_len(info->attrs[IEEE802154_ATTR_HW_ADDR]) !=
+ IEEE802154_ADDR_LEN) {
+ rc = -EINVAL;
+ goto nla_put_failure;
+ }
+
dev = phy->add_iface(phy, devname);
if (IS_ERR(dev)) {
rc = PTR_ERR(dev);
goto nla_put_failure;
}
+ if (info->attrs[IEEE802154_ATTR_HW_ADDR]) {
+ struct sockaddr addr;
+
+ addr.sa_family = ARPHRD_IEEE802154;
+ nla_memcpy(&addr.sa_data, info->attrs[IEEE802154_ATTR_HW_ADDR],
+ IEEE802154_ADDR_LEN);
+
+ /*
+ * strangely enough, some callbacks (inetdev_event) from
+ * dev_set_mac_address require RTNL_LOCK
+ */
+ rtnl_lock();
+ rc = dev_set_mac_address(dev, &addr);
+ rtnl_unlock();
+ if (rc)
+ goto dev_unregister;
+ }
+
NLA_PUT_STRING(msg, IEEE802154_ATTR_PHY_NAME, wpan_phy_name(phy));
NLA_PUT_STRING(msg, IEEE802154_ATTR_DEV_NAME, dev->name);
@@ -228,6 +254,11 @@ static int ieee802154_add_iface(struct sk_buff *skb,
return ieee802154_nl_reply(msg, info);
+dev_unregister:
+ rtnl_lock(); /* del_iface must be called with RTNL lock */
+ phy->del_iface(phy, dev);
+ dev_put(dev);
+ rtnl_unlock();
nla_put_failure:
nlmsg_free(msg);
out_dev:
--
1.7.5.4
^ permalink raw reply related
* [PATCH 3/5] ieee802154: it's IEEE 802.15.4, not ZigBee
From: Dmitry Eremin-Solenikov @ 2011-06-30 12:37 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
In-Reply-To: <1309437468-31021-1-git-send-email-dbaryshkov@gmail.com>
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
net/ieee802154/dgram.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/ieee802154/dgram.c b/net/ieee802154/dgram.c
index 1a3334c..faecf64 100644
--- a/net/ieee802154/dgram.c
+++ b/net/ieee802154/dgram.c
@@ -1,5 +1,5 @@
/*
- * ZigBee socket interface
+ * IEEE 802.15.4 dgram socket interface
*
* Copyright 2007, 2008 Siemens AG
*
--
1.7.5.4
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox