Netdev List
 help / color / mirror / Atom feed
* [PATCH 3/3] ath10k: sdio: set skb len for all rx packets
From: Niklas Cassel @ 2018-06-20  8:42 UTC (permalink / raw)
  To: Kalle Valo, David S. Miller
  Cc: alagusankar, Niklas Cassel, ath10k, linux-wireless, netdev,
	linux-kernel
In-Reply-To: <20180620084222.3521-1-niklas.cassel@linaro.org>

Without this, packets larger than 1500 will silently be dropped.
Easily reproduced by sending a ping packet with a size larger
than 1500.

Signed-off-by: Alagu Sankar <alagusankar@silex-india.com>
Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>
---
 drivers/net/wireless/ath/ath10k/sdio.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/ath/ath10k/sdio.c b/drivers/net/wireless/ath/ath10k/sdio.c
index 0c57d6aaa437..8ac47b04a17e 100644
--- a/drivers/net/wireless/ath/ath10k/sdio.c
+++ b/drivers/net/wireless/ath/ath10k/sdio.c
@@ -396,6 +396,7 @@ static int ath10k_sdio_mbox_rx_process_packet(struct ath10k *ar,
 	int ret;
 
 	payload_len = le16_to_cpu(htc_hdr->len);
+	skb->len = payload_len + sizeof(struct ath10k_htc_hdr);
 
 	if (trailer_present) {
 		trailer = skb->data + sizeof(*htc_hdr) +
-- 
2.17.1

^ permalink raw reply related

* Re: [RFC v2, net-next, PATCH 4/4] net/cpsw_switchdev: add switchdev mode of operation on cpsw driver
From: Jiri Pirko @ 2018-06-20  7:08 UTC (permalink / raw)
  To: Grygorii Strashko
  Cc: Ilias Apalodimas, netdev, ivan.khoronzhuk, nsekhar, ivecera,
	andrew, f.fainelli, francois.ozog, yogeshs, spatton, Jose.Abreu
In-Reply-To: <071f7595-aad3-7c16-88ab-8a881d1acf69@ti.com>

Tue, Jun 19, 2018 at 01:19:00AM CEST, grygorii.strashko@ti.com wrote:
>
>
>On 06/14/2018 06:43 AM, Ilias Apalodimas wrote:
>> On Thu, Jun 14, 2018 at 01:39:58PM +0200, Jiri Pirko wrote:
>>> Thu, Jun 14, 2018 at 01:34:04PM CEST, ilias.apalodimas@linaro.org wrote:
>>>> On Thu, Jun 14, 2018 at 01:30:28PM +0200, Jiri Pirko wrote:
>>>>> Thu, Jun 14, 2018 at 01:11:30PM CEST, ilias.apalodimas@linaro.org wrote:
>>>>>
>>>>> [...]
>>>>>
>>>>>> @@ -2711,6 +2789,10 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data,
>>>>>> 	if (of_property_read_bool(node, "dual_emac"))
>>>>>> 		data->switch_mode = CPSW_DUAL_EMAC;
>>>>>>
>>>>>> +	/* switchdev overrides DTS */
>>>>>> +	if (IS_ENABLED(CONFIG_TI_CPSW_SWITCHDEV))
>>>>>> +		data->switch_mode = CPSW_SWITCHDEV;
>>>>>
>>>>> So you force CPSW_SWITCHDEV mode if the CONFIG_TI_CPSW_SWITCHDEV is
>>>>> enabled. That does not sound right. I think that user should tell what
>>>>> mode does he want regardless what the kernel config is.
>>>> We discussed this during the V1 of the RFC. Yes it doesn't seem good, but the
>>>> device currently configures the modes using DTS (which is not correct). I choose
>>>> the .config due to that. I can't think of anything better, but i am open to
>>>> suggestions
>>>
>>> Agreed that DTS does fit as well. I think that this might be a job for
>>> devlink parameters (patchset is going to be sent upstream next week).
>>> You do have 1 bus address for the whole device (both ports), right?
>>>
>> Yes devlink sounds reasonable. I thyink there's only one bus for it, but then
>> again i am far from an expert on the hardware interrnals. Grygorii can correct
>> me if i am wrong.
>
>Devlink and NFS boot are not compatible as per my understanding, so .. 

? Why do you say so?


>
>Again, current driver, as is, supports NFS boot in all modes
>(how good is the cur driver is question which out of scope of this discussion).
>
>And we discussed this in RFC v1 - driver mode selection will be changed 
>if we will proceed and it will be new driver for proper switch support.
>
>Not sure about about Devlink (need to study it and we never got any requests from end
>users for this as I know), and I'd like to note (again) that this is embedded 
>(industrial/automotive etc), so everything preferred to be simple, fast and
>preferably configured statically (in most of the cases end users what boot time 
>configuration).

You need to study it indeed.

> 
>-- 
>regards,
>-grygorii

^ permalink raw reply

* [PATCH net] net: mscc: fix the injection header
From: Antoine Tenart @ 2018-06-20  8:50 UTC (permalink / raw)
  To: davem
  Cc: Antoine Tenart, f.fainelli, andrew, netdev, linux-kernel,
	thomas.petazzoni, alexandre.belloni, quentin.schulz,
	allan.nielsen

When injecting frames in the Ocelot switch driver an injection header
(IFH) should be used to configure various parameters related to a given
frame, such as the port onto which the frame should be departed or its
vlan id. Other parameters in the switch configuration can led to an
injected frame being sent without an IFH but this led to various issues
as the per-frame parameters are then not used. This is especially true
when using multiple ports for injection.

The IFH was injected with the wrong endianness which led to the switch
not taking it into account as the IFH_INJ_BYPASS bit was then unset.
(The bit tells the switch to use the IFH over its internal
configuration). This patch fixes it.

In addition to the endianness fix, the IFH is also fixed. As it was
(unwillingly) unused, some of its fields were not configured the right
way.

Fixes: a556c76adc05 ("net: mscc: Add initial Ocelot switch support")
Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
---
 drivers/net/ethernet/mscc/ocelot.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c
index fb2c8f8071e6..52c57e0ff617 100644
--- a/drivers/net/ethernet/mscc/ocelot.c
+++ b/drivers/net/ethernet/mscc/ocelot.c
@@ -344,10 +344,9 @@ static int ocelot_port_stop(struct net_device *dev)
 static int ocelot_gen_ifh(u32 *ifh, struct frame_info *info)
 {
 	ifh[0] = IFH_INJ_BYPASS;
-	ifh[1] = (0xff00 & info->port) >> 8;
+	ifh[1] = (0xf00 & info->port) >> 8;
 	ifh[2] = (0xff & info->port) << 24;
-	ifh[3] = IFH_INJ_POP_CNT_DISABLE | (info->cpuq << 20) |
-		 (info->tag_type << 16) | info->vid;
+	ifh[3] = (info->tag_type << 16) | info->vid;
 
 	return 0;
 }
@@ -370,11 +369,12 @@ static int ocelot_port_xmit(struct sk_buff *skb, struct net_device *dev)
 			 QS_INJ_CTRL_SOF, QS_INJ_CTRL, grp);
 
 	info.port = BIT(port->chip_port);
-	info.cpuq = 0xff;
+	info.tag_type = IFH_TAG_TYPE_C;
+	info.vid = skb_vlan_tag_get(skb);
 	ocelot_gen_ifh(ifh, &info);
 
 	for (i = 0; i < IFH_LEN; i++)
-		ocelot_write_rix(ocelot, ifh[i], QS_INJ_WR, grp);
+		ocelot_write_rix(ocelot, cpu_to_be32(ifh[i]), QS_INJ_WR, grp);
 
 	count = (skb->len + 3) / 4;
 	last = skb->len % 4;
-- 
2.17.1

^ permalink raw reply related

* Re: WARNING: CPU: 3 PID: 0 at net/sched/sch_hfsc.c:1388 hfsc_dequeue+0x319/0x350 [sch_hfsc]
From: Marco Berizzi @ 2018-06-20  7:00 UTC (permalink / raw)
  To: Cong Wang; +Cc: Linux Kernel Network Developers
In-Reply-To: <619277309.417783.1529408530745@mail.libero.it>

> Il 19 giugno 2018 alle 13.42 Marco Berizzi <pupilla@libero.it> ha scritto:
> 
> > Il 18 giugno 2018 alle 21.28 Cong Wang <xiyou.wangcong@gmail.com> ha scritto:
> > Can you test the attached patch?
> > 
> > It almost certainly fixes the warning, but I am not sure if
> > it papers out any other real problem. Please make sure
> > hfsc still works as expected. :)
> 
> Hi Cong,
> 
> Thanks a lot for the patch. I'm building 4.17.2 + your patch.
> Within 24 hours I will update you.

Hi Cong,

I have applied your patch to 4.17.2
>From my point of view hfsc is working as expected.
However my setup is pretty simple:

tc class add dev eth2 parent 1:2 classid 1:16 hfsc ls rate 3000kbit ul rate 20000kbit

I can see hfsc is shaping my traffic to 20MBit/s.
The error message has not popped up :-)
I will drop you a message withing 48 hours for confirmation.
Will this patch merged in a future kernel release?

Thanks a lot Cong.

Marco

^ permalink raw reply

* [PATCH] net: Fix device name resolving crash in default_device_exit()
From: Kirill Tkhai @ 2018-06-20  8:57 UTC (permalink / raw)
  To: David Ahern, netdev
  Cc: davem, daniel, jakub.kicinski, ast, linux, john.fastabend, brouer
In-Reply-To: <70df65eb-3ef6-20ca-be07-8d73e4e63bea@virtuozzo.com>

From: Kirill Tkhai <ktkhai@virtuozzo.com>

The following script makes kernel to crash since it can't obtain
a name for a device, when the name is occupied by another device:

#!/bin/bash
ifconfig eth0 down
ifconfig eth1 down
index=`cat /sys/class/net/eth1/ifindex`
ip link set eth1 name dev$index
unshare -n sleep 1h &
pid=$!
while [[ "`readlink /proc/self/ns/net`" == "`readlink /proc/$pid/ns/net`" ]]; do continue; done
ip link set dev$index netns $pid
ip link set eth0 name dev$index
kill -9 $pid

Kernel messages:

virtio_net virtio1 dev3: renamed from eth1
virtio_net virtio0 dev3: renamed from eth0
default_device_exit: failed to move dev3 to init_net: -17
------------[ cut here ]------------
kernel BUG at net/core/dev.c:8978!
invalid opcode: 0000 [#1] PREEMPT SMP
CPU: 1 PID: 276 Comm: kworker/u8:3 Not tainted 4.17.0+ #292
Workqueue: netns cleanup_net
RIP: 0010:default_device_exit+0x9c/0xb0
[stack trace snipped]

This patch gives more variability during choosing new name
of device and fixes the problem.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---

Since there is no suggestions how to fix this in another way, I'm resending the patch.

 net/core/dev.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 6e18242a1cae..6c9b9303ded6 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -8959,7 +8959,6 @@ static void __net_exit default_device_exit(struct net *net)
 	rtnl_lock();
 	for_each_netdev_safe(net, dev, aux) {
 		int err;
-		char fb_name[IFNAMSIZ];
 
 		/* Ignore unmoveable devices (i.e. loopback) */
 		if (dev->features & NETIF_F_NETNS_LOCAL)
@@ -8970,8 +8969,7 @@ static void __net_exit default_device_exit(struct net *net)
 			continue;
 
 		/* Push remaining network devices to init_net */
-		snprintf(fb_name, IFNAMSIZ, "dev%d", dev->ifindex);
-		err = dev_change_net_namespace(dev, &init_net, fb_name);
+		err = dev_change_net_namespace(dev, &init_net, "dev%d");
 		if (err) {
 			pr_emerg("%s: failed to move %s to init_net: %d\n",
 				 __func__, dev->name, err);

^ permalink raw reply related

* RE: ICT Service Desk
From: Concepcion Bas @ 2018-06-20  6:22 UTC (permalink / raw)
  To: Concepcion Bas
In-Reply-To: <A1FAA7ADAD22604F803A29333A5C3F8301661EE236@D1VEXMB01.vitas.com>


________________________________
From: Concepcion Bas
Sent: Wednesday, June 20, 2018 2:18 AM
To: Concepcion Bas
Subject: ICT Service Desk

ICT Service Desk vereist dat u bijwerkt / opnieuw valideert naar de meest recente e-mail Outlook Web Apps 2018, vriendelijk Klik op Service Desk<http://www.updatemailowa.flazio.com/home?r=201873> om opnieuw te valideren / upgrade naar de nieuwste e-mail Outlook Web Apps 2018

Verbonden met Microsoft Exchange
© 2018 Microsoft Co-oporation. Alle rechten voorbehouden

^ permalink raw reply

* [PATCH] tc: fix batch force option
From: Vlad Buslov @ 2018-06-20  7:24 UTC (permalink / raw)
  To: netdev; +Cc: chrism, Vlad Buslov

When sending accumulated compound command results an error, check 'force'
option before exiting. Move return code check after putting batch bufs and
freeing iovs to prevent memory leak. Break from loop, instead of returning
error code to allow cleanup at the end of batch function. Don't reset ret
code on each iteration.

Fixes: 485d0c6001c4 ("tc: Add batchsize feature for filter and actions")
Reviewed-by: Roi Dayan <roid@mellanox.com>
Reviewed-by: Chris Mi <chrism@mellanox.com>
Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
---
 tc/tc.c | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/tc/tc.c b/tc/tc.c
index 0d223281ba25..62d54186ec66 100644
--- a/tc/tc.c
+++ b/tc/tc.c
@@ -331,6 +331,7 @@ static int batch(const char *name)
 	int batchsize = 0;
 	size_t len = 0;
 	int ret = 0;
+	int err;
 	bool send;
 
 	batch_mode = 1;
@@ -399,9 +400,9 @@ static int batch(const char *name)
 			continue;	/* blank line */
 		}
 
-		ret = do_cmd(largc, largv, tail == NULL ? NULL : tail->buf,
+		err = do_cmd(largc, largv, tail == NULL ? NULL : tail->buf,
 			     tail == NULL ? 0 : sizeof(tail->buf));
-		if (ret != 0) {
+		if (err != 0) {
 			fprintf(stderr, "Command failed %s:%d\n", name,
 				cmdlineno - 1);
 			ret = 1;
@@ -423,15 +424,17 @@ static int batch(const char *name)
 				iov->iov_len = n->nlmsg_len;
 			}
 
-			ret = rtnl_talk_iov(&rth, iovs, batchsize, NULL);
-			if (ret < 0) {
+			err = rtnl_talk_iov(&rth, iovs, batchsize, NULL);
+			put_batch_bufs(&buf_pool, &head, &tail);
+			free(iovs);
+			if (err < 0) {
 				fprintf(stderr, "Command failed %s:%d\n", name,
-					cmdlineno - (batchsize + ret) - 1);
-				return 2;
+					cmdlineno - (batchsize + err) - 1);
+				ret = 1;
+				if (!force)
+					break;
 			}
-			put_batch_bufs(&buf_pool, &head, &tail);
 			batchsize = 0;
-			free(iovs);
 		}
 	} while (!lastline);
 
-- 
2.7.5

^ permalink raw reply related

* Re: [virtio-dev] Re: [Qemu-devel] [PATCH] qemu: Introduce VIRTIO_NET_F_STANDBY feature bit to virtio_net
From: Cornelia Huck @ 2018-06-20  9:53 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Alexander Duyck, virtio-dev, Jiri Pirko, konrad.wilk,
	Jakub Kicinski, Samudrala, Sridhar, qemu-devel, virtualization,
	Siwei Liu, Venu Busireddy, Netdev, boris.ostrovsky, aaron.f.brown,
	Joao Martins
In-Reply-To: <20180619233001-mutt-send-email-mst@kernel.org>

On Tue, 19 Jun 2018 23:32:06 +0300
"Michael S. Tsirkin" <mst@redhat.com> wrote:

> On Tue, Jun 19, 2018 at 12:54:53PM +0200, Cornelia Huck wrote:
> > Sorry about dragging mainframes into this, but this will only work for
> > homogenous device coupling, not for heterogenous. Consider my vfio-pci
> > + virtio-net-ccw example again: The guest cannot find out that the two
> > belong together by checking some group ID, it has to either use the MAC
> > or some needs-to-be-architectured property.
> > 
> > Alternatively, we could propose that mechanism as pci-only, which means
> > we can rely on mechanisms that won't necessarily work on non-pci
> > transports. (FWIW, I don't see a use case for using vfio-ccw to pass
> > through a network card anytime in the near future, due to the nature of
> > network cards currently in use on s390.)  
> 
> That's what it boils down to, yes.  If there's need to have this for
> non-pci devices, then we should put it in config space.
> Cornelia, what do you think?
> 

I think the only really useful config on s390 is the vfio-pci network
card coupled with a virtio-net-ccw device: Using an s390 network card
via vfio-ccw is out due to the nature of the s390 network cards, and
virtio-ccw is the default transport (virtio-pci is not supported on any
enterprise distro AFAIK).

For this, having a uuid in the config space could work (vfio-pci
devices have a config space by virtue of being pci devices, and
virtio-net-ccw devices have a config space by virtue of being virtio
devices -- ccw devices usually don't have that concept).

^ permalink raw reply

* Re: [PATCH][v2] xfrm: replace NR_CPU with nr_cpu_ids
From: Florian Westphal @ 2018-06-20  9:55 UTC (permalink / raw)
  To: Steffen Klassert; +Cc: Florian Westphal, Li RongQing, netdev
In-Reply-To: <20180619121755.3weaw5lsp4sho23r@gauss3.secunet.de>

Steffen Klassert <steffen.klassert@secunet.com> wrote:
> On Tue, Jun 19, 2018 at 09:53:49AM +0200, Florian Westphal wrote:
> > Li RongQing <lirongqing@baidu.com> wrote:
> > > The default NR_CPUS can be very large, but actual possible nr_cpu_ids
> > > usually is very small. For some x86 distribution, the NR_CPUS is 8192
> > > and nr_cpu_ids is 4, so replace NR_CPU to save some memory
> > 
> > Steffen,
> > 
> > I will soon submit a patch to remove the percpu cache; removal
> > improved performance for at least one user (and by quite a sizeable
> > amount).
> > 
> > Would you consider such removal for ipsec or ipsec-next?
> 
> I think this removel would better fit to ipsec-next.

Agree, it slows things down further for me in my tests.
Problem is that I get quite good re-use of pcpu cache due to
unidirectional flows and only one tunnel.

I suspect that even with tunnel the removal is a win in practice
though, netperf is quite artifical, so I rather trust Kristians results
(real world) than my own.

> considered to apply it to ipsec-next. If you plan
> to remove it, I'll wait for that.

I'll submit once net-next opens.

^ permalink raw reply

* [PATCH] ceph: use ktime_get_real_seconds()
From: Allen Pais @ 2018-06-20 10:00 UTC (permalink / raw)
  To: netdev; +Cc: davem, linux-kernel, ceph-devel, y2038, Allen Pais

Use ktime_get_real_seconds() as get_seconds() is deprecated.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 net/ceph/auth_x.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/net/ceph/auth_x.c b/net/ceph/auth_x.c
index 2f4a1ba..99561c2 100644
--- a/net/ceph/auth_x.c
+++ b/net/ceph/auth_x.c
@@ -154,7 +154,7 @@ static int process_one_ticket(struct ceph_auth_client *ac,
 	void **ptp;
 	struct ceph_crypto_key new_session_key = { 0 };
 	struct ceph_buffer *new_ticket_blob;
-	unsigned long new_expires, new_renew_after;
+	u32 new_expires, new_renew_after;
 	u64 new_secret_id;
 	int ret;
 
@@ -191,9 +191,9 @@ static int process_one_ticket(struct ceph_auth_client *ac,
 
 	ceph_decode_timespec(&validity, dp);
 	dp += sizeof(struct ceph_timespec);
-	new_expires = get_seconds() + validity.tv_sec;
+	new_expires = (u32)ktime_get_real_seconds() + validity.tv_sec;
 	new_renew_after = new_expires - (validity.tv_sec / 4);
-	dout(" expires=%lu renew_after=%lu\n", new_expires,
+	dout(" expires=%u renew_after=%u\n", new_expires,
 	     new_renew_after);
 
 	/* ticket blob for service */
@@ -385,13 +385,13 @@ static bool need_key(struct ceph_x_ticket_handler *th)
 	if (!th->have_key)
 		return true;
 
-	return get_seconds() >= th->renew_after;
+	return ktime_get_real_seconds() >= th->renew_after;
 }
 
 static bool have_key(struct ceph_x_ticket_handler *th)
 {
 	if (th->have_key) {
-		if (get_seconds() >= th->expires)
+		if (ktime_get_real_seconds() >= th->expires)
 			th->have_key = false;
 	}
 
-- 
2.7.4

^ permalink raw reply related

* Re: Grant
From: Maratovich M. Fridman @ 2018-06-20  7:34 UTC (permalink / raw)





-- 
I Mikhail Fridman. has selected you specially as one of my beneficiaries
for my Charitable Donation, Just as I have declared on May 23, 2016 to give
my fortune as charity.

Check the link below for confirmation:

http://www.ibtimes.co.uk/russias-second-wealthiest-man-mikhail-fridman-plans-leaving-14-2bn-fortune-charity-1561604

Reply as soon as possible with further directives.

Best Regards,
Mikhail Fridman.

^ permalink raw reply

* ISDN: use irqsave() in URB completion + usb_fill_int_urb
From: Sebastian Andrzej Siewior @ 2018-06-20 10:40 UTC (permalink / raw)
  To: netdev; +Cc: Karsten Keil, linux-usb, tglx

This series is mostly about using _irqsave() primitives in the
completion callback in order to get rid of local_irq_save() in
__usb_hcd_giveback_urb(). While at it, I also tried to move drivers to
use usb_fill_int_urb() otherwise it is hard find users of a certain API.

Sebastian

^ permalink raw reply

* [PATCH 1/4] isdn: gigaset: use usb_fill_int_urb()
From: Sebastian Andrzej Siewior @ 2018-06-20 10:40 UTC (permalink / raw)
  To: netdev
  Cc: Karsten Keil, linux-usb, tglx, Sebastian Andrzej Siewior,
	Paul Bolle, gigaset307x-common
In-Reply-To: <20180620104028.18283-1-bigeasy@linutronix.de>

Using usb_fill_int_urb() helps to find code which initializes an
URB. A grep for members of the struct (like ->complete) reveal lots
of other things, too.

Cc: Paul Bolle <pebolle@tiscali.nl>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: gigaset307x-common@lists.sourceforge.net
Cc: netdev@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 drivers/isdn/gigaset/bas-gigaset.c | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/drivers/isdn/gigaset/bas-gigaset.c b/drivers/isdn/gigaset/bas-gigaset.c
index 20d0a080a2b0..40c141163f0f 100644
--- a/drivers/isdn/gigaset/bas-gigaset.c
+++ b/drivers/isdn/gigaset/bas-gigaset.c
@@ -972,16 +972,14 @@ static int starturbs(struct bc_state *bcs)
 			rc = -EFAULT;
 			goto error;
 		}
+		usb_fill_int_urb(urb, bcs->cs->hw.bas->udev,
+				 usb_rcvisocpipe(urb->dev, 3 + 2 * bcs->channel),
+				 ubc->isoinbuf + k * BAS_INBUFSIZE,
+				 BAS_INBUFSIZE, read_iso_callback, bcs,
+				 BAS_FRAMETIME);
 
-		urb->dev = bcs->cs->hw.bas->udev;
-		urb->pipe = usb_rcvisocpipe(urb->dev, 3 + 2 * bcs->channel);
 		urb->transfer_flags = URB_ISO_ASAP;
-		urb->transfer_buffer = ubc->isoinbuf + k * BAS_INBUFSIZE;
-		urb->transfer_buffer_length = BAS_INBUFSIZE;
 		urb->number_of_packets = BAS_NUMFRAMES;
-		urb->interval = BAS_FRAMETIME;
-		urb->complete = read_iso_callback;
-		urb->context = bcs;
 		for (j = 0; j < BAS_NUMFRAMES; j++) {
 			urb->iso_frame_desc[j].offset = j * BAS_MAXFRAME;
 			urb->iso_frame_desc[j].length = BAS_MAXFRAME;
@@ -1005,15 +1003,15 @@ static int starturbs(struct bc_state *bcs)
 			rc = -EFAULT;
 			goto error;
 		}
-		urb->dev = bcs->cs->hw.bas->udev;
-		urb->pipe = usb_sndisocpipe(urb->dev, 4 + 2 * bcs->channel);
+		usb_fill_int_urb(urb, bcs->cs->hw.bas->udev,
+				 usb_sndisocpipe(urb->dev, 4 + 2 * bcs->channel),
+				 ubc->isooutbuf->data,
+				 sizeof(ubc->isooutbuf->data),
+				 write_iso_callback, &ubc->isoouturbs[k],
+				 BAS_FRAMETIME);
+
 		urb->transfer_flags = URB_ISO_ASAP;
-		urb->transfer_buffer = ubc->isooutbuf->data;
-		urb->transfer_buffer_length = sizeof(ubc->isooutbuf->data);
 		urb->number_of_packets = BAS_NUMFRAMES;
-		urb->interval = BAS_FRAMETIME;
-		urb->complete = write_iso_callback;
-		urb->context = &ubc->isoouturbs[k];
 		for (j = 0; j < BAS_NUMFRAMES; ++j) {
 			urb->iso_frame_desc[j].offset = BAS_OUTBUFSIZE;
 			urb->iso_frame_desc[j].length = BAS_NORMFRAME;
-- 
2.17.1

^ permalink raw reply related

* [PATCH 2/4] isdn: hisax: hfc_usb: use usb_fill_int_urb()
From: Sebastian Andrzej Siewior @ 2018-06-20 10:40 UTC (permalink / raw)
  To: netdev; +Cc: Karsten Keil, linux-usb, tglx, Sebastian Andrzej Siewior
In-Reply-To: <20180620104028.18283-1-bigeasy@linutronix.de>

Using usb_fill_int_urb() helps to find code which initializes an
URB. A grep for members of the struct (like ->complete) reveal lots
of other things, too.

The `interval' parameter is now set differently on HS and SS. The
argument is fed from bInterval so it should be the right thing to do.

Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: netdev@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 drivers/isdn/hisax/hfc_usb.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/isdn/hisax/hfc_usb.c b/drivers/isdn/hisax/hfc_usb.c
index 97ecb3073045..1d4cd01d4685 100644
--- a/drivers/isdn/hisax/hfc_usb.c
+++ b/drivers/isdn/hisax/hfc_usb.c
@@ -432,16 +432,12 @@ fill_isoc_urb(struct urb *urb, struct usb_device *dev, unsigned int pipe,
 {
 	int k;
 
-	urb->dev = dev;
-	urb->pipe = pipe;
-	urb->complete = complete;
+	usb_fill_int_urb(urb, dev, pipe, buf, packet_size * num_packets,
+			 complete, context, interval);
+
 	urb->number_of_packets = num_packets;
-	urb->transfer_buffer_length = packet_size * num_packets;
-	urb->context = context;
-	urb->transfer_buffer = buf;
 	urb->transfer_flags = URB_ISO_ASAP;
 	urb->actual_length = 0;
-	urb->interval = interval;
 	for (k = 0; k < num_packets; k++) {
 		urb->iso_frame_desc[k].offset = packet_size * k;
 		urb->iso_frame_desc[k].length = packet_size;
-- 
2.17.1

^ permalink raw reply related

* [PATCH 3/4] isdn: hisax: st5481_usb: use usb_fill_int_urb()
From: Sebastian Andrzej Siewior @ 2018-06-20 10:40 UTC (permalink / raw)
  To: netdev; +Cc: Karsten Keil, linux-usb, tglx, Sebastian Andrzej Siewior
In-Reply-To: <20180620104028.18283-1-bigeasy@linutronix.de>

Using usb_fill_int_urb() helps to find code which initializes an
URB. A grep for members of the struct (like ->complete) reveal lots
of other things, too.

Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: netdev@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 drivers/isdn/hisax/st5481_usb.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/isdn/hisax/st5481_usb.c b/drivers/isdn/hisax/st5481_usb.c
index 1cb9930d5e24..f207fda691c7 100644
--- a/drivers/isdn/hisax/st5481_usb.c
+++ b/drivers/isdn/hisax/st5481_usb.c
@@ -408,15 +408,10 @@ fill_isoc_urb(struct urb *urb, struct usb_device *dev,
 {
 	int k;
 
-	urb->dev = dev;
-	urb->pipe = pipe;
-	urb->interval = 1;
-	urb->transfer_buffer = buf;
+	usb_fill_int_urb(urb, dev, pipe, buf, num_packets * packet_size,
+			 complete, context, 1);
+
 	urb->number_of_packets = num_packets;
-	urb->transfer_buffer_length = num_packets * packet_size;
-	urb->actual_length = 0;
-	urb->complete = complete;
-	urb->context = context;
 	urb->transfer_flags = URB_ISO_ASAP;
 	for (k = 0; k < num_packets; k++) {
 		urb->iso_frame_desc[k].offset = packet_size * k;
-- 
2.17.1

^ permalink raw reply related

* [PATCH 4/4] isdn: mISDN: use irqsave() in USB's complete callback
From: Sebastian Andrzej Siewior @ 2018-06-20 10:40 UTC (permalink / raw)
  To: netdev; +Cc: Karsten Keil, linux-usb, tglx, Sebastian Andrzej Siewior
In-Reply-To: <20180620104028.18283-1-bigeasy@linutronix.de>

The USB completion callback does not disable interrupts while acquiring
the ->lock. We want to remove the local_irq_disable() invocation from
__usb_hcd_giveback_urb() and therefore it is required for the callback
handler to disable the interrupts while acquiring the lock.
The callback may be invoked either in IRQ or BH context depending on the
USB host controller.
Use the _irqsave() variant of the locking primitives.

Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: netdev@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 drivers/isdn/hardware/mISDN/hfcsusb.c | 36 +++++++++++++++------------
 1 file changed, 20 insertions(+), 16 deletions(-)

diff --git a/drivers/isdn/hardware/mISDN/hfcsusb.c b/drivers/isdn/hardware/mISDN/hfcsusb.c
index 17cc879ad2bb..6d05946b445e 100644
--- a/drivers/isdn/hardware/mISDN/hfcsusb.c
+++ b/drivers/isdn/hardware/mISDN/hfcsusb.c
@@ -819,6 +819,7 @@ hfcsusb_rx_frame(struct usb_fifo *fifo, __u8 *data, unsigned int len,
 	int		fifon = fifo->fifonum;
 	int		i;
 	int		hdlc = 0;
+	unsigned long	flags;
 
 	if (debug & DBG_HFC_CALL_TRACE)
 		printk(KERN_DEBUG "%s: %s: fifo(%i) len(%i) "
@@ -835,7 +836,7 @@ hfcsusb_rx_frame(struct usb_fifo *fifo, __u8 *data, unsigned int len,
 		return;
 	}
 
-	spin_lock(&hw->lock);
+	spin_lock_irqsave(&hw->lock, flags);
 	if (fifo->dch) {
 		rx_skb = fifo->dch->rx_skb;
 		maxlen = fifo->dch->maxlen;
@@ -844,7 +845,7 @@ hfcsusb_rx_frame(struct usb_fifo *fifo, __u8 *data, unsigned int len,
 	if (fifo->bch) {
 		if (test_bit(FLG_RX_OFF, &fifo->bch->Flags)) {
 			fifo->bch->dropcnt += len;
-			spin_unlock(&hw->lock);
+			spin_unlock_irqrestore(&hw->lock, flags);
 			return;
 		}
 		maxlen = bchannel_get_rxbuf(fifo->bch, len);
@@ -854,7 +855,7 @@ hfcsusb_rx_frame(struct usb_fifo *fifo, __u8 *data, unsigned int len,
 				skb_trim(rx_skb, 0);
 			pr_warning("%s.B%d: No bufferspace for %d bytes\n",
 				   hw->name, fifo->bch->nr, len);
-			spin_unlock(&hw->lock);
+			spin_unlock_irqrestore(&hw->lock, flags);
 			return;
 		}
 		maxlen = fifo->bch->maxlen;
@@ -878,7 +879,7 @@ hfcsusb_rx_frame(struct usb_fifo *fifo, __u8 *data, unsigned int len,
 			} else {
 				printk(KERN_DEBUG "%s: %s: No mem for rx_skb\n",
 				       hw->name, __func__);
-				spin_unlock(&hw->lock);
+				spin_unlock_irqrestore(&hw->lock, flags);
 				return;
 			}
 		}
@@ -888,7 +889,7 @@ hfcsusb_rx_frame(struct usb_fifo *fifo, __u8 *data, unsigned int len,
 			       "for fifo(%d) HFCUSB_D_RX\n",
 			       hw->name, __func__, fifon);
 			skb_trim(rx_skb, 0);
-			spin_unlock(&hw->lock);
+			spin_unlock_irqrestore(&hw->lock, flags);
 			return;
 		}
 	}
@@ -942,7 +943,7 @@ hfcsusb_rx_frame(struct usb_fifo *fifo, __u8 *data, unsigned int len,
 		/* deliver transparent data to layer2 */
 		recv_Bchannel(fifo->bch, MISDN_ID_ANY, false);
 	}
-	spin_unlock(&hw->lock);
+	spin_unlock_irqrestore(&hw->lock, flags);
 }
 
 static void
@@ -979,18 +980,19 @@ rx_iso_complete(struct urb *urb)
 	__u8 *buf;
 	static __u8 eof[8];
 	__u8 s0_state;
+	unsigned long flags;
 
 	fifon = fifo->fifonum;
 	status = urb->status;
 
-	spin_lock(&hw->lock);
+	spin_lock_irqsave(&hw->lock, flags);
 	if (fifo->stop_gracefull) {
 		fifo->stop_gracefull = 0;
 		fifo->active = 0;
-		spin_unlock(&hw->lock);
+		spin_unlock_irqrestore(&hw->lock, flags);
 		return;
 	}
-	spin_unlock(&hw->lock);
+	spin_unlock_irqrestore(&hw->lock, flags);
 
 	/*
 	 * ISO transfer only partially completed,
@@ -1096,15 +1098,16 @@ rx_int_complete(struct urb *urb)
 	struct usb_fifo *fifo = (struct usb_fifo *) urb->context;
 	struct hfcsusb *hw = fifo->hw;
 	static __u8 eof[8];
+	unsigned long flags;
 
-	spin_lock(&hw->lock);
+	spin_lock_irqsave(&hw->lock, flags);
 	if (fifo->stop_gracefull) {
 		fifo->stop_gracefull = 0;
 		fifo->active = 0;
-		spin_unlock(&hw->lock);
+		spin_unlock_irqrestore(&hw->lock, flags);
 		return;
 	}
-	spin_unlock(&hw->lock);
+	spin_unlock_irqrestore(&hw->lock, flags);
 
 	fifon = fifo->fifonum;
 	if ((!fifo->active) || (urb->status)) {
@@ -1172,12 +1175,13 @@ tx_iso_complete(struct urb *urb)
 	int *tx_idx;
 	int frame_complete, fifon, status, fillempty = 0;
 	__u8 threshbit, *p;
+	unsigned long flags;
 
-	spin_lock(&hw->lock);
+	spin_lock_irqsave(&hw->lock, flags);
 	if (fifo->stop_gracefull) {
 		fifo->stop_gracefull = 0;
 		fifo->active = 0;
-		spin_unlock(&hw->lock);
+		spin_unlock_irqrestore(&hw->lock, flags);
 		return;
 	}
 
@@ -1195,7 +1199,7 @@ tx_iso_complete(struct urb *urb)
 	} else {
 		printk(KERN_DEBUG "%s: %s: neither BCH nor DCH\n",
 		       hw->name, __func__);
-		spin_unlock(&hw->lock);
+		spin_unlock_irqrestore(&hw->lock, flags);
 		return;
 	}
 
@@ -1375,7 +1379,7 @@ tx_iso_complete(struct urb *urb)
 			       hw->name, __func__,
 			       symbolic(urb_errlist, status), status, fifon);
 	}
-	spin_unlock(&hw->lock);
+	spin_unlock_irqrestore(&hw->lock, flags);
 }
 
 /*
-- 
2.17.1

^ permalink raw reply related

* [PATCH v4 3/5] batman-adv: use BIT_ULL for NL80211_STA_INFO_* attribute types
From: Omer Efrat @ 2018-06-20 10:46 UTC (permalink / raw)
  To: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r
  Cc: Omer Efrat

The BIT macro uses unsigned long which some architectures handle as 32 bit
and therefore might cause macro's shift to overflow when used on a value
equals or larger than 32 (NL80211_STA_INFO_RX_DURATION and afterwards).

Since 'filled' member in station_info changed to u64, BIT_ULL macro
should be used with all NL80211_STA_INFO_* attribute types instead of BIT
to prevent future possible bugs when one will use BIT macro for higher
attributes by mistake.

This commit cleans up all usages of BIT macro with the above field
in batman-adv by changing it to BIT_ULL instead.

Signed-off-by: Omer Efrat <omer.efrat-CtGflUZwD1xBDgjK7y7TUQ@public.gmane.org>
---
 net/batman-adv/bat_v_elp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/batman-adv/bat_v_elp.c b/net/batman-adv/bat_v_elp.c
index 71c20c1..2f0de55 100644
--- a/net/batman-adv/bat_v_elp.c
+++ b/net/batman-adv/bat_v_elp.c
@@ -114,7 +114,8 @@ static u32 batadv_v_elp_get_throughput(struct batadv_hardif_neigh_node *neigh)
 		}
 		if (ret)
 			goto default_throughput;
-		if (!(sinfo.filled & BIT(NL80211_STA_INFO_EXPECTED_THROUGHPUT)))
+		if (!(sinfo.filled &
+			  BIT_ULL(NL80211_STA_INFO_EXPECTED_THROUGHPUT)))
 			goto default_throughput;
 
 		return sinfo.expected_throughput / 100;
-- 
2.7.4

^ permalink raw reply related

* Re: [PATCH net] net: sungem: fix rx checksum support
From: Mathieu Malaterre @ 2018-06-20 11:22 UTC (permalink / raw)
  To: David S. Miller; +Cc: Eric Dumazet, netdev, Meelis Roos, schwab, eric.dumazet
In-Reply-To: <20180620.143050.313454768369559179.davem@davemloft.net>

On Wed, Jun 20, 2018 at 7:31 AM David Miller <davem@davemloft.net> wrote:
>
> From: Eric Dumazet <edumazet@google.com>
> Date: Tue, 19 Jun 2018 19:18:50 -0700
>
> > After commit 88078d98d1bb ("net: pskb_trim_rcsum() and CHECKSUM_COMPLETE
> > are friends"), sungem owners reported the infamous "eth0: hw csum failure"
> > message.
> >
> > CHECKSUM_COMPLETE has in fact never worked for this driver, but this
> > was masked by the fact that upper stacks had to strip the FCS, and
> > therefore skb->ip_summed was set back to CHECKSUM_NONE before
> > my recent change.
> >
> > Driver configures a number of bytes to skip when the chip computes
> > the checksum, and for some reason only half of the Ethernet header
> > was skipped.
> >
> > Then a second problem is that we should strip the FCS by default,
> > unless the driver is updated to eventually support NETIF_F_RXFCS in
> > the future.
> >
> > Finally, a driver should check if NETIF_F_RXCSUM feature is enabled
> > or not, so that the admin can turn off rx checksum if wanted.
> >
> > Many thanks to Andreas Schwab and Mathieu Malaterre for their
> > help in debugging this issue.
> >
> > Signed-off-by: Eric Dumazet <edumazet@google.com>
> > Reported-by: Meelis Roos <mroos@linux.ee>
> > Reported-by: Mathieu Malaterre <malat@debian.org>
> > Reported-by: Andreas Schwab <schwab@linux-m68k.org>
> > Tested-by: Andreas Schwab <schwab@linux-m68k.org>
>
> Applied and queued up for -stable, thanks Eric.

Thanks for the stable tag.

IMHO the commit message should have also reference commit 7ce5a27f2ef8
("Revert "net: Handle CHECKSUM_COMPLETE more adequately in
pskb_trim_rcsum().""). Which means that commit 88078d98d1bb ("net:
pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends") should be ready
for stable also, since it seems that the only driver responsible for
the revert was sungem.

my 2cts

^ permalink raw reply

* Re: [PATCH net] net: mscc: fix the injection header
From: Alexandre Belloni @ 2018-06-20 11:29 UTC (permalink / raw)
  To: Antoine Tenart
  Cc: davem, f.fainelli, andrew, netdev, linux-kernel, thomas.petazzoni,
	quentin.schulz, allan.nielsen
In-Reply-To: <20180620085046.2377-1-antoine.tenart@bootlin.com>

On 20/06/2018 10:50:46+0200, Antoine Ténart wrote:
> When injecting frames in the Ocelot switch driver an injection header
> (IFH) should be used to configure various parameters related to a given
> frame, such as the port onto which the frame should be departed or its
> vlan id. Other parameters in the switch configuration can led to an
> injected frame being sent without an IFH but this led to various issues
> as the per-frame parameters are then not used. This is especially true
> when using multiple ports for injection.
> 
> The IFH was injected with the wrong endianness which led to the switch
> not taking it into account as the IFH_INJ_BYPASS bit was then unset.
> (The bit tells the switch to use the IFH over its internal
> configuration). This patch fixes it.
> 
> In addition to the endianness fix, the IFH is also fixed. As it was
> (unwillingly) unused, some of its fields were not configured the right
> way.
> 
> Fixes: a556c76adc05 ("net: mscc: Add initial Ocelot switch support")
> Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

> ---
>  drivers/net/ethernet/mscc/ocelot.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c
> index fb2c8f8071e6..52c57e0ff617 100644
> --- a/drivers/net/ethernet/mscc/ocelot.c
> +++ b/drivers/net/ethernet/mscc/ocelot.c
> @@ -344,10 +344,9 @@ static int ocelot_port_stop(struct net_device *dev)
>  static int ocelot_gen_ifh(u32 *ifh, struct frame_info *info)
>  {
>  	ifh[0] = IFH_INJ_BYPASS;
> -	ifh[1] = (0xff00 & info->port) >> 8;
> +	ifh[1] = (0xf00 & info->port) >> 8;
>  	ifh[2] = (0xff & info->port) << 24;
> -	ifh[3] = IFH_INJ_POP_CNT_DISABLE | (info->cpuq << 20) |
> -		 (info->tag_type << 16) | info->vid;
> +	ifh[3] = (info->tag_type << 16) | info->vid;
>  
>  	return 0;
>  }
> @@ -370,11 +369,12 @@ static int ocelot_port_xmit(struct sk_buff *skb, struct net_device *dev)
>  			 QS_INJ_CTRL_SOF, QS_INJ_CTRL, grp);
>  
>  	info.port = BIT(port->chip_port);
> -	info.cpuq = 0xff;
> +	info.tag_type = IFH_TAG_TYPE_C;
> +	info.vid = skb_vlan_tag_get(skb);
>  	ocelot_gen_ifh(ifh, &info);
>  
>  	for (i = 0; i < IFH_LEN; i++)
> -		ocelot_write_rix(ocelot, ifh[i], QS_INJ_WR, grp);
> +		ocelot_write_rix(ocelot, cpu_to_be32(ifh[i]), QS_INJ_WR, grp);
>  
>  	count = (skb->len + 3) / 4;
>  	last = skb->len % 4;
> -- 
> 2.17.1
> 

-- 
Alexandre Belloni, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply

* Re: [PATCH v4 3/5] batman-adv: use BIT_ULL for NL80211_STA_INFO_* attribute types
From: Sven Eckelmann @ 2018-06-20 11:34 UTC (permalink / raw)
  To: b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA, Omer Efrat
In-Reply-To: <1529491616-23222-1-git-send-email-omer.efrat-CtGflUZwD1xBDgjK7y7TUQ@public.gmane.org>

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

On Mittwoch, 20. Juni 2018 13:46:56 CEST Omer Efrat wrote:
> -               if (!(sinfo.filled & BIT(NL80211_STA_INFO_EXPECTED_THROUGHPUT)))
> +               if (!(sinfo.filled &
> +                         BIT_ULL(NL80211_STA_INFO_EXPECTED_THROUGHPUT)))
>                         goto default_throughput;

Please fix the alignment:

* Found wrong alignment at net/batman-adv/bat_v_elp.c:118, was 27 but expected 23

Kind regards,
	Sven

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

^ permalink raw reply

* [PATCH] net: macb: Fix ptp time adjustment for large negative delta
From: Harini Katakam @ 2018-06-20 11:34 UTC (permalink / raw)
  To: nicolas.ferre, davem
  Cc: netdev, linux-kernel, michal.simek, harinikatakamlinux,
	harini.katakam

When delta passed to gem_ptp_adjtime is negative, the sign is
maintained in the ns_to_timespec64 conversion. Hence timespec_add
should be used directly. timespec_sub will just subtract the negative
value thus increasing the time difference.

Signed-off-by: Harini Katakam <harini.katakam@xilinx.com>
---
 drivers/net/ethernet/cadence/macb_ptp.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/cadence/macb_ptp.c b/drivers/net/ethernet/cadence/macb_ptp.c
index 2220c77..6788351 100644
--- a/drivers/net/ethernet/cadence/macb_ptp.c
+++ b/drivers/net/ethernet/cadence/macb_ptp.c
@@ -170,10 +170,7 @@ static int gem_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)
 
 	if (delta > TSU_NSEC_MAX_VAL) {
 		gem_tsu_get_time(&bp->ptp_clock_info, &now);
-		if (sign)
-			now = timespec64_sub(now, then);
-		else
-			now = timespec64_add(now, then);
+		now = timespec64_add(now, then);
 
 		gem_tsu_set_time(&bp->ptp_clock_info,
 				 (const struct timespec64 *)&now);
-- 
2.7.4

^ permalink raw reply related

* Re: [PATCH v4 net-next] net:sched: add action inheritdsfield to skbedit
From: Jamal Hadi Salim @ 2018-06-20 11:53 UTC (permalink / raw)
  To: Michel Machado, Fu, Qiaobin, davem@davemloft.net
  Cc: netdev@vger.kernel.org, Marcelo Ricardo Leitner,
	xiyou.wangcong@gmail.com
In-Reply-To: <785f294c-080a-bfb4-5c7f-3ab48056649f@digirati.com.br>

On 19/06/18 08:39 AM, Michel Machado wrote:

>  Notice that, different from skbmod, there's no field parm->flags in 
> skbedit. Skbedit infers the flags in d->flags from the presence of the 
> parameters of each of its actions. But SKBEDIT_F_INHERITDSFIELD has no 
> parameter and adding field parm->flags breaks backward compatibility 
> with user space as pointed out by Marcelo Ricardo Leitner. Our solution 
> was to add TCA_SKBEDIT_FLAGS, so SKBEDIT_F_INHERITDSFIELD and future 
> flag-only actions can be added.

Ok, that makes sense - thanks. I am not so sure about using
64 bits (32 bits would have been fine to match the size of
the kernel flags), but other than that LGTM.

Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>

cheers,
jamal

^ permalink raw reply

* [PATCH] r8169: Fix netpoll oops
From: Ville Syrjala @ 2018-06-20 12:01 UTC (permalink / raw)
  To: netdev
  Cc: Realtek linux nic maintainers, Heiner Kallweit, David S . Miller,
	Ville Syrjälä

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Pass the correct thing to rtl8169_interrupt() from netpoll.

Cc: Realtek linux nic maintainers <nic_swsd@realtek.com>
Cc: netdev@vger.kernel.org
Cc: Heiner Kallweit <hkallweit1@gmail.com>
Cc: David S. Miller <davem@davemloft.net>
Fixes: ebcd5daa7ffd ("r8169: change interrupt handler argument type")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/net/ethernet/realtek/r8169.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 75dfac0248f4..f4cae2be0fda 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -7148,7 +7148,7 @@ static void rtl8169_netpoll(struct net_device *dev)
 {
 	struct rtl8169_private *tp = netdev_priv(dev);
 
-	rtl8169_interrupt(pci_irq_vector(tp->pci_dev, 0), dev);
+	rtl8169_interrupt(pci_irq_vector(tp->pci_dev, 0), tp);
 }
 #endif
 
-- 
2.16.4

^ permalink raw reply related

* Re: [PATCH net 1/5] net sched actions: fix coding style in pedit action
From: Davide Caratti @ 2018-06-20 12:29 UTC (permalink / raw)
  To: Roman Mashak, davem; +Cc: netdev, kernel, jhs, xiyou.wangcong, jiri
In-Reply-To: <1529427368-17129-2-git-send-email-mrv@mojatatu.com>

On Tue, 2018-06-19 at 12:56 -0400, Roman Mashak wrote:
> Fix coding style issues in tc pedit action detected by the
> checkpatch script.
> 
> Signed-off-by: Roman Mashak <mrv@mojatatu.com>
...

> ---
> @@ -316,16 +318,15 @@ static int tcf_pedit(struct sk_buff *skb, const struct tc_action *a,
>  						hoffset + tkey->at);
>  					goto bad;
>  				}
> -				d = skb_header_pointer(skb, hoffset + tkey->at, 1,
> -						       &_d);
> +				d = skb_header_pointer(skb, hoffset + tkey->at,
> +						       1, &_d);
> 				if (!d)
>  					goto bad;
>  				offset += (*d & tkey->offmask) >> tkey->shift;
>  			}

hello Roman,

nit: while we are here, what about changing the declaration of _d and *d
to u8, so that the bitwise operation is done on unsigned?

BTW: the patch (and the series) looks ok, but I guess it will better
target net-next when the branch reopens

thanks!
-- 
davide

 

^ permalink raw reply

* Re: [PATCH] ceph: use ktime_get_real_seconds()
From: Ilya Dryomov @ 2018-06-20 12:33 UTC (permalink / raw)
  To: allen.lkml; +Cc: netdev, David S. Miller, linux-kernel, Ceph Development, y2038
In-Reply-To: <1529488801-22093-1-git-send-email-allen.lkml@gmail.com>

On Wed, Jun 20, 2018 at 12:00 PM Allen Pais <allen.lkml@gmail.com> wrote:
>
> Use ktime_get_real_seconds() as get_seconds() is deprecated.
>
> Signed-off-by: Allen Pais <allen.lkml@gmail.com>
> ---
>  net/ceph/auth_x.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/net/ceph/auth_x.c b/net/ceph/auth_x.c
> index 2f4a1ba..99561c2 100644
> --- a/net/ceph/auth_x.c
> +++ b/net/ceph/auth_x.c
> @@ -154,7 +154,7 @@ static int process_one_ticket(struct ceph_auth_client *ac,
>         void **ptp;
>         struct ceph_crypto_key new_session_key = { 0 };
>         struct ceph_buffer *new_ticket_blob;
> -       unsigned long new_expires, new_renew_after;
> +       u32 new_expires, new_renew_after;
>         u64 new_secret_id;
>         int ret;
>
> @@ -191,9 +191,9 @@ static int process_one_ticket(struct ceph_auth_client *ac,
>
>         ceph_decode_timespec(&validity, dp);
>         dp += sizeof(struct ceph_timespec);
> -       new_expires = get_seconds() + validity.tv_sec;
> +       new_expires = (u32)ktime_get_real_seconds() + validity.tv_sec;

Why the change to u32 and this cast?  If the type has to change,
wouldn't time64_t make more sense?  ktime_get_real_seconds() returns
time64_t, after all.

Thanks,

                Ilya

^ permalink raw reply


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