* [PATCH net-next 0/2] liquidio: VF driver will notify NIC firmware of MTU change
@ 2017-08-18 18:34 Felix Manlunas
2017-08-18 18:35 ` [PATCH net-next 1/2] liquidio: move macro definition to a proper place Felix Manlunas
2017-08-18 18:35 ` [PATCH net-next 2/2] liquidio: make VF driver notify NIC firmware of MTU change Felix Manlunas
0 siblings, 2 replies; 4+ messages in thread
From: Felix Manlunas @ 2017-08-18 18:34 UTC (permalink / raw)
To: davem
Cc: netdev, raghu.vatsavayi, derek.chickles, satananda.burla,
veerasenareddy.burru
From: Veerasenareddy Burru <veerasenareddy.burru@cavium.com>
Make VF driver notify NIC firmware of MTU change. Firmware needs this
information for MTU propagation and enforcement.
The first patch in this series moves a macro definition to a proper place
to prevent a build error in the second patch which has the code that sends
the notification.
Veerasenareddy Burru (2):
liquidio: move macro definition to a proper place
liquidio: make VF driver notify NIC firmware of MTU change
.../ethernet/cavium/liquidio/cn23xx_pf_device.h | 2 --
drivers/net/ethernet/cavium/liquidio/lio_vf_main.c | 22 ++++++++++++++++++----
.../net/ethernet/cavium/liquidio/liquidio_common.h | 2 ++
3 files changed, 20 insertions(+), 6 deletions(-)
--
2.9.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH net-next 1/2] liquidio: move macro definition to a proper place
2017-08-18 18:34 [PATCH net-next 0/2] liquidio: VF driver will notify NIC firmware of MTU change Felix Manlunas
@ 2017-08-18 18:35 ` Felix Manlunas
2017-08-18 18:35 ` [PATCH net-next 2/2] liquidio: make VF driver notify NIC firmware of MTU change Felix Manlunas
1 sibling, 0 replies; 4+ messages in thread
From: Felix Manlunas @ 2017-08-18 18:35 UTC (permalink / raw)
To: davem
Cc: netdev, raghu.vatsavayi, derek.chickles, satananda.burla,
veerasenareddy.burru
The macro LIO_CMD_WAIT_TM is not specific to the PF driver; it can be used
by the VF driver too, so move its definition from a PF-specific header file
to one that's common to PF and VF.
Signed-off-by: Veerasenareddy Burru <veerasenareddy.burru@cavium.com>
Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
---
drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.h | 2 --
drivers/net/ethernet/cavium/liquidio/liquidio_common.h | 2 ++
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.h b/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.h
index dee6046..2aba524 100644
--- a/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.h
+++ b/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.h
@@ -24,8 +24,6 @@
#include "cn23xx_pf_regs.h"
-#define LIO_CMD_WAIT_TM 100
-
/* Register address and configuration for a CN23XX devices.
* If device specific changes need to be made then add a struct to include
* device specific fields as shown in the commented section
diff --git a/drivers/net/ethernet/cavium/liquidio/liquidio_common.h b/drivers/net/ethernet/cavium/liquidio/liquidio_common.h
index 18d2955..a2274e6 100644
--- a/drivers/net/ethernet/cavium/liquidio/liquidio_common.h
+++ b/drivers/net/ethernet/cavium/liquidio/liquidio_common.h
@@ -238,6 +238,8 @@ static inline void add_sg_size(struct octeon_sg_entry *sg_entry,
#define OCTNET_CMD_VLAN_FILTER_ENABLE 0x1
#define OCTNET_CMD_VLAN_FILTER_DISABLE 0x0
+#define LIO_CMD_WAIT_TM 100
+
/* RX(packets coming from wire) Checksum verification flags */
/* TCP/UDP csum */
#define CNNIC_L4SUM_VERIFIED 0x1
--
2.9.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH net-next 2/2] liquidio: make VF driver notify NIC firmware of MTU change
2017-08-18 18:34 [PATCH net-next 0/2] liquidio: VF driver will notify NIC firmware of MTU change Felix Manlunas
2017-08-18 18:35 ` [PATCH net-next 1/2] liquidio: move macro definition to a proper place Felix Manlunas
@ 2017-08-18 18:35 ` Felix Manlunas
2017-08-21 18:04 ` David Miller
1 sibling, 1 reply; 4+ messages in thread
From: Felix Manlunas @ 2017-08-18 18:35 UTC (permalink / raw)
To: davem
Cc: netdev, raghu.vatsavayi, derek.chickles, satananda.burla,
veerasenareddy.burru
Signed-off-by: Veerasenareddy Burru <veerasenareddy.burru@cavium.com>
Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
---
drivers/net/ethernet/cavium/liquidio/lio_vf_main.c | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
index 0402b18..e947783 100644
--- a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
+++ b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
@@ -1545,13 +1545,27 @@ static struct net_device_stats *liquidio_get_stats(struct net_device *netdev)
static int liquidio_change_mtu(struct net_device *netdev, int new_mtu)
{
struct lio *lio = GET_LIO(netdev);
+ struct octeon_device *oct = lio->oct_dev;
+ struct octnic_ctrl_pkt nctrl;
+ int ret = 0;
- lio->mtu = new_mtu;
+ memset(&nctrl, 0, sizeof(struct octnic_ctrl_pkt));
- netif_info(lio, probe, lio->netdev, "MTU Changed from %d to %d\n",
- netdev->mtu, new_mtu);
+ nctrl.ncmd.u64 = 0;
+ nctrl.ncmd.s.cmd = OCTNET_CMD_CHANGE_MTU;
+ nctrl.ncmd.s.param1 = new_mtu;
+ nctrl.iq_no = lio->linfo.txpciq[0].s.q_no;
+ nctrl.wait_time = LIO_CMD_WAIT_TM;
+ nctrl.netpndev = (u64)netdev;
+ nctrl.cb_fn = liquidio_link_ctrl_cmd_completion;
- netdev->mtu = new_mtu;
+ ret = octnet_send_nic_ctrl_pkt(lio->oct_dev, &nctrl);
+ if (ret < 0) {
+ dev_err(&oct->pci_dev->dev, "Failed to set MTU\n");
+ return -EIO;
+ }
+
+ lio->mtu = new_mtu;
return 0;
}
--
2.9.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next 2/2] liquidio: make VF driver notify NIC firmware of MTU change
2017-08-18 18:35 ` [PATCH net-next 2/2] liquidio: make VF driver notify NIC firmware of MTU change Felix Manlunas
@ 2017-08-21 18:04 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2017-08-21 18:04 UTC (permalink / raw)
To: felix.manlunas
Cc: netdev, raghu.vatsavayi, derek.chickles, satananda.burla,
veerasenareddy.burru
From: Felix Manlunas <felix.manlunas@cavium.com>
Date: Fri, 18 Aug 2017 11:35:20 -0700
> Signed-off-by: Veerasenareddy Burru <veerasenareddy.burru@cavium.com>
> Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
> ---
> drivers/net/ethernet/cavium/liquidio/lio_vf_main.c | 22 ++++++++++++++++++----
> 1 file changed, 18 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
> index 0402b18..e947783 100644
> --- a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
> +++ b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
> @@ -1545,13 +1545,27 @@ static struct net_device_stats *liquidio_get_stats(struct net_device *netdev)
> static int liquidio_change_mtu(struct net_device *netdev, int new_mtu)
> {
> struct lio *lio = GET_LIO(netdev);
> + struct octeon_device *oct = lio->oct_dev;
> + struct octnic_ctrl_pkt nctrl;
> + int ret = 0;
Please order local variable declarations from longest to shortest line.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-08-21 18:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-18 18:34 [PATCH net-next 0/2] liquidio: VF driver will notify NIC firmware of MTU change Felix Manlunas
2017-08-18 18:35 ` [PATCH net-next 1/2] liquidio: move macro definition to a proper place Felix Manlunas
2017-08-18 18:35 ` [PATCH net-next 2/2] liquidio: make VF driver notify NIC firmware of MTU change Felix Manlunas
2017-08-21 18:04 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).