Netdev List
 help / color / mirror / Atom feed
* Re: pull-request: wireless-drivers-next 2015-02-07
From: David Miller @ 2015-02-09 20:13 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless, netdev
In-Reply-To: <87a90qosos.fsf@kamboji.qca.qualcomm.com>

From: Kalle Valo <kvalo@codeaurora.org>
Date: Sat, 07 Feb 2015 13:40:51 +0200

> There's a small conflict in drivers/net/wireless/rtlwifi/pci.c, the fix
> is to leave the two labels like this:
> 
> 			schedule_work(&rtlpriv->works.lps_change_work);
> 		}
> end:
> 		skb = new_skb;
> no_new:
> 		if (rtlpriv->use_new_trx_flow) {
> 
> 

That can't be the correct resolution:

drivers/net/wireless/rtlwifi/pci.c: In function ‘_rtl_pci_rx_interrupt’:
drivers/net/wireless/rtlwifi/pci.c:934:1: warning: label ‘end’ defined but not used [-Wunused-label]

So I've removed that label in the merge commit.

> Please let me know if there are any issues and sorry for being late.

Pulled, thanks a lot.

^ permalink raw reply

* Re: [PATCH v2 1/3] bridge: Base the BR_PROXYARP decision on the target port flag
From: Jouni Malinen @ 2015-02-09 19:54 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, kyeyoonp
In-Reply-To: <20150207.215922.1914777712701024499.davem@davemloft.net>

On Sat, Feb 07, 2015 at 09:59:22PM -0800, David Miller wrote:
> From: Jouni Malinen <jouni@codeaurora.org>
> > When doing proxy ARP, instead of checking the bridge port flag for
> > BR_PROXYARP on the bridge port on which the frame was received, check
> > the bridge port flag of the bridge port to which the target device
> > belongs.
> 
> This is a semantic change, what if the administrator wanted the
> current behavior?
> 
> I'm not applying this.  If you want the new behavior, it will have
> to be at a minimum turned on via a sysctl that defaults to OFF.

Agreed, this does change the semantics of the commit 958501163ddd
("bridge: Add support for IEEE 802.11 Proxy ARP"). However, I see this
as a bug fix rather than new behavior. In other words, this set of three
patches came up from extended testing coverage and issues found during
implementation of automated protocol tests. Taken into account that this
BR_PROXYARP functionality was added recently and I'm not aware of a use
case that would use the current design, I was hoping to avoid the added
complexity of configuration parameters for something that I do not
expect to be needed.

This IEEE 802.11 Proxy ARP functionality is still work in progress in
the sense that the IPv6 patch has not yet been contributed (RFC version
would be ready, but I'm waiting for the IPv4 side to get fully
completed).


If a configuration parameter is required for this, what would the
preferred way of adding it in net/bridge? It looks like only
br_netfilter.c is currently using sysctl. Would netlink with another
BRPORT_ATTR_FLAG similarly to BR_PROXYARP be a suitable alternative?

-- 
Jouni Malinen                                            PGP id EFC895FA

^ permalink raw reply

* Re: Kill I4L?
From: One Thousand Gnomes @ 2015-02-09 19:48 UTC (permalink / raw)
  To: Tilman Schmidt
  Cc: Bas Peters, Karsten Keil, Paul Bolle, Joe Perches,
	Sergei Shtylyov, isdn@linux-pingi.de, Julia Lawall, David Miller,
	netdev, linux-kernel
In-Reply-To: <54D891C0.2010303@imap.cc>

> The reason is the maintenance load it produces. There's a continuous,
> annoying trickle of patch  proposals, discussions, conflicts with
> development in other, still actively maintained areas of the kernel,
> and so on. The present discussion being a point in case.
> 
> > Does it hurt anyone to leave the code in there, despite it barely 
> > being used?
> 
> Yes it does. Not much, but the pain is increasing over the years.
> Every time someone tries to touch that code there's the problem
> that no one can actually answer for it, much less test anything.

The same has been happening with a lot of other code. For i2o I've
followed the pattern a few other drivers have used. I sent GregKH a patch
to move it into staging, and if nobody steps up then it will vanish in a
few releases.

> > We're not talking about a particularly huge driver here, either.
> 
> But one that's particularly difficult to maintain, without
> providing any noticeable benefit in return.

I'm also not sure a pretty, polished and untested driver is actually
better than someone who needs it going back to an old tree and a known
working driver to forward port.

Alan

^ permalink raw reply

* Re: [PATCH] net:ethernet:intel:Remove outdated fix me comment in the function, gb_acquire_swfw_sync_i210
From: Nick Krause @ 2015-02-09 19:35 UTC (permalink / raw)
  To: Hisashi T Fujinaka
  Cc: linux.nics, e1000-devel@lists.sourceforge.net,
	netdev@vger.kernel.org, bruce.w.allan,
	linux-kernel@vger.kernel.org, jesse.brandeburg, john.ronciak,
	Andrej Manduch, Bjørn Mork
In-Reply-To: <alpine.NEB.2.11.1502090901440.395@chris.i8u.org>

On Mon, Feb 9, 2015 at 12:03 PM, Hisashi T Fujinaka <htodd@twofifty.com> wrote:
> On Mon, 9 Feb 2015, Bj?rn Mork wrote:
>
>> Jeff Kirsher <jeffrey.t.kirsher@intel.com> writes:
>>
>>> If you want to see Nick's patch, feel free to view his patch on
>>> my queue tree:
>>> https://git.kernel.org/cgit/linux/kernel/git/jkirsher/queue.git/
>>
>> which said:
>>  - s32 i = 0, timeout = 200; /* FIXME: find real value to use here */
>>  + s32 i = 0, timeout = 200;
>>
>>
>> Comments like the one deleted by that patch do have some value in my
>> opinion: They document that the constant is chosen arbitrarily and is
>> not taken from some datasheet.
>>
>> Not a big deal, but leaving such comments, even if the value never ever
>> changes, could save someone from trying to figure out where the heck you
>> got that constant.  And there's noone actually misinterpreting this
>> comment as "something needs to be fixed here", is there? So the cost of
>> leaving the comment is exactly zero.
>>
>> Just my .02 ?.  I'm not going to tell you how to maintain your driver,
>> of course.  At least I try not to :-)
>
> I think, for now, we should NAK this. It's a short comment and you don't
> want me to replace it with a philosophical statement on how you could
> tune the timeout. That's what the data sheet is for.
>
> (Replying from my home account and not my work account -
> todd.fujinaka@intel.com)
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming. The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> E1000-devel mailing list
> E1000-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/e1000-devel
> To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired
That's fine, however if that is the case why not just explain the
reasons for these values in
another patch with a added comment rather then just removing the FIXME.
 Nick

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired

^ permalink raw reply

* Re: [PATCH] net: dsa: Remove redundant phy_attach()
From: Florian Fainelli @ 2015-02-09 19:21 UTC (permalink / raw)
  To: Andrew Lunn, davem; +Cc: netdev
In-Reply-To: <1423445395-412-1-git-send-email-andrew@lunn.ch>

On 08/02/15 17:29, Andrew Lunn wrote:
> dsa_slave_phy_setup() finds the phy for the port via device tree and
> using of_phy_connect(), or it uses the fall back of taking a phy from
> the switch internal mdio bus and calling phy_connect_direct(). Either
> way, if a phy is found, phy_attach_direct() is called to attach the
> phy to the slave device.
> 
> In dsa_slave_create(), a second call to phy_attach() is made. This
> results in the warning "PHY already attached". Remove this second,
> redundant attaching of the phy.
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Tested-by: Florian Fainelli <f.fainelli@gmail.com>

> ---
>  net/dsa/slave.c | 13 -------------
>  1 file changed, 13 deletions(-)
> 
> diff --git a/net/dsa/slave.c b/net/dsa/slave.c
> index 589aafd01fc5..d104ae15836f 100644
> --- a/net/dsa/slave.c
> +++ b/net/dsa/slave.c
> @@ -676,18 +676,5 @@ dsa_slave_create(struct dsa_switch *ds, struct device *parent,
>  
>  	netif_carrier_off(slave_dev);
>  
> -	if (p->phy != NULL) {
> -		if (ds->drv->get_phy_flags)
> -			p->phy->dev_flags |= ds->drv->get_phy_flags(ds, port);
> -
> -		phy_attach(slave_dev, dev_name(&p->phy->dev),
> -			   PHY_INTERFACE_MODE_GMII);
> -
> -		p->phy->autoneg = AUTONEG_ENABLE;
> -		p->phy->speed = 0;
> -		p->phy->duplex = 0;
> -		p->phy->advertising = p->phy->supported | ADVERTISED_Autoneg;
> -	}
> -
>  	return slave_dev;
>  }
> 


-- 
Florian

^ permalink raw reply

* Re: [PATCH] prevent the read ahead of /proc/slabinfo in ss
From: David Miller @ 2015-02-09 19:16 UTC (permalink / raw)
  To: brytonlee01; +Cc: stephen, netdev
In-Reply-To: <1423481830-9599-1-git-send-email-brytonlee01@gmail.com>

From: Bryton Lee <brytonlee01@gmail.com>
Date: Mon,  9 Feb 2015 19:37:10 +0800

> @@ -617,6 +617,7 @@ struct slabstat
>  };
>  
>  struct slabstat slabstat;
> +int slabstat_valid = 0;
>  
>  static const char *slabstat_ids[] =
>  {

Nothing sets this to a non-zero value.  If nothing is going to set it to
a non-zero value, the code it guards should simple be removed instead.

Otherwise, nothing uses this variable outside of this file, and if
that's intentional it should be static.

^ permalink raw reply

* [PATCH] ath9k_htc: add adaptive usb receive flow control to repair soft lockup with monitor mode
From: Yuwei Zheng @ 2015-02-09 18:31 UTC (permalink / raw)
  To: linux-kernel, ath9k-devel, linux-wireless, kvalo, ath9k-devel
  Cc: netdev, zhengyuwei, Yuwei Zheng

The ath9k_hif_usb_rx_cb function excute on  the interrupt context, and ath9k_rx_tasklet excute
on the soft irq context. In other words, the ath9k_hif_usb_rx_cb have more chance to excute than
ath9k_rx_tasklet.  So in the worst condition,  the rx.rxbuf receive list is always full,
and the do {}while(true) loop will not be break. The kernel get a soft lockup panic. 
 
[59011.007210] BUG: soft lockup - CPU#0 stuck for 23s!
[kworker/0:0:30609]
[59011.030560] BUG: scheduling while atomic: kworker/0:0/30609/0x40010100
[59013.804486] BUG: scheduling while atomic: kworker/0:0/30609/0x40010100
[59013.858522] Kernel panic - not syncing: softlockup: hung tasks
 
[59014.038891] Exception stack(0xdf4bbc38 to 0xdf4bbc80)
[59014.046834] bc20:                                                       de57b950 60000113
[59014.059579] bc40: 00000000 bb32bb32 60000113 de57b948 de57b500 dc7bb440 df4bbcd0 00000000
[59014.072337] bc60: de57b950 60000113 df4bbcd0 df4bbc80 c04c259d c04c25a0 60000133 ffffffff
[59014.085233] [<c04c28db>] (__irq_svc+0x3b/0x5c) from [<c04c25a0>] (_raw_spin_unlock_irqrestore+0xc/0x10)
[59014.100437] [<c04c25a0>] (_raw_spin_unlock_irqrestore+0xc/0x10) from [<bf9c2089>] (ath9k_rx_tasklet+0x290/0x490 [ath9k_htc])
[59014.118267] [<bf9c2089>] (ath9k_rx_tasklet+0x290/0x490 [ath9k_htc]) from [<c0036d23>] (tasklet_action+0x3b/0x98)
[59014.134132] [<c0036d23>] (tasklet_action+0x3b/0x98) from [<c0036709>] (__do_softirq+0x99/0x16c)
[59014.147784] [<c0036709>] (__do_softirq+0x99/0x16c) from [<c00369f7>] (irq_exit+0x5b/0x5c)
[59014.160653] [<c00369f7>] (irq_exit+0x5b/0x5c) from [<c000cfc3>] (handle_IRQ+0x37/0x78)
[59014.173124] [<c000cfc3>] (handle_IRQ+0x37/0x78) from [<c00085df>] (omap3_intc_handle_irq+0x5f/0x68)
[59014.187225] [<c00085df>] (omap3_intc_handle_irq+0x5f/0x68) from [<c04c28db>](__irq_svc+0x3b/0x5c)
 
This bug can be see with low performance board, such as uniprocessor beagle bone board. Add some debug message in the ath9k_hif_usb_rx_cb
function may trigger this bug quickly.
 
Signed-off-by: Yuwei Zheng <yuweizheng@139.com>
---
 drivers/net/wireless/ath/ath9k/hif_usb.c       | 78 +++++++++++++++++++++++---
 drivers/net/wireless/ath/ath9k/hif_usb.h       | 13 +++++
 drivers/net/wireless/ath/ath9k/htc.h           | 19 +++++++
 drivers/net/wireless/ath/ath9k/htc_drv_debug.c | 53 +++++++++++++++++
 drivers/net/wireless/ath/ath9k/htc_drv_txrx.c  | 58 +++++++++++++++++++
 5 files changed, 214 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
index 8e7153b..2e73e19 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
@@ -640,6 +640,7 @@ static void ath9k_hif_usb_rx_cb(struct urb *urb)
 	struct hif_device_usb *hif_dev =
 		usb_get_intfdata(usb_ifnum_to_if(urb->dev, 0));
 	int ret;
+	int delay;
 
 	if (!skb)
 		return;
@@ -658,7 +659,6 @@ static void ath9k_hif_usb_rx_cb(struct urb *urb)
 	default:
 		goto resubmit;
 	}
-
 	if (likely(urb->actual_length != 0)) {
 		skb_put(skb, urb->actual_length);
 		ath9k_hif_usb_rx_stream(hif_dev, skb);
@@ -667,12 +667,23 @@ static void ath9k_hif_usb_rx_cb(struct urb *urb)
 resubmit:
 	skb_reset_tail_pointer(skb);
 	skb_trim(skb, 0);
-
-	usb_anchor_urb(urb, &hif_dev->rx_submitted);
-	ret = usb_submit_urb(urb, GFP_ATOMIC);
-	if (ret) {
-		usb_unanchor_urb(urb);
-		goto free;
+	spin_lock(&hif_dev->aurfc_lock);
+	/* submit the urb more slowly for flow control */
+	if (atomic_read(&hif_dev->aurfc_submit_delay) > 0 &&
+	    hif_dev->aurfc_active == 1) {
+		usb_anchor_urb(urb, &hif_dev->rx_delayed_submitted);
+		delay = atomic_read(&hif_dev->aurfc_submit_delay);
+		schedule_delayed_work(&hif_dev->aurfc_delayed_work,
+				      msecs_to_jiffies(delay));
+		spin_unlock(&hif_dev->aurfc_lock);
+	} else {
+		spin_unlock(&hif_dev->aurfc_lock);
+		usb_anchor_urb(urb, &hif_dev->rx_submitted);
+		ret = usb_submit_urb(urb, GFP_ATOMIC);
+		if (ret) {
+			usb_unanchor_urb(urb);
+			goto free;
+		}
 	}
 
 	return;
@@ -818,9 +829,53 @@ err:
 	return -ENOMEM;
 }
 
+static void aurfc_submit_handler(struct work_struct *work)
+{
+	struct hif_device_usb *hif_dev =
+		container_of(work,
+			     struct hif_device_usb,
+			     aurfc_delayed_work.work);
+	struct urb *urb = NULL;
+	struct sk_buff *skb = NULL;
+	int ret;
+	int loop_times = 0;
+
+	AURFC_STAT_INC(aurfc_called);
+	while (true) {
+		loop_times++;
+		if (loop_times > MAX_RX_URB_NUM)
+			atomic_add(AURFC_STEP,
+				   &hif_dev->aurfc_submit_delay);
+
+		urb = usb_get_from_anchor(
+				&hif_dev->rx_delayed_submitted);
+		if (urb) {
+			skb = (struct sk_buff *)urb->context;
+			ret = usb_submit_urb(urb, GFP_KERNEL);
+			if (ret != 0) {
+				usb_unanchor_urb(urb);
+				dev_kfree_skb_any(skb);
+				urb->context = NULL;
+			}
+		} else {
+			break;
+		}
+	}
+}
+
 static void ath9k_hif_usb_dealloc_rx_urbs(struct hif_device_usb *hif_dev)
 {
+	unsigned long flags;
+
+	spin_lock_irqsave(&hif_dev->aurfc_lock, flags);
+	hif_dev->aurfc_active = 0;
+	/* excute the last queued work immediately */
+	mod_delayed_work(system_wq, &hif_dev->aurfc_delayed_work, 0);
+	spin_unlock_irqrestore(&hif_dev->aurfc_lock, flags);
+	/* wait the last work finish, otherwise kill urbs may deadlock */
+	flush_delayed_work(&hif_dev->aurfc_delayed_work);
 	usb_kill_anchored_urbs(&hif_dev->rx_submitted);
+	usb_kill_anchored_urbs(&hif_dev->rx_delayed_submitted);
 }
 
 static int ath9k_hif_usb_alloc_rx_urbs(struct hif_device_usb *hif_dev)
@@ -830,8 +885,17 @@ static int ath9k_hif_usb_alloc_rx_urbs(struct hif_device_usb *hif_dev)
 	int i, ret;
 
 	init_usb_anchor(&hif_dev->rx_submitted);
+	init_usb_anchor(&hif_dev->rx_delayed_submitted);
+
 	spin_lock_init(&hif_dev->rx_lock);
 
+	/* add for adaptive usb receive flow control*/
+	atomic_set(&hif_dev->aurfc_submit_delay, 0);
+	INIT_DELAYED_WORK(&hif_dev->aurfc_delayed_work,
+			  aurfc_submit_handler);
+	spin_lock_init(&hif_dev->aurfc_lock);
+	hif_dev->aurfc_active = 1;
+
 	for (i = 0; i < MAX_RX_URB_NUM; i++) {
 
 		/* Allocate URB */
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.h b/drivers/net/wireless/ath/ath9k/hif_usb.h
index 51496e7..2ff59be 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.h
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.h
@@ -41,6 +41,7 @@
 #define MAX_RX_URB_NUM  8
 #define MAX_RX_BUF_SIZE 16384
 #define MAX_PKT_NUM_IN_TRANSFER 10
+#define AURFC_STEP 70  /* millisecond */
 
 #define MAX_REG_OUT_URB_NUM  1
 #define MAX_REG_IN_URB_NUM   64
@@ -98,9 +99,21 @@ struct hif_device_usb {
 	struct hif_usb_tx tx;
 	struct usb_anchor regout_submitted;
 	struct usb_anchor rx_submitted;
+	/* anchor delayed urb */
+	struct usb_anchor rx_delayed_submitted;
 	struct usb_anchor reg_in_submitted;
 	struct usb_anchor mgmt_submitted;
 	struct sk_buff *remain_skb;
+
+	/* adaptive usb receive flow control */
+	struct delayed_work aurfc_delayed_work;
+	/* to protect the delayed work */
+	spinlock_t aurfc_lock;
+	/* urb submit delay, in millisecond */
+	atomic_t  aurfc_submit_delay;
+	/* set to 1, if the urb can be delayed submit */
+	int aurfc_active;
+
 	const char *fw_name;
 	int rx_remain_len;
 	int rx_pkt_len;
diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h
index 9dde265..1586bd2 100644
--- a/drivers/net/wireless/ath/ath9k/htc.h
+++ b/drivers/net/wireless/ath/ath9k/htc.h
@@ -331,6 +331,13 @@ static inline struct ath9k_htc_tx_ctl *HTC_SKB_CB(struct sk_buff *skb)
 
 #define TX_QSTAT_INC(q) (priv->debug.tx_stats.queue_stats[q]++)
 
+#define AURFC_STAT_INC(c) \
+	(hif_dev->htc_handle->drv_priv->debug.aurfc_stats.c++)
+#define AURFC_STAT_ADD(c, a) \
+	(hif_dev->htc_handle->drv_priv->debug.aurfc_stats.c += a)
+#define AURFC_STAT_SET(c, a) \
+	(hif_dev->htc_handle->drv_priv->debug.aurfc_stats.c = a)
+
 void ath9k_htc_err_stat_rx(struct ath9k_htc_priv *priv,
 			   struct ath_rx_status *rs);
 
@@ -352,11 +359,20 @@ struct ath_skbrx_stats {
 	u32 skb_dropped;
 };
 
+struct ath_aurfc_stats {
+	u32 aurfc_highwater;
+	u32 aurfc_lowwater;
+	u32 aurfc_wm_triggered;
+	u32 aurfc_submit_delay;
+	u32 aurfc_called;
+};
+
 struct ath9k_debug {
 	struct dentry *debugfs_phy;
 	struct ath_tx_stats tx_stats;
 	struct ath_rx_stats rx_stats;
 	struct ath_skbrx_stats skbrx_stats;
+	struct ath_aurfc_stats aurfc_stats;
 };
 
 void ath9k_htc_get_et_strings(struct ieee80211_hw *hw,
@@ -377,6 +393,9 @@ void ath9k_htc_get_et_stats(struct ieee80211_hw *hw,
 
 #define TX_QSTAT_INC(c) do { } while (0)
 
+#define AURFC_STAT_INC(c) do {} while (0)
+#define AURFC_STAT_ADD(c, a) do {} while (0)
+#define AURFC_STAT_SET(c, a) do {} while (0)
 static inline void ath9k_htc_err_stat_rx(struct ath9k_htc_priv *priv,
 					 struct ath_rx_status *rs)
 {
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
index 8cef1ed..a6be9be 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
@@ -286,6 +286,54 @@ static const struct file_operations fops_skb_rx = {
 	.llseek = default_llseek,
 };
 
+static ssize_t read_file_aurfc(struct file *file,
+			       char __user *user_buf,
+			       size_t count, loff_t *ppos)
+{
+	struct ath9k_htc_priv *priv = file->private_data;
+	char *buf;
+	unsigned int len = 0, size = 1500;
+	ssize_t retval = 0;
+
+	buf = kzalloc(size, GFP_KERNEL);
+	if (!buf)
+		return -ENOMEM;
+
+	len += scnprintf(buf + len, size - len,
+			"%20s : %10u\n", "High watermark",
+			priv->debug.aurfc_stats.aurfc_highwater);
+	len += scnprintf(buf + len, size - len,
+			"%20s : %10u\n", "Low watermark",
+			priv->debug.aurfc_stats.aurfc_lowwater);
+
+	len += scnprintf(buf + len, size - len,
+			"%20s : %10u\n", "WM triggered",
+			priv->debug.aurfc_stats.aurfc_wm_triggered);
+
+	len += scnprintf(buf + len, size - len,
+			"%20s : %10u\n", "Handler called",
+			priv->debug.aurfc_stats.aurfc_called);
+
+	len += scnprintf(buf + len, size - len,
+			"%20s : %10u\n", "Submit delay",
+			priv->debug.aurfc_stats.aurfc_submit_delay);
+	if (len > size)
+		len = size;
+
+	retval = simple_read_from_buffer(user_buf, count,
+					 ppos, buf, len);
+	kfree(buf);
+
+	return retval;
+}
+
+static const struct file_operations fops_aurfc = {
+	.read = read_file_aurfc,
+	.open = simple_open,
+	.owner = THIS_MODULE,
+	.llseek = default_llseek,
+};
+
 static ssize_t read_file_slot(struct file *file, char __user *user_buf,
 			      size_t count, loff_t *ppos)
 {
@@ -518,7 +566,12 @@ int ath9k_htc_init_debug(struct ath_hw *ah)
 	debugfs_create_file("skb_rx", S_IRUSR, priv->debug.debugfs_phy,
 			    priv, &fops_skb_rx);
 
+	debugfs_create_file("aurfc_stats", S_IRUSR,
+			    priv->debug.debugfs_phy,
+			    priv, &fops_aurfc);
+
 	ath9k_cmn_debug_recv(priv->debug.debugfs_phy, &priv->debug.rx_stats);
+
 	ath9k_cmn_debug_phy_err(priv->debug.debugfs_phy, &priv->debug.rx_stats);
 
 	debugfs_create_file("slot", S_IRUSR, priv->debug.debugfs_phy,
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
index a0f58e2..1c8ebc5 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
@@ -1061,7 +1061,31 @@ void ath9k_rx_tasklet(unsigned long data)
 	unsigned long flags;
 	struct ieee80211_hdr *hdr;
 
+	/* add for adaptive usb receive flow control*/
+	int looptimes = 0;
+	int highwatermark = ATH9K_HTC_RXBUF*3/4;
+	int lowwatermark = ATH9K_HTC_RXBUF/32;
+	unsigned int delay = 0;
+
+	struct htc_target *htc = priv->htc;
+	struct hif_device_usb *hif_dev = htc->hif_dev;
+
+	AURFC_STAT_SET(aurfc_highwater, highwatermark);
+	AURFC_STAT_SET(aurfc_lowwater, lowwatermark);
+
 	do {
+		looptimes++;
+		/* when trigger high wartermark, tell the
+		 * urb callback to submit more slowlly.
+		 */
+		if (looptimes > highwatermark) {
+			delay = looptimes*AURFC_STEP;
+			atomic_set(&hif_dev->aurfc_submit_delay,
+				   delay);
+			AURFC_STAT_INC(aurfc_wm_triggered);
+			AURFC_STAT_SET(aurfc_submit_delay, delay);
+		}
+
 		spin_lock_irqsave(&priv->rx.rxbuflock, flags);
 		list_for_each_entry(tmp_buf, &priv->rx.rxbuf, list) {
 			if (tmp_buf->in_process) {
@@ -1072,6 +1096,29 @@ void ath9k_rx_tasklet(unsigned long data)
 
 		if (rxbuf == NULL) {
 			spin_unlock_irqrestore(&priv->rx.rxbuflock, flags);
+			spin_lock_irqsave(&hif_dev->aurfc_lock,
+					  flags);
+			/* the rxbuf list is empty now, the
+			 * queued work could be scheduled
+			 * to submit urbs immediately.
+			 */
+			if (atomic_read(
+				&hif_dev->aurfc_submit_delay) > 0 &&
+			    hif_dev->aurfc_active > 0)
+				mod_delayed_work(system_wq,
+					&hif_dev->aurfc_delayed_work,
+						 0);
+			spin_unlock_irqrestore(&hif_dev->aurfc_lock,
+					       flags);
+			/* reset submit delay to guaranteed
+			 * usb receive performance.
+			 */
+			if (looptimes < lowwatermark) {
+				atomic_set(&hif_dev->aurfc_submit_delay
+					   , 0);
+				AURFC_STAT_SET(aurfc_submit_delay,
+					       0);
+			}
 			break;
 		}
 
@@ -1114,6 +1161,10 @@ void ath9k_htc_rxep(void *drv_priv, struct sk_buff *skb,
 	struct ath_common *common = ath9k_hw_common(ah);
 	struct ath9k_htc_rxbuf *rxbuf = NULL, *tmp_buf = NULL;
 
+	struct htc_target *htc = priv->htc;
+	struct hif_device_usb *hif_dev = htc->hif_dev;
+	int delay = ATH9K_HTC_RXBUF * AURFC_STEP;
+
 	spin_lock(&priv->rx.rxbuflock);
 	list_for_each_entry(tmp_buf, &priv->rx.rxbuf, list) {
 		if (!tmp_buf->in_process) {
@@ -1124,6 +1175,13 @@ void ath9k_htc_rxep(void *drv_priv, struct sk_buff *skb,
 	spin_unlock(&priv->rx.rxbuflock);
 
 	if (rxbuf == NULL) {
+		/* The rxbuf list is full now, tell the urb callback
+		 * to submit more slowly. Otherwise, the soft lockup
+		 * may be triggerd immediately.
+		 */
+		atomic_set(&hif_dev->aurfc_submit_delay, delay);
+		AURFC_STAT_INC(aurfc_wm_triggered);
+		AURFC_STAT_SET(aurfc_submit_delay, delay);
 		ath_dbg(common, ANY, "No free RX buffer\n");
 		goto err;
 	}
-- 
1.9.1

^ permalink raw reply related

* [PATCH net-next 3/3] net: Introducing socket mark receive socket option
From: Eyal Birger @ 2015-02-09 18:15 UTC (permalink / raw)
  To: davem; +Cc: edumazet, netdev, Eyal Birger
In-Reply-To: <1423505723-2281-1-git-send-email-eyal.birger@gmail.com>

A userspace program may wish to receive the mark of packets it receives.

Packets may be marked by Netfilter, by other userspace applications
using the SO_MARK socket option, or by other kernel means.

Receiving the mark in userspace is useful for example for distinguishing
between different TPROXY diversion rules to the same userspace proxy socket.

Signed-off-by: Eyal Birger <eyal.birger@gmail.com>
---
 arch/alpha/include/uapi/asm/socket.h   | 2 ++
 arch/avr32/include/uapi/asm/socket.h   | 2 ++
 arch/cris/include/uapi/asm/socket.h    | 2 ++
 arch/frv/include/uapi/asm/socket.h     | 2 ++
 arch/ia64/include/uapi/asm/socket.h    | 2 ++
 arch/m32r/include/uapi/asm/socket.h    | 2 ++
 arch/mips/include/uapi/asm/socket.h    | 2 ++
 arch/mn10300/include/uapi/asm/socket.h | 2 ++
 arch/parisc/include/uapi/asm/socket.h  | 2 ++
 arch/powerpc/include/uapi/asm/socket.h | 2 ++
 arch/s390/include/uapi/asm/socket.h    | 2 ++
 arch/sparc/include/uapi/asm/socket.h   | 2 ++
 arch/xtensa/include/uapi/asm/socket.h  | 2 ++
 include/net/sock.h                     | 8 +++++---
 include/uapi/asm-generic/socket.h      | 2 ++
 net/core/sock.c                        | 8 ++++++++
 net/socket.c                           | 9 +++++++++
 17 files changed, 50 insertions(+), 3 deletions(-)

diff --git a/arch/alpha/include/uapi/asm/socket.h b/arch/alpha/include/uapi/asm/socket.h
index 9a20821..7c49f4b 100644
--- a/arch/alpha/include/uapi/asm/socket.h
+++ b/arch/alpha/include/uapi/asm/socket.h
@@ -92,4 +92,6 @@
 #define SO_ATTACH_BPF		50
 #define SO_DETACH_BPF		SO_DETACH_FILTER
 
+#define SO_RCVMARK		51
+
 #endif /* _UAPI_ASM_SOCKET_H */
diff --git a/arch/avr32/include/uapi/asm/socket.h b/arch/avr32/include/uapi/asm/socket.h
index 2b65ed6..6c81e0e 100644
--- a/arch/avr32/include/uapi/asm/socket.h
+++ b/arch/avr32/include/uapi/asm/socket.h
@@ -85,4 +85,6 @@
 #define SO_ATTACH_BPF		50
 #define SO_DETACH_BPF		SO_DETACH_FILTER
 
+#define SO_RCVMARK		51
+
 #endif /* _UAPI__ASM_AVR32_SOCKET_H */
diff --git a/arch/cris/include/uapi/asm/socket.h b/arch/cris/include/uapi/asm/socket.h
index e2503d9f..55ca3be 100644
--- a/arch/cris/include/uapi/asm/socket.h
+++ b/arch/cris/include/uapi/asm/socket.h
@@ -87,6 +87,8 @@
 #define SO_ATTACH_BPF		50
 #define SO_DETACH_BPF		SO_DETACH_FILTER
 
+#define SO_RCVMARK		51
+
 #endif /* _ASM_SOCKET_H */
 
 
diff --git a/arch/frv/include/uapi/asm/socket.h b/arch/frv/include/uapi/asm/socket.h
index 4823ad1..b69f0d5 100644
--- a/arch/frv/include/uapi/asm/socket.h
+++ b/arch/frv/include/uapi/asm/socket.h
@@ -85,5 +85,7 @@
 #define SO_ATTACH_BPF		50
 #define SO_DETACH_BPF		SO_DETACH_FILTER
 
+#define SO_RCVMARK		51
+
 #endif /* _ASM_SOCKET_H */
 
diff --git a/arch/ia64/include/uapi/asm/socket.h b/arch/ia64/include/uapi/asm/socket.h
index 59be3d8..ee6abaf 100644
--- a/arch/ia64/include/uapi/asm/socket.h
+++ b/arch/ia64/include/uapi/asm/socket.h
@@ -94,4 +94,6 @@
 #define SO_ATTACH_BPF		50
 #define SO_DETACH_BPF		SO_DETACH_FILTER
 
+#define SO_RCVMARK		51
+
 #endif /* _ASM_IA64_SOCKET_H */
diff --git a/arch/m32r/include/uapi/asm/socket.h b/arch/m32r/include/uapi/asm/socket.h
index 7bc4cb2..bf0f932 100644
--- a/arch/m32r/include/uapi/asm/socket.h
+++ b/arch/m32r/include/uapi/asm/socket.h
@@ -85,4 +85,6 @@
 #define SO_ATTACH_BPF		50
 #define SO_DETACH_BPF		SO_DETACH_FILTER
 
+#define SO_RCVMARK		51
+
 #endif /* _ASM_M32R_SOCKET_H */
diff --git a/arch/mips/include/uapi/asm/socket.h b/arch/mips/include/uapi/asm/socket.h
index dec3c85..47a61c4 100644
--- a/arch/mips/include/uapi/asm/socket.h
+++ b/arch/mips/include/uapi/asm/socket.h
@@ -103,4 +103,6 @@
 #define SO_ATTACH_BPF		50
 #define SO_DETACH_BPF		SO_DETACH_FILTER
 
+#define SO_RCVMARK		51
+
 #endif /* _UAPI_ASM_SOCKET_H */
diff --git a/arch/mn10300/include/uapi/asm/socket.h b/arch/mn10300/include/uapi/asm/socket.h
index cab7d6d..216305b 100644
--- a/arch/mn10300/include/uapi/asm/socket.h
+++ b/arch/mn10300/include/uapi/asm/socket.h
@@ -85,4 +85,6 @@
 #define SO_ATTACH_BPF		50
 #define SO_DETACH_BPF		SO_DETACH_FILTER
 
+#define SO_RCVMARK		51
+
 #endif /* _ASM_SOCKET_H */
diff --git a/arch/parisc/include/uapi/asm/socket.h b/arch/parisc/include/uapi/asm/socket.h
index a5cd40c..047980a3 100644
--- a/arch/parisc/include/uapi/asm/socket.h
+++ b/arch/parisc/include/uapi/asm/socket.h
@@ -84,4 +84,6 @@
 #define SO_ATTACH_BPF		0x402B
 #define SO_DETACH_BPF		SO_DETACH_FILTER
 
+#define SO_RCVMARK		0x402C
+
 #endif /* _UAPI_ASM_SOCKET_H */
diff --git a/arch/powerpc/include/uapi/asm/socket.h b/arch/powerpc/include/uapi/asm/socket.h
index c046666..188abb6 100644
--- a/arch/powerpc/include/uapi/asm/socket.h
+++ b/arch/powerpc/include/uapi/asm/socket.h
@@ -92,4 +92,6 @@
 #define SO_ATTACH_BPF		50
 #define SO_DETACH_BPF		SO_DETACH_FILTER
 
+#define SO_RCVMARK		51
+
 #endif	/* _ASM_POWERPC_SOCKET_H */
diff --git a/arch/s390/include/uapi/asm/socket.h b/arch/s390/include/uapi/asm/socket.h
index 296942d..70a5791 100644
--- a/arch/s390/include/uapi/asm/socket.h
+++ b/arch/s390/include/uapi/asm/socket.h
@@ -91,4 +91,6 @@
 #define SO_ATTACH_BPF		50
 #define SO_DETACH_BPF		SO_DETACH_FILTER
 
+#define SO_RCVMARK		51
+
 #endif /* _ASM_SOCKET_H */
diff --git a/arch/sparc/include/uapi/asm/socket.h b/arch/sparc/include/uapi/asm/socket.h
index e6a16c4..f7ee249 100644
--- a/arch/sparc/include/uapi/asm/socket.h
+++ b/arch/sparc/include/uapi/asm/socket.h
@@ -81,6 +81,8 @@
 #define SO_ATTACH_BPF		0x0034
 #define SO_DETACH_BPF		SO_DETACH_FILTER
 
+#define SO_RCVMARK		0x0035
+
 /* Security levels - as per NRL IPv6 - don't actually do anything */
 #define SO_SECURITY_AUTHENTICATION		0x5001
 #define SO_SECURITY_ENCRYPTION_TRANSPORT	0x5002
diff --git a/arch/xtensa/include/uapi/asm/socket.h b/arch/xtensa/include/uapi/asm/socket.h
index 4120af0..5b588fa 100644
--- a/arch/xtensa/include/uapi/asm/socket.h
+++ b/arch/xtensa/include/uapi/asm/socket.h
@@ -96,4 +96,6 @@
 #define SO_ATTACH_BPF		50
 #define SO_DETACH_BPF		SO_DETACH_FILTER
 
+#define SO_RCVMARK		51
+
 #endif	/* _XTENSA_SOCKET_H */
diff --git a/include/net/sock.h b/include/net/sock.h
index 412cab78..f179dbc 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -719,6 +719,7 @@ enum sock_flags {
 		     */
 	SOCK_FILTER_LOCKED, /* Filter cannot be changed anymore */
 	SOCK_SELECT_ERR_QUEUE, /* Wake select on error queue */
+	SOCK_RCVMARK,
 };
 
 static inline void sock_copy_flags(struct sock *nsk, struct sock *osk)
@@ -2119,12 +2120,13 @@ void __sock_cmsg_recv(struct msghdr *msg, struct sock *sk,
 static inline void sock_cmsg_recv(struct msghdr *msg, struct sock *sk,
 					  struct sk_buff *skb)
 {
-#define FLAGS_TS_OR_DROPS ((1UL << SOCK_RXQ_OVFL)			| \
-			   (1UL << SOCK_RCVTSTAMP))
+#define FLAGS_CMSG_ANY	  ((1UL << SOCK_RXQ_OVFL)			| \
+			   (1UL << SOCK_RCVTSTAMP)			| \
+			   (1UL << SOCK_RCVMARK))
 #define TSFLAGS_ANY	  (SOF_TIMESTAMPING_SOFTWARE			| \
 			   SOF_TIMESTAMPING_RAW_HARDWARE)
 
-	if (sk->sk_flags & FLAGS_TS_OR_DROPS || sk->sk_tsflags & TSFLAGS_ANY)
+	if (sk->sk_flags & FLAGS_CMSG_ANY || sk->sk_tsflags & TSFLAGS_ANY)
 		__sock_cmsg_recv(msg, sk, skb);
 	else
 		sk->sk_stamp = skb->tstamp;
diff --git a/include/uapi/asm-generic/socket.h b/include/uapi/asm-generic/socket.h
index 5c15c2a..17a1e2e 100644
--- a/include/uapi/asm-generic/socket.h
+++ b/include/uapi/asm-generic/socket.h
@@ -87,4 +87,6 @@
 #define SO_ATTACH_BPF		50
 #define SO_DETACH_BPF		SO_DETACH_FILTER
 
+#define SO_RCVMARK		51
+
 #endif /* __ASM_GENERIC_SOCKET_H */
diff --git a/net/core/sock.c b/net/core/sock.c
index 93c8b20..36fe687 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -928,6 +928,10 @@ set_rcvbuf:
 			sk->sk_mark = val;
 		break;
 
+	case SO_RCVMARK:
+		sock_valbool_flag(sk, SOCK_RCVMARK, valbool);
+		break;
+
 		/* We implement the SO_SNDLOWAT etc to
 		   not be settable (1003.1g 5.3) */
 	case SO_RXQ_OVFL:
@@ -1179,6 +1183,10 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
 		v.val = sk->sk_mark;
 		break;
 
+	case SO_RCVMARK:
+		v.val = sock_flag(sk, SOCK_RCVMARK);
+		break;
+
 	case SO_RXQ_OVFL:
 		v.val = sock_flag(sk, SOCK_RXQ_OVFL);
 		break;
diff --git a/net/socket.c b/net/socket.c
index 17be338..d4a860b 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -736,11 +736,20 @@ static inline void sock_recv_drops(struct msghdr *msg, struct sock *sk,
 			sizeof(__u32), &skb->dropcount);
 }
 
+static inline void sock_recv_mark(struct msghdr *msg, struct sock *sk,
+				  struct sk_buff *skb)
+{
+	if (sock_flag(sk, SOCK_RCVMARK) && skb)
+		put_cmsg(msg, SOL_SOCKET, SO_RCVMARK,
+			 sizeof(__u32), &skb->mark);
+}
+
 void __sock_cmsg_recv(struct msghdr *msg, struct sock *sk,
 		      struct sk_buff *skb)
 {
 	sock_recv_timestamp(msg, sk, skb);
 	sock_recv_drops(msg, sk, skb);
+	sock_recv_mark(msg, sk, skb);
 }
 EXPORT_SYMBOL_GPL(__sock_cmsg_recv);
 
-- 
2.1.4

^ permalink raw reply related

* [PATCH net-next 2/3] net: use skb->priority for overloading skb->dropcount and skb->reserved_tailroom instead of skb->mark
From: Eyal Birger @ 2015-02-09 18:15 UTC (permalink / raw)
  To: davem; +Cc: edumazet, netdev, Eyal Birger
In-Reply-To: <1423505723-2281-1-git-send-email-eyal.birger@gmail.com>

Commit 977750076d98 ("af_packet: add interframe drop cmsg (v6)") unionized
skb->mark and skb->dropcount in order to allow recording of the socket drop
count while maintaining struct sk_buff size.

In order to allow for the skb->mark to be fetched by user-space code it needs
to be detached from this union; skb->priority is used instead.

Signed-off-by: Eyal Birger <eyal.birger@gmail.com>
----
The purpose of overloading skb->priority is solely for retaining struct sk_buff
size; skb->priority is not used after the skb queued to the socket and has the
same guarentee of not being shared as skb->mark.
---
 include/linux/skbuff.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 1bb36ed..23f1a94 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -621,7 +621,7 @@ struct sk_buff {
 			__u16	csum_offset;
 		};
 	};
-	__u32			priority;
+	__u32			mark;
 	int			skb_iif;
 	__u32			hash;
 	__be16			vlan_proto;
@@ -636,7 +636,7 @@ struct sk_buff {
 	__u32			secmark;
 #endif
 	union {
-		__u32		mark;
+		__u32		priority;
 		__u32		dropcount;
 		__u32		reserved_tailroom;
 	};
-- 
2.1.4

^ permalink raw reply related

* [PATCH net-next 1/3] net: Rename sock_recv_ts_and_drops() to sock_cmsg_recv()
From: Eyal Birger @ 2015-02-09 18:15 UTC (permalink / raw)
  To: davem; +Cc: edumazet, netdev, Eyal Birger
In-Reply-To: <1423505723-2281-1-git-send-email-eyal.birger@gmail.com>

sock_recv_ts_and_drops() - as its name suggests - allows receiving timestamp
information and drop statistics.
Generalize the function name in preparation for adding additional ancillary
information.

Signed-off-by: Eyal Birger <eyal.birger@gmail.com>
---
 include/net/sock.h           | 6 +++---
 net/atm/common.c             | 2 +-
 net/bluetooth/af_bluetooth.c | 4 ++--
 net/can/bcm.c                | 2 +-
 net/can/raw.c                | 2 +-
 net/ieee802154/socket.c      | 4 ++--
 net/ipv4/raw.c               | 2 +-
 net/ipv4/udp.c               | 2 +-
 net/ipv6/raw.c               | 2 +-
 net/ipv6/udp.c               | 2 +-
 net/key/af_key.c             | 2 +-
 net/packet/af_packet.c       | 2 +-
 net/rxrpc/ar-recvmsg.c       | 2 +-
 net/sctp/socket.c            | 2 +-
 net/socket.c                 | 6 +++---
 15 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/include/net/sock.h b/include/net/sock.h
index e138245..412cab78 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -2113,10 +2113,10 @@ sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb)
 		__sock_recv_wifi_status(msg, sk, skb);
 }
 
-void __sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk,
+void __sock_cmsg_recv(struct msghdr *msg, struct sock *sk,
 			      struct sk_buff *skb);
 
-static inline void sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk,
+static inline void sock_cmsg_recv(struct msghdr *msg, struct sock *sk,
 					  struct sk_buff *skb)
 {
 #define FLAGS_TS_OR_DROPS ((1UL << SOCK_RXQ_OVFL)			| \
@@ -2125,7 +2125,7 @@ static inline void sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk,
 			   SOF_TIMESTAMPING_RAW_HARDWARE)
 
 	if (sk->sk_flags & FLAGS_TS_OR_DROPS || sk->sk_tsflags & TSFLAGS_ANY)
-		__sock_recv_ts_and_drops(msg, sk, skb);
+		__sock_cmsg_recv(msg, sk, skb);
 	else
 		sk->sk_stamp = skb->tstamp;
 }
diff --git a/net/atm/common.c b/net/atm/common.c
index b84057e..611b1c2 100644
--- a/net/atm/common.c
+++ b/net/atm/common.c
@@ -557,7 +557,7 @@ int vcc_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
 	error = skb_copy_datagram_msg(skb, 0, msg, copied);
 	if (error)
 		return error;
-	sock_recv_ts_and_drops(msg, sk, skb);
+	sock_cmsg_recv(msg, sk, skb);
 
 	if (!(flags & MSG_PEEK)) {
 		pr_debug("%d -= %d\n", atomic_read(&sk->sk_rmem_alloc),
diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c
index ce22e0c..4bdcbc9 100644
--- a/net/bluetooth/af_bluetooth.c
+++ b/net/bluetooth/af_bluetooth.c
@@ -241,7 +241,7 @@ int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
 	skb_reset_transport_header(skb);
 	err = skb_copy_datagram_msg(skb, 0, msg, copied);
 	if (err == 0) {
-		sock_recv_ts_and_drops(msg, sk, skb);
+		sock_cmsg_recv(msg, sk, skb);
 
 		if (bt_sk(sk)->skb_msg_name)
 			bt_sk(sk)->skb_msg_name(skb, msg->msg_name,
@@ -339,7 +339,7 @@ int bt_sock_stream_recvmsg(struct kiocb *iocb, struct socket *sock,
 		copied += chunk;
 		size   -= chunk;
 
-		sock_recv_ts_and_drops(msg, sk, skb);
+		sock_cmsg_recv(msg, sk, skb);
 
 		if (!(flags & MSG_PEEK)) {
 			int skb_len = skb_headlen(skb);
diff --git a/net/can/bcm.c b/net/can/bcm.c
index ee9ffd9..f741f29 100644
--- a/net/can/bcm.c
+++ b/net/can/bcm.c
@@ -1559,7 +1559,7 @@ static int bcm_recvmsg(struct kiocb *iocb, struct socket *sock,
 		return err;
 	}
 
-	sock_recv_ts_and_drops(msg, sk, skb);
+	sock_cmsg_recv(msg, sk, skb);
 
 	if (msg->msg_name) {
 		__sockaddr_check_size(sizeof(struct sockaddr_can));
diff --git a/net/can/raw.c b/net/can/raw.c
index 00c13ef..549b871 100644
--- a/net/can/raw.c
+++ b/net/can/raw.c
@@ -754,7 +754,7 @@ static int raw_recvmsg(struct kiocb *iocb, struct socket *sock,
 		return err;
 	}
 
-	sock_recv_ts_and_drops(msg, sk, skb);
+	sock_cmsg_recv(msg, sk, skb);
 
 	if (msg->msg_name) {
 		__sockaddr_check_size(sizeof(struct sockaddr_can));
diff --git a/net/ieee802154/socket.c b/net/ieee802154/socket.c
index 2878d8c..41ac5fa 100644
--- a/net/ieee802154/socket.c
+++ b/net/ieee802154/socket.c
@@ -348,7 +348,7 @@ static int raw_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
 	if (err)
 		goto done;
 
-	sock_recv_ts_and_drops(msg, sk, skb);
+	sock_cmsg_recv(msg, sk, skb);
 
 	if (flags & MSG_TRUNC)
 		copied = skb->len;
@@ -739,7 +739,7 @@ static int dgram_recvmsg(struct kiocb *iocb, struct sock *sk,
 	if (err)
 		goto done;
 
-	sock_recv_ts_and_drops(msg, sk, skb);
+	sock_cmsg_recv(msg, sk, skb);
 
 	if (saddr) {
 		saddr->family = AF_IEEE802154;
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index f027a70..a28a83b 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -740,7 +740,7 @@ static int raw_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
 	if (err)
 		goto done;
 
-	sock_recv_ts_and_drops(msg, sk, skb);
+	sock_cmsg_recv(msg, sk, skb);
 
 	/* Copy the address. */
 	if (sin) {
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 97ef1f8b..07b1394 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1318,7 +1318,7 @@ try_again:
 		UDP_INC_STATS_USER(sock_net(sk),
 				UDP_MIB_INDATAGRAMS, is_udplite);
 
-	sock_recv_ts_and_drops(msg, sk, skb);
+	sock_cmsg_recv(msg, sk, skb);
 
 	/* Copy the address. */
 	if (sin) {
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index dae7f1a..882c997 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -510,7 +510,7 @@ static int rawv6_recvmsg(struct kiocb *iocb, struct sock *sk,
 		*addr_len = sizeof(*sin6);
 	}
 
-	sock_recv_ts_and_drops(msg, sk, skb);
+	sock_cmsg_recv(msg, sk, skb);
 
 	if (np->rxopt.all)
 		ip6_datagram_recv_ctl(sk, msg, skb);
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index d048d46..be0cfae 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -469,7 +469,7 @@ try_again:
 					UDP_MIB_INDATAGRAMS, is_udplite);
 	}
 
-	sock_recv_ts_and_drops(msg, sk, skb);
+	sock_cmsg_recv(msg, sk, skb);
 
 	/* Copy the address. */
 	if (msg->msg_name) {
diff --git a/net/key/af_key.c b/net/key/af_key.c
index f8ac939..e03ba49 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -3658,7 +3658,7 @@ static int pfkey_recvmsg(struct kiocb *kiocb,
 	if (err)
 		goto out_free;
 
-	sock_recv_ts_and_drops(msg, sk, skb);
+	sock_cmsg_recv(msg, sk, skb);
 
 	err = (flags & MSG_TRUNC) ? skb->len : copied;
 
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 9c28cec..6033520 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -2982,7 +2982,7 @@ static int packet_recvmsg(struct kiocb *iocb, struct socket *sock,
 	if (err)
 		goto out_free;
 
-	sock_recv_ts_and_drops(msg, sk, skb);
+	sock_cmsg_recv(msg, sk, skb);
 
 	if (msg->msg_name) {
 		/* If the address length field is there to be filled
diff --git a/net/rxrpc/ar-recvmsg.c b/net/rxrpc/ar-recvmsg.c
index 4575485..323b1c7 100644
--- a/net/rxrpc/ar-recvmsg.c
+++ b/net/rxrpc/ar-recvmsg.c
@@ -150,7 +150,7 @@ int rxrpc_recvmsg(struct kiocb *iocb, struct socket *sock,
 				       &call->conn->trans->peer->srx, len);
 				msg->msg_namelen = len;
 			}
-			sock_recv_ts_and_drops(msg, &rx->sk, skb);
+			sock_cmsg_recv(msg, &rx->sk, skb);
 		}
 
 		/* receive the message */
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index aafe94b..27835aa 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -2108,7 +2108,7 @@ static int sctp_recvmsg(struct kiocb *iocb, struct sock *sk,
 	if (err)
 		goto out_free;
 
-	sock_recv_ts_and_drops(msg, sk, skb);
+	sock_cmsg_recv(msg, sk, skb);
 	if (sctp_ulpevent_is_notification(event)) {
 		msg->msg_flags |= MSG_NOTIFICATION;
 		sp->pf->event_msgname(event, msg->msg_name, addr_len);
diff --git a/net/socket.c b/net/socket.c
index bbedbfc..17be338 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -736,13 +736,13 @@ static inline void sock_recv_drops(struct msghdr *msg, struct sock *sk,
 			sizeof(__u32), &skb->dropcount);
 }
 
-void __sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk,
-	struct sk_buff *skb)
+void __sock_cmsg_recv(struct msghdr *msg, struct sock *sk,
+		      struct sk_buff *skb)
 {
 	sock_recv_timestamp(msg, sk, skb);
 	sock_recv_drops(msg, sk, skb);
 }
-EXPORT_SYMBOL_GPL(__sock_recv_ts_and_drops);
+EXPORT_SYMBOL_GPL(__sock_cmsg_recv);
 
 static inline int __sock_recvmsg_nosec(struct kiocb *iocb, struct socket *sock,
 				       struct msghdr *msg, size_t size, int flags)
-- 
2.1.4

^ permalink raw reply related

* [PATCH net-next 0/3] net: Introducing socket mark receive socket option
From: Eyal Birger @ 2015-02-09 18:15 UTC (permalink / raw)
  To: davem; +Cc: edumazet, netdev, Eyal Birger

This patchset introduces a new socket option for fetching the mark of skbs
passed to sockets as ancillary data.

A userspace program may wish to receive the mark of packets it receives, for 
example for distinguishing between different TPROXY diversion rules to the 
same userspace proxy socket.

The patchset includes a minor function renaming, as well as a change in struct
sk_buff for allowing skb->mark to persist after being queued to the socket
queue.

Eyal Birger (3):
  net: Rename sock_recv_ts_and_drops() to sock_cmsg_recv()
  net: use skb->priority for overloading skb->dropcount and
    skb->reserved_tailroom instead of skb->mark
  net: Introducing socket mark receive socket option

 arch/alpha/include/uapi/asm/socket.h   |  2 ++
 arch/avr32/include/uapi/asm/socket.h   |  2 ++
 arch/cris/include/uapi/asm/socket.h    |  2 ++
 arch/frv/include/uapi/asm/socket.h     |  2 ++
 arch/ia64/include/uapi/asm/socket.h    |  2 ++
 arch/m32r/include/uapi/asm/socket.h    |  2 ++
 arch/mips/include/uapi/asm/socket.h    |  2 ++
 arch/mn10300/include/uapi/asm/socket.h |  2 ++
 arch/parisc/include/uapi/asm/socket.h  |  2 ++
 arch/powerpc/include/uapi/asm/socket.h |  2 ++
 arch/s390/include/uapi/asm/socket.h    |  2 ++
 arch/sparc/include/uapi/asm/socket.h   |  2 ++
 arch/xtensa/include/uapi/asm/socket.h  |  2 ++
 include/linux/skbuff.h                 |  4 ++--
 include/net/sock.h                     | 14 ++++++++------
 include/uapi/asm-generic/socket.h      |  2 ++
 net/atm/common.c                       |  2 +-
 net/bluetooth/af_bluetooth.c           |  4 ++--
 net/can/bcm.c                          |  2 +-
 net/can/raw.c                          |  2 +-
 net/core/sock.c                        |  8 ++++++++
 net/ieee802154/socket.c                |  4 ++--
 net/ipv4/raw.c                         |  2 +-
 net/ipv4/udp.c                         |  2 +-
 net/ipv6/raw.c                         |  2 +-
 net/ipv6/udp.c                         |  2 +-
 net/key/af_key.c                       |  2 +-
 net/packet/af_packet.c                 |  2 +-
 net/rxrpc/ar-recvmsg.c                 |  2 +-
 net/sctp/socket.c                      |  2 +-
 net/socket.c                           | 15 ++++++++++++---
 31 files changed, 73 insertions(+), 26 deletions(-)

-- 
2.1.4

^ permalink raw reply

* Re: [PATCH 1/2] net wireless wcn36xx add wcnss platform code
From: Bjorn Andersson @ 2015-02-09 18:00 UTC (permalink / raw)
  To: Andy Green; +Cc: Kalle Valo, Eugene Krasnikov, wcn36xx, linux-wireless, netdev
In-Reply-To: <20150118051644.32019.65489.stgit@114-36-241-182.dynamic.hinet.net>

On Sat, Jan 17, 2015 at 9:16 PM, Andy Green <andy.green@linaro.org> wrote:
> From: Eugene Krasnikov <k.eugene.e@gmail.com>
>
> AG modified to remove regulator handling not needed on msm8916-qrd
>
> Signed-off-by: Eugene Krasnikov <k.eugene.e@gmail.com>
> Signed-off-by: Andy Green <andy.green@linaro.org>
> ---
>  drivers/net/wireless/ath/wcn36xx/Makefile      |    2
>  drivers/net/wireless/ath/wcn36xx/wcn36xx-msm.c |  357 ++++++++++++++++++++++++

It seems like we're finally getting somewhere with the hwspinlock
devicetree binding, which will allow us to go ahead with the work on
getting smem, smd, smsm and smp2p into mainline.

With that in place we have fixed apis that this driver will run upon,
so I would like to suggest that we at that point fold this logic into
the driver itself rather than having this skim.

Regards,
Bjorn

^ permalink raw reply

* Re: [PATCH net-next] openvswitch: Only set TUNNEL_VXLAN_OPT if VXLAN-GBP metadata is set
From: Pravin Shelar @ 2015-02-09 17:59 UTC (permalink / raw)
  To: Thomas Graf; +Cc: David Miller, netdev
In-Reply-To: <27de6976a7a40d1da2875b93138353724cbfa24b.1423497309.git.tgraf@suug.ch>

On Mon, Feb 9, 2015 at 7:56 AM, Thomas Graf <tgraf@suug.ch> wrote:
> This avoids setting TUNNEL_VXLAN_OPT for VXLAN frames which don't
> have any GBP metadata set. It is not invalid to set it but unnecessary.
>
> Signed-off-by: Thomas Graf <tgraf@suug.ch>

Acked-by: Pravin B Shelar <pshelar@nicira.com>

Thanks.

^ permalink raw reply

* Re: [PATCH 6/7] net: wireless: wcn36xx: remove powersaving for wcn3620
From: Bjorn Andersson @ 2015-02-09 17:54 UTC (permalink / raw)
  To: Andy Green
  Cc: Kalle Valo, Eugene Krasnikov, wcn36xx,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20150118051111.31866.39208.stgit-FDDIDLfWL9/T9rR/E2HzMujRB4CPm7EUkgzjau31qRg@public.gmane.org>

On Sat, Jan 17, 2015 at 9:11 PM, Andy Green <andy.green-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
> WCN3620 powersaving mode is not stable.  Disable it if we're
> on a wcn3620 chip type.
>
> Signed-off-by: Andy Green <andy.green-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> ---
>  drivers/net/wireless/ath/wcn36xx/main.c |    4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
> index c4178c7..569d45b 100644
> --- a/drivers/net/wireless/ath/wcn36xx/main.c
> +++ b/drivers/net/wireless/ath/wcn36xx/main.c
> @@ -924,6 +924,10 @@ static int wcn36xx_init_ieee80211(struct wcn36xx *wcn)
>                 IEEE80211_HW_AMPDU_AGGREGATION |
>                 IEEE80211_HW_TIMING_BEACON_ONLY;
>
> +       /* 3620 powersaving currently unstable */
> +       if (wcn->chip_version == WCN36XX_CHIP_3620)
> +               wcn->hw->flags &= ~IEEE80211_HW_SUPPORTS_PS;
> +

Hi Andy,

I have the same problem (Data Abort Exception in wcnss) on 3680, this
with my wip smd code and a hacked up remoteproc-pil. I haven't spent
any effort on debugging this, but it looks like it's something related
to what we have ported to mainline (or lack thereof) rather than a
3620 specific issue.

Regards,
Bjorn
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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 v3 12/18] crypto: switch af_alg_make_sg() to iov_iter
From: Al Viro @ 2015-02-09 17:30 UTC (permalink / raw)
  To: Stephan Mueller; +Cc: David Miller, netdev, linux-crypto
In-Reply-To: <1830853.QH0ahQU9zL@tachyon.chronox.de>

On Mon, Feb 09, 2015 at 02:59:40PM +0100, Stephan Mueller wrote:
> Am Mittwoch, 4. Februar 2015, 06:40:03 schrieb Al Viro:
> 
> Hi Al,
> 
> > From: Al Viro <viro@zeniv.linux.org.uk>
> > 
> > With that, all ->sendmsg() instances are converted to iov_iter primitives
> > and are agnostic wrt the kind of iov_iter they are working with.
> > So's the last remaining ->recvmsg() instance that wasn't kind-agnostic yet.
> > All ->sendmsg() and ->recvmsg() advance ->msg_iter by the amount actually
> > copied and none of them modifies the underlying iovec, etc.
> 
> After testing this patch with the test application by simply executing 
> [1]/test/test.sh, the hash and skcipher interface invocation hang in kernel 
> space. Though, I am not sure where the problem is.
> 
> For individual invocations of the tests, you may look into [1]/test/kcapi-
> main.c in the comments above cavs_sym or cavs_hash.
> 
> [1] http://www.chronox.de/libkcapi.html

Very interesting; I'll try to reproduce it once I get some sleep (up since
yesterday, and it's past noon here ;-/)

^ permalink raw reply

* Re: [PATCH v3 12/18] crypto: switch af_alg_make_sg() to iov_iter
From: Al Viro @ 2015-02-09 17:28 UTC (permalink / raw)
  To: Stephan Mueller; +Cc: David Miller, netdev, linux-crypto
In-Reply-To: <2856206.EMAskHcVAC@tachyon.chronox.de>

On Mon, Feb 09, 2015 at 02:33:48PM +0100, Stephan Mueller wrote:
> > 
> > -int af_alg_make_sg(struct af_alg_sgl *sgl, void __user *addr, int len,
> > -		   int write)
> > +int af_alg_make_sg(struct af_alg_sgl *sgl, struct iov_iter *iter, int len)
> 
> Shouldn't len be size_t? iov_iter_get_pages wants a size_t. Also, the 
> invocation of af_alg_make_sg uses an unsigned variable that is provided by 
> userspace.

Keepo in mind that rw_copy_check_uvector() does, among other things,
verify that total length is less than 2^31.  So this code doesn't
suffer from wraparounds; it might make sense to switch to size_t here,
but that's a separate patch, IMO.  For this conversion I just kept
the type that used to be there.

^ permalink raw reply

* [PATCH v3 4/4] mdio-mux-gpio: use new gpiod_get_array and gpiod_put_array functions
From: Rojhalat Ibrahim @ 2015-02-09 17:07 UTC (permalink / raw)
  To: linux-gpio@vger.kernel.org
  Cc: Alexandre Courbot, Alexandre Courbot, Linus Walleij, David Miller,
	netdev

Use the new gpiod_get_array and gpiod_put_array functions for obtaining and
disposing of GPIO descriptors.

Cc: David Miller <davem@davemloft.net>
Signed-off-by: Rojhalat Ibrahim <imr@rtschenk.de>
---
Change log:
  v3: no change
  v2: use the new interface

 drivers/net/phy/mdio-mux-gpio.c | 61 ++++++++++++-----------------------------
 1 file changed, 18 insertions(+), 43 deletions(-)

diff --git a/drivers/net/phy/mdio-mux-gpio.c b/drivers/net/phy/mdio-mux-gpio.c
index 320eb15..3f6929c 100644
--- a/drivers/net/phy/mdio-mux-gpio.c
+++ b/drivers/net/phy/mdio-mux-gpio.c
@@ -12,33 +12,31 @@
 #include <linux/module.h>
 #include <linux/phy.h>
 #include <linux/mdio-mux.h>
-#include <linux/of_gpio.h>
+#include <linux/gpio/consumer.h>
 
 #define DRV_VERSION "1.1"
 #define DRV_DESCRIPTION "GPIO controlled MDIO bus multiplexer driver"
 
-#define MDIO_MUX_GPIO_MAX_BITS 8
-
 struct mdio_mux_gpio_state {
-	struct gpio_desc *gpio[MDIO_MUX_GPIO_MAX_BITS];
-	unsigned int num_gpios;
+	struct gpio_descs *gpios;
 	void *mux_handle;
 };
 
 static int mdio_mux_gpio_switch_fn(int current_child, int desired_child,
 				   void *data)
 {
-	int values[MDIO_MUX_GPIO_MAX_BITS];
-	unsigned int n;
 	struct mdio_mux_gpio_state *s = data;
+	int values[s->gpios->array_size];
+	unsigned int n;
 
 	if (current_child == desired_child)
 		return 0;
 
-	for (n = 0; n < s->num_gpios; n++) {
+	for (n = 0; n < s->gpios->array_size; n++)
 		values[n] = (desired_child >> n) & 1;
-	}
-	gpiod_set_array_cansleep(s->num_gpios, s->gpio, values);
+
+	gpiod_set_array_cansleep(s->gpios->array_size, s->gpios->desc_array,
+				 values);
 
 	return 0;
 }
@@ -46,56 +44,33 @@ static int mdio_mux_gpio_switch_fn(int current_child, int desired_child,
 static int mdio_mux_gpio_probe(struct platform_device *pdev)
 {
 	struct mdio_mux_gpio_state *s;
-	int num_gpios;
-	unsigned int n;
 	int r;
 
-	if (!pdev->dev.of_node)
-		return -ENODEV;
-
-	num_gpios = of_gpio_count(pdev->dev.of_node);
-	if (num_gpios <= 0 || num_gpios > MDIO_MUX_GPIO_MAX_BITS)
-		return -ENODEV;
-
 	s = devm_kzalloc(&pdev->dev, sizeof(*s), GFP_KERNEL);
 	if (!s)
 		return -ENOMEM;
 
-	s->num_gpios = num_gpios;
-
-	for (n = 0; n < num_gpios; ) {
-		struct gpio_desc *gpio = gpiod_get_index(&pdev->dev, NULL, n,
-							 GPIOD_OUT_LOW);
-		if (IS_ERR(gpio)) {
-			r = PTR_ERR(gpio);
-			goto err;
-		}
-		s->gpio[n] = gpio;
-		n++;
-	}
+	s->gpios = gpiod_get_array(&pdev->dev, NULL, GPIOD_OUT_LOW);
+	if (IS_ERR(s->gpios))
+		return PTR_ERR(s->gpios);
 
 	r = mdio_mux_init(&pdev->dev,
 			  mdio_mux_gpio_switch_fn, &s->mux_handle, s);
 
-	if (r == 0) {
-		pdev->dev.platform_data = s;
-		return 0;
-	}
-err:
-	while (n) {
-		n--;
-		gpiod_put(s->gpio[n]);
+	if (r != 0) {
+		gpiod_put_array(s->gpios);
+		return r;
 	}
-	return r;
+
+	pdev->dev.platform_data = s;
+	return 0;
 }
 
 static int mdio_mux_gpio_remove(struct platform_device *pdev)
 {
-	unsigned int n;
 	struct mdio_mux_gpio_state *s = dev_get_platdata(&pdev->dev);
 	mdio_mux_uninit(s->mux_handle);
-	for (n = 0; n < s->num_gpios; n++)
-		gpiod_put(s->gpio[n]);
+	gpiod_put_array(s->gpios);
 	return 0;
 }
 
-- 
2.0.5



^ permalink raw reply related

* Re: [PATCH] net:ethernet:intel:Remove outdated fix me comment in the function, gb_acquire_swfw_sync_i210
From: Hisashi T Fujinaka @ 2015-02-09 17:03 UTC (permalink / raw)
  To: Bjørn Mork
  Cc: linux.nics, e1000-devel, netdev, bruce.w.allan, linux-kernel,
	jesse.brandeburg, john.ronciak, Andrej Manduch
In-Reply-To: <87egpzqvpc.fsf@nemi.mork.no>

On Mon, 9 Feb 2015, Bj?rn Mork wrote:

> Jeff Kirsher <jeffrey.t.kirsher@intel.com> writes:
>
>> If you want to see Nick's patch, feel free to view his patch on
>> my queue tree:
>> https://git.kernel.org/cgit/linux/kernel/git/jkirsher/queue.git/
>
> which said:
>  - s32 i = 0, timeout = 200; /* FIXME: find real value to use here */
>  + s32 i = 0, timeout = 200;
>
>
> Comments like the one deleted by that patch do have some value in my
> opinion: They document that the constant is chosen arbitrarily and is
> not taken from some datasheet.
>
> Not a big deal, but leaving such comments, even if the value never ever
> changes, could save someone from trying to figure out where the heck you
> got that constant.  And there's noone actually misinterpreting this
> comment as "something needs to be fixed here", is there? So the cost of
> leaving the comment is exactly zero.
>
> Just my .02 ?.  I'm not going to tell you how to maintain your driver,
> of course.  At least I try not to :-)

I think, for now, we should NAK this. It's a short comment and you don't
want me to replace it with a philosophical statement on how you could
tune the timeout. That's what the data sheet is for.

(Replying from my home account and not my work account -
todd.fujinaka@intel.com)

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired

^ permalink raw reply

* RE: [PATCH v3] net: bluetooth: hci_sock: Use 'const u32 *' instead of 'void *' for 2nd parameter of hci_test_bit()
From: David Laight @ 2015-02-09 16:57 UTC (permalink / raw)
  To: 'Marcel Holtmann'
  Cc: Chen Gang S, Joe Perches, Sergei Shtylyov, Gustavo F. Padovan,
	Johan Hedberg, David S. Miller, linux-bluetooth@vger.kernel.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
In-Reply-To: <DECB4016-B7D2-4C0B-A055-ED3282F727EE@holtmann.org>

From: Marcel Holtmann
> Hi David,
> 
> >> So at present, in kernel part, we can only say the original authors
> >> intended to do like this. And only within kernel part, it can not cause
> >> issue. I guess, original authors originally knew what we talk about.
> >
> > I've just searched for hci_u*filter it is all horrid.
> > Look at the code for get/set_sockopt of HCI_FILTER.
> > Someone seems to have done a complete 'bodge job' of fixing the user interface
> > for apps (32bit and 64bit) on 64bit kernels.
> 
> we are actually fully aware of that. Just keep in mind that this code is from 2.4.6 kernel and with
> that most likely 14 years old by now. Unfortunately it ended up as userspace API.

AFAICT the userspace API is always __u32[2] the long[2] is never exposed
to userspace (certainly not through the socket option code).

Quite why all the casts were added - instead of changing the type
is probably hidden in the annals of the source repo.
Some serious archaeology might be in order.

	David

^ permalink raw reply

* Re: [PATCH v3] net: bluetooth: hci_sock: Use 'const u32 *' instead of 'void *' for 2nd parameter of hci_test_bit()
From: Marcel Holtmann @ 2015-02-09 16:51 UTC (permalink / raw)
  To: David Laight
  Cc: Chen Gang S, Joe Perches, Sergei Shtylyov, Gustavo F. Padovan,
	Johan Hedberg, David S. Miller, linux-bluetooth@vger.kernel.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D1CAE0823@AcuExch.aculab.com>

Hi David,

>> So at present, in kernel part, we can only say the original authors
>> intended to do like this. And only within kernel part, it can not cause
>> issue. I guess, original authors originally knew what we talk about.
> 
> I've just searched for hci_u*filter it is all horrid.
> Look at the code for get/set_sockopt of HCI_FILTER.
> Someone seems to have done a complete 'bodge job' of fixing the user interface
> for apps (32bit and 64bit) on 64bit kernels.

we are actually fully aware of that. Just keep in mind that this code is from 2.4.6 kernel and with that most likely 14 years old by now. Unfortunately it ended up as userspace API.

>> This patch is for fixing building warnings without any negative effect.
>> And most of us are not the suitable members to continue analyzing. So
>> at present, for me, we can accept this patch.
> 
> And, not uncommonly, it has shown up a 'bag of worms'.
> 
> If you change 'hci_filter' to contain u32[2] then you can drop
> all of the casts and the temporary structures in the sockopt code.
> Just be aware of the tail-padding.

I am happy to accept patches for this, but we might want to get some unit tests into BlueZ userspace code first to make sure that nothing breaks.

Regards

Marcel

^ permalink raw reply

* RE: [net-next 15/15] i40e/i40evf: Add call to u64_stats_init to init
From: Wyborny, Carolyn @ 2015-02-09 16:45 UTC (permalink / raw)
  To: Sergei Shtylyov, Kirsher, Jeffrey T, davem@davemloft.net
  Cc: netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
	jogreene@redhat.com
In-Reply-To: <54D8A36B.8040401@cogentembedded.com>

> -----Original Message-----
> From: Sergei Shtylyov [mailto:sergei.shtylyov@cogentembedded.com]
> Sent: Monday, February 09, 2015 4:09 AM
> To: Kirsher, Jeffrey T; davem@davemloft.net
> Cc: Wyborny, Carolyn; netdev@vger.kernel.org; nhorman@redhat.com;
> sassmann@redhat.com; jogreene@redhat.com
> Subject: Re: [net-next 15/15] i40e/i40evf: Add call to u64_stats_init to init
> 
> Hello.
> 
[..]
> > +		u64_stats_init(rx_ring->syncp);
> 
>     This is over-indented.
> 
> > +
> >   	/* Round up to nearest 4K */
> >   	rx_ring->size = ring_is_16byte_desc_enabled(rx_ring)
> >   		? rx_ring->count * sizeof(union i40e_16byte_rx_desc) diff --git
> > a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
> > b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
> > index 4bf15da..459499a 100644
> > --- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
> > +++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
> > @@ -596,6 +596,8 @@ int i40evf_setup_rx_descriptors(struct i40e_ring
> *rx_ring)
> >   	if (!rx_ring->rx_bi)
> >   		goto err;
> >
> > +		u64_stats_init(rx_ring->syncp);
> 
>     Likewise.
> 
> > +
> >   	/* Round up to nearest 4K */
> >   	rx_ring->size = ring_is_16byte_desc_enabled(rx_ring)
> >   		? rx_ring->count * sizeof(union i40e_16byte_rx_desc)
> 
> WBR, Sergei
Thanks, I have already submitted a patch to correct this, but need to track down the same change in the vf code.  

Jeff, do you know how close it is to submission?  

Carolyn

Carolyn Wyborny 
Linux Development 
Networking Division 
Intel Corporation 

^ permalink raw reply

* Re: [PATCH net-next] drivers: net: cpsw: make cpsw_ale.c a module to allow re-use on Keystone
From: Tony Lindgren @ 2015-02-09 16:41 UTC (permalink / raw)
  To: Murali Karicheri
  Cc: Arnd Bergmann, w-kwok2, davem, mugunthanvnm, prabhakar.csengg,
	grygorii.strashko, lokeshvutla, mpa, lsorense, netdev,
	linux-kernel
In-Reply-To: <54D3EFDB.9060300@ti.com>

* Murali Karicheri <m-karicheri2@ti.com> [150205 14:37]:
> On 02/02/2015 11:40 AM, Tony Lindgren wrote:
> >* Arnd Bergmann<arnd@arndb.de>  [150129 15:51]:
> >>On Thursday 29 January 2015 18:15:51 Murali Karicheri wrote:
> >>>NetCP on Keystone has cpsw ale function similar to other TI SoCs
> >>>and this driver is re-used. To allow both ti cpsw and keystone netcp
> >>>to re-use the driver, convert the cpsw ale to a module and configure
> >>>it through Kconfig option CONFIG_TI_CPSW_ALE. Currently it is statically
> >>>linked to both TI CPSW and NetCP and this causes issues when the above
> >>>drivers are built as dynamic modules. This patch addresses this issue
> >>>
> >>>While at it, fix the Makefile and code to build both netcp_core and
> >>>netcp_ethss as dynamic modules. This is needed to support arm allmodconfig.
> >>>This also requires exporting of API calls provided by netcp_core so that
> >>>both the above can be dynamic modules.
> >>>
> >>>Signed-off-by: Murali Karicheri<m-karicheri2@ti.com>
> >>>---
> >>>  drivers/net/ethernet/ti/Kconfig       |   19 +++++++++++++++++--
> >>>  drivers/net/ethernet/ti/Makefile      |    8 +++++---
> >>>  drivers/net/ethernet/ti/cpsw_ale.c    |   26 ++++++++++++++++++++++++--
> >>>  drivers/net/ethernet/ti/netcp_core.c  |    8 ++++++++
> >>>  drivers/net/ethernet/ti/netcp_ethss.c |    5 +++++
> >>>  5 files changed, 59 insertions(+), 7 deletions(-)
> >>
> >>I was hoping there would be a way without exporting all those symbols, but
> >>I also couldn't come up with a better solution. I'm putting this into the
> >>randconfig build test for now, but I'm guessing it's fine.
> >
> >Probably the best way in the long run is to add a single exported
> >function to cpsw-common.c I just added for the MAC address function.
> 
> If understand correctly, what you have done is moved the common mac function
> and exported the function in cpsw-common.c and called it from cpsw.c. How is
> this any different from exporting all common functions from cpsw_ale.c as is
> done today? Not sure what you meant by a single exported function. Are you
> talking about defining a ale_ops struct of function ptrs and exporting that
> instead of individual functions? So
> 
> cpsw_ale_common.c
>   Move all of the common functions here and define them as static.
>   Defined cpsw_ale_ops and export it.
>   cpsw.c and netcp_ethss.c calls something like
> 
>   cpsw_ale_ops.foo();

Yeah something like that. I was thinking struct cpsw_common with
shared function pointers. Then in cpsw-common.c, export cpsw_register()
and cpsw_free() that the cpsw like drivers can use to configure whatever
combination of cpsw shared functions it can use. It could be naturally
more than one struct, or maybe struct cpsw_ale, struct cpdma and struct
netcp could be within the struct cpsw_common.

I only attempted to set up a place for future cpsw code sharing
with cpsw-common.c. I have not identified what all could be shared,
looks like you have a much better idea about that :)

By registering cpsw like drivers with cpsw-common allows exporting
only a few selected functions instead of exporting tons of custom
functions (currently 43 of them).

Regards,

Tony

^ permalink raw reply

* Re: [RFC PATCH 00/29] net: VRF support
From: roopa @ 2015-02-09 16:38 UTC (permalink / raw)
  To: David Ahern
  Cc: netdev, ebiederm, Dinesh Dutt, Vipin Kumar, Nicolas Dichtel,
	hannes
In-Reply-To: <54D424BD.2090402@gmail.com>

On 2/5/15, 6:19 PM, David Ahern wrote:
> On 2/5/15 4:12 PM, roopa wrote:
>> Wondering if you have thought about some of the the below cases in your
>> approach to vrfs ?.
>> - Leaking routes from one vrf to another
>
> Can you give me an example of what you mean by this?

sorry for the delay in my response.
I cant say I know a lot about types of vrfs and vrf route leaking today :).
Hoping that i will catch up someday ;)

But I think it is needed to deploy VRF-lite (when MPLS is not in the 
picture).
And there maybe a need to leak routes from one VRF to another.
And the leaking can be done with static routes or dynamic using a 
routing protocol
I think (lot of content on the web for vrf route leaking).

I have been in discussions where namespaces are considered for vrfs..
and on the same lines as above there have been discussions on
  having the ability to add a route in one vrf with nexthop in another vrf
>
>> - route lookup in one vrf on failure to fallback to the global vrf (This
>> for example can be done using throw if we used ip rules and route tables
>> to do the same).
>> - A route in one vrf pointing to a nexthop in another vrf
>
> I have been more focused on the initial VRF infrastructure and have 
> not spent too much time on these use cases or other route lookup 
> features (e.g., allow an application to handle route lookup misses 
> similar to arp misses, allow custom route lookup modules) that are 
> needed to approach the feature richness provided by high end routers.
agreed. Thanks for opening up the vrf discussion!.
It will be good to consider all types of vrf deployments with any vrf 
solution we consider for the kernel.


Thanks,
Roopa

^ permalink raw reply

* Re: [PATCH] prevent the read ahead of /proc/slabinfo in ss
From: Eric Dumazet @ 2015-02-09 16:07 UTC (permalink / raw)
  To: Bryton Lee; +Cc: stephen, netdev
In-Reply-To: <1423481830-9599-1-git-send-email-brytonlee01@gmail.com>

On Mon, 2015-02-09 at 19:37 +0800, Bryton Lee wrote:
> ss reads ahead of /proc/slabinfo whatever slabstat will be used or not in future.
> this will cause huge system delay when the kernel hires SLAB allocator(SLUB allocator is ok). when program reads
> /proc/slabinfo, it will call s_show() in SLAB allocator level, and s_show() calls spin_lock_irq(&l3->list_lock) 
> then iterate on whole three lists. if one slab has about 900 million objects (for example dentry),
> it will cause more than 1000ms delay. 
> 
> so this patch prevents the read ahead of /proc/slabinfo, ss runs with most parameters not using slabstat at all.

Indeed, thanks !

Acked-by: Eric Dumazet <edumazet@google.com>

^ permalink raw reply

* [PATCH net-next] openvswitch: Only set TUNNEL_VXLAN_OPT if VXLAN-GBP metadata is set
From: Thomas Graf @ 2015-02-09 15:56 UTC (permalink / raw)
  To: davem; +Cc: netdev, pshelar

This avoids setting TUNNEL_VXLAN_OPT for VXLAN frames which don't
have any GBP metadata set. It is not invalid to set it but unnecessary.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
---
 net/openvswitch/vport-vxlan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/openvswitch/vport-vxlan.c b/net/openvswitch/vport-vxlan.c
index ff07d40..3277a75 100644
--- a/net/openvswitch/vport-vxlan.c
+++ b/net/openvswitch/vport-vxlan.c
@@ -76,7 +76,7 @@ static void vxlan_rcv(struct vxlan_sock *vs, struct sk_buff *skb,
 
 	flags = TUNNEL_KEY | (udp_hdr(skb)->check != 0 ? TUNNEL_CSUM : 0);
 	vxlan_port = vxlan_vport(vport);
-	if (vxlan_port->exts & VXLAN_F_GBP)
+	if (vxlan_port->exts & VXLAN_F_GBP && md->gbp)
 		flags |= TUNNEL_VXLAN_OPT;
 
 	/* Save outer tunnel values */
-- 
1.9.3

^ permalink raw reply related


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