* Re: [PATCH] ibm_newemac: Fix EMACx_TRTR[TRT] bit shifts
From: David Miller @ 2009-11-18 13:11 UTC (permalink / raw)
To: sr; +Cc: linuxppc-dev, dmitchell, netdev, linuxppc-dev, benh
In-Reply-To: <200911181107.51661.sr@denx.de>
From: Stefan Roese <sr@denx.de>
Date: Wed, 18 Nov 2009 11:07:51 +0100
> On Wednesday 18 November 2009 01:56:55 Dave Mitchell wrote:
>> The TRT bit shifts were reversed for EMAC4 and non-EMAC4 during the
>> port from ibm_emac to ibm_newemac. This patch corrects that error.
>>
>> Signed-off-by: Dave Mitchell <dmitchell@appliedmicro.com>
>> Acked-by: Feng Kan <fkan@appliedmicro.com>
>> Acked-by: Prodyut Hazarika <phazarika@appliedmicro.com>
>
> Acked-by: Stefan Roese <sr@denx.de>
>
> Would be great if this could go into 2.6.32. Thanks.
Applied to net-2.6, thanks.
^ permalink raw reply
* Re: [PATCH 2.6.32] cxgb3: fix premature page unmap
From: David Miller @ 2009-11-18 13:11 UTC (permalink / raw)
To: divy; +Cc: netdev, linux-kernel, swise
In-Reply-To: <20091118023828.16411.57681.stgit@localhost.localdomain>
From: Divy Le Ray <divy@chelsio.com>
Date: Tue, 17 Nov 2009 18:38:28 -0800
> From: Divy Le Ray <divy@chelsio.com>
>
> unmap Rx page only when guaranteed that this page won't be
> used anymore to allocate rx page chunks.
>
> Signed-off-by: Divy Le Ray <divy@chelsio.com>
Applied to net-2.6, thanks.
^ permalink raw reply
* Re: [PATCH 0/3] TI EMAC driver : Make driver re-usable on non-davinci platforms.
From: David Miller @ 2009-11-18 13:12 UTC (permalink / raw)
To: srk; +Cc: netdev, davinci-linux-open-source
In-Reply-To: <1258537328-31527-1-git-send-email-srk@ti.com>
From: Sriramakrishnan <srk@ti.com>
Date: Wed, 18 Nov 2009 15:12:05 +0530
> The Davinci EMAC peripheral is also available on other TI platforms -
> notably TI AM3517 SoC. The following series of patches modify the driver
> suitably to make it platform agnostic.
>
> Sriramakrishnan (3):
> TI Davinci EMAC : Re-use driver for other platforms.
> TI Davinci EMAC : add platform specific interrupt enable/disable
> logic.
> TI Davinci EMAC : Abstract Buffer address translation logic.
It is easier to send this through the ARM tree? If so, feel free
to do that and add my:
Acked-by: David S. Miller <davem@davemloft.net>
Thanks.
^ permalink raw reply
* Re: large packet loss take2 2.6.31.x
From: Jarek Poplawski @ 2009-11-18 13:51 UTC (permalink / raw)
To: Caleb Cushing; +Cc: Frans Pop, Andi Kleen, linux-kernel, netdev
In-Reply-To: <81bfc67a0911180159g45a45675k44ce3f251c6bddea@mail.gmail.com>
On Wed, Nov 18, 2009 at 04:59:03AM -0500, Caleb Cushing wrote:
> > Might be the same bugzilla report, I guess. We need to establish if
> > these pings reach 192.168.1.1, so a short test and tcpdump without any
> > special options just to get a few lost cases as seen on both sides.
> > (And ifconfigs before and after the test.)
> >
> > Btw, could you check with lsmod if usbserial module is loaded before
> > this test? I'd like to verify this git bisection result. (If the
> > module is loaded or you have CONFIG_USB_SERIAL=y instead of m, try to
> > recompile the kernel with this option turned off, for this test.)
>
> sorry for taking so long to get back. busy problematic times.
No problem, don't hurry.
>
> the dumps and ifconfigs are a bit less 'clean' because the router
> serves several other computers (none of which have this issue
> (windows)) here's the ifconfig -a from the router.
Actually, I'm a little bit surprised. Maybe I missed something from
your previous messages, but I expected something more similar to the
first wireshark dump, which suggested to me there was only this mtr
traffic. Now there is a lot more (plus we know it's not all).
So, there is a basic question: can this mtr loss be seen while no
other traffic is present? After looking into these current dumps I
doubt. There are e.g. 3 pings unanswered between 09:21:50 and
09:21:52 (21:31:34 to 21:31:38 router time), but a lot of tcp
packets to and from 192.168.1.3, so looks like simply dropped and
we can guess the reason.
>
> usbserial is not loaded. actually from reading the patch submission I
> suspected the official cause might be off... but I'm not kernel
> programmer all I know is where I could see the loss during tests.and I
> haven't been able to reproduce over dozens of reboots from this
> 2.6.31.1-test-00091-gfa31221 kernel.
Since this patch from the bisection is really limited to this one
module I doubt we should follow this direction. IMHO it shows the
test wasn't reproducible enough. Probably the amount and/or kind of
other traffic really matter. If I'm wrong and missed something again
let me know. Btw, could you try if changing with ifconfig the
txqueuelen of desktop's eth0 from 100 to 1000 changes anything
in this mtr test?
Jarek P.
> this is the ifconfig -a from my desktop while experiencing the issue
>
> eth0 Link encap:Ethernet HWaddr 00:21:9B:06:4C:C9
> inet addr:192.168.1.3 Bcast:192.168.1.255 Mask:255.255.255.0
> inet6 addr: fe80::221:9bff:fe06:4cc9/64 Scope:Link
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> RX packets:3465 errors:0 dropped:0 overruns:0 frame:0
> TX packets:4951 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:100
> RX bytes:1467320 (1.3 Mb) TX bytes:631808 (617.0 Kb)
> Memory:fdfc0000-fdfe0000
^ permalink raw reply
* Re: [net-next-2.6 PATCH v6 4/7 RFC] TCPCT part 1d: define TCP cookie option, extend existing struct's
From: William Allen Simpson @ 2009-11-18 13:55 UTC (permalink / raw)
To: Ilpo Järvinen
Cc: Eric Dumazet, Linux Kernel Network Developers, Joe Perches,
David Miller
In-Reply-To: <alpine.DEB.2.00.0911171402260.7024@wel-95.cs.helsinki.fi>
Ilpo Järvinen wrote:
> You both are right (and that's what is causing confusion)...
>
In this case, for /this/ code, *none* of you are correct, and _that's_
causing confusion. There is no independent retransmission of SYNACK data!
None!! Nada!!! There is no retransmission queue for SYNACK data.
SYN with SACK should never be sent, and should never be received -- and
already should be discarded and ignored (outside the scope of this patch).
As I've already mentioned in this thread 2 days ago, in my earlier patches
(now deferred to part 2 after the functional split requested by Eric and
Ilpo), the request_sock was removed entirely (just like syncookies).
There wasn't (and won't be) any struct or timer lying around to allow
SYNACK data retransmissions to occur.
Even now, the entire s_data_* edifice isn't passed to be retransmitted.
Note the code (in part 1a), already reviewed and Ack'd:
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index 4be2228..7a42990 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -537,7 +537,7 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb,
* Enforce "SYN-ACK" according to figure 8, figure 6
* of RFC793, fixed by RFC1122.
*/
- req->rsk_ops->rtx_syn_ack(sk, req);
+ req->rsk_ops->rtx_syn_ack(sk, req, NULL);
return NULL;
}
See that NULL? There's no cookie data structure for retransmission!
Could we end this diversion into rampant speculation?
^ permalink raw reply related
* RE: [PATCH 2/7] bnx2x: Refactor MAC address setup code.
From: Vladislav Zolotarov @ 2009-11-18 14:01 UTC (permalink / raw)
To: Stanislaw Gruszka, Michael Chan
Cc: davem@davemloft.net, netdev@vger.kernel.org, michaelc@cs.wisc.edu,
Shmulik Ravid - Rabinovitz, Eilon Greenstein
In-Reply-To: <20091118110608.GA2358@dhcp-lab-161.englab.brq.redhat.com>
The main idea of this counter is to make the set MAC functions return only when FW has
finished handling the ramrod. Currently the only valid values of this "counter" is 0 and 1.
So before sending the ramrod the counter is incremented,
then there is an smp_wmb() (to ensure that the future DPC handler will see the up to date value
before it decrements it during handling ramrod completion in the bnx2x_sp_event()) and only then the ramrod is sent.
So, smp_wmb() will just do right in a single "set MAC" operation flow. Then, if we recall
that MAC is always changed under the rtnl lock we'll see that the current implementation is
just fine.
I agree that atomic_t could be used here but then I should have used the
smp_mb__after_atomic_dec()/smp_mb__after_atomic_inc() to ensure the proper ordering.
IMHO the above is not better than the current implementation.
Regards,
vlad
> -----Original Message-----
> From: netdev-owner@vger.kernel.org
> [mailto:netdev-owner@vger.kernel.org] On Behalf Of Stanislaw Gruszka
> Sent: Wednesday, November 18, 2009 1:06 PM
> To: Michael Chan
> Cc: davem@davemloft.net; netdev@vger.kernel.org;
> michaelc@cs.wisc.edu; Shmulik Ravid - Rabinovitz; Eilon Greenstein
> Subject: Re: [PATCH 2/7] bnx2x: Refactor MAC address setup code.
>
> Hi Michael
>
> On Sat, Oct 10, 2009 at 04:46:54PM -0700, Michael Chan wrote:
> > For iSCSI MAC address setup in later patches.
> >
> > Signed-off-by: Shmulik Ravid - Rabinovitz <shmulikr@broadcom.com>
> > Signed-off-by: Michael Chan <mchan@broadcom.com>
> > Acked-by: Eilon Greenstein <eilong@broadcom.com>
>
> In this patch you become to use ->set_mac_pending as a
> counter. It looks
> like you are trying to do smb_wmb() to make incrementing/decrementing
> operations correct on many processors. But this seems to be wrong,
> since there is no data dependency and smp_wmb()/smp_rmb() does noting.
> In particular these barriers not prevent to race when two processors
> decrement/increment counter. IMHO atomic_t should be used.
>
> Stanislaw
>
> > ---
> > drivers/net/bnx2x.h | 4 +-
> > drivers/net/bnx2x_main.c | 162
> ++++++++++++++++++++++++++++++++--------------
> > 2 files changed, 114 insertions(+), 52 deletions(-)
> >
> > diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h
> > index bbf8422..1f07063 100644
> > --- a/drivers/net/bnx2x.h
> > +++ b/drivers/net/bnx2x.h
> > @@ -863,8 +863,8 @@ struct bnx2x {
> >
> > /* Flags for marking that there is a STAT_QUERY or
> > SET_MAC ramrod pending */
> > - u8 stats_pending;
> > - u8 set_mac_pending;
> > + int stats_pending;
> > + int set_mac_pending;
> >
> > /* End of fields used in the performance code paths */
> >
> > diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
> > index 713d669..02ce3b3 100644
> > --- a/drivers/net/bnx2x_main.c
> > +++ b/drivers/net/bnx2x_main.c
> > @@ -1026,12 +1026,15 @@ static void bnx2x_sp_event(struct
> bnx2x_fastpath *fp,
> > case (RAMROD_CMD_ID_ETH_SET_MAC | BNX2X_STATE_OPEN):
> > case (RAMROD_CMD_ID_ETH_SET_MAC | BNX2X_STATE_DIAG):
> > DP(NETIF_MSG_IFUP, "got set mac ramrod\n");
> > - bp->set_mac_pending = 0;
> > + bp->set_mac_pending--;
> > + smp_wmb();
> > break;
> >
> > case (RAMROD_CMD_ID_ETH_SET_MAC |
> BNX2X_STATE_CLOSING_WAIT4_HALT):
> > case (RAMROD_CMD_ID_ETH_SET_MAC | BNX2X_STATE_DISABLED):
> > DP(NETIF_MSG_IFDOWN, "got (un)set mac ramrod\n");
> > + bp->set_mac_pending--;
> > + smp_wmb();
> > break;
> >
> > default:
> > @@ -2530,7 +2533,7 @@ u32 bnx2x_fw_command(struct bnx2x
> *bp, u32 command)
> > }
> >
> > static void bnx2x_set_storm_rx_mode(struct bnx2x *bp);
> > -static void bnx2x_set_mac_addr_e1h(struct bnx2x *bp, int set);
> > +static void bnx2x_set_eth_mac_addr_e1h(struct bnx2x *bp, int set);
> > static void bnx2x_set_rx_mode(struct net_device *dev);
> >
> > static void bnx2x_e1h_disable(struct bnx2x *bp)
> > @@ -2546,7 +2549,7 @@ static void bnx2x_e1h_disable(struct
> bnx2x *bp)
> >
> > REG_WR(bp, NIG_REG_LLH0_FUNC_EN + port*8, 0);
> >
> > - bnx2x_set_mac_addr_e1h(bp, 0);
> > + bnx2x_set_eth_mac_addr_e1h(bp, 0);
> >
> > for (i = 0; i < MC_HASH_SIZE; i++)
> > REG_WR(bp, MC_HASH_OFFSET(bp, i), 0);
> > @@ -2560,7 +2563,7 @@ static void bnx2x_e1h_enable(struct bnx2x *bp)
> >
> > REG_WR(bp, NIG_REG_LLH0_FUNC_EN + port*8, 1);
> >
> > - bnx2x_set_mac_addr_e1h(bp, 1);
> > + bnx2x_set_eth_mac_addr_e1h(bp, 1);
> >
> > /* Tx queue should be only reenabled */
> > netif_tx_wake_all_queues(bp->dev);
> > @@ -7036,7 +7039,19 @@ static void bnx2x_netif_stop(struct
> bnx2x *bp, int disable_hw)
> > * Init service functions
> > */
> >
> > -static void bnx2x_set_mac_addr_e1(struct bnx2x *bp, int set)
> > +/**
> > + * Sets a MAC in a CAM for a few L2 Clients for E1 chip
> > + *
> > + * @param bp driver descriptor
> > + * @param set set or clear an entry (1 or 0)
> > + * @param mac pointer to a buffer containing a MAC
> > + * @param cl_bit_vec bit vector of clients to register a MAC for
> > + * @param cam_offset offset in a CAM to use
> > + * @param with_bcast set broadcast MAC as well
> > + */
> > +static void bnx2x_set_mac_addr_e1_gen(struct bnx2x *bp,
> int set, u8 *mac,
> > + u32 cl_bit_vec, u8 cam_offset,
> > + u8 with_bcast)
> > {
> > struct mac_configuration_cmd *config = bnx2x_sp(bp, mac_config);
> > int port = BP_PORT(bp);
> > @@ -7045,25 +7060,25 @@ static void
> bnx2x_set_mac_addr_e1(struct bnx2x *bp, int set)
> > * unicasts 0-31:port0 32-63:port1
> > * multicast 64-127:port0 128-191:port1
> > */
> > - config->hdr.length = 2;
> > - config->hdr.offset = port ? 32 : 0;
> > - config->hdr.client_id = bp->fp->cl_id;
> > + config->hdr.length = 1 + (with_bcast ? 1 : 0);
> > + config->hdr.offset = cam_offset;
> > + config->hdr.client_id = 0xff;
> > config->hdr.reserved1 = 0;
> >
> > /* primary MAC */
> > config->config_table[0].cam_entry.msb_mac_addr =
> > - swab16(*(u16
> *)&bp->dev->dev_addr[0]);
> > + swab16(*(u16 *)&mac[0]);
> > config->config_table[0].cam_entry.middle_mac_addr =
> > - swab16(*(u16
> *)&bp->dev->dev_addr[2]);
> > + swab16(*(u16 *)&mac[2]);
> > config->config_table[0].cam_entry.lsb_mac_addr =
> > - swab16(*(u16
> *)&bp->dev->dev_addr[4]);
> > + swab16(*(u16 *)&mac[4]);
> > config->config_table[0].cam_entry.flags = cpu_to_le16(port);
> > if (set)
> > config->config_table[0].target_table_entry.flags = 0;
> > else
> > CAM_INVALIDATE(config->config_table[0]);
> > config->config_table[0].target_table_entry.clients_bit_vector =
> > - cpu_to_le32(1
> << BP_L_ID(bp));
> > + cpu_to_le32(cl_bit_vec);
> > config->config_table[0].target_table_entry.vlan_id = 0;
> >
> > DP(NETIF_MSG_IFUP, "%s MAC (%04x:%04x:%04x)\n",
> > @@ -7073,47 +7088,58 @@ static void
> bnx2x_set_mac_addr_e1(struct bnx2x *bp, int set)
> > config->config_table[0].cam_entry.lsb_mac_addr);
> >
> > /* broadcast */
> > - config->config_table[1].cam_entry.msb_mac_addr =
> cpu_to_le16(0xffff);
> > - config->config_table[1].cam_entry.middle_mac_addr =
> cpu_to_le16(0xffff);
> > - config->config_table[1].cam_entry.lsb_mac_addr =
> cpu_to_le16(0xffff);
> > - config->config_table[1].cam_entry.flags = cpu_to_le16(port);
> > - if (set)
> > - config->config_table[1].target_table_entry.flags =
> > - TSTORM_CAM_TARGET_TABLE_ENTRY_BROADCAST;
> > - else
> > - CAM_INVALIDATE(config->config_table[1]);
> > - config->config_table[1].target_table_entry.clients_bit_vector =
> > - cpu_to_le32(1
> << BP_L_ID(bp));
> > - config->config_table[1].target_table_entry.vlan_id = 0;
> > + if (with_bcast) {
> > + config->config_table[1].cam_entry.msb_mac_addr =
> > + cpu_to_le16(0xffff);
> > + config->config_table[1].cam_entry.middle_mac_addr =
> > + cpu_to_le16(0xffff);
> > + config->config_table[1].cam_entry.lsb_mac_addr =
> > + cpu_to_le16(0xffff);
> > + config->config_table[1].cam_entry.flags =
> cpu_to_le16(port);
> > + if (set)
> > +
> config->config_table[1].target_table_entry.flags =
> > +
> TSTORM_CAM_TARGET_TABLE_ENTRY_BROADCAST;
> > + else
> > + CAM_INVALIDATE(config->config_table[1]);
> > +
> config->config_table[1].target_table_entry.clients_bit_vector =
> > +
> cpu_to_le32(cl_bit_vec);
> > + config->config_table[1].target_table_entry.vlan_id = 0;
> > + }
> >
> > bnx2x_sp_post(bp, RAMROD_CMD_ID_ETH_SET_MAC, 0,
> > U64_HI(bnx2x_sp_mapping(bp, mac_config)),
> > U64_LO(bnx2x_sp_mapping(bp, mac_config)), 0);
> > }
> >
> > -static void bnx2x_set_mac_addr_e1h(struct bnx2x *bp, int set)
> > +/**
> > + * Sets a MAC in a CAM for a few L2 Clients for E1H chip
> > + *
> > + * @param bp driver descriptor
> > + * @param set set or clear an entry (1 or 0)
> > + * @param mac pointer to a buffer containing a MAC
> > + * @param cl_bit_vec bit vector of clients to register a MAC for
> > + * @param cam_offset offset in a CAM to use
> > + */
> > +static void bnx2x_set_mac_addr_e1h_gen(struct bnx2x *bp,
> int set, u8 *mac,
> > + u32 cl_bit_vec, u8 cam_offset)
> > {
> > struct mac_configuration_cmd_e1h *config =
> > (struct mac_configuration_cmd_e1h
> *)bnx2x_sp(bp, mac_config);
> >
> > - /* CAM allocation for E1H
> > - * unicasts: by func number
> > - * multicast: 20+FUNC*20, 20 each
> > - */
> > config->hdr.length = 1;
> > - config->hdr.offset = BP_FUNC(bp);
> > - config->hdr.client_id = bp->fp->cl_id;
> > + config->hdr.offset = cam_offset;
> > + config->hdr.client_id = 0xff;
> > config->hdr.reserved1 = 0;
> >
> > /* primary MAC */
> > config->config_table[0].msb_mac_addr =
> > - swab16(*(u16
> *)&bp->dev->dev_addr[0]);
> > + swab16(*(u16 *)&mac[0]);
> > config->config_table[0].middle_mac_addr =
> > - swab16(*(u16
> *)&bp->dev->dev_addr[2]);
> > + swab16(*(u16 *)&mac[2]);
> > config->config_table[0].lsb_mac_addr =
> > - swab16(*(u16
> *)&bp->dev->dev_addr[4]);
> > + swab16(*(u16 *)&mac[4]);
> > config->config_table[0].clients_bit_vector =
> > - cpu_to_le32(1 << BP_L_ID(bp));
> > + cpu_to_le32(cl_bit_vec);
> > config->config_table[0].vlan_id = 0;
> > config->config_table[0].e1hov_id = cpu_to_le16(bp->e1hov);
> > if (set)
> > @@ -7122,11 +7148,11 @@ static void
> bnx2x_set_mac_addr_e1h(struct bnx2x *bp, int set)
> > config->config_table[0].flags =
> > MAC_CONFIGURATION_ENTRY_E1H_ACTION_TYPE;
> >
> > - DP(NETIF_MSG_IFUP, "%s MAC (%04x:%04x:%04x) E1HOV %d
> CLID %d\n",
> > + DP(NETIF_MSG_IFUP, "%s MAC (%04x:%04x:%04x) E1HOV %d
> CLID mask %d\n",
> > (set ? "setting" : "clearing"),
> > config->config_table[0].msb_mac_addr,
> > config->config_table[0].middle_mac_addr,
> > - config->config_table[0].lsb_mac_addr, bp->e1hov,
> BP_L_ID(bp));
> > + config->config_table[0].lsb_mac_addr, bp->e1hov, cl_bit_vec);
> >
> > bnx2x_sp_post(bp, RAMROD_CMD_ID_ETH_SET_MAC, 0,
> > U64_HI(bnx2x_sp_mapping(bp, mac_config)),
> > @@ -7178,6 +7204,31 @@ static int bnx2x_wait_ramrod(struct
> bnx2x *bp, int state, int idx,
> > return -EBUSY;
> > }
> >
> > +static void bnx2x_set_eth_mac_addr_e1h(struct bnx2x *bp, int set)
> > +{
> > + bp->set_mac_pending++;
> > + smp_wmb();
> > +
> > + bnx2x_set_mac_addr_e1h_gen(bp, set, bp->dev->dev_addr,
> > + (1 << bp->fp->cl_id), BP_FUNC(bp));
> > +
> > + /* Wait for a completion */
> > + bnx2x_wait_ramrod(bp, 0, 0, &bp->set_mac_pending, set ? 0 : 1);
> > +}
> > +
> > +static void bnx2x_set_eth_mac_addr_e1(struct bnx2x *bp, int set)
> > +{
> > + bp->set_mac_pending++;
> > + smp_wmb();
> > +
> > + bnx2x_set_mac_addr_e1_gen(bp, set, bp->dev->dev_addr,
> > + (1 << bp->fp->cl_id),
> (BP_PORT(bp) ? 32 : 0),
> > + 1);
> > +
> > + /* Wait for a completion */
> > + bnx2x_wait_ramrod(bp, 0, 0, &bp->set_mac_pending, set ? 0 : 1);
> > +}
> > +
> > static int bnx2x_setup_leading(struct bnx2x *bp)
> > {
> > int rc;
> > @@ -7452,9 +7503,9 @@ static int bnx2x_nic_load(struct
> bnx2x *bp, int load_mode)
> > }
> >
> > if (CHIP_IS_E1(bp))
> > - bnx2x_set_mac_addr_e1(bp, 1);
> > + bnx2x_set_eth_mac_addr_e1(bp, 1);
> > else
> > - bnx2x_set_mac_addr_e1h(bp, 1);
> > + bnx2x_set_eth_mac_addr_e1h(bp, 1);
> > }
> >
> > if (bp->port.pmf)
> > @@ -7717,7 +7768,7 @@ static int bnx2x_nic_unload(struct
> bnx2x *bp, int unload_mode)
> > struct mac_configuration_cmd *config =
> > bnx2x_sp(bp,
> mcast_config);
> >
> > - bnx2x_set_mac_addr_e1(bp, 0);
> > + bnx2x_set_eth_mac_addr_e1(bp, 0);
> >
> > for (i = 0; i < config->hdr.length; i++)
> > CAM_INVALIDATE(config->config_table[i]);
> > @@ -7730,6 +7781,9 @@ static int bnx2x_nic_unload(struct
> bnx2x *bp, int unload_mode)
> > config->hdr.client_id = bp->fp->cl_id;
> > config->hdr.reserved1 = 0;
> >
> > + bp->set_mac_pending++;
> > + smp_wmb();
> > +
> > bnx2x_sp_post(bp, RAMROD_CMD_ID_ETH_SET_MAC, 0,
> > U64_HI(bnx2x_sp_mapping(bp,
> mcast_config)),
> > U64_LO(bnx2x_sp_mapping(bp,
> mcast_config)), 0);
> > @@ -7737,7 +7791,7 @@ static int bnx2x_nic_unload(struct
> bnx2x *bp, int unload_mode)
> > } else { /* E1H */
> > REG_WR(bp, NIG_REG_LLH0_FUNC_EN + port*8, 0);
> >
> > - bnx2x_set_mac_addr_e1h(bp, 0);
> > + bnx2x_set_eth_mac_addr_e1h(bp, 0);
> >
> > for (i = 0; i < MC_HASH_SIZE; i++)
> > REG_WR(bp, MC_HASH_OFFSET(bp, i), 0);
> > @@ -8520,6 +8574,14 @@ static void __devinit
> bnx2x_link_settings_requested(struct bnx2x *bp)
> > bp->link_params.req_flow_ctrl,
> bp->port.advertising);
> > }
> >
> > +static void __devinit bnx2x_set_mac_buf(u8 *mac_buf, u32
> mac_lo, u16 mac_hi)
> > +{
> > + mac_hi = cpu_to_be16(mac_hi);
> > + mac_lo = cpu_to_be32(mac_lo);
> > + memcpy(mac_buf, &mac_hi, sizeof(mac_hi));
> > + memcpy(mac_buf + sizeof(mac_hi), &mac_lo, sizeof(mac_lo));
> > +}
> > +
> > static void __devinit bnx2x_get_port_hwinfo(struct bnx2x *bp)
> > {
> > int port = BP_PORT(bp);
> > @@ -8601,12 +8663,7 @@ static void __devinit
> bnx2x_get_port_hwinfo(struct bnx2x *bp)
> >
> > val2 = SHMEM_RD(bp, dev_info.port_hw_config[port].mac_upper);
> > val = SHMEM_RD(bp, dev_info.port_hw_config[port].mac_lower);
> > - bp->dev->dev_addr[0] = (u8)(val2 >> 8 & 0xff);
> > - bp->dev->dev_addr[1] = (u8)(val2 & 0xff);
> > - bp->dev->dev_addr[2] = (u8)(val >> 24 & 0xff);
> > - bp->dev->dev_addr[3] = (u8)(val >> 16 & 0xff);
> > - bp->dev->dev_addr[4] = (u8)(val >> 8 & 0xff);
> > - bp->dev->dev_addr[5] = (u8)(val & 0xff);
> > + bnx2x_set_mac_buf(bp->dev->dev_addr, val, val2);
> > memcpy(bp->link_params.mac_addr, bp->dev->dev_addr, ETH_ALEN);
> > memcpy(bp->dev->perm_addr, bp->dev->dev_addr, ETH_ALEN);
> > }
> > @@ -10232,14 +10289,16 @@ static int bnx2x_test_intr(struct
> bnx2x *bp)
> > config->hdr.client_id = bp->fp->cl_id;
> > config->hdr.reserved1 = 0;
> >
> > + bp->set_mac_pending++;
> > + smp_wmb();
> > rc = bnx2x_sp_post(bp, RAMROD_CMD_ID_ETH_SET_MAC, 0,
> > U64_HI(bnx2x_sp_mapping(bp, mac_config)),
> > U64_LO(bnx2x_sp_mapping(bp, mac_config)), 0);
> > if (rc == 0) {
> > - bp->set_mac_pending++;
> > for (i = 0; i < 10; i++) {
> > if (!bp->set_mac_pending)
> > break;
> > + smp_rmb();
> > msleep_interruptible(10);
> > }
> > if (i == 10)
> > @@ -11337,6 +11396,9 @@ static void
> bnx2x_set_rx_mode(struct net_device *dev)
> > config->hdr.client_id = bp->fp->cl_id;
> > config->hdr.reserved1 = 0;
> >
> > + bp->set_mac_pending++;
> > + smp_wmb();
> > +
> > bnx2x_sp_post(bp, RAMROD_CMD_ID_ETH_SET_MAC, 0,
> > U64_HI(bnx2x_sp_mapping(bp,
> mcast_config)),
> > U64_LO(bnx2x_sp_mapping(bp,
> mcast_config)),
> > @@ -11386,9 +11448,9 @@ static int
> bnx2x_change_mac_addr(struct net_device *dev, void *p)
> > memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
> > if (netif_running(dev)) {
> > if (CHIP_IS_E1(bp))
> > - bnx2x_set_mac_addr_e1(bp, 1);
> > + bnx2x_set_eth_mac_addr_e1(bp, 1);
> > else
> > - bnx2x_set_mac_addr_e1h(bp, 1);
> > + bnx2x_set_eth_mac_addr_e1h(bp, 1);
> > }
> >
> > return 0;
> > --
> > 1.6.4.GIT
> >
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe netdev" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
^ permalink raw reply
* Re: [net-next-2.6 PATCH v6 4/7 RFC] TCPCT part 1d: define TCP cookie option, extend existing struct's
From: Ilpo Järvinen @ 2009-11-18 14:08 UTC (permalink / raw)
To: William Allen Simpson
Cc: Eric Dumazet, Linux Kernel Network Developers, Joe Perches,
David Miller
In-Reply-To: <4B03FCE4.5020403@gmail.com>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1724 bytes --]
On Wed, 18 Nov 2009, William Allen Simpson wrote:
> Ilpo Järvinen wrote:
> > You both are right (and that's what is causing confusion)...
> >
> In this case, for /this/ code, *none* of you are correct, and _that's_
> causing confusion. There is no independent retransmission of SYNACK data!
> None!! Nada!!! There is no retransmission queue for SYNACK data.
>
> SYN with SACK should never be sent, and should never be received -- and
> already should be discarded and ignored (outside the scope of this patch).
>
> As I've already mentioned in this thread 2 days ago, in my earlier patches
> (now deferred to part 2 after the functional split requested by Eric and
> Ilpo), the request_sock was removed entirely (just like syncookies).
> There wasn't (and won't be) any struct or timer lying around to allow
> SYNACK data retransmissions to occur.
>
> Even now, the entire s_data_* edifice isn't passed to be retransmitted.
> Note the code (in part 1a), already reviewed and Ack'd:
>
> diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
> index 4be2228..7a42990 100644
> --- a/net/ipv4/tcp_minisocks.c
> +++ b/net/ipv4/tcp_minisocks.c
> @@ -537,7 +537,7 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff
> *skb,
> * Enforce "SYN-ACK" according to figure 8, figure 6
> * of RFC793, fixed by RFC1122.
> */
> - req->rsk_ops->rtx_syn_ack(sk, req);
> + req->rsk_ops->rtx_syn_ack(sk, req, NULL);
> return NULL;
> }
>
> See that NULL? There's no cookie data structure for retransmission!
>
> Could we end this diversion into rampant speculation?
...I was just commenting on the disagreement in the interpretation of what
DaveM said vs comments you mentioned... :-)
--
i.
^ permalink raw reply
* Re: [PATCH 1/3] macvlan: Reflect macvlan packets meant for other macvlan devices
From: Eric W. Biederman @ 2009-11-18 14:37 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Eric Dumazet, linux-kernel, netdev, David Miller,
Stephen Hemminger, Herbert Xu, Patrick McHardy, Patrick Mullaney,
Edge Virtual Bridging, Anna Fischer, bridge, virtualization,
Jens Osterkamp, Gerhard Stenzel
In-Reply-To: <200911181047.07974.arnd@arndb.de>
Arnd Bergmann <arnd@arndb.de> writes:
> On Wednesday 18 November 2009, Eric Dumazet wrote:
>> > - skb->dev = dev;
>> > - skb->pkt_type = PACKET_HOST;
>> > + skb->protocol = eth_type_trans(skb, dev);
>> > + eth = eth_hdr(skb);
>> >
>> > - netif_rx(skb);
>> > - return NULL;
>> > + skb_dst_drop(skb);
>>
>> Why do you drop dst here ?
>>
>> It seems strange, since this driver specifically masks out IFF_XMIT_DST_RELEASE
>> in its macvlan_setup() :
>>
>> dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
>>
>> If we really want to drop dst, it could be done by caller, if IFF_XMIT_DST_RELEASE
>> was not masked in macvlan_setup().
>>
>
> That must be my fault, it is the only change I did to Eric B's patch when
> forward-porting to 2.6.32. The original patch did
>
> skb->protocol = eth_type_trans(skb, dev);
> eth = eth_hdr(skb);
> dst_release(skb->dst);
> skb->dst = NULL;
> skb->mark = 0;
>
> and I tried to convert that in the same way that other drivers did, but I
> have to admit that I did not understand the mechanics of IFF_XMIT_DST_RELEASE.
Please copy and ideally share code with the veth driver for recycling a skb.
There are bunch of little things you have to do to get it right. As I recally
I was missing a few details in my original patch.
Eric
^ permalink raw reply
* Re: [net-next-2.6 PATCH v6 4/7 RFC] TCPCT part 1d: define TCP cookie option, extend existing struct's
From: William Allen Simpson @ 2009-11-18 14:42 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Linux Kernel Network Developers, Joe Perches, David Miller
In-Reply-To: <4B01D17C.4010407@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1918 bytes --]
Eric Dumazet wrote:
> William Allen Simpson a écrit :
>> There is nothing yet in this patch series to send data with a SYN. Back in
>> early October, David required that the various s_data and cookie structures
>> be compressed and consolidated. So, for the client side, the cookie_*
>> fields are filled and the s_data_* fields are zero (ignored), while the
>> server side can have both filled.
>>
>> Moreover, *this* patch does nothing other than allocate and deallocate the
>> structure, zero filled by kzalloc().
>>
>> SYN data will be implemented (much) later.
>
> okay
>
Still no technical corrections. Seeking Acks.
Trying to get review back on track. The patch is still the same.
This patch allocates and deallocates the structures. One main
difference (off the top of my head) from Alan's original patch is
that it uses sk->sk_allocation instead of GFP_ATOMIC in a couple of
places. David Miller wanted to reduce the number of atomic
allocations, and sk->sk_allocation can be GFP_KERNEL or GFP_ATOMIC.
AFAICT, it's usually GFP_KERNEL in both tcp_v4_init_sock() and
tcp_v6_init_sock(), as they're called by inet_create() via
sk->sk_prot->init() shortly after calling sock_init_data() that set
sk->sk_allocation to GFP_KERNEL.
I used the existing variable just in case there are other code paths
that I've missed, and just in case there are future changes adding
code paths.
Limited multiple (=) assignments to only 2 per line for readability
(that in existing code have 4 per line and run well beyond 80
characters, triggering a warning in scripts/checkpatch.pl).
Data structures are carefully composed to require minimal additions.
For example, the struct tcp_options_received cookie_plus variable fits
between existing 16-bit and 8-bit variables, requiring no additional
space (taking alignment into consideration). There are no additions to
tcp_request_sock, and only 1 pointer in tcp_sock.
[-- Attachment #2: TCPCT+1d6++.patch --]
[-- Type: text/plain, Size: 10948 bytes --]
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index eaa3113..7fee8a4 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -247,31 +247,38 @@ struct tcp_options_received {
sack_ok : 4, /* SACK seen on SYN packet */
snd_wscale : 4, /* Window scaling received from sender */
rcv_wscale : 4; /* Window scaling to send to receiver */
-/* SACKs data */
+ u8 cookie_plus:6, /* bytes in authenticator/cookie option */
+ cookie_out_never:1,
+ cookie_in_always:1;
u8 num_sacks; /* Number of SACK blocks */
- u16 user_mss; /* mss requested by user in ioctl */
+ u16 user_mss; /* mss requested by user in ioctl */
u16 mss_clamp; /* Maximal mss, negotiated at connection setup */
};
static inline void tcp_clear_options(struct tcp_options_received *rx_opt)
{
- rx_opt->tstamp_ok = rx_opt->sack_ok = rx_opt->wscale_ok = rx_opt->snd_wscale = 0;
+ rx_opt->tstamp_ok = rx_opt->sack_ok = 0;
+ rx_opt->wscale_ok = rx_opt->snd_wscale = 0;
+ rx_opt->cookie_plus = 0;
}
/* This is the max number of SACKS that we'll generate and process. It's safe
- * to increse this, although since:
+ * to increase this, although since:
* size = TCPOLEN_SACK_BASE_ALIGNED (4) + n * TCPOLEN_SACK_PERBLOCK (8)
* only four options will fit in a standard TCP header */
#define TCP_NUM_SACKS 4
+struct tcp_cookie_values;
+struct tcp_request_sock_ops;
+
struct tcp_request_sock {
struct inet_request_sock req;
#ifdef CONFIG_TCP_MD5SIG
/* Only used by TCP MD5 Signature so far. */
const struct tcp_request_sock_ops *af_specific;
#endif
- u32 rcv_isn;
- u32 snt_isn;
+ u32 rcv_isn;
+ u32 snt_isn;
};
static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req)
@@ -441,6 +448,12 @@ struct tcp_sock {
/* TCP MD5 Signature Option information */
struct tcp_md5sig_info *md5sig_info;
#endif
+
+ /* When the cookie options are generated and exchanged, then this
+ * object holds a reference to them (cookie_values->kref). Also
+ * contains related tcp_cookie_transactions fields.
+ */
+ struct tcp_cookie_values *cookie_values;
};
static inline struct tcp_sock *tcp_sk(const struct sock *sk)
@@ -459,6 +472,10 @@ struct tcp_timewait_sock {
u16 tw_md5_keylen;
u8 tw_md5_key[TCP_MD5SIG_MAXKEYLEN];
#endif
+ /* Few sockets in timewait have cookies; in that case, then this
+ * object holds a reference to them (tw_cookie_values->kref).
+ */
+ struct tcp_cookie_values *tw_cookie_values;
};
static inline struct tcp_timewait_sock *tcp_twsk(const struct sock *sk)
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 738b65f..f9abd9b 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -30,6 +30,7 @@
#include <linux/dmaengine.h>
#include <linux/crypto.h>
#include <linux/cryptohash.h>
+#include <linux/kref.h>
#include <net/inet_connection_sock.h>
#include <net/inet_timewait_sock.h>
@@ -164,6 +165,7 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo);
#define TCPOPT_SACK 5 /* SACK Block */
#define TCPOPT_TIMESTAMP 8 /* Better RTT estimations/PAWS */
#define TCPOPT_MD5SIG 19 /* MD5 Signature (RFC2385) */
+#define TCPOPT_COOKIE 253 /* Cookie extension (experimental) */
/*
* TCP option lengths
@@ -174,6 +176,10 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo);
#define TCPOLEN_SACK_PERM 2
#define TCPOLEN_TIMESTAMP 10
#define TCPOLEN_MD5SIG 18
+#define TCPOLEN_COOKIE_BASE 2 /* Cookie-less header extension */
+#define TCPOLEN_COOKIE_PAIR 3 /* Cookie pair header extension */
+#define TCPOLEN_COOKIE_MIN (TCPOLEN_COOKIE_BASE+TCP_COOKIE_MIN)
+#define TCPOLEN_COOKIE_MAX (TCPOLEN_COOKIE_BASE+TCP_COOKIE_MAX)
/* But this is what stacks really send out. */
#define TCPOLEN_TSTAMP_ALIGNED 12
@@ -1482,6 +1488,83 @@ struct tcp_request_sock_ops {
extern int tcp_cookie_generator(u32 *bakery);
+/**
+ * struct tcp_cookie_values - each socket needs extra space for the
+ * cookies, together with (optional) space for any SYN data.
+ *
+ * A tcp_sock contains a pointer to the current value, and this is
+ * cloned to the tcp_timewait_sock.
+ *
+ * @cookie_pair: variable data from the option exchange.
+ *
+ * @cookie_desired: user specified tcpct_cookie_desired. Zero
+ * indicates default (sysctl_tcp_cookie_size).
+ * After cookie sent, remembers size of cookie.
+ * Range 0, TCP_COOKIE_MIN to TCP_COOKIE_MAX.
+ *
+ * @s_data_desired: user specified tcpct_s_data_desired. When the
+ * constant payload is specified (@s_data_constant),
+ * holds its length instead.
+ * Range 0 to TCP_MSS_DESIRED.
+ *
+ * @s_data_payload: constant data that is to be included in the
+ * payload of SYN or SYNACK segments when the
+ * cookie option is present.
+ */
+struct tcp_cookie_values {
+ struct kref kref;
+ u8 cookie_pair[TCP_COOKIE_PAIR_SIZE];
+ u8 cookie_pair_size;
+ u8 cookie_desired;
+ u16 s_data_desired:11,
+ s_data_constant:1,
+ s_data_in:1,
+ s_data_out:1,
+ s_data_unused:2;
+ u8 s_data_payload[0];
+};
+
+static inline void tcp_cookie_values_release(struct kref *kref)
+{
+ kfree(container_of(kref, struct tcp_cookie_values, kref));
+}
+
+/* The length of constant payload data. Note that s_data_desired is
+ * overloaded, depending on s_data_constant: either the length of constant
+ * data (returned here) or the limit on variable data.
+ */
+static inline int tcp_s_data_size(const struct tcp_sock *tp)
+{
+ return (tp->cookie_values != NULL && tp->cookie_values->s_data_constant)
+ ? tp->cookie_values->s_data_desired
+ : 0;
+}
+
+/**
+ * struct tcp_extend_values - tcp_ipv?.c to tcp_output.c workspace.
+ *
+ * As tcp_request_sock has already been extended in other places, the
+ * only remaining method is to pass stack values along as function
+ * parameters. These parameters are not needed after sending SYNACK.
+ *
+ * @cookie_bakery: cryptographic secret and message workspace.
+ *
+ * @cookie_plus: bytes in authenticator/cookie option, copied from
+ * struct tcp_options_received (above).
+ */
+struct tcp_extend_values {
+ struct request_values rv;
+ u32 cookie_bakery[COOKIE_WORKSPACE_WORDS];
+ u8 cookie_plus:6,
+ cookie_out_never:1,
+ cookie_in_always:1;
+};
+
+static inline struct tcp_extend_values *tcp_xv(struct request_values *rvp)
+{
+ return (struct tcp_extend_values *)rvp;
+}
+
extern void tcp_v4_init(void);
extern void tcp_init(void);
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 397ab8f..2bb7864 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1834,6 +1834,19 @@ static int tcp_v4_init_sock(struct sock *sk)
tp->af_specific = &tcp_sock_ipv4_specific;
#endif
+ /* TCP Cookie Transactions */
+ if (sysctl_tcp_cookie_size > 0) {
+ /* Default, cookies without s_data_payload. */
+ tp->cookie_values =
+ kzalloc(sizeof(*tp->cookie_values),
+ sk->sk_allocation);
+ if (tp->cookie_values != NULL)
+ kref_init(&tp->cookie_values->kref);
+ }
+ /* Presumed zeroed, in order of appearance:
+ * cookie_in_always, cookie_out_never,
+ * s_data_constant, s_data_in, s_data_out
+ */
sk->sk_sndbuf = sysctl_tcp_wmem[1];
sk->sk_rcvbuf = sysctl_tcp_rmem[1];
@@ -1887,6 +1900,13 @@ void tcp_v4_destroy_sock(struct sock *sk)
sk->sk_sndmsg_page = NULL;
}
+ /* TCP Cookie Transactions */
+ if (tp->cookie_values != NULL) {
+ kref_put(&tp->cookie_values->kref,
+ tcp_cookie_values_release);
+ tp->cookie_values = NULL;
+ }
+
percpu_counter_dec(&tcp_sockets_allocated);
}
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index 7a42990..53ef6d8 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -389,14 +389,43 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct request_sock *req,
const struct inet_request_sock *ireq = inet_rsk(req);
struct tcp_request_sock *treq = tcp_rsk(req);
struct inet_connection_sock *newicsk = inet_csk(newsk);
- struct tcp_sock *newtp;
+ struct tcp_sock *newtp = tcp_sk(newsk);
+ struct tcp_sock *oldtp = tcp_sk(sk);
+ struct tcp_cookie_values *oldcvp = oldtp->cookie_values;
+
+ /* TCP Cookie Transactions require space for the cookie pair,
+ * as it differs for each connection. There is no need to
+ * copy any s_data_payload stored at the original socket.
+ * Failure will prevent resuming the connection.
+ *
+ * Presumed copied, in order of appearance:
+ * cookie_in_always, cookie_out_never
+ */
+ if (oldcvp != NULL) {
+ struct tcp_cookie_values *newcvp =
+ kzalloc(sizeof(*newtp->cookie_values),
+ GFP_ATOMIC);
+
+ if (newcvp != NULL) {
+ kref_init(&newcvp->kref);
+ newcvp->cookie_desired =
+ oldcvp->cookie_desired;
+ newtp->cookie_values = newcvp;
+ } else {
+ /* Not Yet Implemented */
+ newtp->cookie_values = NULL;
+ }
+ }
/* Now setup tcp_sock */
- newtp = tcp_sk(newsk);
newtp->pred_flags = 0;
- newtp->rcv_wup = newtp->copied_seq = newtp->rcv_nxt = treq->rcv_isn + 1;
- newtp->snd_sml = newtp->snd_una = newtp->snd_nxt = treq->snt_isn + 1;
- newtp->snd_up = treq->snt_isn + 1;
+
+ newtp->rcv_wup = newtp->copied_seq =
+ newtp->rcv_nxt = treq->rcv_isn + 1;
+
+ newtp->snd_sml = newtp->snd_una =
+ newtp->snd_nxt = newtp->snd_up =
+ treq->snt_isn + 1 + tcp_s_data_size(oldtp);
tcp_prequeue_init(newtp);
@@ -429,8 +458,8 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct request_sock *req,
tcp_set_ca_state(newsk, TCP_CA_Open);
tcp_init_xmit_timers(newsk);
skb_queue_head_init(&newtp->out_of_order_queue);
- newtp->write_seq = treq->snt_isn + 1;
- newtp->pushed_seq = newtp->write_seq;
+ newtp->write_seq = newtp->pushed_seq =
+ treq->snt_isn + 1 + tcp_s_data_size(oldtp);
newtp->rx_opt.saw_tstamp = 0;
@@ -596,7 +625,8 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb,
* Invalid ACK: reset will be sent by listening socket
*/
if ((flg & TCP_FLAG_ACK) &&
- (TCP_SKB_CB(skb)->ack_seq != tcp_rsk(req)->snt_isn + 1))
+ (TCP_SKB_CB(skb)->ack_seq !=
+ tcp_rsk(req)->snt_isn + 1 + tcp_s_data_size(tcp_sk(sk))))
return sk;
/* Also, it would be not so bad idea to check rcv_tsecr, which
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 3e327bc..973096a 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1865,6 +1865,19 @@ static int tcp_v6_init_sock(struct sock *sk)
tp->af_specific = &tcp_sock_ipv6_specific;
#endif
+ /* TCP Cookie Transactions */
+ if (sysctl_tcp_cookie_size > 0) {
+ /* Default, cookies without s_data_payload. */
+ tp->cookie_values =
+ kzalloc(sizeof(*tp->cookie_values),
+ sk->sk_allocation);
+ if (tp->cookie_values != NULL)
+ kref_init(&tp->cookie_values->kref);
+ }
+ /* Presumed zeroed, in order of appearance:
+ * cookie_in_always, cookie_out_never,
+ * s_data_constant, s_data_in, s_data_out
+ */
sk->sk_sndbuf = sysctl_tcp_wmem[1];
sk->sk_rcvbuf = sysctl_tcp_rmem[1];
^ permalink raw reply related
* Re: [PATCH 1/3] macvlan: Reflect macvlan packets meant for other macvlan devices
From: Arnd Bergmann @ 2009-11-18 14:44 UTC (permalink / raw)
To: Eric W. Biederman
Cc: Eric Dumazet, linux-kernel, netdev, David Miller,
Stephen Hemminger, Herbert Xu, Patrick McHardy, Patrick Mullaney,
Edge Virtual Bridging, Anna Fischer, bridge, virtualization,
Jens Osterkamp, Gerhard Stenzel
In-Reply-To: <m1pr7fdhkx.fsf@fess.ebiederm.org>
On Wednesday 18 November 2009, Eric W. Biederman wrote:
> Please copy and ideally share code with the veth driver for recycling a skb.
> There are bunch of little things you have to do to get it right. As I recally
> I was missing a few details in my original patch.
Ok, thanks for the hint!
Arnd <><
^ permalink raw reply
* Re: [net-next-2.6 PATCH v6 5/7 RFC] TCPCT part 1e: implement socket option TCP_COOKIE_TRANSACTIONS
From: William Allen Simpson @ 2009-11-18 15:03 UTC (permalink / raw)
To: Linux Kernel Network Developers
In-Reply-To: <4AFCEA59.3060707@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1127 bytes --]
William Allen Simpson wrote:
> Provide per socket control of the TCP cookie option and SYN/SYNACK data.
>
> This is a straightforward re-implementation of an earlier (year-old)
> patch that no longer applies cleanly, with permission of the original
> author (Adam Langley):
>
> http://thread.gmane.org/gmane.linux.network/102586
>
> The principle difference is using a TCP option to carry the cookie nonce,
> instead of a user configured offset in the data.
>
> Allocations have been rearranged to avoid requiring GFP_ATOMIC.
>
> Requires:
> net: TCP_MSS_DEFAULT, TCP_MSS_DESIRED
> TCPCT part 1c: sysctl_tcp_cookie_size, socket option TCP_COOKIE_TRANSACTIONS
> TCPCT part 1d: define TCP cookie option, extend existing struct's
>
> Signed-off-by: William.Allen.Simpson@gmail.com
> ---
> net/ipv4/tcp.c | 133
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
> 1 files changed, 131 insertions(+), 2 deletions(-)
>
Although we've had one comment, explaining that the future documentation
will be sent to another email list, there are still no technical comments.
Same patch as before. Seeking Acks.
[-- Attachment #2: TCPCT+1e6.patch --]
[-- Type: text/plain, Size: 4406 bytes --]
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 3ae01bf..3424499 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2079,8 +2079,9 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
int val;
int err = 0;
- /* This is a string value all the others are int's */
- if (optname == TCP_CONGESTION) {
+ /* These are data/string values, all the others are ints */
+ switch (optname) {
+ case TCP_CONGESTION: {
char name[TCP_CA_NAME_MAX];
if (optlen < 1)
@@ -2097,6 +2098,93 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
release_sock(sk);
return err;
}
+ case TCP_COOKIE_TRANSACTIONS: {
+ struct tcp_cookie_transactions ctd;
+ struct tcp_cookie_values *cvp = NULL;
+
+ if (sizeof(ctd) > optlen)
+ return -EINVAL;
+ if (copy_from_user(&ctd, optval, sizeof(ctd)))
+ return -EFAULT;
+
+ if (ctd.tcpct_used > sizeof(ctd.tcpct_value)
+ || ctd.tcpct_s_data_desired > TCP_MSS_DESIRED)
+ return -EINVAL;
+
+ if (ctd.tcpct_cookie_desired == 0) {
+ /* default to global value */
+ } else if ((0x1 & ctd.tcpct_cookie_desired)
+ || ctd.tcpct_cookie_desired > TCP_COOKIE_MAX
+ || ctd.tcpct_cookie_desired < TCP_COOKIE_MIN) {
+ return -EINVAL;
+ }
+
+ if (TCP_COOKIE_OUT_NEVER & ctd.tcpct_flags) {
+ /* Supercedes all other values */
+ lock_sock(sk);
+ if (tp->cookie_values != NULL) {
+ kref_put(&tp->cookie_values->kref,
+ tcp_cookie_values_release);
+ tp->cookie_values = NULL;
+ }
+ tp->rx_opt.cookie_in_always = 0; /* false */
+ tp->rx_opt.cookie_out_never = 1; /* true */
+ release_sock(sk);
+ return err;
+ }
+
+ /* Allocate ancillary memory before locking.
+ */
+ if (ctd.tcpct_used > 0
+ || (tp->cookie_values == NULL
+ && (sysctl_tcp_cookie_size > 0
+ || ctd.tcpct_cookie_desired > 0
+ || ctd.tcpct_s_data_desired > 0))) {
+ cvp = kzalloc(sizeof(*cvp) + ctd.tcpct_used,
+ GFP_KERNEL);
+ if (cvp == NULL)
+ return -ENOMEM;
+ }
+ lock_sock(sk);
+ tp->rx_opt.cookie_in_always =
+ (TCP_COOKIE_IN_ALWAYS & ctd.tcpct_flags);
+ tp->rx_opt.cookie_out_never = 0; /* false */
+
+ if (tp->cookie_values != NULL) {
+ if (cvp != NULL) {
+ /* Changed values are recorded by a changed
+ * pointer, ensuring the cookie will differ,
+ * without separately hashing each value later.
+ */
+ kref_put(&tp->cookie_values->kref,
+ tcp_cookie_values_release);
+ kref_init(&cvp->kref);
+ tp->cookie_values = cvp;
+ } else {
+ cvp = tp->cookie_values;
+ }
+ }
+ if (cvp != NULL) {
+ cvp->cookie_desired = ctd.tcpct_cookie_desired;
+
+ if (ctd.tcpct_used > 0) {
+ memcpy(cvp->s_data_payload, ctd.tcpct_value,
+ ctd.tcpct_used);
+ cvp->s_data_desired = ctd.tcpct_used;
+ cvp->s_data_constant = 1; /* true */
+ } else {
+ /* No constant payload data. */
+ cvp->s_data_desired = ctd.tcpct_s_data_desired;
+ cvp->s_data_constant = 0; /* false */
+ }
+ }
+ release_sock(sk);
+ return err;
+ }
+ default:
+ /* fallthru */
+ break;
+ };
if (optlen < sizeof(int))
return -EINVAL;
@@ -2421,6 +2509,47 @@ static int do_tcp_getsockopt(struct sock *sk, int level,
if (copy_to_user(optval, icsk->icsk_ca_ops->name, len))
return -EFAULT;
return 0;
+
+ case TCP_COOKIE_TRANSACTIONS: {
+ struct tcp_cookie_transactions ctd;
+ struct tcp_cookie_values *cvp = tp->cookie_values;
+
+ if (get_user(len, optlen))
+ return -EFAULT;
+ if (len < sizeof(ctd))
+ return -EINVAL;
+
+ memset(&ctd, 0, sizeof(ctd));
+ ctd.tcpct_flags = (tp->rx_opt.cookie_in_always
+ ? TCP_COOKIE_IN_ALWAYS : 0)
+ + (tp->rx_opt.cookie_out_never
+ ? TCP_COOKIE_OUT_NEVER : 0);
+
+ if (cvp != NULL) {
+ ctd.tcpct_flags += (cvp->s_data_in
+ ? TCP_S_DATA_IN : 0)
+ + (cvp->s_data_out
+ ? TCP_S_DATA_OUT : 0);
+
+ ctd.tcpct_cookie_desired = cvp->cookie_desired;
+ ctd.tcpct_s_data_desired = cvp->s_data_desired;
+
+ /* Cookie(s) saved, return as nonce */
+ if (sizeof(ctd.tcpct_value) < cvp->cookie_pair_size) {
+ /* impossible? */
+ return -EINVAL;
+ }
+ memcpy(&ctd.tcpct_value[0], &cvp->cookie_pair[0],
+ cvp->cookie_pair_size);
+ ctd.tcpct_used = cvp->cookie_pair_size;
+ }
+
+ if (put_user(sizeof(ctd), optlen))
+ return -EFAULT;
+ if (copy_to_user(optval, &ctd, sizeof(ctd)))
+ return -EFAULT;
+ return 0;
+ }
default:
return -ENOPROTOOPT;
}
--
1.6.3.3
^ permalink raw reply related
* [GIT]: Networking
From: David Miller @ 2009-11-18 15:25 UTC (permalink / raw)
To: torvalds; +Cc: akpm, netdev, linux-kernel
1) Device refcount leak fixes in ROSE and DecNET from Eric Dumazet.
2) IXGBE TX hang fix from Don Skidmore.
3) CXGB3 unmaps DMA buffer too early, fix from Divy Le Ray
4) Wireless fixes via John Linville, in particular a revert of
the cfg80211 conversion of the ipw2xxx driver as it simply
broke too much and fixing it is not worth the hassle and risk
this late in the -rc series. Also revert the "fix oops on
missing firmware" change as that broke more than it fixed.
5) Fragmentation disabling busted in IPIP driver when not using
PMTU discovery, fix from Herbert Xu.
6) Fix SunGEM serdes PHY detection on Sparc.
7) IPMR leaks devices, fix from Dan Carpenter.
8) GRO can merge packets illegally in some circumstances. Fix from
Herbert Xu.
9) Locking and error handling fixes in ISDN and Cassini driver from
Jiri Slaby.
10) CQE_STATUS_EXTD_SHIFT in be2net driver is wrong, fix from Sathya Perla.
Also be2net fails to reprogram flow control properly on resume, from
Ajit Khaparde.
11) Endian fix in ems_usb from Sebastian Haas.
12) Randomized MAC address is busted in forcedeth driver, use the
standard interface we provide to do this to fix it. From
Stanislav O. Bezzubtsev.
13) Missing driver license tag in fsl_pq_mdio driver leads to taint,
from Sebastian Siewior.
14) All of bridging code assumes 6 byte addressing, like ethernet,
so make sure we don't allow configuring bridging on devices that
use something else otherwise we'll explode. Fix from Stephen
Hemminger.
15) Add some new IDs to cdc_ether, from Torgny Johansson.
16) DaVinci EMAC driver passes wrong device pointer to IRQ handler
from ->poll_controller(), from Tonyliu.
17) SCTP bug fixes pertaining to source address handling and a regression
added by the new sctp_conntectx APIs, from Vlad Yasevich.
18) CAN protocol must provide ->get_stats_size() and ->get_xstats_size()
netlink callbacks, from Wolfgang Grandegger.
19) IXGBE's ->gso_max_size setting is wrong in some circumstances. Also
TXOFF status checking is busted when DCB is enabled. Both from
Yi Zou.
20) NAT bug fix from Jozsef Kadlecsik. xt_connlimit regression fix
from Jan Engelhardt.
21) Non-linear SKBs causes crashes in multilink PPP receive, fix from
Ben McKeegan.
22) Bluetooth fixes via Marcel Holtmann.
23) Bit shift defines in ibm_newemac driver are completely wrong,
fix from Dave Mitchell.
Please pull, thanks a lot!
The following changes since commit 7c9abfb884b8737f0afdc8a88bcea77526f0da87:
Linus Torvalds (1):
Merge branch 'kvm-updates/2.6.32' of git://git.kernel.org/pub/scm/virt/kvm/kvm
are available in the git repository at:
master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6.git master
Ajit Khaparde (2):
be2net: fix to set proper flow control on resume
be2net: Bug fix to send config commands to hardware after netdev_register
Andrei Emeltchenko (1):
Bluetooth: Set general bonding security for ACL by default
Ben McKeegan (1):
ppp: fix BUG on non-linear SKB (multilink receive)
Bing Zhao (2):
Libertas: coding style cleanup in ethtool.c
Libertas: fix issues while configuring host sleep using ethtool wol
Bob Copeland (3):
ath5k: don't reset mcast filter when configuring the mode
ath5k: add LED support for HP Compaq CQ60
ath5k: add LED definition for BenQ Joybook R55v
Breno Leitao (2):
s2io: fixing a ethtool test that is broken
ixgbe: Fixing EEH handler to handle more than one error
Dan Carpenter (2):
misdn: Fix reversed 'if' in st_own_ctrl
ipmr: missing dev_put() on error path in vif_add()
Dave Mitchell (1):
ibm_newemac: Fix EMACx_TRTR[TRT] bit shifts
David S. Miller (5):
Merge branch 'master' of git://git.kernel.org/.../linville/wireless-2.6
Merge branch 'master' of git://git.kernel.org/.../holtmann/bluetooth-2.6
Revert "isdn: isdn_ppp: Use SKB list facilities instead of home-grown implementation."
Merge branch 'master' of git://git.kernel.org/.../linville/wireless-2.6
sungem: Fix Serdes detection.
Divy Le Ray (1):
cxgb3: fix premature page unmap
Don Skidmore (1):
ixgbe: fix traffic hangs on Tx with ioatdma loaded
Eric Dumazet (5):
rose: device refcount leak
decnet: netdevice refcount leak
can: should not use __dev_get_by_index() without locks
net: Fix the rollback test in dev_change_name()
vlan: Fix register_vlan_dev() error path
Felix Fietkau (1):
b43: work around a locking issue in ->set_tim()
Finn Thain (1):
macsonic: fix crash on PowerBook 520
Florian Fainelli (1):
r6040: fix version printing
Gertjan van Wingerde (1):
rt2x00: Update MAINTAINERS
Gustavo F. Padovan (2):
Bluetooth: Select Basic Mode as default for SOCK_SEQPACKET
Bluetooth: Fix regression with L2CAP configuration in Basic Mode
Herbert Xu (2):
ipip: Fix handling of DF packets when pmtudisc is OFF
gro: Fix illegal merging of trailer trash
Ilpo Järvinen (1):
tcp: provide more information on the tcp receive_queue bugs
Ivo van Doorn (1):
rt2x00: update MAINTAINERS
Jan Engelhardt (1):
netfilter: xt_connlimit: fix regression caused by zero family value
Jiri Slaby (4):
isdn: hisax: Fix lock imbalance.
isdn: eicon: Use offsetof
isdn: eicon: Return on error
NET: cassini, fix lock imbalance
Joe Perches (2):
MAINTAINERS: Add git net-next-2.6
MAINTAINERS: RFKILL - Fix pattern entry missing colon
John W. Linville (2):
Revert "ipw2200: fix oops on missing firmware"
Revert "libipw: initiate cfg80211 API conversion"
Jozsef Kadlecsik (1):
netfilter: nf_nat: fix NAT issue in 2.6.30.4+
Larry Finger (3):
rtl8187: Fix kernel oops when device is removed when LEDS enabled
rtl8187: Fix sparse warnings
p54usb: Remove DMA buffer from stack
Martin Fuzzey (1):
ssb-pcmcia: Fix 32bit register access in early bus scanning
Martin Michlmayr (1):
hisax: remove bad udelay call to fix build error on ARM
Oliver Hartkopp (1):
can: Fix driver Kconfig structure
Raimonds Cicans (1):
r8169: Fix receive buffer length when MTU is between 1515 and 1536
Roel Kluin (3):
isdn: hisax: Fix test in waitforxfw
isdn: hfc_usb: Fix read buffer overflow
mISDN: fix error return in HFCmulti_init()
Ron Mercer (2):
qlge: Fix early exit from mbox cmd complete wait.
qlge: Set PCIe reset type for EEH to fundamental.
Sathya Perla (1):
be2net: Fix CQE_STATUS_EXTD_SHIFT define
Sean Cross (1):
rt2x00: Don't queue ieee80211 work after USB removal
Sebastian Haas (1):
ems_usb: Fix byte order issues on big endian machines
Sebastian Siewior (1):
net/fsl_pq_mdio: add module license GPL
Sriram (2):
smsc911x: Fix Console Hang when bringing the interface down.
TI Davinci EMAC : Fix Console Hang when bringing the interface down
Stanislav O. Bezzubtsev (1):
forcedeth: mac address fix
Stephen Hemminger (1):
bridge: prevent bridging wrong device
Stephen Rothwell (1):
net: fix mdio section mismatch warning
Tonyliu (1):
DaVinci EMAC: correct param for ISR
Torgny Johansson (1):
cdc_ether: additional Ericsson MBM PID's to the whitelist
Uwe Kleine-König (1):
virtio_net: rename driver struct to please modpost
Vlad Yasevich (3):
sctp: Set source addresses on the association before adding transports
sctp: Fix regression introduced by new sctp_connectx api
sctp: Set socket source address when additing first transport
Wey-Yi Guy (2):
iwlwifi: Use RTS/CTS as the preferred protection mechanism for 6000 series
iwlwifi: Fix issue on file transfer stalled in HT mode
Wolfgang Grandegger (2):
can: fix WARN_ON dump in net/core/rtnetlink.c:rtmsg_ifinfo()
can: add the missing netlink get_xstats_size callback
Yi Zou (2):
ixgbe: Fix gso_max_size for 82599 when DCB is enabled
ixgbe: Fix checking TFCS register for TXOFF status when DCB is enabled
MAINTAINERS | 5 +-
drivers/isdn/hardware/eicon/maintidi.c | 5 +-
drivers/isdn/hardware/eicon/message.c | 18 +-
drivers/isdn/hardware/mISDN/hfcmulti.c | 2 +-
drivers/isdn/hisax/amd7930_fn.c | 1 +
drivers/isdn/hisax/diva.c | 2 +-
drivers/isdn/hisax/elsa_ser.c | 22 +-
drivers/isdn/hisax/hfc_usb.c | 4 +-
drivers/isdn/hisax/hscx_irq.c | 2 +-
drivers/isdn/hisax/icc.c | 1 +
drivers/isdn/i4l/isdn_ppp.c | 352 ++++++++++++-------------
drivers/isdn/mISDN/stack.c | 2 +-
drivers/net/benet/be.h | 2 +
drivers/net/benet/be_cmds.h | 2 +-
drivers/net/benet/be_ethtool.c | 8 +-
drivers/net/benet/be_main.c | 28 ++-
drivers/net/can/Kconfig | 60 +----
drivers/net/can/dev.c | 23 ++
drivers/net/can/sja1000/Kconfig | 47 ++++
drivers/net/can/usb/Kconfig | 10 +
drivers/net/can/usb/Makefile | 2 +
drivers/net/can/usb/ems_usb.c | 5 +-
drivers/net/cassini.c | 5 +-
drivers/net/cxgb3/sge.c | 4 +-
drivers/net/davinci_emac.c | 5 +-
drivers/net/forcedeth.c | 5 +-
drivers/net/fsl_pq_mdio.c | 1 +
drivers/net/ibm_newemac/emac.h | 4 +-
drivers/net/ixgbe/ixgbe_main.c | 85 ++++++-
drivers/net/macsonic.c | 117 +++++----
drivers/net/phy/mdio-gpio.c | 2 +-
drivers/net/ppp_generic.c | 11 +-
drivers/net/qlge/qlge_main.c | 2 +
drivers/net/qlge/qlge_mpi.c | 2 +-
drivers/net/r6040.c | 2 +-
drivers/net/r8169.c | 4 +-
drivers/net/s2io.c | 1 +
drivers/net/smsc911x.c | 2 +-
drivers/net/sungem.c | 10 +-
drivers/net/usb/Kconfig | 2 +-
drivers/net/usb/cdc_ether.c | 42 +++-
drivers/net/virtio_net.c | 6 +-
drivers/net/wireless/ath/ath5k/base.c | 1 -
drivers/net/wireless/ath/ath5k/led.c | 4 +
drivers/net/wireless/b43/main.c | 3 +-
drivers/net/wireless/ipw2x00/ipw2100.c | 11 +-
drivers/net/wireless/ipw2x00/ipw2200.c | 143 ++--------
drivers/net/wireless/ipw2x00/libipw.h | 9 +-
drivers/net/wireless/ipw2x00/libipw_module.c | 46 +---
drivers/net/wireless/iwlwifi/iwl-1000.c | 1 +
drivers/net/wireless/iwlwifi/iwl-6000.c | 5 +
drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 9 +
drivers/net/wireless/iwlwifi/iwl-agn.c | 10 +-
drivers/net/wireless/iwlwifi/iwl-core.h | 2 +
drivers/net/wireless/libertas/ethtool.c | 17 +-
drivers/net/wireless/p54/p54usb.c | 10 +-
drivers/net/wireless/rt2x00/rt2x00dev.c | 4 +-
drivers/net/wireless/rt2x00/rt2x00link.c | 11 +-
drivers/net/wireless/rt2x00/rt2x00usb.c | 9 +-
drivers/net/wireless/rtl818x/rtl8187_leds.c | 4 +-
drivers/net/wireless/rtl818x/rtl8187_rfkill.c | 1 +
drivers/ssb/scan.c | 6 +-
include/linux/isdn_ppp.h | 2 +-
include/net/netfilter/nf_conntrack.h | 8 +-
include/net/netfilter/nf_nat_helper.h | 4 +
include/net/sctp/structs.h | 2 +-
net/8021q/vlan.c | 7 +-
net/bluetooth/hci_conn.c | 1 +
net/bluetooth/l2cap.c | 13 +-
net/bridge/br_if.c | 6 +-
net/can/bcm.c | 19 +-
net/core/dev.c | 11 +-
net/core/skbuff.c | 3 +-
net/decnet/sysctl_net_decnet.c | 7 +-
net/ipv4/ipip.c | 32 ++-
net/ipv4/ipmr.c | 4 +-
net/ipv4/netfilter/nf_nat_core.c | 3 +
net/ipv4/netfilter/nf_nat_helper.c | 34 ++-
net/ipv4/tcp.c | 19 +-
net/netfilter/nf_conntrack_core.c | 8 +
net/netfilter/nf_conntrack_proto_tcp.c | 64 ++---
net/netfilter/xt_connlimit.c | 10 +-
net/rose/rose_route.c | 16 +-
net/sctp/associola.c | 4 +-
net/sctp/sm_statefuns.c | 15 +-
net/sctp/socket.c | 40 ++-
net/sctp/transport.c | 3 +-
87 files changed, 834 insertions(+), 722 deletions(-)
create mode 100644 drivers/net/can/sja1000/Kconfig
create mode 100644 drivers/net/can/usb/Kconfig
^ permalink raw reply
* Re: [net-next-2.6 PATCH v2] allow access to sysfs_groups member
From: Kurt Van Dijck @ 2009-11-18 15:43 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev, David Miller
In-Reply-To: <20091116084612.3654bdd1@nehalam>
On Mon, Nov 16, 2009 at 08:46:12AM -0800, Stephen Hemminger wrote:
>
> Okay by me.
>
Sorry for asking.
I'm not very experienced yet with git etc.
Is there anything I'm supposed to do/deliver to get the patch committed?
kind regards,
Kurt
^ permalink raw reply
* Re: [net-next-2.6 PATCH v2] allow access to sysfs_groups member
From: David Miller @ 2009-11-18 16:08 UTC (permalink / raw)
To: kurt.van.dijck; +Cc: shemminger, netdev
In-Reply-To: <20091118154313.GE325@e-circ.dyndns.org>
From: Kurt Van Dijck <kurt.van.dijck@eia.be>
Date: Wed, 18 Nov 2009 16:43:13 +0100
> Is there anything I'm supposed to do/deliver to get the patch committed?
Please just resubmit it fully with full changelog and signoffs.
Thanks.
^ permalink raw reply
* Re: [ewg] [PATCHv6 0/10] RDMAoE support
From: Or Gerlitz @ 2009-11-18 16:34 UTC (permalink / raw)
To: Eli Cohen; +Cc: Roland Dreier, Linux RDMA list, netdev, ewg
In-Reply-To: <20091116155302.GA2463@mtls03>
Eli Cohen wrote:
> This new series reflects changes based on feedback from the community on the previous set of patches, and is tagged v6. Previous series were posted to the openfabrics general list only.
>
> Changes from v5:
> 1. Bug fixes.
How do you expect a reviewer to learn what were the bugs and what are
the fixes and if there are bugs that are known and weren't fixed yet? is
one expected to do a diff between patches? where is the listing of
changes from vX for X=1,2,3,4?
Or.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [net-next-2.6 PATCH v2] allow access to sysfs_groups member
From: Kurt Van Dijck @ 2009-11-18 16:41 UTC (permalink / raw)
To: David Miller; +Cc: shemminger, netdev
In-Reply-To: <20091118.080849.196755366.davem@davemloft.net>
This patch allows adding sysfs attribute groups during netdevice registration.
The idea is that before the register_netdev call, several calls to
netdev_sysfs_add_group can be done. These attributes are accessible (by
udev) during the uevent.
Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
---
include/linux/netdevice.h | 2 ++
net/core/net-sysfs.c | 29 ++++++++++++++++++++++++-----
2 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 8380009..ebfc789 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1115,6 +1115,8 @@ extern int dev_open(struct net_device *dev);
extern int dev_close(struct net_device *dev);
extern void dev_disable_lro(struct net_device *dev);
extern int dev_queue_xmit(struct sk_buff *skb);
+extern int netdev_sysfs_add_group(struct net_device *net,
+ const struct attribute_group *grp);
extern int register_netdevice(struct net_device *dev);
extern void unregister_netdevice(struct net_device *dev);
extern void free_netdev(struct net_device *dev);
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 753c420..6451e9a 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -527,27 +527,46 @@ void netdev_unregister_kobject(struct net_device * net)
device_del(dev);
}
+/* Add a sysfs group to the netdev groups */
+int netdev_sysfs_add_group(struct net_device *net,
+ const struct attribute_group *grp)
+{
+ struct attribute_group **groups = net->sysfs_groups;
+ struct attribute_group **end;
+
+ BUG_ON(net->reg_state >= NETREG_REGISTERED);
+ /* end pointer, with room for null terminator */
+ end = &net->sysfs_groups[ARRAY_SIZE(net->sysfs_groups) - 1];
+ for (; groups < end; ++groups) {
+ if (!*groups) {
+ *groups = grp;
+ return 0;
+ }
+ }
+ return -ENOSPC;
+}
+EXPORT_SYMBOL_GPL(netdev_sysfs_add_group);
+
/* Create sysfs entries for network device. */
int netdev_register_kobject(struct net_device *net)
{
struct device *dev = &(net->dev);
- const struct attribute_group **groups = net->sysfs_groups;
dev->class = &net_class;
dev->platform_data = net;
- dev->groups = groups;
+ dev->groups = net->sysfs_groups;
dev_set_name(dev, "%s", net->name);
#ifdef CONFIG_SYSFS
- *groups++ = &netstat_group;
+ netdev_sysfs_add_group(net, &netstat_group);
#ifdef CONFIG_WIRELESS_EXT_SYSFS
if (net->ieee80211_ptr)
- *groups++ = &wireless_group;
+ netdev_sysfs_add_group(net, &wireless_group);
#ifdef CONFIG_WIRELESS_EXT
else if (net->wireless_handlers)
- *groups++ = &wireless_group;
+ netdev_sysfs_add_group(net, &wireless_group);
#endif
#endif
#endif /* CONFIG_SYSFS */
^ permalink raw reply related
* Re: [PATCH 04/10] AOE: use rcu to find network device
From: Ed Cashin @ 2009-11-18 16:49 UTC (permalink / raw)
To: shemminger, karaluh, ecashin, roel.kluin, harvey.harrison,
bzolnier, netdev
In-Reply-To: <20091110155316.2c3d7b6e@nehalam>
On Tue Nov 10 18:53:43 EST 2009, shemminger@vyatta.com wrote:
...
> --- a/drivers/block/aoe/aoecmd.c 2009-11-10 15:13:25.673859220 -0800
> +++ b/drivers/block/aoe/aoecmd.c 2009-11-10 15:49:20.009047132 -0800
...
> @@ -424,12 +426,29 @@ static void
> ejectif(struct aoetgt *t, struct aoeif *ifp)
> {
> struct aoeif *e;
> + struct net_device *nd;
> ulong n;
>
> e = t->ifs + NAOEIFS - 1;
> + nd = e->nd;
> n = (e - ifp) * sizeof *ifp;
> memmove(ifp, ifp+1, n);
> e->nd = NULL;
> + dev_put(nd);
> +}
I didn't notice this before, but e->nd will be the net_device pointer
from the last ifp in the allocated array, whether it's NULL or not,
and usually won't be ifp->nd, the one we need to give to dev_put. I
think that's why I see an oops when testing the version of the patch
that I sent last. The test is doing rmmod on the interface that's
being used to create an ext2 fs on an AoE target.
I'll use ifp->nd instead of e->nd and test again tomorrow. I have to
step away from the computer today.
--
Ed
^ permalink raw reply
* [PATCH] veth: Fix veth_get_stats()
From: Eric Dumazet @ 2009-11-18 17:09 UTC (permalink / raw)
To: David S. Miller; +Cc: Linux Netdev List
veth_get_stats() can be called in parallel on several cpus.
It's better to not reset dev->stats as it could give wrong result on
one cpu. Use temporary variables, then store the final results.
Also, we should loop on every possible cpus, not only online cpus,
or cpu hotplug can suddenly give wrong veth stats.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
drivers/net/veth.c | 35 ++++++++++++++++-------------------
1 files changed, 16 insertions(+), 19 deletions(-)
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index ade5b34..52af501 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -210,32 +210,29 @@ rx_drop:
static struct net_device_stats *veth_get_stats(struct net_device *dev)
{
struct veth_priv *priv;
- struct net_device_stats *dev_stats;
int cpu;
- struct veth_net_stats *stats;
+ struct veth_net_stats *stats, total = {0};
priv = netdev_priv(dev);
- dev_stats = &dev->stats;
-
- dev_stats->rx_packets = 0;
- dev_stats->tx_packets = 0;
- dev_stats->rx_bytes = 0;
- dev_stats->tx_bytes = 0;
- dev_stats->tx_dropped = 0;
- dev_stats->rx_dropped = 0;
- for_each_online_cpu(cpu) {
+ for_each_possible_cpu(cpu) {
stats = per_cpu_ptr(priv->stats, cpu);
- dev_stats->rx_packets += stats->rx_packets;
- dev_stats->tx_packets += stats->tx_packets;
- dev_stats->rx_bytes += stats->rx_bytes;
- dev_stats->tx_bytes += stats->tx_bytes;
- dev_stats->tx_dropped += stats->tx_dropped;
- dev_stats->rx_dropped += stats->rx_dropped;
+ total.rx_packets += stats->rx_packets;
+ total.tx_packets += stats->tx_packets;
+ total.rx_bytes += stats->rx_bytes;
+ total.tx_bytes += stats->tx_bytes;
+ total.tx_dropped += stats->tx_dropped;
+ total.rx_dropped += stats->rx_dropped;
}
-
- return dev_stats;
+ dev->stats.rx_packets = total.rx_packets;
+ dev->stats.tx_packets = total.tx_packets;
+ dev->stats.rx_bytes = total.rx_bytes;
+ dev->stats.tx_bytes = total.tx_bytes;
+ dev->stats.tx_dropped = total.tx_dropped;
+ dev->stats.rx_dropped = total.rx_dropped;
+
+ return &dev->stats;
}
static int veth_open(struct net_device *dev)
^ permalink raw reply related
* Re: [PATCH 0/3] TI EMAC driver : Make driver re-usable on non-davinci platforms.
From: Kevin Hilman @ 2009-11-18 17:53 UTC (permalink / raw)
To: Sriramakrishnan; +Cc: netdev, davinci-linux-open-source
In-Reply-To: <1258537328-31527-1-git-send-email-srk@ti.com>
Sriramakrishnan <srk@ti.com> writes:
> The Davinci EMAC peripheral is also available on other TI platforms -
> notably TI AM3517 SoC. The following series of patches modify the driver
> suitably to make it platform agnostic.
>
> Sriramakrishnan (3):
> TI Davinci EMAC : Re-use driver for other platforms.
> TI Davinci EMAC : add platform specific interrupt enable/disable
> logic.
> TI Davinci EMAC : Abstract Buffer address translation logic.
>
As David proposed, this should go upstream via the ARM/DaVinci route.
Can you please re-submit against current DaVinci git? This series
doesn't apply there currently.
Kevin
^ permalink raw reply
* Re: [net-next-2.6 PATCH v2] allow access to sysfs_groups member
From: David Miller @ 2009-11-18 17:57 UTC (permalink / raw)
To: kurt.van.dijck; +Cc: shemminger, netdev
In-Reply-To: <20091118164126.GF325@e-circ.dyndns.org>
From: Kurt Van Dijck <kurt.van.dijck@eia.be>
Date: Wed, 18 Nov 2009 17:41:26 +0100
> This patch allows adding sysfs attribute groups during netdevice registration.
> The idea is that before the register_netdev call, several calls to
> netdev_sysfs_add_group can be done. These attributes are accessible (by
> udev) during the uevent.
>
> Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
> Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Patch is corrupted by your email client. Tab characters have
been turned into spaces, etc.
Please fix this up and resubmit.
Thanks.
^ permalink raw reply
* Re: Patches for hso driver
From: David Miller @ 2009-11-18 18:01 UTC (permalink / raw)
To: mschiller; +Cc: netdev
In-Reply-To: <DDA9430807DF40968BE983465235D580@mschille2>
From: "Martin Schiller" <mschiller@tdt.de>
Date: Wed, 18 Nov 2009 08:35:30 +0100
> Have a look at the "hso-memleak.patch" file to see what I mean.
Hmmm...
Please make sure this all works properly, considering
the games that hso_kick_transmit() plays wherein it
swaps ->tx_data and ->tx_buffer every packet send.
Also, please submit your patches sperately and numbered
with changelog and signoffs specific to each change as
described in linux/Documentation/SubmittingPatches
Thanks.
^ permalink raw reply
* Re: [RFC PATCH iproute2] ip: Add support for setting MAC and VLAN on hardware queues
From: David Miller @ 2009-11-18 18:07 UTC (permalink / raw)
To: shemminger; +Cc: jeffrey.t.kirsher, netdev, gospo, mitch.a.williams
In-Reply-To: <20091117140641.7f8c8ac0@nehalam>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Tue, 17 Nov 2009 14:06:41 -0800
> On Tue, 17 Nov 2009 13:55:07 -0800
> Jeff Kirsher <jeffrey.t.kirsher@intel.com> wrote:
>
>> From: Williams, Mitch A <mitch.a.williams@intel.com>
>>
>> This patch adds support to the "ip" tool for setting the MAC address and
>> VLAN filter for hardware device queues. This is most immediately useful for
>> SR-IOV; for VF devices to be usable in the real world, the hypervisor or VM
>> manager must be able to set these parameters before the VF device is
>> assigned to any VM.
>>
>> Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
>> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>
> Is there anything to avoid prevent this from being misused by users who
> are doing multiqueue. Maybe we need equivalent of "mounted" flag that block
> devices have?
It's a privileged config operation as far as I can tell.
Given that, what could we possibly need to protect?
This stuff looks basically fine to me.
^ permalink raw reply
* Re: [RFC] [PATCH net-next] Phonet: convert devices list to RCU
From: David Miller @ 2009-11-18 18:08 UTC (permalink / raw)
To: remi; +Cc: netdev, remi.denis-courmont
In-Reply-To: <1258462956-31549-1-git-send-email-remi@remlab.net>
From: Rémi Denis-Courmont <remi@remlab.net>
Date: Tue, 17 Nov 2009 15:02:36 +0200
> From: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
>
> Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Looks good, applied, thanks.
^ permalink raw reply
* Re: [net-next-2.6 PATCH 2/3] ixgbe: Set MSI-X vectors to NOBALANCING and set affinity
From: David Miller @ 2009-11-18 18:10 UTC (permalink / raw)
To: peter.p.waskiewicz.jr; +Cc: jeffrey.t.kirsher, gospo, netdev
In-Reply-To: <F86E8680A7D9D74A99DC6345E35A69293E3D4171@orsmsx503.amr.corp.intel.com>
From: "Waskiewicz Jr, Peter P" <peter.p.waskiewicz.jr@intel.com>
Date: Thu, 12 Nov 2009 11:12:22 -0800
> Jesse Brandeburg and I talked with Arjan yesterday regarding these patches.
Thanks for the update.
> We also discussed the need for irqbalance to distinguish between Rx
> and Tx queue vectors. Right now, irqbalance can identify an
> interrupt belong to an Ethernet device, but it stops there. It
> needs to also distinguish the directional vectors, and make sure to
> balance the right queue vector with its paired queue (i.e. make sure
> Tx queue 0's vector lines up with Rx queue 0's vector).
Why don't you just simply use the same MSI-X vector for both TX
queue 0 and RX queue 0, can't your hardware do that?
That's what I plan on doing in the NIU driver soon.
^ permalink raw reply
* [PATCH 2/16] drivers/net/can: remove exceptional & on function name
From: Julia Lawall @ 2009-11-18 18:20 UTC (permalink / raw)
To: Urs Thuermann, Oliver Hartkopp, netdev, arnd, joe, linux-kernel,
ker
From: Julia Lawall <julia@diku.dk>
In this file, function names are otherwise used as pointers without &.
A simplified version of the semantic patch that makes this change is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@r@
identifier f;
@@
f(...) { ... }
@@
identifier r.f;
@@
- &f
+ f
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
---
drivers/net/can/sja1000/sja1000.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/can/sja1000/sja1000.c b/drivers/net/can/sja1000/sja1000.c
index 782a47f..b4ba88a 100644
--- a/drivers/net/can/sja1000/sja1000.c
+++ b/drivers/net/can/sja1000/sja1000.c
@@ -516,7 +516,7 @@ static int sja1000_open(struct net_device *dev)
/* register interrupt handler, if not done by the device driver */
if (!(priv->flags & SJA1000_CUSTOM_IRQ_HANDLER)) {
- err = request_irq(dev->irq, &sja1000_interrupt, priv->irq_flags,
+ err = request_irq(dev->irq, sja1000_interrupt, priv->irq_flags,
dev->name, (void *)dev);
if (err) {
close_candev(dev);
^ 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