Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH] ibm_newemac: Fix EMACx_TRTR[TRT] bit shifts
From: Stefan Roese @ 2009-11-18 10:07 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: netdev, Dave Mitchell, linuxppc-dev
In-Reply-To: <1258505815-31261-1-git-send-email-dmitchell@appliedmicro.com>

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.

Cheers,
Stefan

^ permalink raw reply

* Re: [RFC v2] mac80211: disallow bridging managed/adhoc interfaces
From: Johannes Berg @ 2009-11-18 10:52 UTC (permalink / raw)
  To: John W. Linville
  Cc: Stefan Monnier, linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20091118025920.GA4588-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 627 bytes --]

On Tue, 2009-11-17 at 21:59 -0500, John W. Linville wrote:

> > As someone who's been bitten by this, I fully support this change.
> > Still, it makes me wonder: my broadcom-based home-router using the wl.o
> > driver can be set in "client bridge" mode.  How does it work?
> 
> If I'm not mistaken, that has a bunch of code embedded in it that
> among other things can do a layer-2 version of NAT to rewrite the
> MAC adresses for frames on the air.

Yeah, that's how it works. You can probably achieve the same effect with
the ebtable_nat module in ebtables but I've never even attempted to try
that.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply

* Re: [PATCH 2/7] bnx2x: Refactor MAC address setup code.
From: Stanislaw Gruszka @ 2009-11-18 11:06 UTC (permalink / raw)
  To: Michael Chan; +Cc: davem, netdev, michaelc, shmulikr, eilong
In-Reply-To: <1255218419-17320-2-git-send-email-mchan@broadcom.com>

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

^ permalink raw reply

* Re: [net-next-2.6 PATCH] net: device name allocation cleanups
From: Octavian Purdila @ 2009-11-18 12:36 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev
In-Reply-To: <20091117164633.49e5fa44@nehalam>

On Wednesday 18 November 2009 02:46:33 you wrote:
> 
> Flatten this logic out.
> 
>         if (fmt && strchr(name, '%'))
> 		return __dev_alloc_name(net, name, buf);
> 	else if (__dev_get_by_name(net, name))
> 		return -EEXIST;
> 	else if (buf != name)
> 		strlcpy(buf, name, IFNAMSIZ);
> 
> 	return 0;
> 

Thanks for your help ! Here is a new version which addresses the spotted issues:

[net-next-2.6 PATCH] net: device name allocation cleanups

Signed-off-by: Octavian Purdila <opurdila@ixiacom.com>
---
 net/core/dev.c |   69 +++++++++++++++++++------------------------------------
 1 files changed, 24 insertions(+), 45 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 4b24d79..f684ff8 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -893,7 +893,8 @@ static int __dev_alloc_name(struct net *net, const char *name, char *buf)
 		free_page((unsigned long) inuse);
 	}
 
-	snprintf(buf, IFNAMSIZ, name, i);
+	if (buf != name)
+		snprintf(buf, IFNAMSIZ, name, i);
 	if (!__dev_get_by_name(net, buf))
 		return i;
 
@@ -933,6 +934,21 @@ int dev_alloc_name(struct net_device *dev, const char *name)
 }
 EXPORT_SYMBOL(dev_alloc_name);
 
+static int dev_get_valid_name(struct net *net, const char *name, char *buf,
+			      bool fmt)
+{
+	if (!dev_valid_name(name))
+		return -EINVAL;
+
+	if (fmt && strchr(name, '%'))
+		return __dev_alloc_name(net, name, buf);
+	else if (__dev_get_by_name(net, name))
+		return -EEXIST;
+	else if (buf != name)
+		strlcpy(buf, name, IFNAMSIZ);
+
+	return 0;
+}
 
 /**
  *	dev_change_name - change name of a device
@@ -956,22 +972,14 @@ int dev_change_name(struct net_device *dev, const char *newname)
 	if (dev->flags & IFF_UP)
 		return -EBUSY;
 
-	if (!dev_valid_name(newname))
-		return -EINVAL;
-
 	if (strncmp(newname, dev->name, IFNAMSIZ) == 0)
 		return 0;
 
 	memcpy(oldname, dev->name, IFNAMSIZ);
 
-	if (strchr(newname, '%')) {
-		err = dev_alloc_name(dev, newname);
-		if (err < 0)
-			return err;
-	} else if (__dev_get_by_name(net, newname))
-		return -EEXIST;
-	else
-		strlcpy(dev->name, newname, IFNAMSIZ);
+	err = dev_get_valid_name(net, newname, dev->name, 1);
+	if (err < 0)
+		return err;
 
 rollback:
 	/* For now only devices in the initial network namespace
@@ -4864,8 +4872,6 @@ EXPORT_SYMBOL(netdev_fix_features);
 
 int register_netdevice(struct net_device *dev)
 {
-	struct hlist_head *head;
-	struct hlist_node *p;
 	int ret;
 	struct net *net = dev_net(dev);
 
@@ -4894,26 +4900,14 @@ int register_netdevice(struct net_device *dev)
 		}
 	}
 
-	if (!dev_valid_name(dev->name)) {
-		ret = -EINVAL;
+	ret = dev_get_valid_name(net, dev->name, dev->name, 0);
+	if (ret)
 		goto err_uninit;
-	}
 
 	dev->ifindex = dev_new_index(net);
 	if (dev->iflink == -1)
 		dev->iflink = dev->ifindex;
 
-	/* Check for existence of name */
-	head = dev_name_hash(net, dev->name);
-	hlist_for_each(p, head) {
-		struct net_device *d
-			= hlist_entry(p, struct net_device, name_hlist);
-		if (!strncmp(d->name, dev->name, IFNAMSIZ)) {
-			ret = -EEXIST;
-			goto err_uninit;
-		}
-	}
-
 	/* Fix illegal checksum combinations */
 	if ((dev->features & NETIF_F_HW_CSUM) &&
 	    (dev->features & (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))) {
@@ -5422,8 +5416,6 @@ EXPORT_SYMBOL(unregister_netdev);
 
 int dev_change_net_namespace(struct net_device *dev, struct net *net, const char *pat)
 {
-	char buf[IFNAMSIZ];
-	const char *destname;
 	int err;
 
 	ASSERT_RTNL();
@@ -5456,20 +5448,11 @@ int dev_change_net_namespace(struct net_device *dev, struct net *net, const char
 	 * we can use it in the destination network namespace.
 	 */
 	err = -EEXIST;
-	destname = dev->name;
-	if (__dev_get_by_name(net, destname)) {
+	if (__dev_get_by_name(net, dev->name)) {
 		/* We get here if we can't use the current device name */
 		if (!pat)
 			goto out;
-		if (!dev_valid_name(pat))
-			goto out;
-		if (strchr(pat, '%')) {
-			if (__dev_alloc_name(net, pat, buf) < 0)
-				goto out;
-			destname = buf;
-		} else
-			destname = pat;
-		if (__dev_get_by_name(net, destname))
+		if (dev_get_valid_name(net, pat, dev->name, 1))
 			goto out;
 	}
 
@@ -5505,10 +5488,6 @@ int dev_change_net_namespace(struct net_device *dev, struct net *net, const char
 	/* Actually switch the network namespace */
 	dev_net_set(dev, net);
 
-	/* Assign the new device name */
-	if (destname != dev->name)
-		strcpy(dev->name, destname);
-
 	/* If there is an ifindex conflict assign a new one */
 	if (__dev_get_by_index(net, dev->ifindex)) {
 		int iflink = (dev->iflink == dev->ifindex);
-- 
1.5.6.5




^ permalink raw reply related

* Re: [PATCH 1/2] net: introduce NETDEV_UNREGISTER_PERNET
From: David Miller @ 2009-11-18 13:04 UTC (permalink / raw)
  To: opurdila; +Cc: netdev, eric.dumazet
In-Reply-To: <200911170149.35240.opurdila@ixiacom.com>

From: Octavian Purdila <opurdila@ixiacom.com>
Date: Tue, 17 Nov 2009 01:49:35 +0200

> This new event is called once for each unique net namespace in batched
> unregister operations (with the argument set to a random device from
> that namespace) and once per device in non-batched unregister
> operations.
> 
> It allows us to factorize some device unregister work such as clearing the
> routing cache.
> 
> Signed-off-by: Octavian Purdila <opurdila@ixiacom.com>

Applied to net-next-2.6

^ permalink raw reply

* Re: [PATCH 2/2] ipv4: factorize cache clearing for batched unregister operations
From: David Miller @ 2009-11-18 13:04 UTC (permalink / raw)
  To: opurdila; +Cc: netdev, eric.dumazet
In-Reply-To: <200911170149.50011.opurdila@ixiacom.com>

From: Octavian Purdila <opurdila@ixiacom.com>
Date: Tue, 17 Nov 2009 01:49:49 +0200

> Signed-off-by: Octavian Purdila <opurdila@ixiacom.com>

Applied to net-next-2.6

^ permalink raw reply

* Re: PATCH net-next-2.6] linkwatch: linkwatch_forget_dev() to speedup device dismantle
From: David Miller @ 2009-11-18 13:05 UTC (permalink / raw)
  To: eric.dumazet; +Cc: herbert, shemminger, netdev
In-Reply-To: <4B02C859.6020100@gmail.com>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 17 Nov 2009 16:59:21 +0100

> Herbert Xu a écrit :
>> On Tue, Nov 17, 2009 at 04:26:04AM -0800, David Miller wrote:
>>> Really, the link watch stuff is just due for a redesign.  I don't
>>> think a simple hack is going to cut it this time, sorry Eric :-)
>> 
>> I have no objections against any redesigns, but since the only
>> caller of linkwatch_forget_dev runs in process context with the
>> RTNL, it could also legally emit those events.
> 
> Thanks guys, here an updated version then, before linkwatch surgery ?

Sure, applied to net-next-2.6, thanks.

^ permalink raw reply

* Re: [net-next] bnx2x: Don't set netdev->trans_start
From: David Miller @ 2009-11-18 13:06 UTC (permalink / raw)
  To: vladz; +Cc: netdev
In-Reply-To: <1258474595.32030.1.camel@lb-tlvb-vladz.il.broadcom.com>

From: "Vladislav Zolotarov" <vladz@broadcom.com>
Date: Tue, 17 Nov 2009 18:16:35 +0200

> Setting dev->trans_start caused spurious watchdog warnings.
> 
> Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
> Signed-off-by: Eilon Greenstein <eilong@broadcom.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next-2.6] can: fix setting mcp251x bit timing on open
From: David Miller @ 2009-11-18 13:06 UTC (permalink / raw)
  To: wg; +Cc: chripell, socketcan-core, netdev, pthomas8589
In-Reply-To: <4B02CDFA.6040700@grandegger.com>

From: Wolfgang Grandegger <wg@grandegger.com>
Date: Tue, 17 Nov 2009 17:23:22 +0100

> Christian Pellegrin wrote:
>> Signed-off-by: Christian Pellegrin <chripell@fsfe.org>
> 
> Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next-2.6] netns: net_identifiers should be read_mostly
From: David Miller @ 2009-11-18 13:07 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev
In-Reply-To: <4B030AC9.3050709@gmail.com>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 17 Nov 2009 21:42:49 +0100

> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>

Applied.

^ permalink raw reply

* Re: [net-next PATCH 1/1] qlge: Bonding fix for mode 6.
From: David Miller @ 2009-11-18 13:07 UTC (permalink / raw)
  To: ron.mercer; +Cc: netdev
In-Reply-To: <1258492240-24554-1-git-send-email-ron.mercer@qlogic.com>

From: Ron Mercer <ron.mercer@qlogic.com>
Date: Tue, 17 Nov 2009 13:10:40 -0800

> Allow MAC address to be changed even if device is not up.
> 
> Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>

Applied.

^ permalink raw reply

* Re: [patch 1/1] drivers/atm/solos-pci.c: fix warning/bug, clean up code
From: David Miller @ 2009-11-18 13:07 UTC (permalink / raw)
  To: david.woodhouse; +Cc: akpm, netdev, chas, nathan
In-Reply-To: <1258498555.6132.71.camel@macbook.infradead.org>

From: David Woodhouse <david.woodhouse@intel.com>
Date: Tue, 17 Nov 2009 22:55:55 +0000

> On Tue, 2009-11-17 at 14:46 -0800, akpm@linux-foundation.org wrote:
>> From: Andrew Morton <akpm@linux-foundation.org>
>> 
>> drivers/atm/solos-pci.c: In function 'flash_upgrade':
>> drivers/atm/solos-pci.c:528: warning: 'fw_name' may be used uninitialized in this function
>> 
>> Cc: Chas Williams <chas@cmf.nrl.navy.mil>
>> Cc: Nathan Williams <nathan@traverse.com.au>
>> Cc: David S. Miller <davem@davemloft.net>
>> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> 
> Acked-By: David Woodhouse <David.Woodhouse@intel.com>

Applied to net-next-2.6

^ permalink raw reply

* Re: [net-next-2.6 PATCH] net: device name allocation cleanups
From: David Miller @ 2009-11-18 13:07 UTC (permalink / raw)
  To: opurdila; +Cc: shemminger, netdev
In-Reply-To: <200911181436.59261.opurdila@ixiacom.com>

From: Octavian Purdila <opurdila@ixiacom.com>
Date: Wed, 18 Nov 2009 14:36:59 +0200

> Thanks for your help ! Here is a new version which addresses the spotted issues:
> 
> [net-next-2.6 PATCH] net: device name allocation cleanups
> 
> Signed-off-by: Octavian Purdila <opurdila@ixiacom.com>

Applied, thanks.

^ permalink raw reply

* 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


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox