The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, so make sure the implementation in
this driver has returns 'netdev_tx_t' value, and change the function
return type to netdev_tx_t.
YueHaibing (22):
net: micrel: fix return type of ndo_start_xmit function
net: freescale: fix return type of ndo_start_xmit function
net: seeq: fix return type of ndo_start_xmit function
net: cirrus: fix return type of ndo_start_xmit function
net: sgi: fix return type of ndo_start_xmit function
net: wiznet: fix return type of ndo_start_xmit function
net: i825xx: fix return type of ndo_start_xmit function
net: apple: fix return type of ndo_start_xmit function
net: smsc: fix return type of ndo_start_xmit function
net: ti: fix return type of ndo_start_xmit function
net: faraday: fix return type of ndo_start_xmit function
net: ovs: fix return type of ndo_start_xmit function
net: xen-netback: fix return type of ndo_start_xmit function
net: caif: fix return type of ndo_start_xmit function
net: hamradio: fix return type of ndo_start_xmit function
usbnet: ipheth: fix return type of ndo_start_xmit function
hv_netvsc: fix return type of ndo_start_xmit function
can: xilinx: fix return type of ndo_start_xmit function
net: plip: fix return type of ndo_start_xmit function
rionet: fix return type of ndo_start_xmit function
l2tp: fix return type of ndo_start_xmit function
net: hsr: fix return type of ndo_start_xmit function
drivers/net/caif/caif_hsi.c | 10 +++++-----
drivers/net/caif/caif_serial.c | 7 +++++--
drivers/net/caif/caif_spi.c | 6 +++---
drivers/net/caif/caif_virtio.c | 2 +-
drivers/net/can/xilinx_can.c | 2 +-
drivers/net/ethernet/apple/bmac.c | 4 ++--
drivers/net/ethernet/apple/mace.c | 4 ++--
drivers/net/ethernet/apple/macmace.c | 4 ++--
drivers/net/ethernet/cirrus/ep93xx_eth.c | 2 +-
drivers/net/ethernet/cirrus/mac89x0.c | 4 ++--
drivers/net/ethernet/faraday/ftgmac100.c | 4 ++--
drivers/net/ethernet/faraday/ftmac100.c | 7 ++++---
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 3 ++-
drivers/net/ethernet/freescale/fec_mpc52xx.c | 3 ++-
drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c | 3 ++-
drivers/net/ethernet/freescale/gianfar.c | 4 ++--
drivers/net/ethernet/freescale/ucc_geth.c | 3 ++-
drivers/net/ethernet/i825xx/ether1.c | 5 +++--
drivers/net/ethernet/i825xx/lib82596.c | 4 ++--
drivers/net/ethernet/i825xx/sun3_82586.c | 6 ++++--
drivers/net/ethernet/micrel/ks8695net.c | 2 +-
drivers/net/ethernet/micrel/ks8851_mll.c | 4 ++--
drivers/net/ethernet/seeq/ether3.c | 5 +++--
drivers/net/ethernet/seeq/sgiseeq.c | 3 ++-
drivers/net/ethernet/sgi/ioc3-eth.c | 4 ++--
drivers/net/ethernet/sgi/meth.c | 2 +-
drivers/net/ethernet/smsc/smc911x.c | 3 ++-
drivers/net/ethernet/smsc/smc91x.c | 3 ++-
drivers/net/ethernet/smsc/smsc911x.c | 3 ++-
drivers/net/ethernet/ti/cpmac.c | 2 +-
drivers/net/ethernet/ti/davinci_emac.c | 2 +-
drivers/net/ethernet/ti/netcp_core.c | 8 ++++----
drivers/net/ethernet/wiznet/w5100.c | 2 +-
drivers/net/ethernet/wiznet/w5300.c | 2 +-
drivers/net/hamradio/baycom_epp.c | 3 ++-
drivers/net/hamradio/dmascc.c | 4 ++--
drivers/net/hyperv/netvsc_drv.c | 10 +++++++---
drivers/net/plip/plip.c | 4 ++--
drivers/net/rionet.c | 3 ++-
drivers/net/usb/ipheth.c | 2 +-
drivers/net/xen-netback/interface.c | 3 ++-
net/caif/chnl_net.c | 3 ++-
net/hsr/hsr_device.c | 2 +-
net/l2tp/l2tp_eth.c | 3 ++-
net/openvswitch/vport-internal_dev.c | 5 +++--
45 files changed, 100 insertions(+), 74 deletions(-)
--
1.8.3.1
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, so make sure the implementation in
this driver has returns 'netdev_tx_t' value, and change the function
return type to netdev_tx_t.
Found by coccinelle.
Signed-off-by: YueHaibing <redacted>
---
drivers/net/ethernet/micrel/ks8695net.c | 2 +-
drivers/net/ethernet/micrel/ks8851_mll.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, so make sure the implementation in
this driver has returns 'netdev_tx_t' value, and change the function
return type to netdev_tx_t.
Found by coccinelle.
Signed-off-by: YueHaibing <redacted>
---
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 3 ++-
drivers/net/ethernet/freescale/fec_mpc52xx.c | 3 ++-
drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c | 3 ++-
drivers/net/ethernet/freescale/gianfar.c | 4 ++--
drivers/net/ethernet/freescale/ucc_geth.c | 3 ++-
5 files changed, 10 insertions(+), 6 deletions(-)
@@ -2332,7 +2332,7 @@ static inline bool gfar_csum_errata_76(struct gfar_private *priv,/* This is called by the kernel when a frame is ready for transmission.*Itispointedtobythedev->hard_start_xmitfunctionpointer*/-staticintgfar_start_xmit(structsk_buff*skb,structnet_device*dev)+staticnetdev_tx_tgfar_start_xmit(structsk_buff*skb,structnet_device*dev){structgfar_private*priv=netdev_priv(dev);structgfar_priv_tx_q*tx_queue=NULL;
@@ -3078,7 +3078,8 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)/* This is called by the kernel when a frame is ready for transmission. *//* It is pointed to by the dev->hard_start_xmit function pointer */-staticintucc_geth_start_xmit(structsk_buff*skb,structnet_device*dev)+staticnetdev_tx_t+ucc_geth_start_xmit(structsk_buff*skb,structnet_device*dev){structucc_geth_private*ugeth=netdev_priv(dev);#ifdef CONFIG_UGETH_TX_ON_DEMAND
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, so make sure the implementation in
this driver has returns 'netdev_tx_t' value, and change the function
return type to netdev_tx_t.
Found by coccinelle.
Signed-off-by: YueHaibing <redacted>
---
drivers/net/ethernet/sgi/ioc3-eth.c | 4 ++--
drivers/net/ethernet/sgi/meth.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, so make sure the implementation in
this driver has returns 'netdev_tx_t' value, and change the function
return type to netdev_tx_t.
Found by coccinelle.
Signed-off-by: YueHaibing <redacted>
---
drivers/net/ethernet/i825xx/ether1.c | 5 +++--
drivers/net/ethernet/i825xx/lib82596.c | 4 ++--
drivers/net/ethernet/i825xx/sun3_82586.c | 6 ++++--
3 files changed, 9 insertions(+), 6 deletions(-)
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, so make sure the implementation in
this driver has returns 'netdev_tx_t' value, and change the function
return type to netdev_tx_t.
Found by coccinelle.
Signed-off-by: YueHaibing <redacted>
---
drivers/net/ethernet/smsc/smc911x.c | 3 ++-
drivers/net/ethernet/smsc/smc91x.c | 3 ++-
drivers/net/ethernet/smsc/smsc911x.c | 3 ++-
3 files changed, 6 insertions(+), 3 deletions(-)
@@ -1786,7 +1786,8 @@ static int smsc911x_stop(struct net_device *dev)}/* Entry point for transmitting a packet */-staticintsmsc911x_hard_start_xmit(structsk_buff*skb,structnet_device*dev)+staticnetdev_tx_t+smsc911x_hard_start_xmit(structsk_buff*skb,structnet_device*dev){structsmsc911x_data*pdata=netdev_priv(dev);unsignedintfreespace;
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, so make sure the implementation in
this driver has returns 'netdev_tx_t' value, and change the function
return type to netdev_tx_t.
Found by coccinelle.
Signed-off-by: YueHaibing <redacted>
---
drivers/net/ethernet/ti/cpmac.c | 2 +-
drivers/net/ethernet/ti/davinci_emac.c | 2 +-
drivers/net/ethernet/ti/netcp_core.c | 8 ++++----
3 files changed, 6 insertions(+), 6 deletions(-)
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, but the implementation in this
driver returns an 'int'.
Found by coccinelle.
Signed-off-by: YueHaibing <redacted>
---
drivers/net/ethernet/faraday/ftgmac100.c | 4 ++--
drivers/net/ethernet/faraday/ftmac100.c | 7 ++++---
2 files changed, 6 insertions(+), 5 deletions(-)
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, so make sure the implementation in
this driver has returns 'netdev_tx_t' value, and change the function
return type to netdev_tx_t.
Found by coccinelle.
Signed-off-by: YueHaibing <redacted>
---
drivers/net/caif/caif_hsi.c | 10 +++++-----
drivers/net/caif/caif_serial.c | 7 +++++--
drivers/net/caif/caif_spi.c | 6 +++---
drivers/net/caif/caif_virtio.c | 2 +-
net/caif/chnl_net.c | 3 ++-
5 files changed, 16 insertions(+), 12 deletions(-)
@@ -1048,7 +1048,7 @@ static int cfhsi_xmit(struct sk_buff *skb, struct net_device *dev)if(WARN_ON(test_bit(CFHSI_SHUTDOWN,&cfhsi->bits))){spin_unlock_bh(&cfhsi->lock);cfhsi_abort_tx(cfhsi);-return-EINVAL;+returnNETDEV_TX_BUSY;}/* Send flow off if number of packets is above high water mark. */
@@ -1072,7 +1072,7 @@ static int cfhsi_xmit(struct sk_buff *skb, struct net_device *dev)spin_unlock_bh(&cfhsi->lock);if(aggregate_ready)cfhsi_start_tx(cfhsi);-return0;+returnNETDEV_TX_OK;}/* Delete inactivity timer if started. */
@@ -519,7 +519,7 @@ static struct buf_info *cfv_alloc_and_copy_to_shm(struct cfv_info *cfv,}/* Put the CAIF packet on the virtio ring and kick the receiver */-staticintcfv_netdev_tx(structsk_buff*skb,structnet_device*netdev)+staticnetdev_tx_tcfv_netdev_tx(structsk_buff*skb,structnet_device*netdev){structcfv_info*cfv=netdev_priv(netdev);structbuf_info*buf_info;
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, so make sure the implementation in
this driver has returns 'netdev_tx_t' value, and change the function
return type to netdev_tx_t.
Found by coccinelle.
Signed-off-by: YueHaibing <redacted>
---
drivers/net/hamradio/baycom_epp.c | 3 ++-
drivers/net/hamradio/dmascc.c | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, so make sure the implementation in
this driver has returns 'netdev_tx_t' value, and change the function
return type to netdev_tx_t.
Found by coccinelle.
Signed-off-by: YueHaibing <redacted>
---
drivers/net/usb/ipheth.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, so make sure the implementation in
this driver has returns 'netdev_tx_t' value, and change the function
return type to netdev_tx_t.
Found by coccinelle.
Signed-off-by: YueHaibing <redacted>
---
drivers/net/can/xilinx_can.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, so make sure the implementation in
this driver has returns 'netdev_tx_t' value, and change the function
return type to netdev_tx_t.
Found by coccinelle.
Signed-off-by: YueHaibing <redacted>
---
drivers/net/plip/plip.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
@@ -146,7 +146,7 @@staticvoidplip_interrupt(void*dev_id);/* Functions for DEV methods */-staticintplip_tx_packet(structsk_buff*skb,structnet_device*dev);+staticnetdev_tx_tplip_tx_packet(structsk_buff*skb,structnet_device*dev);staticintplip_hard_header(structsk_buff*skb,structnet_device*dev,unsignedshorttype,constvoid*daddr,constvoid*saddr,unsignedlen);
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, so make sure the implementation in
this driver has returns 'netdev_tx_t' value, and change the function
return type to netdev_tx_t.
Found by coccinelle.
Signed-off-by: YueHaibing <redacted>
---
drivers/net/rionet.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, so make sure the implementation in
this driver has returns 'netdev_tx_t' value, and change the function
return type to netdev_tx_t.
Found by coccinelle.
Signed-off-by: YueHaibing <redacted>
---
net/hsr/hsr_device.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, so make sure the implementation in
this driver has returns 'netdev_tx_t' value, and change the function
return type to netdev_tx_t.
Found by coccinelle.
Signed-off-by: YueHaibing <redacted>
---
net/l2tp/l2tp_eth.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, so make sure the implementation in
this driver has returns 'netdev_tx_t' value, and change the function
return type to netdev_tx_t.
Found by coccinelle.
Signed-off-by: YueHaibing <redacted>
---
drivers/net/hyperv/netvsc_drv.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
@@ -528,8 +529,11 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)*/vf_netdev=rcu_dereference_bh(net_device_ctx->vf_netdev);if(vf_netdev&&netif_running(vf_netdev)&&-!netpoll_tx_running(net))-returnnetvsc_vf_xmit(net,vf_netdev,skb);+!netpoll_tx_running(net)){+ret=netvsc_vf_xmit(net,vf_netdev,skb);+if(ret)+returnNETDEV_TX_BUSY;+}/* We will atmost need two pages to describe the rndis*header.WecanonlytransmitMAX_PAGE_BUFFER_COUNTnumber
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, so make sure the implementation in
this driver has returns 'netdev_tx_t' value, and change the function
return type to netdev_tx_t.
Found by coccinelle.
Signed-off-by: YueHaibing <redacted>
---
drivers/net/xen-netback/interface.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, so make sure the implementation in
this driver has returns 'netdev_tx_t' value, and change the function
return type to netdev_tx_t.
Found by coccinelle.
Signed-off-by: YueHaibing <redacted>
---
net/openvswitch/vport-internal_dev.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, so make sure the implementation in
this driver has returns 'netdev_tx_t' value, and change the function
return type to netdev_tx_t.
Found by coccinelle.
Signed-off-by: YueHaibing <redacted>
---
drivers/net/ethernet/apple/bmac.c | 4 ++--
drivers/net/ethernet/apple/mace.c | 4 ++--
drivers/net/ethernet/apple/macmace.c | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, so make sure the implementation in
this driver has returns 'netdev_tx_t' value, and change the function
return type to netdev_tx_t.
Found by coccinelle.
Signed-off-by: YueHaibing <redacted>
---
drivers/net/ethernet/wiznet/w5100.c | 2 +-
drivers/net/ethernet/wiznet/w5300.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, so make sure the implementation in
this driver has returns 'netdev_tx_t' value, and change the function
return type to netdev_tx_t.
Found by coccinelle.
Signed-off-by: YueHaibing <redacted>
---
drivers/net/ethernet/seeq/ether3.c | 5 +++--
drivers/net/ethernet/seeq/sgiseeq.c | 3 ++-
2 files changed, 5 insertions(+), 3 deletions(-)
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, so make sure the implementation in
this driver has returns 'netdev_tx_t' value, and change the function
return type to netdev_tx_t.
Found by coccinelle.
Signed-off-by: YueHaibing <redacted>
---
drivers/net/ethernet/cirrus/ep93xx_eth.c | 2 +-
drivers/net/ethernet/cirrus/mac89x0.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
@@ -113,7 +113,7 @@ struct net_local {/* Index to functions, as function prototypes. */staticintnet_open(structnet_device*dev);-staticintnet_send_packet(structsk_buff*skb,structnet_device*dev);+staticnetdev_tx_tnet_send_packet(structsk_buff*skb,structnet_device*dev);staticirqreturn_tnet_interrupt(intirq,void*dev_id);staticvoidset_multicast_list(structnet_device*dev);staticvoidnet_rx(structnet_device*dev);
@@ -324,7 +324,7 @@ static int mac89x0_device_probe(struct platform_device *pdev)return0;}-staticint+staticnetdev_tx_tnet_send_packet(structsk_buff*skb,structnet_device*dev){structnet_local*lp=netdev_priv(dev);
On Thu, Sep 20, 2018 at 08:32:57PM +0800, YueHaibing wrote:
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, so make sure the implementation in
this driver has returns 'netdev_tx_t' value, and change the function
return type to netdev_tx_t.
Found by coccinelle.
Signed-off-by: YueHaibing <redacted>
For error case, please just return NETDEV_TX_OK. We are not sure if the=20
error can go away after retrying, returning NETDEV_TX_BUSY may cause=20
infinite retry from the upper layer.
Thanks,
- Haiyang
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, so make sure the implementation in
this driver has returns 'netdev_tx_t' value, and change the function
return type to netdev_tx_t.
Found by coccinelle.
Signed-off-by: YueHaibing <redacted>
---
drivers/net/hyperv/netvsc_drv.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
linux-kernel@vger.kernel.org; linux-can@vger.kernel.org;
devel@linuxdriverproject.org; linux-hams@vger.kernel.org; linux-
omap@vger.kernel.org; linuxppc-dev@lists.ozlabs.org; linux-arm-
kernel@lists.infradead.org
Subject: Re: [PATCH net-next 17/22] hv_netvsc: fix return type of
ndo_start_xmit function
=20
On Thu, 20 Sep 2018 20:33:01 +0800
YueHaibing [off-list ref] wrote:
quoted
int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
*/
vf_netdev =3D rcu_dereference_bh(net_device_ctx->vf_netdev);
if (vf_netdev && netif_running(vf_netdev) &&
- !netpoll_tx_running(net))
- return netvsc_vf_xmit(net, vf_netdev, skb);
+ !netpoll_tx_running(net)) {
+ ret =3D netvsc_vf_xmit(net, vf_netdev, skb);
+ if (ret)
+ return NETDEV_TX_BUSY;
+ }
=20
Sorry, the new code is wrong. It will fall through if ret =3D=3D 0 (NETDE=
V_TX_OK)
Please review and test your patches.
Plus consideration of -- For error case, please just return NETDEV_TX_OK. W=
e=20
are not sure if the error can go away after retrying, returning NETDEV_TX_B=
USY=20
may cause infinite retry from the upper layer.
So, let's just always return NETDEV_TX_OK like this:
netvsc_vf_xmit(net, vf_netdev, skb);
return NETDEV_TX_OK;
Thanks,
- Haiyang
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, so make sure the implementation in
this driver has returns 'netdev_tx_t' value, and change the function
return type to netdev_tx_t.
I would advise you not to send so many of these changes as a group.
If one of the patches needs feedback addressed, which is already the
case, you will have to resubmit the entire series all over again with
the fixes.
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, so make sure the implementation in
this driver has returns 'netdev_tx_t' value, and change the function
return type to netdev_tx_t.
May be I missed smth, but it's acceptable to report standard error codes from
.xmit() callback as per dev_xmit_complete().
--
regards,
-grygorii
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, so make sure the implementation in
this driver has returns 'netdev_tx_t' value, and change the function
return type to netdev_tx_t.
I would advise you not to send so many of these changes as a group.
If one of the patches needs feedback addressed, which is already the
case, you will have to resubmit the entire series all over again with
the fixes.
Yes, I will send it separately after test and review again.
Thank you for your advice.
-----Original Message-----
From: Stephen Hemminger <stephen@networkplumber.org>
Sent: Thursday, September 20, 2018 10:44 AM
To: YueHaibing <redacted>
Cc: davem@davemloft.net; dmitry.tarnyagin@lockless.no;
wg@grandegger.com; mkl@pengutronix.de; michal.simek@xilinx.com;
hsweeten@visionengravers.com; madalin.bucur@nxp.com;
pantelis.antoniou@gmail.com; claudiu.manoil@nxp.com; leoyang.li@nxp.com;
linux@armlinux.org.uk; sammy@sammy.net; ralf@linux-mips.org;
nico@fluxnic.net; steve.glendinning@shawell.net; f.fainelli@gmail.com;
grygorii.strashko@ti.com; w-kwok2@ti.com; m-karicheri2@ti.com;
t.sailer@alumni.ethz.ch; jreuter@yaina.de; KY Srinivasan [off-list ref];
Haiyang Zhang [off-list ref]; wei.liu2@citrix.com;
paul.durrant@citrix.com; arvid.brodin@alten.se; pshelar@ovn.org;
dev@openvswitch.org; linux-mips@linux-mips.org; xen-
devel@lists.xenproject.org; netdev@vger.kernel.org; linux-usb@vger.kernel.org;
linux-kernel@vger.kernel.org; linux-can@vger.kernel.org;
devel@linuxdriverproject.org; linux-hams@vger.kernel.org; linux-
omap@vger.kernel.org; linuxppc-dev@lists.ozlabs.org; linux-arm-
kernel@lists.infradead.org
Subject: Re: [PATCH net-next 17/22] hv_netvsc: fix return type of
ndo_start_xmit function
On Thu, 20 Sep 2018 20:33:01 +0800
YueHaibing [off-list ref] wrote:
quoted
int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
*/
vf_netdev = rcu_dereference_bh(net_device_ctx->vf_netdev);
if (vf_netdev && netif_running(vf_netdev) &&
- !netpoll_tx_running(net))
- return netvsc_vf_xmit(net, vf_netdev, skb);
+ !netpoll_tx_running(net)) {
+ ret = netvsc_vf_xmit(net, vf_netdev, skb);
+ if (ret)
+ return NETDEV_TX_BUSY;
+ }
Sorry, the new code is wrong. It will fall through if ret == 0 (NETDEV_TX_OK)
Please review and test your patches.
Plus consideration of -- For error case, please just return NETDEV_TX_OK. We
are not sure if the error can go away after retrying, returning NETDEV_TX_BUSY
may cause infinite retry from the upper layer.
So, let's just always return NETDEV_TX_OK like this:
netvsc_vf_xmit(net, vf_netdev, skb);
return NETDEV_TX_OK;
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, so make sure the implementation in
this driver has returns 'netdev_tx_t' value, and change the function
return type to netdev_tx_t.
Found by coccinelle.
Signed-off-by: YueHaibing <redacted>
---
drivers/net/hyperv/netvsc_drv.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)