* [PATCH RESEND net-next 2/3] net: huawei_cdc_ncm: Introduce the
From: Enrico Mioso @ 2013-08-20 14:50 UTC (permalink / raw)
To: netdev; +Cc: Enrico Mioso
In-Reply-To: <1377010256-19063-1-git-send-email-mrkiko.rs@gmail.com>
huawei_cdc_ncm driver
This driver supports devices using the NCM protocol as an encapsulation layer
for other protocols, like the E3131 Huawei 3G modem. This driver was heavily inspired by the qmi_wwan approach & code model.
Suggested-by: Bjorn Mork <bjorn@mork.no>
Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>
---
drivers/net/usb/Kconfig | 11 +++++++++++
drivers/net/usb/Makefile | 1 +
2 files changed, 12 insertions(+)
diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig
index d84bfd4..6e56751 100644
--- a/drivers/net/usb/Kconfig
+++ b/drivers/net/usb/Kconfig
@@ -242,6 +242,17 @@ config USB_NET_CDC_NCM
* ST-Ericsson M343 HSPA Mobile Broadband Modem (reference design)
* Ericsson F5521gw Mobile Broadband Module
+config USB_NET_HUAWEI_CDC_NCM
+ tristate "Huawei-style CDC NCM support"
+ depends on USB_USBNET
+ select USB_WDM
+ select USB_NET_CDC_NCM
+ help
+ This driver aims to support huawei-style NCM devices, that use ncm as a
+ transport for other protocols.
+ To compile this driver as a module, choose M here: the module will be
+ called huawei_cdc_ncm.
+
config USB_NET_CDC_MBIM
tristate "CDC MBIM support"
depends on USB_USBNET
diff --git a/drivers/net/usb/Makefile b/drivers/net/usb/Makefile
index e817178..fd0e6a7 100644
--- a/drivers/net/usb/Makefile
+++ b/drivers/net/usb/Makefile
@@ -31,6 +31,7 @@ obj-$(CONFIG_USB_IPHETH) += ipheth.o
obj-$(CONFIG_USB_SIERRA_NET) += sierra_net.o
obj-$(CONFIG_USB_NET_CX82310_ETH) += cx82310_eth.o
obj-$(CONFIG_USB_NET_CDC_NCM) += cdc_ncm.o
+obj-$(CONFIG_USB_NET_HUAWEI_CDC_NCM) += huawei_cdc_ncm.o
obj-$(CONFIG_USB_VL600) += lg-vl600.o
obj-$(CONFIG_USB_NET_QMI_WWAN) += qmi_wwan.o
obj-$(CONFIG_USB_NET_CDC_MBIM) += cdc_mbim.o
--
1.7.10.4
^ permalink raw reply related
* [PATCH RESEND net-next 1/3] net: cdc_ncm: Export cdc_ncm_{tx,rx}_fixup functions for re-use
From: Enrico Mioso @ 2013-08-20 14:50 UTC (permalink / raw)
To: netdev; +Cc: Enrico Mioso
In-Reply-To: <1377010256-19063-1-git-send-email-mrkiko.rs@gmail.com>
Some drivers implementing NCM-like protocols, may re-use those functions, as is
the case in the huawei_cdc_ncm driver.
Export them via EXPORT_SYMBOL_GPL, in accordance with how other functions have
been exported.
Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>
---
drivers/net/usb/cdc_ncm.c | 6 ++++--
include/linux/usb/cdc_ncm.h | 3 +++
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c
index 43afde8..62686be 100644
--- a/drivers/net/usb/cdc_ncm.c
+++ b/drivers/net/usb/cdc_ncm.c
@@ -858,7 +858,7 @@ static void cdc_ncm_txpath_bh(unsigned long param)
}
}
-static struct sk_buff *
+struct sk_buff *
cdc_ncm_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags)
{
struct sk_buff *skb_out;
@@ -885,6 +885,7 @@ error:
return NULL;
}
+EXPORT_SYMBOL_GPL(cdc_ncm_tx_fixup);
/* verify NTB header and return offset of first NDP, or negative error */
int cdc_ncm_rx_verify_nth16(struct cdc_ncm_ctx *ctx, struct sk_buff *skb_in)
@@ -965,7 +966,7 @@ error:
}
EXPORT_SYMBOL_GPL(cdc_ncm_rx_verify_ndp16);
-static int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in)
+int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in)
{
struct sk_buff *skb;
struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0];
@@ -1040,6 +1041,7 @@ err_ndp:
error:
return 0;
}
+EXPORT_SYMBOL_GPL(cdc_ncm_rx_fixup);
static void
cdc_ncm_speed_change(struct cdc_ncm_ctx *ctx,
diff --git a/include/linux/usb/cdc_ncm.h b/include/linux/usb/cdc_ncm.h
index cc25b70..163244b 100644
--- a/include/linux/usb/cdc_ncm.h
+++ b/include/linux/usb/cdc_ncm.h
@@ -133,3 +133,6 @@ extern void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf);
extern struct sk_buff *cdc_ncm_fill_tx_frame(struct cdc_ncm_ctx *ctx, struct sk_buff *skb, __le32 sign);
extern int cdc_ncm_rx_verify_nth16(struct cdc_ncm_ctx *ctx, struct sk_buff *skb_in);
extern int cdc_ncm_rx_verify_ndp16(struct sk_buff *skb_in, int ndpoffset);
+struct sk_buff *
+cdc_ncm_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags);
+int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in);
--
1.7.10.4
^ permalink raw reply related
* [PATCH RESEND net-next 0/3] huawei_cdc_ncm introduction
From: Enrico Mioso @ 2013-08-20 14:50 UTC (permalink / raw)
To: netdev; +Cc: Enrico Mioso
These patches are all related to the new huawei_cdc_ncm driver, supporting
devices that use the NCM protocol as a transport layer for other protocols.
this is the case of the Huawei E3131 3G modem.
Thanks should go to bjorn and others who helped me with patience.
Enrico Mioso (3):
net: cdc_ncm: Export cdc_ncm_{tx,rx}_fixup functions for re-use
net: huawei_cdc_ncm: Introduce the
net: cdc_ncm: remove non-standard NCM device IDs
drivers/net/usb/Kconfig | 11 +++++++++++
drivers/net/usb/Makefile | 1 +
drivers/net/usb/cdc_ncm.c | 17 ++++-------------
include/linux/usb/cdc_ncm.h | 3 +++
4 files changed, 19 insertions(+), 13 deletions(-)
--
1.7.10.4
^ permalink raw reply
* Re: [Patch net-next v3 9/9] selinux: use generic union inet_addr
From: Markku Savela @ 2013-08-20 14:48 UTC (permalink / raw)
To: Casey Schaufler
Cc: Cong Wang, David Miller, netdev, james.l.morris, sds, eparis,
pmoore, linux-kernel, linux-security-module
In-Reply-To: <52137CFF.70601@schaufler-ca.com>
Imho, the patch doesn't go far enough actually. What should be done:
- get rid of the union
- use IPv6 format only
- store IPv4 addresses in IPv4 mapped format
^ permalink raw reply
* Re: [Patch net-next v3 9/9] selinux: use generic union inet_addr
From: Casey Schaufler @ 2013-08-20 14:28 UTC (permalink / raw)
To: Cong Wang
Cc: David Miller, netdev, james.l.morris, sds, eparis, pmoore,
linux-kernel, linux-security-module
In-Reply-To: <1377003677.13412.5.camel@cr0>
On 8/20/2013 6:01 AM, Cong Wang wrote:
> On Mon, 2013-08-19 at 14:42 -0700, Casey Schaufler wrote:
>> Well, they certainly don't appear to add any value on their own.
>> I also generally oppose doing clever things with data structures.
> If you want to implement same thing for 5+ times,
Those 5+ implementations are already there, and already work.
A 6th implementation to replace known working code is just churn
unless it provides some additional value. Making the code "better"
does not itself add value.
> yes, it has no value
> for you. Enjoy the following code in current tree:
>
> union nf_inet_addr;
> union sctp_addr;
> union vxlan_addr; (in my VXLAN IPv6 patches, search email archives)
> struct br_mdb_entry::addr;
> union inet_addr; (in netpoll.h)
>
> And may I tell you the last three are all from me? ;-)
I do use and enjoy all of these implementations! Thank you
for the fine implementations. In the end, if you're maintaining
the code it's your call. I question change that does not have
an obvious purpose because statistically every 10th change has
a bug.
Now that I know what the change is for I am fine with it. I
like seeing reasons up front.
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-security-module" 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: [PATCH 0/3] net: propagate dynamic needed_headroom/tailroom changes
From: Jiri Pirko @ 2013-08-20 14:27 UTC (permalink / raw)
To: Florian Fainelli
Cc: netdev, amwang, Stephen Hemminger, kaber, David Miller, vyasevic,
Johannes Berg, Eric Dumazet
In-Reply-To: <CAGVrzcZQ79rVcezAM7rk6dMBnHySCn3b5wL98npOx=LM=Tb6Mw@mail.gmail.com>
Tue, Aug 20, 2013 at 04:24:37PM CEST, f.fainelli@gmail.com wrote:
>2013/8/20 Jiri Pirko <jiri@resnulli.us>:
>> Tue, Aug 20, 2013 at 02:45:49PM CEST, f.fainelli@gmail.com wrote:
>>>Hi all,
>>>
>>>This patchset aims at allowing dynamically changing a given device
>>>needed_headroom/tailroom space and propagating such events to stacked
>>>devices such as bridges and vlans.
>>
>> You should also add support for other stacked devices, like bonding,
>> team, macvlan, ovs-datapath, etc.
>
>Ok, will take a look at these.
>
>>
>>>
>>>Unless callers use the new helpers (dev_set_headroom/dev_set_tailroom)
>>>there is no functional change introduced.
>>>
>>>I tested this with an out of tree Ethernet driver with both VLANs and
>>>bridges and the need for a 64-byte headroom to insert a transmit
>>>status descriptor in front of a SKB.
>>
>> Would be nice to add at least one driver which would use your new api.
>
>cxgb, niu, ps3_gelic_net and gianfar could probably directly benefit
>from this change.
Great, please add use of your new api to one of these and add that patch
to your set. Thanks!
>
>Thanks for your feedback!
>--
>Florian
^ permalink raw reply
* Re: [PATCH 2/2] sh_eth: remove 'register_type' field from 'struct sh_eth_plat_data'
From: Sergei Shtylyov @ 2013-08-20 14:27 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: netdev, davem, lethal, linux-sh
In-Reply-To: <3069255.T0Cvttgz9W@avalon>
Hello.
On 20-08-2013 14:51, Laurent Pinchart wrote:
>> Now that the 'register_type' field of the 'sh_eth' driver's platform data is
>> not used by the driver anymore, it's time to remove it and its
>> initializers from the SH platform code. Also move *enum* declaring values
>> for this field from <linux/sh_eth.h> to the local driver's header file
>> as they're only needed by the driver itself now...
>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>> ---
>> arch/arm/mach-shmobile/board-armadillo800eva.c | 1 -
>> arch/arm/mach-shmobile/board-bockw.c | 1 -
>> arch/sh/boards/board-espt.c | 1 -
>> arch/sh/boards/board-sh7757lcr.c | 4 ----
>> arch/sh/boards/mach-ecovec24/setup.c | 1 -
>> arch/sh/boards/mach-se/7724/setup.c | 1 -
>> arch/sh/boards/mach-sh7763rdp/setup.c | 1 -
>> arch/sh/kernel/cpu/sh2/setup-sh7619.c | 1 -
>> drivers/net/ethernet/renesas/sh_eth.h | 7 +++++++
>> include/linux/sh_eth.h | 7 -------
>> 10 files changed, 7 insertions(+), 18 deletions(-)
> [snip]
>> Index: net-next/drivers/net/ethernet/renesas/sh_eth.h
>> ===================================================================
>> --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.h
>> +++ net-next/drivers/net/ethernet/renesas/sh_eth.h
>> @@ -157,6 +157,13 @@ enum {
>> SH_ETH_MAX_REGISTER_OFFSET,
>> };
>>
>> +enum {
>> + SH_ETH_REG_GIGABIT,
>> + SH_ETH_REG_FAST_RCAR,
>> + SH_ETH_REG_FAST_SH4,
>> + SH_ETH_REG_FAST_SH3_SH2
>> +};
>> +
> Would it make sense to move this change and the one below to a separate patch
> to be merged through the net tree ?
I'm intending to merge these patches thru the net-next tree.
>> /* Driver's parameters */
>> #if defined(CONFIG_CPU_SH4) || defined(CONFIG_ARCH_SHMOBILE)
>> #define SH4_SKB_RX_ALIGN 32
>> Index: net-next/include/linux/sh_eth.h
>> ===================================================================
>> --- net-next.orig/include/linux/sh_eth.h
>> +++ net-next/include/linux/sh_eth.h
>> @@ -5,17 +5,10 @@
>> #include <linux/if_ether.h>
>>
>> enum {EDMAC_LITTLE_ENDIAN, EDMAC_BIG_ENDIAN};
>> -enum {
>> - SH_ETH_REG_GIGABIT,
>> - SH_ETH_REG_FAST_RCAR,
>> - SH_ETH_REG_FAST_SH4,
>> - SH_ETH_REG_FAST_SH3_SH2
>> -};
>>
>> struct sh_eth_plat_data {
>> int phy;
>> int edmac_endian;
> Wouldn't it make sense to move the edmac_endian field to sh_eth_cpu_data as
> well ?
No, it depends on the SoC endianness which is determined by power-on pin
strapping -- which is board specific.
WBR, Sergei
^ permalink raw reply
* Re: [PATCH 0/3] net: propagate dynamic needed_headroom/tailroom changes
From: Florian Fainelli @ 2013-08-20 14:24 UTC (permalink / raw)
To: Jiri Pirko
Cc: netdev, amwang, Stephen Hemminger, kaber, David Miller, vyasevic,
Johannes Berg, Eric Dumazet
In-Reply-To: <20130820132950.GA1593@minipsycho.brq.redhat.com>
2013/8/20 Jiri Pirko <jiri@resnulli.us>:
> Tue, Aug 20, 2013 at 02:45:49PM CEST, f.fainelli@gmail.com wrote:
>>Hi all,
>>
>>This patchset aims at allowing dynamically changing a given device
>>needed_headroom/tailroom space and propagating such events to stacked
>>devices such as bridges and vlans.
>
> You should also add support for other stacked devices, like bonding,
> team, macvlan, ovs-datapath, etc.
Ok, will take a look at these.
>
>>
>>Unless callers use the new helpers (dev_set_headroom/dev_set_tailroom)
>>there is no functional change introduced.
>>
>>I tested this with an out of tree Ethernet driver with both VLANs and
>>bridges and the need for a 64-byte headroom to insert a transmit
>>status descriptor in front of a SKB.
>
> Would be nice to add at least one driver which would use your new api.
cxgb, niu, ps3_gelic_net and gianfar could probably directly benefit
from this change.
Thanks for your feedback!
--
Florian
^ permalink raw reply
* RE: [PATCH next] netlink: prevent deadlock in ctrl_dumpfamily()
From: Berg, Johannes @ 2013-08-20 14:03 UTC (permalink / raw)
To: Sergey Senozhatsky, David S. Miller
Cc: Patrick McHardy, Pablo Neira Ayuso, Gao feng,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
In-Reply-To: <20130820135033.GA2315@swordfish.minsk.epam.com>
> + if (need_locking) {
> + /* genl_mutex could be already locked in genl_rcv_msg() */
> + rt = genl_family_find_byid(cb->nlh->nlmsg_type);
> + need_locking = need_locking && rt->parallel_ops;
> + }
This is equivalent to reverting the patch because parallel_ops will be false for the genl family. :-)
johannes
--
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052
^ permalink raw reply
* [PATCH next] netlink: prevent deadlock in ctrl_dumpfamily()
From: Sergey Senozhatsky @ 2013-08-20 13:50 UTC (permalink / raw)
To: David S. Miller
Cc: Patrick McHardy, Pablo Neira Ayuso, Johannes Berg, Gao feng,
netdev, linux-kernel
Commmit 58ad436fcf49810aa006016107f494c9ac9013db
Author: Johannes Berg <johannes.berg at intel.com>
genetlink: fix family dump race
added genl_lock() call to ctrl_dumpfamily(), which potentially
can deadlock. Suppose the following case:
genl_rcv_msg(): !family->parallel_ops -> genl_lock()
genl_family_rcv_msg()
netlink_dump_start()
netlink_dump()
ctrl_dumpfamily() --> genl_lock()
Take in account possibility of genl_lock() in genl_rcv_msg() and do
not acquire genl_mutex in ctrl_dumpfamily() for a family that supports
parallel_ops.
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
---
net/netlink/genetlink.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index f85f8a2..fca3659 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -791,6 +791,12 @@ static int ctrl_dumpfamily(struct sk_buff *skb, struct netlink_callback *cb)
int fams_to_skip = cb->args[1];
bool need_locking = chains_to_skip || fams_to_skip;
+ if (need_locking) {
+ /* genl_mutex could be already locked in genl_rcv_msg() */
+ rt = genl_family_find_byid(cb->nlh->nlmsg_type);
+ need_locking = need_locking && rt->parallel_ops;
+ }
+
if (need_locking)
genl_lock();
^ permalink raw reply related
* Re: [PATCH net-next v3] net: cpsw: Add support for wake-on-lan for cpsw
From: Sergei Shtylyov @ 2013-08-20 13:40 UTC (permalink / raw)
To: ujhelyi.m; +Cc: davem, mugunthanvnm, netdev, linux-kernel
In-Reply-To: <1376977097-25296-1-git-send-email-ujhelyi.m@gmail.com>
Hello.
On 20-08-2013 9:38, ujhelyi.m@gmail.com wrote:
> From: Matus Ujhelyi <ujhelyi.m@gmail.com>
> Some phy's can be configured to enable wake on lan (e.g. at803x or marvell 88E1318S).
> There is no way how to enable wol on CPSW with such connected phys. This patch
> adds this support. It is provided by calling the phy's related code.
> Tested on board with at8030x connected phy. Wol interrupt line is
> connected to GPIO0 on am335x.
> Signed-off-by: Matus Ujhelyi <ujhelyi.m@gmail.com>
> ---
> drivers/net/ethernet/ti/cpsw.c | 24 ++++++++++++++++++++++++
> 1 file changed, 24 insertions(+)
> diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
> index 0fcf212..5d673bf 100644
> --- a/drivers/net/ethernet/ti/cpsw.c
> +++ b/drivers/net/ethernet/ti/cpsw.c
> @@ -1640,6 +1640,28 @@ static int cpsw_set_settings(struct net_device *ndev, struct ethtool_cmd *ecmd)
> return -EOPNOTSUPP;
> }
>
> +static void cpsw_get_wol(struct net_device *ndev, struct ethtool_wolinfo *wol)
> +{
> + struct cpsw_priv *priv = netdev_priv(ndev);
> + int slave_no = cpsw_slave_index(priv);
You should have put an empty line here, not below.
> + wol->supported = 0;
> + wol->wolopts = 0;
> +
> + if (priv->slaves[slave_no].phy)
> + phy_ethtool_get_wol(priv->slaves[slave_no].phy, wol);
> +}
WBR, Sergei
^ permalink raw reply
* Re: [PATCH-SR9700] Merge USB 1.1 Ethernet Adapter SR9700 Device Driver into the Linux Kernel
From: Ben Hutchings @ 2013-08-20 13:36 UTC (permalink / raw)
To: liujunliang_ljl; +Cc: gregkh, linux-usb, netdev, linux-kernel, sunhecheng
In-Reply-To: <201308201850095789331@163.com>
On Tue, 2013-08-20 at 18:50 +0800, liujunliang_ljl wrote:
> Dear Gregkh & all :
>
> I am the software engineer Liu Junliang from ShenZhen CoreChips high technology company, on the market of SR9700 chip is designed and owned by us.
> SR9700 is a type of USB to Ethernet Converter and is compatible with USB 1.1 protocol, We want to merge SR9700 device driver into the Linux Kernel. The following is the Linux 3.10.7 version patch for SR9700, Please give us the assessment and support.
> Thanks a lot.
As this is a net driver, the relevant maintainer is David Miller and not
Greg.
There are some style errors here which can be found using
scripts/checkpatch.pl. You'll need to fix those and re-submit. I'll
point out some more problems inline.
> --- /dev/null
> +++ b/drivers/net/usb/sr9700.c
[...]
> +static int sr9700_get_eeprom(struct net_device *net, struct ethtool_eeprom *eeprom, u8 * data)
> +{
> + struct usbnet *dev = netdev_priv(net);
> + __le16 *ebuf = (__le16 *) data;
> + int i;
> +
> + /* access is 16bit */
> + if ((eeprom->offset % 2) || (eeprom->len % 2))
> + return -EINVAL;
You're really supposed to handle these cases by shifting as necessary.
> + for (i = 0; i < eeprom->len / 2; i++) {
> + if (sr_read_eeprom_word(dev, eeprom->offset / 2 + i, &ebuf[i]) < 0)
> + return -EINVAL;
You should pass up the error code, not substitute -EINVAL.
[...]
> +static void sr9700_get_drvinfo(struct net_device *net, struct ethtool_drvinfo *info)
> +{
> + /* Inherit standard device info */
> + usbnet_get_drvinfo(net, info);
> + info->eedump_len = SR_EEPROM_LEN;
You don't need to set eedump_len; the ethtool core will set it after
calling sr9700_get_eeprom_len(). So you don't need your own
implementation of get_drvinfo at all.
[...]
> +static int sr9700_bind(struct usbnet *dev, struct usb_interface *intf)
> +{
[...]
> + /* read MAC */
> + if (sr_read(dev, PAR, ETH_ALEN, dev->net->dev_addr) < 0) {
> + printk(KERN_ERR "Error reading MAC address\n");
> + ret = -ENODEV;
> + goto out;
> + }
[...]
I think this should read the MAC address from EEPROM and copy it to both
dev_addr to perm_addr. MAC address changes should not persist if the
driver is reloaded.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH 0/3] net: propagate dynamic needed_headroom/tailroom changes
From: Jiri Pirko @ 2013-08-20 13:29 UTC (permalink / raw)
To: Florian Fainelli
Cc: netdev, amwang, stephen, kaber, davem, vyasevic, johannes,
eric.dumazet
In-Reply-To: <1377002752-4622-1-git-send-email-f.fainelli@gmail.com>
Tue, Aug 20, 2013 at 02:45:49PM CEST, f.fainelli@gmail.com wrote:
>Hi all,
>
>This patchset aims at allowing dynamically changing a given device
>needed_headroom/tailroom space and propagating such events to stacked
>devices such as bridges and vlans.
You should also add support for other stacked devices, like bonding,
team, macvlan, ovs-datapath, etc.
>
>Unless callers use the new helpers (dev_set_headroom/dev_set_tailroom)
>there is no functional change introduced.
>
>I tested this with an out of tree Ethernet driver with both VLANs and
>bridges and the need for a 64-byte headroom to insert a transmit
>status descriptor in front of a SKB.
Would be nice to add at least one driver which would use your new api.
Thanks,
Jiri
>
>Since I am not familiar with all subsystems/drivers changing the
>needed_headroom/tailroom requirements, I would leave that to them.
>
>Florian Fainelli (3):
> net: add a new NETDEV_CHANGEROOM event type
> net: vlan: handle NETDEV_CHANGEROOM events
> net: bridge: handle NETDEV_CHANGEROOM event
>
> include/linux/netdevice.h | 3 +++
> net/8021q/vlan.c | 7 +++++++
> net/bridge/br_if.c | 32 ++++++++++++++++++++++++++++++++
> net/bridge/br_notify.c | 5 +++++
> net/bridge/br_private.h | 2 ++
> net/core/dev.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
> 6 files changed, 95 insertions(+)
>
>--
>1.8.1.2
>
>
^ permalink raw reply
* Re: [Patch net-next v3 9/9] selinux: use generic union inet_addr
From: Cong Wang @ 2013-08-20 13:01 UTC (permalink / raw)
To: Casey Schaufler
Cc: David Miller, netdev, james.l.morris, sds, eparis, pmoore,
linux-kernel, linux-security-module
In-Reply-To: <5212915F.20905@schaufler-ca.com>
On Mon, 2013-08-19 at 14:42 -0700, Casey Schaufler wrote:
>
> Well, they certainly don't appear to add any value on their own.
> I also generally oppose doing clever things with data structures.
If you want to implement same thing for 5+ times, yes, it has no value
for you. Enjoy the following code in current tree:
union nf_inet_addr;
union sctp_addr;
union vxlan_addr; (in my VXLAN IPv6 patches, search email archives)
struct br_mdb_entry::addr;
union inet_addr; (in netpoll.h)
And may I tell you the last three are all from me? ;-)
^ permalink raw reply
* [PATCH 2/3] net: vlan: handle NETDEV_CHANGEROOM events
From: Florian Fainelli @ 2013-08-20 12:45 UTC (permalink / raw)
To: netdev
Cc: amwang, jiri, stephen, kaber, davem, vyasevic, johannes,
eric.dumazet, Florian Fainelli
In-Reply-To: <1377002752-4622-1-git-send-email-f.fainelli@gmail.com>
Whenever the parent device has needed_headroom/needed_tailroom
requirement changes, the VLAN devices should also be updated to the new
value. Handle the NETDEV_CHANGEROOM events and just set the new headroom
and tailroom requirements to the values of the parent device.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
net/8021q/vlan.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 61fc573..11a1faa 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -466,6 +466,13 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
vlan_group_for_each_dev(grp, i, vlandev)
call_netdevice_notifiers(event, vlandev);
break;
+
+ case NETDEV_CHANGEROOM:
+ vlan_group_for_each_dev(grp, i, vlandev) {
+ dev_set_headroom(vlandev, dev->needed_headroom);
+ dev_set_tailroom(vlandev, dev->needed_tailroom);
+ }
+ break;
}
out:
--
1.8.1.2
^ permalink raw reply related
* [PATCH 3/3] net: bridge: handle NETDEV_CHANGEROOM event
From: Florian Fainelli @ 2013-08-20 12:45 UTC (permalink / raw)
To: netdev
Cc: amwang, jiri, stephen, kaber, davem, vyasevic, johannes,
eric.dumazet, Florian Fainelli
In-Reply-To: <1377002752-4622-1-git-send-email-f.fainelli@gmail.com>
When a device which is a port member of a bridge has
needed_headroom/tailroom requirement changes, we need to walk the list
of bridge members, compute the minimum headroom or tailroom value, and
update the parent bridge device with the new values.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
net/bridge/br_if.c | 32 ++++++++++++++++++++++++++++++++
net/bridge/br_notify.c | 5 +++++
net/bridge/br_private.h | 2 ++
3 files changed, 39 insertions(+)
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index aa6c9a8..017622b 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -296,6 +296,38 @@ int br_min_mtu(const struct net_bridge *br)
return mtu;
}
+int br_min_headroom(const struct net_bridge *br)
+{
+ const struct net_bridge_port *p;
+ unsigned short needed_headroom = 0;
+
+ ASSERT_RTNL();
+
+ list_for_each_entry(p, &br->port_list, list) {
+ if (!needed_headroom ||
+ p->dev->needed_headroom < needed_headroom)
+ needed_headroom = p->dev->needed_headroom;
+ }
+
+ return needed_headroom;
+}
+
+int br_min_tailroom(const struct net_bridge *br)
+{
+ const struct net_bridge_port *p;
+ unsigned short needed_tailroom = 0;
+
+ ASSERT_RTNL();
+
+ list_for_each_entry(p, &br->port_list, list) {
+ if (!needed_tailroom ||
+ p->dev->needed_tailroom < needed_tailroom)
+ needed_tailroom = p->dev->needed_tailroom;
+ }
+
+ return needed_tailroom;
+}
+
/*
* Recomputes features using slave's features
*/
diff --git a/net/bridge/br_notify.c b/net/bridge/br_notify.c
index 2998dd1..1c7be7c 100644
--- a/net/bridge/br_notify.c
+++ b/net/bridge/br_notify.c
@@ -107,6 +107,11 @@ static int br_device_event(struct notifier_block *unused, unsigned long event, v
/* Propagate to master device */
call_netdevice_notifiers(event, br->dev);
break;
+
+ case NETDEV_CHANGEROOM:
+ dev_set_headroom(br->dev, br_min_headroom(br));
+ dev_set_tailroom(br->dev, br_min_tailroom(br));
+ break;
}
/* Events that may cause spanning tree to refresh */
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index d41283c..81dc7aa 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -421,6 +421,8 @@ extern int br_add_if(struct net_bridge *br,
extern int br_del_if(struct net_bridge *br,
struct net_device *dev);
extern int br_min_mtu(const struct net_bridge *br);
+extern int br_min_headroom(const struct net_bridge *br);
+extern int br_min_tailroom(const struct net_bridge *br);
extern netdev_features_t br_features_recompute(struct net_bridge *br,
netdev_features_t features);
--
1.8.1.2
^ permalink raw reply related
* [PATCH 1/3] net: add a new NETDEV_CHANGEROOM event type
From: Florian Fainelli @ 2013-08-20 12:45 UTC (permalink / raw)
To: netdev
Cc: amwang, jiri, stephen, kaber, davem, vyasevic, johannes,
eric.dumazet, Florian Fainelli
In-Reply-To: <1377002752-4622-1-git-send-email-f.fainelli@gmail.com>
The event NETDEV_CHANGEROOM event can be used by devices/subsystems
which need to adjust their needed_headroom and/or needed_tailroom
requirements dynamically. Two helper functions are introduced:
- dev_set_headroom(dev, new_headroom)
- dev_set_taioroom(dev, new_tailroom)
which will notify listeners of such a change.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
include/linux/netdevice.h | 3 +++
net/core/dev.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 49 insertions(+)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 077363d..2b3e56c 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1652,6 +1652,7 @@ struct packet_offload {
#define NETDEV_JOIN 0x0014
#define NETDEV_CHANGEUPPER 0x0015
#define NETDEV_RESEND_IGMP 0x0016
+#define NETDEV_CHANGEROOM 0x0017 /* needed_headroom/tailroom change */
extern int register_netdevice_notifier(struct notifier_block *nb);
extern int unregister_netdevice_notifier(struct notifier_block *nb);
@@ -2329,6 +2330,8 @@ extern int dev_change_net_namespace(struct net_device *,
struct net *, const char *);
extern int dev_set_mtu(struct net_device *, int);
extern void dev_set_group(struct net_device *, int);
+extern int dev_set_headroom(struct net_device *, unsigned short);
+extern int dev_set_tailroom(struct net_device *, unsigned short);
extern int dev_set_mac_address(struct net_device *,
struct sockaddr *);
extern int dev_change_carrier(struct net_device *,
diff --git a/net/core/dev.c b/net/core/dev.c
index 1ed2b66..be712be 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4931,6 +4931,52 @@ int dev_set_mtu(struct net_device *dev, int new_mtu)
EXPORT_SYMBOL(dev_set_mtu);
/**
+ * dev_set_headroom - Change device needed headroom
+ * @dev: device
+ * @new_headroom: new headroom size
+ *
+ * Change the network device headroom space.
+ */
+int dev_set_headroom(struct net_device *dev, unsigned short new_headroom)
+{
+ if (dev->needed_headroom == new_headroom)
+ return 0;
+
+ if (!netif_device_present(dev))
+ return -ENODEV;
+
+ dev->needed_headroom = new_headroom;
+
+ call_netdevice_notifiers(NETDEV_CHANGEROOM, dev);
+
+ return 0;
+}
+EXPORT_SYMBOL(dev_set_headroom);
+
+/**
+ * dev_set_tailroom - Change device needed tailroom
+ * @dev: device
+ * @new_tailroom: new tailroom size
+ *
+ * Change the network device tailroom space.
+ */
+int dev_set_tailroom(struct net_device *dev, unsigned short new_tailroom)
+{
+ if (dev->needed_tailroom == new_tailroom)
+ return 0;
+
+ if (!netif_device_present(dev))
+ return -ENODEV;
+
+ dev->needed_tailroom = new_tailroom;
+
+ call_netdevice_notifiers(NETDEV_CHANGEROOM, dev);
+
+ return 0;
+}
+EXPORT_SYMBOL(dev_set_tailroom);
+
+/**
* dev_set_group - Change group this device belongs to
* @dev: device
* @new_group: group this device should belong to
--
1.8.1.2
^ permalink raw reply related
* [PATCH 0/3] net: propagate dynamic needed_headroom/tailroom changes
From: Florian Fainelli @ 2013-08-20 12:45 UTC (permalink / raw)
To: netdev
Cc: amwang, jiri, stephen, kaber, davem, vyasevic, johannes,
eric.dumazet, Florian Fainelli
Hi all,
This patchset aims at allowing dynamically changing a given device
needed_headroom/tailroom space and propagating such events to stacked
devices such as bridges and vlans.
Unless callers use the new helpers (dev_set_headroom/dev_set_tailroom)
there is no functional change introduced.
I tested this with an out of tree Ethernet driver with both VLANs and
bridges and the need for a 64-byte headroom to insert a transmit
status descriptor in front of a SKB.
Since I am not familiar with all subsystems/drivers changing the
needed_headroom/tailroom requirements, I would leave that to them.
Florian Fainelli (3):
net: add a new NETDEV_CHANGEROOM event type
net: vlan: handle NETDEV_CHANGEROOM events
net: bridge: handle NETDEV_CHANGEROOM event
include/linux/netdevice.h | 3 +++
net/8021q/vlan.c | 7 +++++++
net/bridge/br_if.c | 32 ++++++++++++++++++++++++++++++++
net/bridge/br_notify.c | 5 +++++
net/bridge/br_private.h | 2 ++
net/core/dev.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 95 insertions(+)
--
1.8.1.2
^ permalink raw reply
* Re: [PATCH net-next 3/3] net: ipv6: mcast: minor: use defines for rfc3810/8.1 lengths
From: Hannes Frederic Sowa @ 2013-08-20 11:56 UTC (permalink / raw)
To: Daniel Borkmann; +Cc: davem, netdev
In-Reply-To: <1376994122-3022-4-git-send-email-dborkman@redhat.com>
On Tue, Aug 20, 2013 at 12:22:02PM +0200, Daniel Borkmann wrote:
> Instead of hard-coding length values, use a define to make it clear
> where those lengths come from.
>
> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Nice cleanups, thanks Daniel!
^ permalink raw reply
* Re: [PATCH net-next 2/3] net: ipv6: minor: *_start_timer: rather use unsigned long
From: Hannes Frederic Sowa @ 2013-08-20 11:55 UTC (permalink / raw)
To: Daniel Borkmann; +Cc: davem, netdev
In-Reply-To: <1376994122-3022-3-git-send-email-dborkman@redhat.com>
On Tue, Aug 20, 2013 at 12:22:01PM +0200, Daniel Borkmann wrote:
> For the functions mld_gq_start_timer(), mld_ifc_start_timer(),
> and mld_dad_start_timer(), rather use unsigned long than int
> as we operate only on unsigned values anyway. This seems more
> appropriate as there is no good reason to do type conversions
> to int, that could lead to future errors.
>
> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
^ permalink raw reply
* Re: [PATCH net-next 1/3] net: ipv6: igmp6_event_query: use msecs_to_jiffies
From: Hannes Frederic Sowa @ 2013-08-20 11:55 UTC (permalink / raw)
To: Daniel Borkmann; +Cc: davem, netdev
In-Reply-To: <1376994122-3022-2-git-send-email-dborkman@redhat.com>
On Tue, Aug 20, 2013 at 12:22:00PM +0200, Daniel Borkmann wrote:
> Use proper API functions to calculate jiffies from milliseconds and
> not the crude method of dividing HZ by a value. This ensures more
> accurate values even in the case of strange HZ values. While at it,
> also simplify code in the mlh2 case by using max().
>
> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
^ permalink raw reply
* Re: [PATCH V2] ipv6: handle Redirect ICMP Message with no Redirected Header option
From: Hannes Frederic Sowa @ 2013-08-20 11:50 UTC (permalink / raw)
To: Duan Jiong; +Cc: davem, netdev
In-Reply-To: <52131725.6000409@cn.fujitsu.com>
On Tue, Aug 20, 2013 at 03:13:41PM +0800, Duan Jiong wrote:
> --- a/net/ipv6/route.c
> +++ b/net/ipv6/route.c
> @@ -1178,6 +1178,28 @@ void ip6_redirect(struct sk_buff *skb, struct net *net, int oif, u32 mark)
> }
> EXPORT_SYMBOL_GPL(ip6_redirect);
>
> +void ip6_redirect_no_header(struct sk_buff *skb, struct net *net, int oif,
> + u32 mark)
> +{
> + const struct ipv6hdr *iph = (struct ipv6hdr *)skb_network_header(skb);
Was there a problem with ipv6_hdr?
> + const struct rd_msg *msg = (struct rd_msg *)skb_transport_header(skb);
> + struct dst_entry *dst;
> + struct flowi6 fl6;
> +
> + memset(&fl6, 0, sizeof(fl6));
> + fl6.flowi6_oif = oif;
> + fl6.flowi6_mark = mark;
> + fl6.flowi6_flags = 0;
> + fl6.daddr = msg->dest;
> + fl6.saddr = iph->daddr;
> +
> + dst = ip6_route_output(net, NULL, &fl6);
> + if (!dst->error)
> + rt6_do_redirect(dst, NULL, skb);
> + dst_release(dst);
> +}
> +EXPORT_SYMBOL_GPL(ip6_redirect_no_header);
> +
> void ip6_sk_redirect(struct sk_buff *skb, struct sock *sk)
> {
> ip6_redirect(skb, sock_net(sk), sk->sk_bound_dev_if, sk->sk_mark);
Introducing a new function here is the right thing. Maybe you could have
a look how these redirects could be fed to raw sockets, too?
Thanks,
Hannes
^ permalink raw reply
* Out of office
From: tyree @ 2013-08-20 11:20 UTC (permalink / raw)
To: netdev
I will be out of the office from August 12 and returning August 20.
If your email is urgent please forward to Rebecca Chouinard at rchouinard@mvlwb.com or contact her at 867-766-7459.
Any other inquiries concenrning files can also be sent to permits@mvlwb.com and our main office number is (867) 669-0506.
Thank you,
Tyree Mullaney
Regulatory Officer
Mackenzie Valley Land & Water Board
ph 867.766-4764 email: tyree@mvlwb.com
^ permalink raw reply
* ADSL/ATM linklayer tc shaping regression fix commits for stable
From: Jesper Dangaard Brouer @ 2013-08-20 11:26 UTC (permalink / raw)
To: stable, Greg Kroah-Hartman
Cc: netdev, linux-kernel, bufferbloat-list, David Miller,
Eric Dumazet, Dave Taht
Hi Greg (and google search),
ADSL/ATM linklayer shaping were broken in kernel release from 3.8 to
3.10 by commit 56b765b79 ("htb: improved accuracy at high rates").
I can see that 3.9-stable is marked EOL, and 3.8-stable also seems
closed. I guess it is up to Greg, how far the commits described below
can be backported. Below is the commit needed for a 3.9 backport.
This was not the only regression introduced by the regression commit,
several fixes were required:
(Refactor/change commit for easy 3.9 backport step (in v3.10-rc1)):
commit 6906f4ed6f8 (htb: add HTB_DIRECT_QLEN attribute)
The following commit fixes are in 3.10-rc5:
commit 01cb71d2d47 (net_sched: restore "overhead xxx" handling)
commit 5343a7f8be1 (net_sched: htb: do not mix 1ns and 64ns time units)
The following commit fixes are in 3.10-rc6:
commit 40edeff6e1c (net_sched: qdisc_get_rtab() must check data[] array)
(this fix goes further back, but needed for linklayer atm, see below[1])
Refactor improvements (v3.11-rc1):
commit 130d3d68b52 (net_sched: psched_ratecfg_precompute() improvements)
The linklayer ATM/ADSL fix, reached 3.11-rc6:
commit 8a8e3d84b17 (net_sched: restore "linklayer atm" handling)
[1] Eric Dumazet also found a general "linklayer atm" regression
(dating way-back), which could cause rate-tables to get wrongly shared
between the same rates with-and-without linklayer atm settings.
Addressed/fixed in (3.10-rc6:):
- commit 40edeff6e1c (net_sched: qdisc_get_rtab() must check data[] array)
When configuring two completely equal rates, the kernel detects that
these two equal rates can share the same rate-table. But the kernel
didn't check if the rate-table data had been modified, which is done
in the linklayer atm case.
In practice, this often isn't a problem, as overhead parameter is
usually combined with the linklayer parameter.
The regression commit 56b765b79 ("htb: improved accuracy at high
rates"), is not all bad, it did provided a significantly improved rate
shaping accuracy. The old rate-table based system, which this commit
removed, would get inaccurate at rates above 100Mbit/s.
(ps. I'm the original author of http://www.adsl-optimizer.dk/ and
http://sourceforge.net/projects/adsl-optimizer/)
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Sr. Network Kernel Developer at Red Hat
Author of http://www.iptv-analyzer.org
LinkedIn: http://www.linkedin.com/in/brouer
^ permalink raw reply
* [PATCH 19/19] netfilter: export xt_HMARK.h to userland
From: Pablo Neira Ayuso @ 2013-08-20 10:54 UTC (permalink / raw)
To: netfilter-devel; +Cc: davem, netdev
In-Reply-To: <1376996091-3964-1-git-send-email-pablo@netfilter.org>
From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
This file contains the API for the target "HMARK", hence it should be exported
to userland.
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
include/uapi/linux/netfilter/Kbuild | 1 +
include/{ => uapi}/linux/netfilter/xt_HMARK.h | 0
2 files changed, 1 insertion(+)
rename include/{ => uapi}/linux/netfilter/xt_HMARK.h (100%)
diff --git a/include/uapi/linux/netfilter/Kbuild b/include/uapi/linux/netfilter/Kbuild
index dc00927..1749154 100644
--- a/include/uapi/linux/netfilter/Kbuild
+++ b/include/uapi/linux/netfilter/Kbuild
@@ -22,6 +22,7 @@ header-y += xt_CONNMARK.h
header-y += xt_CONNSECMARK.h
header-y += xt_CT.h
header-y += xt_DSCP.h
+header-y += xt_HMARK.h
header-y += xt_IDLETIMER.h
header-y += xt_LED.h
header-y += xt_LOG.h
diff --git a/include/linux/netfilter/xt_HMARK.h b/include/uapi/linux/netfilter/xt_HMARK.h
similarity index 100%
rename from include/linux/netfilter/xt_HMARK.h
rename to include/uapi/linux/netfilter/xt_HMARK.h
--
1.7.10.4
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox