netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felix Manlunas <felix.manlunas@cavium.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, raghu.vatsavayi@cavium.com,
	derek.chickles@cavium.com, satananda.burla@cavium.com,
	veerasenareddy.burru@cavium.com
Subject: [PATCH net-next 2/2] liquidio: make VF driver notify NIC firmware of MTU change
Date: Fri, 18 Aug 2017 11:35:20 -0700	[thread overview]
Message-ID: <20170818183520.GA4522@felix-thinkpad.cavium.com> (raw)
In-Reply-To: <20170818183432.GA4487@felix-thinkpad.cavium.com>

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

  parent reply	other threads:[~2017-08-18 18:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2017-08-21 18:04   ` [PATCH net-next 2/2] liquidio: make VF driver notify NIC firmware of MTU change David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170818183520.GA4522@felix-thinkpad.cavium.com \
    --to=felix.manlunas@cavium.com \
    --cc=davem@davemloft.net \
    --cc=derek.chickles@cavium.com \
    --cc=netdev@vger.kernel.org \
    --cc=raghu.vatsavayi@cavium.com \
    --cc=satananda.burla@cavium.com \
    --cc=veerasenareddy.burru@cavium.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).