* [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
* [PATCH 4/5] ieee802154: free skb buffer if dev isn't running
From: Dmitry Eremin-Solenikov @ 2011-06-30 12:37 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Alexander Smirnov
In-Reply-To: <1309437468-31021-1-git-send-email-dbaryshkov@gmail.com>
From: Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
Signed-off-by: Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
net/ieee802154/af_ieee802154.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/ieee802154/af_ieee802154.c b/net/ieee802154/af_ieee802154.c
index 6df6ecf..40e606f 100644
--- a/net/ieee802154/af_ieee802154.c
+++ b/net/ieee802154/af_ieee802154.c
@@ -302,7 +302,7 @@ static int ieee802154_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt, struct net_device *orig_dev)
{
if (!netif_running(dev))
- return -ENODEV;
+ goto drop;
pr_debug("got frame, type %d, dev %p\n", dev->type, dev);
#ifdef DEBUG
print_hex_dump_bytes("ieee802154_rcv ", DUMP_PREFIX_NONE, skb->data, skb->len);
--
1.7.5.4
^ permalink raw reply related
* [PATCH 5/5] IEEE 802.15.4: do not enable driver debugging by default
From: Dmitry Eremin-Solenikov @ 2011-06-30 12:37 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Werner Almesberger
In-Reply-To: <1309437468-31021-1-git-send-email-dbaryshkov@gmail.com>
From: Werner Almesberger <werner@almesberger.net>
The IEEE 802.15.4 drivers were compiled by default with debugging,
which caused them to be rather chatty and slow. This patch silences
them. People debugging drivers can still add a #define DEBUG in the
beginning of the respective file or use dynamic debug
This patch also removes the now unused option CONFIG_FFD.
Signed-off-by: Werner Almesberger <werner@almesberger.net>
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
drivers/ieee802154/Makefile | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/drivers/ieee802154/Makefile b/drivers/ieee802154/Makefile
index 6899913..800a389 100644
--- a/drivers/ieee802154/Makefile
+++ b/drivers/ieee802154/Makefile
@@ -1,3 +1 @@
obj-$(CONFIG_IEEE802154_FAKEHARD) += fakehard.o
-
-ccflags-y := -DDEBUG -DCONFIG_FFD
--
1.7.5.4
^ permalink raw reply related
* Re: [PATCHv2 NEXT 1/2] net: add external loopback test in ethtool self test
From: Ben Hutchings @ 2011-06-30 13:25 UTC (permalink / raw)
To: amit.salecha; +Cc: davem, netdev, ameen.rahman, sucheta.chakraborty
In-Reply-To: <1309413650-15952-2-git-send-email-amit.salecha@qlogic.com>
On Wed, 2011-06-29 at 23:00 -0700, amit.salecha@qlogic.com wrote:
> 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>
Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
Ben.
> ---
> 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*/
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: possible bridge regression in "bridge: implement [add/del]_slave ops"?
From: Alexander Stein @ 2011-06-30 13:27 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: David S. Miller, bridge, netdev, linux-kernel
In-Reply-To: <201106301033.23997.alexander.stein@systec-electronic.com>
On Thursday 30 June 2011 10:33:23 Alexander Stein wrote:
> 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.
This change was caused by commit 1faa4356a3bd89ea11fb92752d897cff3a20ec0e
"bridge: control carrier based on ports online". It prevents the bridge from
actually receiving/sending packets. Reverting restores the old behavior.
^ permalink raw reply
* [PATCH] sctp: ABORT if receive queue is not empty while closing socket
From: Thomas Graf @ 2011-06-30 13:31 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.
Is this what you had in mind?
Trigger user ABORT when a socket is closed which has skbs sitting on
the receive queue. If data was lost, there is no point in doing a
graceful shutdown. This is consistent with TCP behaviour.
This also resolves the situation when a receiver cannot reopen its rwnd
and the sender continues retransmission attempts indefinitely before
initiating the shutdown.
Signed-off-by: Thomas Graf <tgraf@infradead.org>
diff --git a/include/net/sctp/ulpevent.h b/include/net/sctp/ulpevent.h
index 99b027b..ca4693b 100644
--- a/include/net/sctp/ulpevent.h
+++ b/include/net/sctp/ulpevent.h
@@ -80,7 +80,7 @@ static inline struct sctp_ulpevent *sctp_skb2event(struct sk_buff *skb)
void sctp_ulpevent_free(struct sctp_ulpevent *);
int sctp_ulpevent_is_notification(const struct sctp_ulpevent *);
-void sctp_queue_purge_ulpevents(struct sk_buff_head *list);
+unsigned int sctp_queue_purge_ulpevents(struct sk_buff_head *list);
struct sctp_ulpevent *sctp_ulpevent_make_assoc_change(
const struct sctp_association *asoc,
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 6766913..958253a 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -1384,6 +1384,7 @@ SCTP_STATIC void sctp_close(struct sock *sk, long timeout)
struct sctp_endpoint *ep;
struct sctp_association *asoc;
struct list_head *pos, *temp;
+ unsigned int data_was_unread;
SCTP_DEBUG_PRINTK("sctp_close(sk: 0x%p, timeout:%ld)\n", sk, timeout);
@@ -1393,6 +1394,10 @@ SCTP_STATIC void sctp_close(struct sock *sk, long timeout)
ep = sctp_sk(sk)->ep;
+ /* Clean up any skbs sitting on the receive queue. */
+ data_was_unread = sctp_queue_purge_ulpevents(&sk->sk_receive_queue);
+ data_was_unread += sctp_queue_purge_ulpevents(&sctp_sk(sk)->pd_lobby);
+
/* Walk all associations on an endpoint. */
list_for_each_safe(pos, temp, &ep->asocs) {
asoc = list_entry(pos, struct sctp_association, asocs);
@@ -1410,7 +1415,8 @@ SCTP_STATIC void sctp_close(struct sock *sk, long timeout)
}
}
- if (sock_flag(sk, SOCK_LINGER) && !sk->sk_lingertime) {
+ if (data_was_unread ||
+ (sock_flag(sk, SOCK_LINGER) && !sk->sk_lingertime)) {
struct sctp_chunk *chunk;
chunk = sctp_make_abort_user(asoc, NULL, 0);
@@ -1420,10 +1426,6 @@ SCTP_STATIC void sctp_close(struct sock *sk, long timeout)
sctp_primitive_SHUTDOWN(asoc, NULL);
}
- /* Clean up any skbs sitting on the receive queue. */
- sctp_queue_purge_ulpevents(&sk->sk_receive_queue);
- sctp_queue_purge_ulpevents(&sctp_sk(sk)->pd_lobby);
-
/* On a TCP-style socket, block for at most linger_time if set. */
if (sctp_style(sk, TCP) && timeout)
sctp_wait_for_close(sk, timeout);
diff --git a/net/sctp/ulpevent.c b/net/sctp/ulpevent.c
index e70e5fc..aab3184 100644
--- a/net/sctp/ulpevent.c
+++ b/net/sctp/ulpevent.c
@@ -1081,9 +1081,19 @@ void sctp_ulpevent_free(struct sctp_ulpevent *event)
}
/* Purge the skb lists holding ulpevents. */
-void sctp_queue_purge_ulpevents(struct sk_buff_head *list)
+unsigned int sctp_queue_purge_ulpevents(struct sk_buff_head *list)
{
struct sk_buff *skb;
- while ((skb = skb_dequeue(list)) != NULL)
+ unsigned int data_unread = 0;
+
+ while ((skb = skb_dequeue(list)) != NULL) {
+ struct sctp_ulpevent *event = sctp_skb2event(skb);
+
+ if (!sctp_ulpevent_is_notification(event))
+ data_unread += skb->len;
+
sctp_ulpevent_free(sctp_skb2event(skb));
+ }
+
+ return data_unread;
}
^ permalink raw reply related
* Re: [PATCH] sctp: Enforce maximum retransmissions during shutdown
From: Vladislav Yasevich @ 2011-06-30 14:08 UTC (permalink / raw)
To: netdev, davem, Wei Yongjun, Sridhar Samudrala, linux-sctp
In-Reply-To: <20110630084933.GA24074@canuck.infradead.org>
On 06/30/2011 04:49 AM, Thomas Graf wrote:
> 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?
sk_receive_queue isn't the only queue you have to check. You'll need to check
the reassembly and ordering queues, as partial or out of order things might stuck
there. That's would be an extremely rare condition since if we ever get here, the
first thing we do is reneg on those TSN and open the window to get the missing chunk
in and push complete packet up to sk_receive_queue.
>
> 2) the receiver is an older Linux without the above fix or another stack
> that does not ABORT?
crap....
How about this. If we in SHUTDOWN_PENDING state, let the errors accumulate upto
max_retrans. After that, start SHUTDOWN_GUARD timer to let the association live a
bit longer just on the off-chance the receive comes back. When SHUTDOWN_GUARD
expires it will abort the association.
When we are in this state, SACK processing will have to reset SHUTDOWN_GUARD when
the SACK is actually acknowledging something.
>
> 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?
>
There is a potential that the sender may abort prematurely. The issue is that
the sender has no way of knowing if the remote process somehow terminated and
will never consume data, or if it is just extremely busy with something else and
will come back. Since this is a reliable protocol, we given the receive the benefit
of the doubt and try our hardest to get the data across.
My suggestion above is still a bit of a hack that one could argue still violates the
protocol, but the time period tries to remove as much doubt from the sender as possible
the the receiver is really out-to-lunch.
-vlad
^ permalink raw reply
* Re: [PATCH] sctp: ABORT if receive queue is not empty while closing socket
From: Vladislav Yasevich @ 2011-06-30 14:11 UTC (permalink / raw)
To: netdev, davem, Wei Yongjun, Sridhar Samudrala, linux-sctp
In-Reply-To: <20110630133122.GB24074@canuck.infradead.org>
On 06/30/2011 09:31 AM, Thomas Graf wrote:
> 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.
>
> Is this what you had in mind?
Almost. It could really be a simple true/false condition about recvqueue or inqueue
being non-empty. If that's the case, trigger abort.
-vlad
>
> Trigger user ABORT when a socket is closed which has skbs sitting on
> the receive queue. If data was lost, there is no point in doing a
> graceful shutdown. This is consistent with TCP behaviour.
>
> This also resolves the situation when a receiver cannot reopen its rwnd
> and the sender continues retransmission attempts indefinitely before
> initiating the shutdown.
>
> Signed-off-by: Thomas Graf <tgraf@infradead.org>
>
> diff --git a/include/net/sctp/ulpevent.h b/include/net/sctp/ulpevent.h
> index 99b027b..ca4693b 100644
> --- a/include/net/sctp/ulpevent.h
> +++ b/include/net/sctp/ulpevent.h
> @@ -80,7 +80,7 @@ static inline struct sctp_ulpevent *sctp_skb2event(struct sk_buff *skb)
>
> void sctp_ulpevent_free(struct sctp_ulpevent *);
> int sctp_ulpevent_is_notification(const struct sctp_ulpevent *);
> -void sctp_queue_purge_ulpevents(struct sk_buff_head *list);
> +unsigned int sctp_queue_purge_ulpevents(struct sk_buff_head *list);
>
> struct sctp_ulpevent *sctp_ulpevent_make_assoc_change(
> const struct sctp_association *asoc,
> diff --git a/net/sctp/socket.c b/net/sctp/socket.c
> index 6766913..958253a 100644
> --- a/net/sctp/socket.c
> +++ b/net/sctp/socket.c
> @@ -1384,6 +1384,7 @@ SCTP_STATIC void sctp_close(struct sock *sk, long timeout)
> struct sctp_endpoint *ep;
> struct sctp_association *asoc;
> struct list_head *pos, *temp;
> + unsigned int data_was_unread;
>
> SCTP_DEBUG_PRINTK("sctp_close(sk: 0x%p, timeout:%ld)\n", sk, timeout);
>
> @@ -1393,6 +1394,10 @@ SCTP_STATIC void sctp_close(struct sock *sk, long timeout)
>
> ep = sctp_sk(sk)->ep;
>
> + /* Clean up any skbs sitting on the receive queue. */
> + data_was_unread = sctp_queue_purge_ulpevents(&sk->sk_receive_queue);
> + data_was_unread += sctp_queue_purge_ulpevents(&sctp_sk(sk)->pd_lobby);
> +
> /* Walk all associations on an endpoint. */
> list_for_each_safe(pos, temp, &ep->asocs) {
> asoc = list_entry(pos, struct sctp_association, asocs);
> @@ -1410,7 +1415,8 @@ SCTP_STATIC void sctp_close(struct sock *sk, long timeout)
> }
> }
>
> - if (sock_flag(sk, SOCK_LINGER) && !sk->sk_lingertime) {
> + if (data_was_unread ||
> + (sock_flag(sk, SOCK_LINGER) && !sk->sk_lingertime)) {
> struct sctp_chunk *chunk;
>
> chunk = sctp_make_abort_user(asoc, NULL, 0);
> @@ -1420,10 +1426,6 @@ SCTP_STATIC void sctp_close(struct sock *sk, long timeout)
> sctp_primitive_SHUTDOWN(asoc, NULL);
> }
>
> - /* Clean up any skbs sitting on the receive queue. */
> - sctp_queue_purge_ulpevents(&sk->sk_receive_queue);
> - sctp_queue_purge_ulpevents(&sctp_sk(sk)->pd_lobby);
> -
> /* On a TCP-style socket, block for at most linger_time if set. */
> if (sctp_style(sk, TCP) && timeout)
> sctp_wait_for_close(sk, timeout);
> diff --git a/net/sctp/ulpevent.c b/net/sctp/ulpevent.c
> index e70e5fc..aab3184 100644
> --- a/net/sctp/ulpevent.c
> +++ b/net/sctp/ulpevent.c
> @@ -1081,9 +1081,19 @@ void sctp_ulpevent_free(struct sctp_ulpevent *event)
> }
>
> /* Purge the skb lists holding ulpevents. */
> -void sctp_queue_purge_ulpevents(struct sk_buff_head *list)
> +unsigned int sctp_queue_purge_ulpevents(struct sk_buff_head *list)
> {
> struct sk_buff *skb;
> - while ((skb = skb_dequeue(list)) != NULL)
> + unsigned int data_unread = 0;
> +
> + while ((skb = skb_dequeue(list)) != NULL) {
> + struct sctp_ulpevent *event = sctp_skb2event(skb);
> +
> + if (!sctp_ulpevent_is_notification(event))
> + data_unread += skb->len;
> +
> sctp_ulpevent_free(sctp_skb2event(skb));
> + }
> +
> + return data_unread;
> }
>
^ 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