* Re: [PATCH net-next] igb: Change how we check for pre-existing and assigned VFs
From: Greg Rose @ 2012-08-15 16:03 UTC (permalink / raw)
To: Stefan Assmann; +Cc: netdev, e1000-devel, carolyn.wyborny
In-Reply-To: <1345009886-29153-1-git-send-email-sassmann@kpanic.de>
On Wed, 15 Aug 2012 07:51:26 +0200
Stefan Assmann <sassmann@kpanic.de> wrote:
> Adapt the pre-existing and assigned VFs code to the ixgbe way
> introduced in commit 9297127b9cdd8d30c829ef5fd28b7cc0323a7bcd.
>
> Instead of searching the enabled VFs we use pci_num_vf to determine
> enabled VFs. By comparing to which PF an assigned VF is owned it's
> possible to decide whether to leave it enabled or not.
>
> Signed-off-by: Stefan Assmann <sassmann@kpanic.de>
Acked-by: Greg Rose <gregory.v.rose@intel.com>
> ---
> drivers/net/ethernet/intel/igb/igb.h | 1 -
> drivers/net/ethernet/intel/igb/igb_main.c | 104
> ++++++----------------------- 2 files changed, 22 insertions(+), 83
> deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/igb/igb.h
> b/drivers/net/ethernet/intel/igb/igb.h index 9e572dd..d15576a 100644
> --- a/drivers/net/ethernet/intel/igb/igb.h
> +++ b/drivers/net/ethernet/intel/igb/igb.h
> @@ -99,7 +99,6 @@ struct vf_data_storage {
> u16 pf_vlan; /* When set, guest VLAN config not allowed. */
> u16 pf_qos;
> u16 tx_rate;
> - struct pci_dev *vfdev;
> };
>
> #define IGB_VF_FLAG_CTS 0x00000001 /* VF is clear to send
> data */ diff --git a/drivers/net/ethernet/intel/igb/igb_main.c
> b/drivers/net/ethernet/intel/igb/igb_main.c index b7c2d50..9e312da
> 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c
> +++ b/drivers/net/ethernet/intel/igb/igb_main.c
> @@ -172,8 +172,7 @@ static void igb_check_vf_rate_limit(struct
> igb_adapter *);
> #ifdef CONFIG_PCI_IOV
> static int igb_vf_configure(struct igb_adapter *adapter, int vf);
> -static int igb_find_enabled_vfs(struct igb_adapter *adapter);
> -static int igb_check_vf_assignment(struct igb_adapter *adapter);
> +static bool igb_vfs_are_assigned(struct igb_adapter *adapter);
> #endif
>
> #ifdef CONFIG_PM
> @@ -2295,11 +2294,11 @@ static void __devexit igb_remove(struct
> pci_dev *pdev) /* reclaim resources allocated to VFs */
> if (adapter->vf_data) {
> /* disable iov and allow time for transactions to
> clear */
> - if (!igb_check_vf_assignment(adapter)) {
> + if (igb_vfs_are_assigned(adapter)) {
> + dev_info(&pdev->dev, "Unloading driver while
> VFs are assigned - VFs will not be deallocated\n");
> + } else {
> pci_disable_sriov(pdev);
> msleep(500);
> - } else {
> - dev_info(&pdev->dev, "VF(s) assigned to
> guests!\n"); }
>
> kfree(adapter->vf_data);
> @@ -2339,7 +2338,7 @@ static void __devinit igb_probe_vfs(struct
> igb_adapter * adapter) #ifdef CONFIG_PCI_IOV
> struct pci_dev *pdev = adapter->pdev;
> struct e1000_hw *hw = &adapter->hw;
> - int old_vfs = igb_find_enabled_vfs(adapter);
> + int old_vfs = pci_num_vf(adapter->pdev);
> int i;
>
> /* Virtualization features not supported on i210 family. */
> @@ -5003,102 +5002,43 @@ static int igb_notify_dca(struct
> notifier_block *nb, unsigned long event, static int
> igb_vf_configure(struct igb_adapter *adapter, int vf) {
> unsigned char mac_addr[ETH_ALEN];
> - struct pci_dev *pdev = adapter->pdev;
> - struct e1000_hw *hw = &adapter->hw;
> - struct pci_dev *pvfdev;
> - unsigned int device_id;
> - u16 thisvf_devfn;
>
> eth_random_addr(mac_addr);
> igb_set_vf_mac(adapter, vf, mac_addr);
>
> - switch (adapter->hw.mac.type) {
> - case e1000_82576:
> - device_id = IGB_82576_VF_DEV_ID;
> - /* VF Stride for 82576 is 2 */
> - thisvf_devfn = (pdev->devfn + 0x80 + (vf << 1)) |
> - (pdev->devfn & 1);
> - break;
> - case e1000_i350:
> - device_id = IGB_I350_VF_DEV_ID;
> - /* VF Stride for I350 is 4 */
> - thisvf_devfn = (pdev->devfn + 0x80 + (vf << 2)) |
> - (pdev->devfn & 3);
> - break;
> - default:
> - device_id = 0;
> - thisvf_devfn = 0;
> - break;
> - }
> -
> - pvfdev = pci_get_device(hw->vendor_id, device_id, NULL);
> - while (pvfdev) {
> - if (pvfdev->devfn == thisvf_devfn)
> - break;
> - pvfdev = pci_get_device(hw->vendor_id,
> - device_id, pvfdev);
> - }
> -
> - if (pvfdev)
> - adapter->vf_data[vf].vfdev = pvfdev;
> - else
> - dev_err(&pdev->dev,
> - "Couldn't find pci dev ptr for VF %4.4x\n",
> - thisvf_devfn);
> - return pvfdev != NULL;
> + return 0;
> }
>
> -static int igb_find_enabled_vfs(struct igb_adapter *adapter)
> +static bool igb_vfs_are_assigned(struct igb_adapter *adapter)
> {
> - struct e1000_hw *hw = &adapter->hw;
> struct pci_dev *pdev = adapter->pdev;
> - struct pci_dev *pvfdev;
> - u16 vf_devfn = 0;
> - u16 vf_stride;
> - unsigned int device_id;
> - int vfs_found = 0;
> + struct pci_dev *vfdev;
> + int dev_id;
>
> switch (adapter->hw.mac.type) {
> case e1000_82576:
> - device_id = IGB_82576_VF_DEV_ID;
> - /* VF Stride for 82576 is 2 */
> - vf_stride = 2;
> + dev_id = IGB_82576_VF_DEV_ID;
> break;
> case e1000_i350:
> - device_id = IGB_I350_VF_DEV_ID;
> - /* VF Stride for I350 is 4 */
> - vf_stride = 4;
> + dev_id = IGB_I350_VF_DEV_ID;
> break;
> default:
> - device_id = 0;
> - vf_stride = 0;
> - break;
> - }
> -
> - vf_devfn = pdev->devfn + 0x80;
> - pvfdev = pci_get_device(hw->vendor_id, device_id, NULL);
> - while (pvfdev) {
> - if (pvfdev->devfn == vf_devfn &&
> - (pvfdev->bus->number >= pdev->bus->number))
> - vfs_found++;
> - vf_devfn += vf_stride;
> - pvfdev = pci_get_device(hw->vendor_id,
> - device_id, pvfdev);
> + return false;
> }
>
> - return vfs_found;
> -}
> -
> -static int igb_check_vf_assignment(struct igb_adapter *adapter)
> -{
> - int i;
> - for (i = 0; i < adapter->vfs_allocated_count; i++) {
> - if (adapter->vf_data[i].vfdev) {
> - if (adapter->vf_data[i].vfdev->dev_flags &
> - PCI_DEV_FLAGS_ASSIGNED)
> + /* loop through all the VFs to see if we own any that are
> assigned */
> + vfdev = pci_get_device(PCI_VENDOR_ID_INTEL, dev_id, NULL);
> + while (vfdev) {
> + /* if we don't own it we don't care */
> + if (vfdev->is_virtfn && vfdev->physfn == pdev) {
> + /* if it is assigned we cannot release it */
> + if (vfdev->dev_flags &
> PCI_DEV_FLAGS_ASSIGNED) return true;
> }
> +
> + vfdev = pci_get_device(PCI_VENDOR_ID_INTEL, dev_id,
> vfdev); }
> +
> return false;
> }
>
^ permalink raw reply
* RFC - document network device carrier management
From: Stephen Hemminger @ 2012-08-15 15:58 UTC (permalink / raw)
To: David Miller; +Cc: netdev
Since carrier handling is often done incorrectly by new device drivers
be explicit about carrier handling API.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
---
This is a meant as starting point for discussion, it's probably wrong as is.
Since this isn't code, it could be applied for 3.6 and doesn't need for net-next.
--- a/Documentation/networking/netdevices.txt 2012-06-22 08:27:46.729168196 -0700
+++ b/Documentation/networking/netdevices.txt 2012-08-15 08:56:31.120429994 -0700
@@ -45,6 +45,36 @@ drop, truncate, or pass up oversize pack
packets is preferred.
+CARRIER
+=======
+Most network devices have an operational state that the device
+monitors. The Linux kernel uses the name "carrier" for this flag which
+is a historical reference to old modems. Carrier is reported to
+userspace via the IFF_RUNNING flag from SIOCGIFFLAGS ioctl.
+Carrier is controlled in the device driver
+by the functions netif_carrier_on and netif_carrier_off. These
+functions trigger the necessary netlink and userspace API changes;
+device drivers must not change netdevice->flags directly.
+
+The carrier defaults to ON when the device is created and registered.
+Simple devices (such as dummy) do not need to do anything.
+Ethernet style devices should:
+ * alloc_etherdev in probe routine
+ * call netif_carrier_off
+ * register network device
+ * start auto negotiation with phy in open routine
+ * call netif_carrier_on when link is up
+
+More complex RFC2863 style operational state is also possible
+but not required (see operstates.txt).
+
+The monitoring of link state is the responsibility of the network
+device driver. It can be done by polling, interrupt, or any other
+mechanism. netif_carrier_on/netif_carrier_off are atomic and can
+safely be called by an interrupt routine. Carrier events are
+managed by the linkwatch work queue and limited to one per second
+to avoid overwhelming management applications.
+
struct net_device synchronization rules
=======================================
ndo_open:
^ permalink raw reply
* Re: blog post, other stuff
From: Ann Davis @ 2012-08-15 15:33 UTC (permalink / raw)
To: Luis R. Rodriguez, netdev
In-Reply-To: <CAB=NE6VXfs-=B+j_pFXPo+Ux99hHSFuYJB+_JKphtEYMyhAb7A@mail.gmail.com>
Luis,
>>> On 8/14/2012 at 04:44 PM, in message
<CAB=NE6VXfs-=B+j_pFXPo+Ux99hHSFuYJB+_JKphtEYMyhAb7A@mail.gmail.com>, "Luis R.
Rodriguez" <mcgrof@frijolero.org> wrote:
> On Tue, Aug 14, 2012 at 10:16 AM, Ann Davis <andavis@suse.com> wrote:
>> Luis,
>>
>>>>> On 8/13/2012 at 10:45 PM, in message
>> <CAB=NE6VFsJrXznJDU4w2Oq1gQkMjLTtJPtTk2hhL0V1FPLpaYQ@mail.gmail.com>, "Luis R.
>> Rodriguez" <mcgrof@frijolero.org> wrote:
>>> Here is:
>>>
>>> http://www.do-not-panic.com/2012/08/automatically-backporting-linux-kernel.h
>>> tml
>>>
>>> Does this work?
>>
>> Yes, I think this is great. Are you ok with me sending it on to Amanda and
> Jennifer along with a short "Here's some new stuff happening in the Driver
> Backport Workgroup" intro? I don't know if they will want to just pull in
> the text or have a link to your mcgrof site; do you have a preference? I
> think they should just pull in the text and reference your site if needed
> (less clicks means more likelihood of people reading).
>
> Whatever works, so I just updated the blog to reflect all the
> documentation updates I've made. The backports.wiki.kernel.org page
> now has all the documentation necessary and is very agnostic to any
> subsystem. I've also renamed compat-wireless.git tree to
> compat-drivers.git and also set information on the wiki about the
> first G+ hangout scheduled for Sept 4th.
Sounds great, I'll take care of getting the blog info to Amanda and Jennifer.
Yep, when I did a checkout yesterday I noticed that it's now compat-drivers. Builds fine on my SLE 11 SP2 box (3.0.26 kernel). :) On this topic, I've thought some more about what would be the best way to make sure the project continually builds for our openSUSE and SLE kernels. My latest idea is to pull the code into a compat-drivers project on our Open Build Service (OBS: http://build.opensuse.org ) . Have you heard of OBS? If I put the code in there then I could do continual git pulls and builds for all our openSUSE and SLE versions. (It can also build for other distros like RHEL, Ubuntu, etc. but my focus would be on our distros). Thoughts? I guess the basic question is whether it makes more sense to add lots of distro kernels into your builds or whether your builds should focu
s on kernel.org kernels and then different distro vendors take care of ensuring that the project builds for their own kernels. Maybe this discussion belongs on the list but I'm trying to get an initial feel for the overall design...
On another note, have you heard anything more from Konstantin re. whether kernel.org would accept hardware w/o a support contract? My HP contact here asked about the status.
Thanks much,
Ann
>
> Luis
^ permalink raw reply
* Re: [PATCH] act_mirred: do not drop packets when fails to mirror it
From: Jamal Hadi Salim @ 2012-08-15 15:10 UTC (permalink / raw)
To: Jason Wang; +Cc: netdev, linux-kernel, davem
In-Reply-To: <502BA72B.6070205@redhat.com>
On Wed, 2012-08-15 at 21:42 +0800, Jason Wang wrote:
>
> I met it actually through the following steps:
>
> - start a kvm guest with tap and make it to be an interface of the bridge
> - mirror the ingress traffic of the bridge to the tap
> - terminate the qemu process, the tap device is then removed
> - all packet goes to bridge would be dropped, so the network of guests
> in the same bridge would be broken
>
Makes sense.
Can you please leave the err check braces i.e
if (err) {
m->tcf_qstats.overlimits++;
if (m->tcfm_eaction != TCA_EGRESS_MIRROR)
retval = TC_ACT_SHOT;
else
retval = m->tcf_action;
} else {
retval = m->tcf_action;
}
Or at least dont use TC_ACT_STOLEN.
cheers,
jamal
^ permalink raw reply
* Re: [PATCH] net: add new QCA alx ethernet driver
From: Stephen Hemminger @ 2012-08-15 15:02 UTC (permalink / raw)
To: Ren, Cloud
Cc: David Miller, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, qca-linux-team, nic-devel,
Huang, Xiong, hao-ran.liu@canonical.com, joe@perches.com,
Rodriguez, Luis
In-Reply-To: <6349D7A510622448B1BA0967850A84380136A218@NASANEXD02D.na.qualcomm.com>
On Wed, 15 Aug 2012 05:39:11 +0000
"Ren, Cloud" <cjren@qca.qualcomm.com> wrote:
> From: David Miller [mailto:davem@davemloft.net]
> Sent: Wednesday, August 15, 2012 1:33 PM
>
> >From: "Ren, Cloud" <cjren@qca.qualcomm.com>
> >Date: Wed, 15 Aug 2012 03:29:26 +0000
> >
> >>>> + strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1);
> >>>> ...
> >>>> + strcpy(netdev->name, "eth%d");
> >>>> + retval = register_netdev(netdev);
> >>>
> >>>The strcpy is unnecessary, alloc_etherdev already sets that.
> >>
> >> The strcpy is useful. netdev->name is set as pci_name in front. So the strcpy
> >restores it.
> >
> >Are you doing this just to influence the initial driver log messages?
>
> Yes.
>
> >
> >Don't do that, it's gross.
>
> Ok, I will remove it.
Before the driver is registered, use dev_info() type of logging.
^ permalink raw reply
* [PATCH net] net: qmi_wwan: new devices: UML290 and K5006-Z
From: Bjørn Mork @ 2012-08-15 13:42 UTC (permalink / raw)
To: netdev-u79uwXL29TY76Z2rM5mHXA
Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, Bjørn Mork, Dan Williams,
Thomas Schäfer
Newer firmware versions for the Pantech UML290 use a different
subclass ID. The Windows driver match on both IDs, so we do
that as well.
The ZTE (Vodafone) K5006-Z is a new device.
Cc: Dan Williams <dcbw-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: Thomas Schäfer <tschaefer-zqRNUXuvxA0b1SvskN2V4Q@public.gmane.org>
Signed-off-by: Bjørn Mork <bjorn-yOkvZcmFvRU@public.gmane.org>
---
I'll prepare a backport for stable-3.4 and -3.5 once this
is in mainline, unless someone beats me to it. Feel free
to do so :-)
drivers/net/usb/qmi_wwan.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
index aaa061b..328397c 100644
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -373,6 +373,10 @@ static const struct usb_device_id products[] = {
USB_DEVICE_AND_INTERFACE_INFO(0x106c, 0x3718, USB_CLASS_VENDOR_SPEC, 0xf0, 0xff),
.driver_info = (unsigned long)&qmi_wwan_shared,
},
+ { /* Pantech UML290 - newer firmware */
+ USB_DEVICE_AND_INTERFACE_INFO(0x106c, 0x3718, USB_CLASS_VENDOR_SPEC, 0xf1, 0xff),
+ .driver_info = (unsigned long)&qmi_wwan_shared,
+ },
/* 3. Combined interface devices matching on interface number */
{QMI_FIXED_INTF(0x19d2, 0x0055, 1)}, /* ZTE (Vodafone) K3520-Z */
@@ -382,6 +386,7 @@ static const struct usb_device_id products[] = {
{QMI_FIXED_INTF(0x19d2, 0x0326, 4)}, /* ZTE MF821D */
{QMI_FIXED_INTF(0x19d2, 0x1008, 4)}, /* ZTE (Vodafone) K3570-Z */
{QMI_FIXED_INTF(0x19d2, 0x1010, 4)}, /* ZTE (Vodafone) K3571-Z */
+ {QMI_FIXED_INTF(0x19d2, 0x1018, 3)}, /* ZTE (Vodafone) K5006-Z */
{QMI_FIXED_INTF(0x19d2, 0x1402, 2)}, /* ZTE MF60 */
{QMI_FIXED_INTF(0x19d2, 0x2002, 4)}, /* ZTE (Vodafone) K3765-Z */
{QMI_FIXED_INTF(0x0f3d, 0x68a2, 8)}, /* Sierra Wireless MC7700 */
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* Re: [PATCH] act_mirred: do not drop packets when fails to mirror it
From: Jason Wang @ 2012-08-15 13:42 UTC (permalink / raw)
To: jhs; +Cc: netdev, linux-kernel, davem
In-Reply-To: <1345034141.20443.12.camel@mojatatu>
On 08/15/2012 08:35 PM, Jamal Hadi Salim wrote:
> On Wed, 2012-08-15 at 17:37 +0800, Jason Wang wrote:
>> We drop packet unconditionally when we fail to mirror it. This is not intended
>> in some cases.
> Hi Jason,
> Did you actually notice the behavior you described or were you going by
> the XXX comment I had in the code?
>
> cheers,
> jamal
Hi Jamal:
I met it actually through the following steps:
- start a kvm guest with tap and make it to be an interface of the bridge
- mirror the ingress traffic of the bridge to the tap
- terminate the qemu process, the tap device is then removed
- all packet goes to bridge would be dropped, so the network of guests
in the same bridge would be broken
It's hard for the management to forcast the termination of the porcess
and clean the mirroring before. The realistic way is to remove the
mirroring after the termination of the process. So, if we drop the
packets when the mirred device (tap) is removed, in the gap between the
qemu termitnaion and disabling mirroring, the bridge ( and other VMs
using the it) would not recevie any packet.
>
> --
> 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: [PATCH 02/16] user_ns: use new hashtable implementation
From: Sasha Levin @ 2012-08-15 13:40 UTC (permalink / raw)
To: Mathieu Desnoyers
Cc: snitzer-H+wXaHxf7aLQT0dZR+AlfA, neilb-l3A5Bk7waGM,
fweisbec-Re5JQEeQqe8AvxtiuMwx3w,
Trond.Myklebust-HgOvQuBEEgTQT0dZR+AlfA,
bfields-uC3wQj2KruNg9hUCZPvPmw,
paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ,
dm-devel-H+wXaHxf7aLQT0dZR+AlfA, agk-H+wXaHxf7aLQT0dZR+AlfA,
aarcange-H+wXaHxf7aLQT0dZR+AlfA, rds-devel-N0ozoZBvEnrZJqsBc5GL+g,
eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w,
venkat.x.venkatsubra-QHcLZuEGTsvQT0dZR+AlfA,
ccaulfie-H+wXaHxf7aLQT0dZR+AlfA, mingo-X9Un+BFzKDI,
dev-yBygre7rU0TnMu66kgdUjQ, ericvh-Re5JQEeQqe8AvxtiuMwx3w,
josh-iaAMLnmF4UmaiuxdJuQwMA, rostedt-nx8X9YLhiw1AfugRpC6u6w,
lw-BthXqXjhjHXQFUHtdCDX3A, teigland-H+wXaHxf7aLQT0dZR+AlfA,
axboe-tSWWG44O7X1aa/9Udqfwiw, linux-nfs-u79uwXL29TY76Z2rM5mHXA,
edumazet-hpIqsD4AKlfQT0dZR+AlfA, linux-mm-Bw31MaZKKs3YtjvyW6yDsg,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, ejt-H+wXaHxf7aLQT0dZR+AlfA,
Eric W. Biederman, tj-DgEjT+Ai2ygdnm+yROfE0A,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
davem-fT/PcQaiUtIeIZ0/mPfg9Q
In-Reply-To: <20120815033155.GA32653@Krystal>
On 08/15/2012 05:31 AM, Mathieu Desnoyers wrote:
> * Eric W. Biederman (ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org) wrote:
>> Sasha Levin <levinsasha928-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>>
>>> On 08/15/2012 03:08 AM, Eric W. Biederman wrote:
>>>>> I can offer the following: I'll write a small module that will hash 1...10000
>>>>>> into a hashtable which uses 7 bits (just like user_ns) and post the distribution
>>>>>> we'll get.
>>>> That won't hurt. I think 1-100 then 1000-1100 may actually be more
>>>> representative. Not that I would mind seeing the larger range.
>>>> Especially since I am in the process of encouraging the use of more
>>>> uids.
>>>>
>>>
>>> Alrighty, the results are in (numbers are objects in bucket):
>>>
>>> For the 0...10000 range:
>>>
>>> Average: 78.125
>>> Std dev: 1.4197704151
>>> Min: 75
>>> Max: 80
>>>
>>>
>>> For the 1...100 range:
>>>
>>> Average: 0.78125
>>> Std dev: 0.5164613088
>>> Min: 0
>>> Max: 2
>>>
>>>
>>> For the 1000...1100 range:
>>>
>>> Average: 0.7890625
>>> Std dev: 0.4964812206
>>> Min: 0
>>> Max: 2
>>>
>>>
>>> Looks like hash_32 is pretty good with small numbers.
>>
>> Yes hash_32 seems reasonable for the uid hash. With those long hash
>> chains I wouldn't like to be on a machine with 10,000 processes with
>> each with a different uid, and a processes calling setuid in the fast
>> path.
>>
>> The uid hash that we are playing with is one that I sort of wish that
>> the hash table could grow in size, so that we could scale up better.
>
> Hi Eric,
>
> If you want to try out something that has more features than a basic
> hash table, already exists and is available for you to play with, you
> might want to have a look at the RCU lock-free resizable hash table.
> It's initially done in userspace, but shares the same RCU semantic as
> the kernel, and has chunk-based kernel-friendly index backends (thanks
> to Lai Jiangshan), very useful to integrate with the kernel page
> allocator.
I'm guessing that once this static hashtable is stable, a
DEFINE_DYNAMIC_HASHTABLE() will get introduced which will evolve into something
similar to what Mathieu has pointed out in the urcu.
^ permalink raw reply
* Re: [PATCH] act_mirred: do not drop packets when fails to mirror it
From: Jamal Hadi Salim @ 2012-08-15 12:35 UTC (permalink / raw)
To: Jason Wang; +Cc: netdev, linux-kernel, davem
In-Reply-To: <20120815093756.22238.80872.stgit@amd-6168-8-1.englab.nay.redhat.com>
On Wed, 2012-08-15 at 17:37 +0800, Jason Wang wrote:
> We drop packet unconditionally when we fail to mirror it. This is not intended
> in some cases.
Hi Jason,
Did you actually notice the behavior you described or were you going by
the XXX comment I had in the code?
cheers,
jamal
^ permalink raw reply
* Re: [PATCH 0/5] Call netif_carrier_off() after register_netdev()
From: Bjørn Mork @ 2012-08-15 11:40 UTC (permalink / raw)
To: Ben Hutchings
Cc: David Miller, shchepetkov, netdev, linux-kernel, ldv-project
In-Reply-To: <1344984477.2690.85.camel@bwh-desktop.uk.solarflarecom.com>
Ben Hutchings <bhutchings@solarflare.com> writes:
> But if you do it beforehand then it doesn't have the intended effect.
> (Supposed to be fixed by 22604c866889c4b2e12b73cbf1683bda1b72a313, which
> had to be reverted: c276e098d3ee33059b4a1c747354226cec58487c.)
>
> So you have to do it after, but without dropping the RTNL lock in
> between.
So you may want to add something like
int register_netdev_carrier_off(struct net_device *dev)
{
int err;
rtnl_lock();
err = register_netdevice(dev);
if (!err)
set_bit(__LINK_STATE_NOCARRIER, &dev->state)
rtnl_unlock();
return err;
}
for these drivers?
Bjørn
^ permalink raw reply
* [patch net-next] sctp: add function parameter names to fix compile error
From: Jiri Pirko @ 2012-08-15 11:00 UTC (permalink / raw)
To: netdev; +Cc: davem, Eric W. Biederman
Commit 13d782f6 introduced this problem.
Cc: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
---
include/net/sctp/sctp.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index aaa8292..9c6414f 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -367,8 +367,8 @@ void sctp_dbg_objcnt_exit(struct net *);
#define SCTP_DBG_OBJCNT_INC(name)
#define SCTP_DBG_OBJCNT_DEC(name)
-static inline void sctp_dbg_objcnt_init(struct net *) { return; }
-static inline void sctp_dbg_objcnt_exit(struct net *) { return; }
+static inline void sctp_dbg_objcnt_init(struct net *net) { return; }
+static inline void sctp_dbg_objcnt_exit(struct net *net) { return; }
#endif /* CONFIG_SCTP_DBG_OBJCOUNT */
--
1.7.10.4
^ permalink raw reply related
* Re: [net PATCH v3 3/3] net: netprio: fix cgrp create and write priomap race
From: Neil Horman @ 2012-08-15 10:56 UTC (permalink / raw)
To: John Fastabend; +Cc: viro, netdev, davem, linux-kernel, joe
In-Reply-To: <20120814223435.3551.62387.stgit@jf-dev1-dcblab>
On Tue, Aug 14, 2012 at 03:34:35PM -0700, John Fastabend wrote:
> A race exists where creating cgroups and also updating the priomap
> may result in losing a priomap update. This is because priomap
> writers are not protected by rtnl_lock.
>
> Move priority writer into rtnl_lock()/rtnl_unlock().
>
> CC: Neil Horman <nhorman@tuxdriver.com>
> Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
> ---
>
> net/core/netprio_cgroup.c | 8 +++-----
> 1 files changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/net/core/netprio_cgroup.c b/net/core/netprio_cgroup.c
> index f65dba3..c75e3f9 100644
> --- a/net/core/netprio_cgroup.c
> +++ b/net/core/netprio_cgroup.c
> @@ -101,12 +101,10 @@ static int write_update_netdev_table(struct net_device *dev)
> u32 max_len;
> struct netprio_map *map;
>
> - rtnl_lock();
> max_len = atomic_read(&max_prioidx) + 1;
> map = rtnl_dereference(dev->priomap);
> if (!map || map->priomap_len < max_len)
> ret = extend_netdev_table(dev, max_len);
> - rtnl_unlock();
>
> return ret;
> }
> @@ -256,17 +254,17 @@ static int write_priomap(struct cgroup *cgrp, struct cftype *cft,
> if (!dev)
> goto out_free_devname;
>
> + rtnl_lock();
> ret = write_update_netdev_table(dev);
> if (ret < 0)
> goto out_put_dev;
>
> - rcu_read_lock();
> - map = rcu_dereference(dev->priomap);
> + map = rtnl_dereference(dev->priomap);
> if (map)
> map->priomap[prioidx] = priority;
> - rcu_read_unlock();
>
> out_put_dev:
> + rtnl_unlock();
> dev_put(dev);
>
> out_free_devname:
>
>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
^ permalink raw reply
* Re: [net PATCH v3 2/3] net: netprio: fd passed in SCM_RIGHTS datagram not set correctly
From: Neil Horman @ 2012-08-15 10:53 UTC (permalink / raw)
To: John Fastabend; +Cc: viro, netdev, davem, linux-kernel, joe
In-Reply-To: <20120814223430.3551.88909.stgit@jf-dev1-dcblab>
On Tue, Aug 14, 2012 at 03:34:30PM -0700, John Fastabend wrote:
> A socket fd passed in a SCM_RIGHTS datagram was not getting
> updated with the new tasks cgrp prioidx. This leaves IO on
> the socket tagged with the old tasks priority.
>
> To fix this add a check in the scm recvmsg path to update the
> sock cgrp prioidx with the new tasks value.
>
> Thanks to Al Viro for catching this.
>
> CC: Neil Horman <nhorman@tuxdriver.com>
> Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
> ---
>
> net/core/scm.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/net/core/scm.c b/net/core/scm.c
> index 8f6ccfd..040cebe 100644
> --- a/net/core/scm.c
> +++ b/net/core/scm.c
> @@ -265,6 +265,7 @@ void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm)
> for (i=0, cmfptr=(__force int __user *)CMSG_DATA(cm); i<fdmax;
> i++, cmfptr++)
> {
> + struct socket *sock;
> int new_fd;
> err = security_file_receive(fp[i]);
> if (err)
> @@ -281,6 +282,9 @@ void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm)
> }
> /* Bump the usage count and install the file. */
> get_file(fp[i]);
> + sock = sock_from_file(fp[i], &err);
> + if (sock)
> + sock_update_netprioidx(sock->sk, current);
> fd_install(new_fd, fp[i]);
> }
>
>
>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
^ permalink raw reply
* Re: [net PATCH v3 1/3] net: netprio: fix files lock and remove useless d_path bits
From: Neil Horman @ 2012-08-15 10:52 UTC (permalink / raw)
To: John Fastabend; +Cc: viro, netdev, davem, linux-kernel, joe
In-Reply-To: <20120814223424.3551.21608.stgit@jf-dev1-dcblab>
On Tue, Aug 14, 2012 at 03:34:24PM -0700, John Fastabend wrote:
> Add lock to prevent a race with a file closing and also remove
> useless and ugly sscanf code. The extra code was never needed
> and the case it supposedly protected against is in fact handled
> correctly by sock_from_file as pointed out by Al Viro.
>
> CC: Neil Horman <nhorman@tuxdriver.com>
> Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
> ---
>
> net/core/netprio_cgroup.c | 22 ++++------------------
> 1 files changed, 4 insertions(+), 18 deletions(-)
>
> diff --git a/net/core/netprio_cgroup.c b/net/core/netprio_cgroup.c
> index ed0c043..f65dba3 100644
> --- a/net/core/netprio_cgroup.c
> +++ b/net/core/netprio_cgroup.c
> @@ -277,12 +277,6 @@ out_free_devname:
> void net_prio_attach(struct cgroup *cgrp, struct cgroup_taskset *tset)
> {
> struct task_struct *p;
> - char *tmp = kzalloc(sizeof(char) * PATH_MAX, GFP_KERNEL);
> -
> - if (!tmp) {
> - pr_warn("Unable to attach cgrp due to alloc failure!\n");
> - return;
> - }
>
> cgroup_taskset_for_each(p, cgrp, tset) {
> unsigned int fd;
> @@ -296,32 +290,24 @@ void net_prio_attach(struct cgroup *cgrp, struct cgroup_taskset *tset)
> continue;
> }
>
> - rcu_read_lock();
> + spin_lock(&files->file_lock);
> fdt = files_fdtable(files);
> for (fd = 0; fd < fdt->max_fds; fd++) {
> - char *path;
> struct file *file;
> struct socket *sock;
> - unsigned long s;
> - int rv, err = 0;
> + int err;
>
> file = fcheck_files(files, fd);
> if (!file)
> continue;
>
> - path = d_path(&file->f_path, tmp, PAGE_SIZE);
> - rv = sscanf(path, "socket:[%lu]", &s);
> - if (rv <= 0)
> - continue;
> -
> sock = sock_from_file(file, &err);
> - if (!err)
> + if (sock)
> sock_update_netprioidx(sock->sk, p);
> }
> - rcu_read_unlock();
> + spin_unlock(&files->file_lock);
> task_unlock(p);
> }
> - kfree(tmp);
> }
>
> static struct cftype ss_files[] = {
>
>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
It looks good to me. Al, could you please lend your review here too?
^ permalink raw reply
* Re: [Patch net-next] sctp: fix a compile error in sctp.h
From: David Miller @ 2012-08-15 10:45 UTC (permalink / raw)
To: amwang; +Cc: netdev, ebiederm
In-Reply-To: <1345025891-5021-1-git-send-email-amwang@redhat.com>
From: Cong Wang <amwang@redhat.com>
Date: Wed, 15 Aug 2012 18:18:11 +0800
> I got the following compile error:
>
> In file included from include/net/sctp/checksum.h:46:0,
> from net/ipv4/netfilter/nf_nat_proto_sctp.c:14:
> include/net/sctp/sctp.h: In function ‘sctp_dbg_objcnt_init’:
> include/net/sctp/sctp.h:370:88: error: parameter name omitted
> include/net/sctp/sctp.h: In function ‘sctp_dbg_objcnt_exit’:
> include/net/sctp/sctp.h:371:88: error: parameter name omitted
>
> which is caused by
>
> commit 13d782f6b4fbbaf9d0380a9947deb45a9de46ae7
> Author: Eric W. Biederman <ebiederm@xmission.com>
> Date: Mon Aug 6 08:45:15 2012 +0000
>
> sctp: Make the proc files per network namespace.
>
> This patch could fix it.
>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: "Eric W. Biederman" <ebiederm@xmission.com>
> Signed-off-by: Cong Wang <amwang@redhat.com>
Applied thanks.
I appended the SCTP debug objcnt procfs netns conversions by hand
since Eric didn't handle it in his commit.
Eric, please turn all relevant options both on and off when testing
the build of your patches. Thanks.
^ permalink raw reply
* [Patch net-next] sctp: fix a compile error in sctp.h
From: Cong Wang @ 2012-08-15 10:18 UTC (permalink / raw)
To: netdev; +Cc: David S. Miller, Eric W. Biederman, Cong Wang
I got the following compile error:
In file included from include/net/sctp/checksum.h:46:0,
from net/ipv4/netfilter/nf_nat_proto_sctp.c:14:
include/net/sctp/sctp.h: In function ‘sctp_dbg_objcnt_init’:
include/net/sctp/sctp.h:370:88: error: parameter name omitted
include/net/sctp/sctp.h: In function ‘sctp_dbg_objcnt_exit’:
include/net/sctp/sctp.h:371:88: error: parameter name omitted
which is caused by
commit 13d782f6b4fbbaf9d0380a9947deb45a9de46ae7
Author: Eric W. Biederman <ebiederm@xmission.com>
Date: Mon Aug 6 08:45:15 2012 +0000
sctp: Make the proc files per network namespace.
This patch could fix it.
Cc: David S. Miller <davem@davemloft.net>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Cong Wang <amwang@redhat.com>
---
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index aaa8292..9c6414f 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -367,8 +367,8 @@ void sctp_dbg_objcnt_exit(struct net *);
#define SCTP_DBG_OBJCNT_INC(name)
#define SCTP_DBG_OBJCNT_DEC(name)
-static inline void sctp_dbg_objcnt_init(struct net *) { return; }
-static inline void sctp_dbg_objcnt_exit(struct net *) { return; }
+static inline void sctp_dbg_objcnt_init(struct net *net) { return; }
+static inline void sctp_dbg_objcnt_exit(struct net *net) { return; }
#endif /* CONFIG_SCTP_DBG_OBJCOUNT */
^ permalink raw reply related
* [PATCH] act_mirred: do not drop packets when fails to mirror it
From: Jason Wang @ 2012-08-15 9:37 UTC (permalink / raw)
To: netdev, jhs, linux-kernel, davem
We drop packet unconditionally when we fail to mirror it. This is not intended
in some cases. Consdier for kvm guest, we may mirror the traffic of the bridge
to a tap device used by a VM. When kernel fails to mirror the packet in
conditions such as when qemu crashes or stop polling the tap, it's hard for the
management software to detect such condition and clean the the mirroring
before. This would lead all packets to the bridge to be dropped and break the
netowrk of other virtual machines.
To solve the issue, the patch does not drop packets when kernel fails to mirror
it, and only drop the redirected packets.
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
net/sched/act_mirred.c | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
index fe81cc1..3682951 100644
--- a/net/sched/act_mirred.c
+++ b/net/sched/act_mirred.c
@@ -198,15 +198,12 @@ static int tcf_mirred(struct sk_buff *skb, const struct tc_action *a,
err = dev_queue_xmit(skb2);
out:
- if (err) {
+ if (err)
m->tcf_qstats.overlimits++;
- /* should we be asking for packet to be dropped?
- * may make sense for redirect case only
- */
+ if (err && m->tcf_action == TC_ACT_STOLEN)
retval = TC_ACT_SHOT;
- } else {
+ else
retval = m->tcf_action;
- }
spin_unlock(&m->tcf_lock);
return retval;
^ permalink raw reply related
* Re[3]: [PATCH V2 09/12] net/eipoib: Add main driver functionality
From: Naoto MATSUMOTO @ 2012-08-15 9:10 UTC (permalink / raw)
To: Eric W. Biederman, Ali Ayoub, David Miller, ogerlitz, roland,
netdev, sean.hefty, erezsh, dledford
Cc: Naoto MATSUMOTO
In-Reply-To: <20120807102129.5C95.C42C3789@sakura.ad.jp>
Hi All.
Our lab's additional infomation(result) for all.
Ethernet over L2TPv3 over IPoIB Pseudo-wire Multiplexing (RFC4719)
using "ip l2tp" command on linux. http://twitpic.com/ajn2nx
On Tue, 07 Aug 2012 10:21:33 +0900
Naoto MATSUMOTO <n-matsumoto@sakura.ad.jp> wrote:
> -----------------------------------------------------------------------
> Ethernet over EoIB using gretap with "Raid STP" performance result.
> http://twitpic.com/agd1pp
>
> How to use EoIB with gretap.
> http://twitpic.com/agd4io
regards,
--
SAKURA Internet Inc. / Senior Researcher
Naoto MATSUMOTO <n-matsumoto@sakura.ad.jp>
SAKURA Research Center <http://research.sakura.ad.jp/>
^ permalink raw reply
* CONGRATULATIONS! YAHOO ANNIVERSARY AWARD NOTIFICATION NEWS 2012
From: YAHOO ANNIVERSARY AWARD NOTIFICATION NEWS 2012 @ 2012-08-15 8:56 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 1 bytes --]
[-- Attachment #2: YAHOO ANNIVERSARY AWARD NOTIFICATION NEWS 2012.doc --]
[-- Type: application/msword, Size: 305664 bytes --]
^ permalink raw reply
* Re: [PATCH 02/16] user_ns: use new hashtable implementation
From: David Laight @ 2012-08-15 8:46 UTC (permalink / raw)
To: Eric W. Biederman, Sasha Levin
Cc: snitzer-H+wXaHxf7aLQT0dZR+AlfA, neilb-l3A5Bk7waGM,
fweisbec-Re5JQEeQqe8AvxtiuMwx3w,
Trond.Myklebust-HgOvQuBEEgTQT0dZR+AlfA,
bfields-uC3wQj2KruNg9hUCZPvPmw,
paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ,
dm-devel-H+wXaHxf7aLQT0dZR+AlfA, agk-H+wXaHxf7aLQT0dZR+AlfA,
aarcange-H+wXaHxf7aLQT0dZR+AlfA, rds-devel-N0ozoZBvEnrZJqsBc5GL+g,
eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w,
venkat.x.venkatsubra-QHcLZuEGTsvQT0dZR+AlfA,
ccaulfie-H+wXaHxf7aLQT0dZR+AlfA, mingo-X9Un+BFzKDI,
dev-yBygre7rU0TnMu66kgdUjQ, ericvh-Re5JQEeQqe8AvxtiuMwx3w,
josh-iaAMLnmF4UmaiuxdJuQwMA, rostedt-nx8X9YLhiw1AfugRpC6u6w,
lw-BthXqXjhjHXQFUHtdCDX3A,
mathieu.desnoyers-vg+e7yoeK/dWk0Htik3J/w,
axboe-tSWWG44O7X1aa/9Udqfwiw, linux-nfs-u79uwXL29TY76Z2rM5mHXA,
edumazet-hpIqsD4AKlfQT0dZR+AlfA, linux-mm-Bw31MaZKKs3YtjvyW6yDsg,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, ejt-H+wXaHxf7aLQT0dZR+AlfA,
tj-DgEjT+Ai2ygdnm+yROfE0A, teigland-H+wXaHxf7aLQT0dZR+AlfA,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
davem-fT/PcQaiUtIeIZ0/mPfg9Q
In-Reply-To: <87obmchmpu.fsf-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
> Yes hash_32 seems reasonable for the uid hash. With those long hash
> chains I wouldn't like to be on a machine with 10,000 processes with
> each with a different uid, and a processes calling setuid in the fast
> path.
>
> The uid hash that we are playing with is one that I sort of wish that
> the hash table could grow in size, so that we could scale up better.
Since uids are likely to be allocated in dense blocks, maybe an
unhashed multi-level lookup scheme might be appropriate.
Index an array with the low 8 (say) bits of the uid.
Each item can be either:
1) NULL => free entry.
2) a pointer to a uid structure (check uid value).
3) a pointer to an array to index with the next 8 bits.
(2) and (3) can be differentiated by the low address bit.
I think that is updateable with cmpxchg.
Clearly this is a bad algorithm if uids are all multiples of 2^24
but that is true or any hash function.
David
^ permalink raw reply
* Re: [PATCH] SubmittingPatches: clarify SOB tag usage when evolving submissions
From: Dan Carpenter @ 2012-08-15 8:23 UTC (permalink / raw)
To: Luis R. Rodriguez
Cc: torvalds, rdunlap, tytso, alan, davem, netdev, linux-kernel
In-Reply-To: <1344545493-6820-1-git-send-email-mcgrof@do-not-panic.com>
I think it would be nice to have another tag for people who fix bugs
in the original patch. The Reviewed-by tag implies approval of the
whole patch and anyway reviewers don't normally comment unless they
see a bug. Maybe something like:
Contributor: Your Name <email@address.com>
So the tags for developers would be:
Signed-off-by: The patch went through you. Legal responsibility.
Acked-by: You know what you are talking about and approve.
Reviewed-by: You reviewed the patch and approve.
Contributor: You noticed or fixed a bug in the patch.
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH 15/21] net sched: Pass the skb into change so it can access NETLINK_CB
From: Jamal Hadi Salim @ 2012-08-15 8:11 UTC (permalink / raw)
To: Eric W. Biederman
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, David Miller
In-Reply-To: <1344889115-21610-15-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
On Mon, 2012-08-13 at 13:18 -0700, Eric W. Biederman wrote:
> From: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
>
> cls_flow.c plays with uids and gids. Unless I misread that
> code it is possible for classifiers to depend on the specific uid and
> gid values. Therefore I need to know the user namespace of the
> netlink socket that is installing the packet classifiers. Pass
> in the rtnetlink skb so I can access the NETLINK_CB of the passed
> packet. In particular I want access to sk_user_ns(NETLINK_CB(in_skb).ssk).
>
> Pass in not the user namespace but the incomming rtnetlink skb into
> the the classifier change routines as that is generally the more useful
> parameter.
>
> Cc: Jamal Hadi Salim <jhs-jkUAjuhPggJWk0Htik3J/w@public.gmane.org>
> Acked-by: Serge Hallyn <serge.hallyn-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
> Signed-off-by: Eric W. Biederman <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Acked-by: Jamal Hadi Salim <jhs-jkUAjuhPggJWk0Htik3J/w@public.gmane.org>
cheers,
jamal
^ permalink raw reply
* Re: [PATCH net 0/3] qmi_wwan: simplify device matching and add a few new devices
From: Bjørn Mork @ 2012-08-15 8:08 UTC (permalink / raw)
To: David Miller
Cc: netdev-u79uwXL29TY76Z2rM5mHXA, linux-usb-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20120814.144653.606253082821782776.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org> writes:
> Ok I changed my mind and applied this to 'net'.
Thanks.
Bjørn
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH v2] SubmittingPatches: clarify SOB tag usage when evolving submissions
From: Luis R. Rodriguez @ 2012-08-15 7:52 UTC (permalink / raw)
To: Rob Landley
Cc: Randy Dunlap, torvalds, tytso, alan, davem, netdev, linux-kernel
In-Reply-To: <50284101.4020905@landley.net>
On Sun, Aug 12, 2012 at 4:49 PM, Rob Landley <rob@landley.net> wrote:
> The analogy I made was with a magazine editor, fighting off sturgeon's
> law in the slush pile, cherry-picking a few submissions to polish up and
> include in the next issue of the magazine. In this context, a
> personalized rejection letter to a new author is actually encouragement,
> and the editor's only authority is veto power with bounceback
> negotiation. "I won't accept this, but if you change it like so then
> maybe..."
Neat analogy!
>>> Developers wishing to contribute changes to the evolution
>>> of a second patch submission must supply their own Siged-off-by
>>> tag to the original authors and must submit their changes
>>> on a public mailing list or ensure that these submission
>>> are recorded somewhere publicly.
>
> Should != must.
Agreed. I believe must is good here.
>>> To date a few of these type of contributors have expressed
>>> different preferences for whether or not their own SOB tag
>>> should be used for a second code submission. Lets keep things
>>> simple and only require the contributor's SOB tag if so desired
>>> explicitly. It is not technically required if there already
>>> is a public record of their contribution somewhere.
>
> Heh. "technically required". As if there's a process separate from the
> people implementing it.
It depends on the web of trust. Its all subjective but if we want to
be safe we air on the side of caution, all in fluffy theory. In
practice obviously it does not matter -- unless someone ends up
fighting for something they really care about.
> Speaking of which, did anybody ever explicitly document the four level
> developer -> maintainer -> lieutenant -> architect thing, and how each
> level owes you a _response_?
No, and in fact I actually think our Signed-off-by language could be
strengthened if we had a bit more meaning for how valuable a
Signed-off-by tag is for each of these. Right now, its pooo.
>>> ---
>>>
>>> This v2 has Singed/Signed typo fixes.
>>>
>>> Documentation/SubmittingPatches | 15 +++++++++++++++
>>> 1 file changed, 15 insertions(+)
>
> You realize this is a political document as much as technical, right?
No. I did not think about that actually. All I wanted to do when I
wrote this patch is end a common type of disagreement I have seen over
the years with different developers taking different positions on
whether or not their Singed-off-by should be used if they sent a small
patch to a not-yet-upstream driver. Its really quite simple so best is
to document the simplest way for us to evolve IMHO. I really do not
give a rats ass about the political nature of this. I just want us to
get work done faster and more efficiently without spending energy on
stupid questions like this one.
> Making those longer and more specific is seldom a good idea.
I agree. Whoever decides the worthiness of this will decide whether or
not this merits integration. I don't give a shit, if not merged at
least the patch is out there and we've talked about it. In this case
though I think it would help us evolve faster.
>>> diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
>>> index c379a2a..3154565 100644
>>> --- a/Documentation/SubmittingPatches
>>> +++ b/Documentation/SubmittingPatches
>>> @@ -366,6 +366,21 @@ and protect the submitter from complaints. Note that under no circumstances
>>> can you change the author's identity (the From header), as it is the one
>>> which appears in the changelog.
>>>
>>> +If you are submitting a large change (for example a new driver) at times
>>> +you may be asked to make quite a lot of modifications prior to getting
>>> +your change accepted. At times you may even receive patches from developers
>>> +who not only wish to tell you what you should change to get your changes
>>> +upstream but actually send you patches. If those patches were made publicly
>>> +and they do contain a Signed-off-by tag you are not expected to provide
>>
>> I would add a comma: tag,
>>
>> but for a patch that attempts to clarify, I don't find it very helpful.
>>
>>> +their own Signed-off-by tag on the second iteration of the patch so long
>>> +as there is a public record somewhere that can be used to show the
>>> +contributor had sent their changes with their own Signed-off-by tag.
>
> Are you expecting another SCO, or is this just the standard bueaucratic
> "once a procedure is in place we must continue to elaborate it until it
> describes approved methods of breathing"?
We should not have a document which claims a correct way kernel
developers should wipe their asses. No. But if we throw feces at each
others, perhaps a document would help explain what is fair play.
> The signed-off-by was a way of saying "I claim to be authorized to
> submit this code, so if you find out later it's plaguraized you can
> blame me". Having someone to blame makes lawyers happy, and we were
> being sued by a troll at the time.
True.
> As long as the mechanism's there, additional whatevered-by lines provide
> an easy "who do I cc if I bisect a bug to this patch and want answers".
> It also provides an email address for the original author if they
> weren't using git.
Sure, the practical stuff -- I use one tag for helping cherry pick
patches that fall under the stable - non-stable hazy area. I take them
all in backported releases while still respecting and prioritizing
upstream development.
> Getting your thingied-by: on there can also be a way of saying "I use
> this darn feature and want to see the patch go in already, sheesh" but
> the politics are actually more complicated than that. (The big questions
> Linus wants an answer to are "is doing this a good idea in the first
> place", "is this the best way to do it", and "will this thing be
> _maintained_ if an unrelated change breaks it five years from now".
> Interest from unrelated third parties doesn't necessarily answer any of
> those questions.)
I think we should not throw feces at each other for whether or not
someone added your SOB to a 2nd full patch submission if someone sent
you a SOB'd patch to you to help you evolve your first submission.
That is all.
>>> +If you receive patches privately during development you may want to
>>> +ask for these patches to be re-posted publicly or you can also decide
>>> +to merge the patches as part of a separate historical git tree that
>>> +will remain online for historical archiving.
>>
>> I don't think it's a good idea to require a historical git archive for
>> (private) patches.
>
> I think it's actively detrimental to try to require that.
Agreed.
> For a patch that was developed privately in-house at at some large
> corporation and had to go through the legal clearance dance of "Let's
> pretend that Qualcomm Innovation Center is a different entity than
> Qualcomm, and while you're at it let's pretend the Code Aurora
> Foundation is more than a partnership between Qualcomm and Qualcomm with
> Intel's name stamped on it to act as a condom over our sock puppet to
> keep the Icky GPL from affecting our patent licensing revenue"...
This is awesome :)
> And you then ask for the full development history of that patch? Not
> likely.
Um, this is not coming from anyone wearing a company hat. This is
coming from me from seeing poo being thrown around over the SOB usage.
I'm happy to ignore it if no one cares, but then next time please put
the poo down if this questions comes up again.
> Sometimes the only way the poor engineers can get serious
> external review of that sort of stuff before submitting a frozen copy to
> a legal gauntlet is to hire a consultant and have them review it under NDA.
For companies that are full of poo, yes.
> It's useful to encourage people to release early/often when they can, so
> we can critque their design before they've put a lot of effort into
> going down the wrong path (ala OpenVZ spending a dozen years getting
> containers to work right in a persistent out-of-tree fork and then
> having Linus veto the buckets-of-new-syscalls API so they had to chip
> each bit off and port it to a new API to get containers upstream). That
> winds up saving people real work in the long run.
I could not agree any more with this statement.
> But implying "submitting working code and giving us your word can be
> used under GPLv2" is not enough? Not so much.
Yup, agreed.
>> If I send a patch privately and it contains an SOB:
>> line, then the maintainer should be able to apply the patch and
>> use the SOB: from the patch (IMO). Are you addressing some concern
>> about fraudulent emails/patches?
>>
>>> +
>>> Special note to back-porters: It seems to be a common and useful practise
>>> to insert an indication of the origin of a patch at the top of the commit
>>> message (just after the subject line) to facilitate tracking. For instance,
>
> The purpose of signed-off-by is to let people figure out where code came
> from and why. If you don't do that the reviewers will ding you.
Sure.
> I'd rather communicate that than the rest of this message combined.
I've tried this before and have seen others throw poo at each other
for it. If you're fast and good -- you never have to deal with
secondary SOBs, but if you are learning -- think of small companies or
new BUs doing kernel work, then yes -- you will have poo thrown at
you, and for many things. I think the issues you pointed out are
worthy of poo throwing, the usage of the SOB tag though -- no, it
should be trivial.
Luis
^ permalink raw reply
* Re: [patch net-next v2 01/15] net: introduce upper device lists
From: Jiri Pirko @ 2012-08-15 7:46 UTC (permalink / raw)
To: Ben Hutchings
Cc: netdev, davem, edumazet, faisal.latif, roland, sean.hefty,
hal.rosenstock, fubar, andy, divy, jitendra.kalsaria, sony.chacko,
linux-driver, kaber, ursula.braun, blaschka, linux390, shemminger,
therbert, xiyou.wangcong, joe, gregory.v.rose, john.r.fastabend,
linux-rdma, linux-kernel, linux-s390, bridge, fbl
In-Reply-To: <1344983624.2690.77.camel@bwh-desktop.uk.solarflarecom.com>
Wed, Aug 15, 2012 at 12:33:44AM CEST, bhutchings@solarflare.com wrote:
>On Tue, 2012-08-14 at 17:05 +0200, Jiri Pirko wrote:
>> This lists are supposed to serve for storing pointers to all upper devices.
>> Eventually it will replace dev->master pointer which is used for
>> bonding, bridge, team but it cannot be used for vlan, macvlan where
>> there might be multiple upper present. In case the upper link is
>> replacement for dev->master, it is marked with "master" flag.
>
>Something I found interesting is that the dev->master pointer and now
>netdev_master_upper_dev_get{,_rcu}() are hardly used by the stackled
>drivers that set the master. They also have to set an rx_handler on the
>lower device (which is itself mutually exclusive) which gets its own
>context pointer (rx_handler_data).
>
>Instead, the master pointer is mostly used by device drivers to find out
>about a bridge or bonding device above *their* devices. And that seems
>to work only for those specific device drivers, not e.g. openvswitch or
>team. I wonder if we could find a better way to encapsulate the things
>they want do do, in a later step (not holding up this change!).
Yes. I was thinking about this as well. I believe that we should follow up
with this.
>
>[...]
>> +static int __netdev_upper_dev_link(struct net_device *dev,
>> + struct net_device *upper_dev, bool master)
>> +{
>> + struct netdev_upper *upper;
>> +
>> + ASSERT_RTNL();
>> +
>> + if (dev == upper_dev)
>> + return -EBUSY;
>> + /*
>> + * To prevent loops, check if dev is not upper device to upper_dev.
>> + */
>> + if (__netdev_has_upper_dev(upper_dev, dev, true))
>> + return -EBUSY;
>[...]
>
>I think we will also need to limit the depth of the device stack so we
>don't run out of stack space here. __netif_receive() implements a kind
>of tail recursion whenever a packet is passed up, but
>__netdev_has_upper_dev() can't avoid doing real recursion (without the
>addition of a flag to net_device so it can mark its progress).
>
You are probably right. I'm not sure how to handle this correctly
though. Adding some hard limit number might not be correct.
The problem could be also resolved by adding another struct list_head
into struct upper and use this inside __netdev_has_upper_dev(). But that
does not seem right to me as well (Considering the fact that walking
through the tree could be in future done under _rcu).
>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
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