Re: [PATCH net-next v9 5/5] virtio_net: check return value of skb_to_sgvec always

2017-05-24 Thread Sergei Shtylyov

On 05/24/2017 11:39 PM, Jason A. Donenfeld wrote:


   I've only looked on the last 2 patches. You can add my:

Reviewed-by: Sergei Shtylyov 

if you want. :-)


Will do. For the series, or just for 5/5?


   5/5 only. :-)

MBR, Sergei



Re: [PATCH net-next v9 5/5] virtio_net: check return value of skb_to_sgvec always

2017-05-24 Thread Sergei Shtylyov

On 05/24/2017 11:39 PM, Jason A. Donenfeld wrote:


   I've only looked on the last 2 patches. You can add my:

Reviewed-by: Sergei Shtylyov 

if you want. :-)


Will do. For the series, or just for 5/5?


   5/5 only. :-)

MBR, Sergei



Re: [PATCH net-next v9 5/5] virtio_net: check return value of skb_to_sgvec always

2017-05-24 Thread Jason A. Donenfeld
On Wed, May 24, 2017 at 6:41 PM, Sergei Shtylyov
>I've only looked on the last 2 patches. You can add my:
>
> Reviewed-by: Sergei Shtylyov 
>
> if you want. :-)

Will do. For the series, or just for 5/5?


Re: [PATCH net-next v9 5/5] virtio_net: check return value of skb_to_sgvec always

2017-05-24 Thread Jason A. Donenfeld
On Wed, May 24, 2017 at 6:41 PM, Sergei Shtylyov
>I've only looked on the last 2 patches. You can add my:
>
> Reviewed-by: Sergei Shtylyov 
>
> if you want. :-)

Will do. For the series, or just for 5/5?


Re: [PATCH net-next v9 5/5] virtio_net: check return value of skb_to_sgvec always

2017-05-24 Thread Sergei Shtylyov

On 05/24/2017 02:34 PM, Jason A. Donenfeld wrote:


I'm shocked this somehow made it into the commit. I wonder how that happened?


   Sorry for not noticing this when it first appeared.


Anyway, fixed in my git repo, and will be part of the next series.
(Unless DaveM wants to fix it up trivially when/if he merges this v9,
which would be faster.)

Barring that, does this look good to you? Could I have your signed-off-by?


   I've only looked on the last 2 patches. You can add my:

Reviewed-by: Sergei Shtylyov 

if you want. :-)


Regards,
Jason


MBR, Sergei



Re: [PATCH net-next v9 5/5] virtio_net: check return value of skb_to_sgvec always

2017-05-24 Thread Sergei Shtylyov

On 05/24/2017 02:34 PM, Jason A. Donenfeld wrote:


I'm shocked this somehow made it into the commit. I wonder how that happened?


   Sorry for not noticing this when it first appeared.


Anyway, fixed in my git repo, and will be part of the next series.
(Unless DaveM wants to fix it up trivially when/if he merges this v9,
which would be faster.)

Barring that, does this look good to you? Could I have your signed-off-by?


   I've only looked on the last 2 patches. You can add my:

Reviewed-by: Sergei Shtylyov 

if you want. :-)


Regards,
Jason


MBR, Sergei



Re: [PATCH net-next v9 5/5] virtio_net: check return value of skb_to_sgvec always

2017-05-24 Thread Jason A. Donenfeld
I'm shocked this somehow made it into the commit. I wonder how that happened?

Anyway, fixed in my git repo, and will be part of the next series.
(Unless DaveM wants to fix it up trivially when/if he merges this v9,
which would be faster.)

Barring that, does this look good to you? Could I have your signed-off-by?

Regards,
Jason


Re: [PATCH net-next v9 5/5] virtio_net: check return value of skb_to_sgvec always

2017-05-24 Thread Jason A. Donenfeld
I'm shocked this somehow made it into the commit. I wonder how that happened?

Anyway, fixed in my git repo, and will be part of the next series.
(Unless DaveM wants to fix it up trivially when/if he merges this v9,
which would be faster.)

Barring that, does this look good to you? Could I have your signed-off-by?

Regards,
Jason


Re: [PATCH net-next v9 5/5] virtio_net: check return value of skb_to_sgvec always

2017-05-24 Thread Sergei Shtylyov

Hello!

On 5/23/2017 7:05 PM, Jason A. Donenfeld wrote:


Signed-off-by: Jason A. Donenfeld 
Cc: "Michael S. Tsirkin" 
Cc: Jason Wang 
---
 drivers/net/virtio_net.c | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 9320d96a1632..13fbe4b349c2 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -1150,7 +1150,7 @@ static int xmit_skb(struct send_queue *sq, struct sk_buff 
*skb)
struct virtio_net_hdr_mrg_rxbuf *hdr;
const unsigned char *dest = ((struct ethhdr *)skb->data)->h_dest;
struct virtnet_info *vi = sq->vq->vdev->priv;
-   unsigned num_sg;
+   int num_sg;
unsigned hdr_len = vi->hdr_len;
bool can_push;

@@ -1177,11 +1177,16 @@ static int xmit_skb(struct send_queue *sq, struct 
sk_buff *skb)
if (can_push) {
__skb_push(skb, hdr_len);
num_sg = skb_to_sgvec(skb, sq->sg, 0, skb->len);
+if (unlikely(num_sg < 0))


   Please indent with tabs, like above and below.


+   return num_sg;
/* Pull header back to avoid skew in tx bytes calculations. */
__skb_pull(skb, hdr_len);

[...]

MBR, Sergei



Re: [PATCH net-next v9 5/5] virtio_net: check return value of skb_to_sgvec always

2017-05-24 Thread Sergei Shtylyov

Hello!

On 5/23/2017 7:05 PM, Jason A. Donenfeld wrote:


Signed-off-by: Jason A. Donenfeld 
Cc: "Michael S. Tsirkin" 
Cc: Jason Wang 
---
 drivers/net/virtio_net.c | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 9320d96a1632..13fbe4b349c2 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -1150,7 +1150,7 @@ static int xmit_skb(struct send_queue *sq, struct sk_buff 
*skb)
struct virtio_net_hdr_mrg_rxbuf *hdr;
const unsigned char *dest = ((struct ethhdr *)skb->data)->h_dest;
struct virtnet_info *vi = sq->vq->vdev->priv;
-   unsigned num_sg;
+   int num_sg;
unsigned hdr_len = vi->hdr_len;
bool can_push;

@@ -1177,11 +1177,16 @@ static int xmit_skb(struct send_queue *sq, struct 
sk_buff *skb)
if (can_push) {
__skb_push(skb, hdr_len);
num_sg = skb_to_sgvec(skb, sq->sg, 0, skb->len);
+if (unlikely(num_sg < 0))


   Please indent with tabs, like above and below.


+   return num_sg;
/* Pull header back to avoid skew in tx bytes calculations. */
__skb_pull(skb, hdr_len);

[...]

MBR, Sergei