From: Jakub Kicinski <kuba@kernel.org>
To: sunil.kovvuri@gmail.com
Cc: netdev@vger.kernel.org, davem@davemloft.net,
Tomasz Duszynski <tduszynski@marvell.com>,
Subbaraya Sundeep <sbhatta@marvell.com>,
Geetha sowjanya <gakula@marvell.com>,
Sunil Goutham <sgoutham@marvell.com>
Subject: Re: [PATCH net-next 3/6] octeontx2-vf: Virtual function driver dupport
Date: Tue, 10 Mar 2020 14:43:20 -0700 [thread overview]
Message-ID: <20200310144320.4f691cb6@kicinski-fedora-PC1C0HJN> (raw)
In-Reply-To: <1583866045-7129-4-git-send-email-sunil.kovvuri@gmail.com>
On Wed, 11 Mar 2020 00:17:22 +0530 sunil.kovvuri@gmail.com wrote:
> +#define DRV_NAME "octeontx2-nicvf"
> +#define DRV_STRING "Marvell OcteonTX2 NIC Virtual Function Driver"
> +#define DRV_VERSION "1.0"
Please drop the driver version, kernel version should be used upstream.
> +
> +static const struct pci_device_id otx2_vf_id_table[] = {
> + { PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, PCI_DEVID_OCTEONTX2_RVU_AFVF) },
> + { PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, PCI_DEVID_OCTEONTX2_RVU_VF) },
> + { }
> +};
> +
> +MODULE_AUTHOR("Marvell International Ltd.");
Only people can be authors, please put your name here or remove this.
> +MODULE_DESCRIPTION(DRV_STRING);
> +MODULE_LICENSE("GPL v2");
> +MODULE_VERSION(DRV_VERSION);
> +MODULE_DEVICE_TABLE(pci, otx2_vf_id_table);
> +static netdev_tx_t otx2vf_xmit(struct sk_buff *skb, struct net_device *netdev)
> +{
> + struct otx2_nic *vf = netdev_priv(netdev);
> + int qidx = skb_get_queue_mapping(skb);
> + struct otx2_snd_queue *sq;
> + struct netdev_queue *txq;
> +
> + /* Check for minimum and maximum packet length */
> + if (skb->len <= ETH_HLEN ||
> + (!skb_shinfo(skb)->gso_size && skb->len > vf->max_frs)) {
These should never happen (if they do we need to fix the stack, not
sprinkle all the drivers with checks like this).
> + dev_kfree_skb(skb);
> + return NETDEV_TX_OK;
> + }
> +
> + sq = &vf->qset.sq[qidx];
> + txq = netdev_get_tx_queue(netdev, qidx);
> +
> + if (!otx2_sq_append_skb(netdev, sq, skb, qidx)) {
> + netif_tx_stop_queue(txq);
> +
> + /* Check again, incase SQBs got freed up */
> + smp_mb();
> + if (((sq->num_sqbs - *sq->aura_fc_addr) * sq->sqe_per_sqb)
> + > sq->sqe_thresh)
> + netif_tx_wake_queue(txq);
> +
> + return NETDEV_TX_BUSY;
> + }
> +
> + return NETDEV_TX_OK;
> +}
> +static void otx2vf_reset_task(struct work_struct *work)
> +{
> + struct otx2_nic *vf = container_of(work, struct otx2_nic, reset_task);
> +
> + if (!netif_running(vf->netdev))
> + return;
> +
> + otx2vf_stop(vf->netdev);
> + vf->reset_count++;
> + otx2vf_open(vf->netdev);
What's the locking around here? Can user call open/stop while this is
running?
> + netif_trans_update(vf->netdev);
> +}
> +static int otx2vf_realloc_msix_vectors(struct otx2_nic *vf)
> +{
> + struct otx2_hw *hw = &vf->hw;
> + int num_vec, err;
> +
> + num_vec = hw->nix_msixoff;
> + num_vec += NIX_LF_CINT_VEC_START + hw->max_queues;
> +
> + otx2vf_disable_mbox_intr(vf);
> + pci_free_irq_vectors(hw->pdev);
> + pci_free_irq_vectors(hw->pdev);
Why free IRQs twice?
> + err = otx2vf_register_mbox_intr(vf, false);
> + if (err)
> + return err;
return otx2vf_re..
next prev parent reply other threads:[~2020-03-10 21:43 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-10 18:47 [PATCH net-next 0/6] octeontx2-vf: Add network driver for virtual function sunil.kovvuri
2020-03-10 18:47 ` [PATCH net-next 1/6] octeontx2-pf: Enable SRIOV and added VF mbox handling sunil.kovvuri
2020-03-10 21:43 ` Jakub Kicinski
2020-03-10 18:47 ` [PATCH net-next 2/6] octeontx2-pf: Handle VF function level reset sunil.kovvuri
2020-03-10 21:43 ` Jakub Kicinski
2020-03-10 18:47 ` [PATCH net-next 3/6] octeontx2-vf: Virtual function driver dupport sunil.kovvuri
2020-03-10 21:43 ` Jakub Kicinski [this message]
2020-03-11 7:14 ` Sunil Kovvuri
2020-03-11 10:16 ` Leon Romanovsky
2020-03-11 21:24 ` Jakub Kicinski
2020-03-10 18:47 ` [PATCH net-next 4/6] octeontx2-vf: Ethtool support sunil.kovvuri
2020-03-10 19:21 ` Andrew Lunn
2020-03-11 6:39 ` Sunil Kovvuri
2020-03-11 7:05 ` Leon Romanovsky
2020-03-11 7:18 ` Sunil Kovvuri
2020-03-11 10:12 ` Leon Romanovsky
2020-03-10 21:45 ` Jakub Kicinski
2020-03-11 6:40 ` Sunil Kovvuri
2020-03-10 18:47 ` [PATCH net-next 5/6] octeontx2-vf: Link event notification support sunil.kovvuri
2020-03-10 18:47 ` [PATCH net-next 6/6] octeontx2-pf: Cleanup all receive buffers in SG descriptor sunil.kovvuri
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=20200310144320.4f691cb6@kicinski-fedora-PC1C0HJN \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=gakula@marvell.com \
--cc=netdev@vger.kernel.org \
--cc=sbhatta@marvell.com \
--cc=sgoutham@marvell.com \
--cc=sunil.kovvuri@gmail.com \
--cc=tduszynski@marvell.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).