liquidio: enhanced ethtool --set-channels feature
Subsystems (3)
v2 cover liquidio: enhanced ethtool --set-channels feature
From: Intiyaz Basha <[email protected]>
For the ethtool --set-channels feature, the liquidio driver currently accepts max combined value as the queue count configured during driver load time, where max combined count is the total count of input and output queues. This limitation is applicable only when SR-IOV is enabled, that is, when VFs are created for PF. If SR-IOV is not enabled, the driver can configure max supported (64) queues.
This series of patches are for enhancing driver to accept max supported queues for ethtool --set-channels.
Changes in V2:
Only patch #6 was changed to fix these Sparse warnings reported by kbuild test robot:
lio_ethtool.c:848:5: warning: symbol 'lio_23xx_reconfigure_queue_count'
was not declared. Should it be static?
lio_ethtool.c:877:22: warning: incorrect type in assignment (different
base types)
lio_ethtool.c:878:22: warning: incorrect type in assignment (different
base types)
lio_ethtool.c:879:22: warning: incorrect type in assignment (different
base types)
Intiyaz Basha (6):
liquidio: Moved common function if_cfg_callback to lio_core.c
liquidio: Moved common function list_delete_head to octeon_network.h
liquidio: Moved common function delete_glists to lio_core.c
liquidio: Moved common definition octnic_gather to octeon_network.h
liquidio: Moved common function setup_glists to lio_core.c
liquidio: enhanced ethtool --set-channels feature
.../ethernet/cavium/liquidio/cn23xx_pf_device.c | 6 +- .../ethernet/cavium/liquidio/cn23xx_pf_device.h | 2 + drivers/net/ethernet/cavium/liquidio/lio_core.c | 158 +++++++++++- drivers/net/ethernet/cavium/liquidio/lio_ethtool.c | 263 ++++++++++++++++++-- drivers/net/ethernet/cavium/liquidio/lio_main.c | 270 ++++----------------- drivers/net/ethernet/cavium/liquidio/lio_vf_main.c | 206 +--------------- .../net/ethernet/cavium/liquidio/liquidio_common.h | 1 + .../net/ethernet/cavium/liquidio/octeon_device.c | 12 +- .../net/ethernet/cavium/liquidio/octeon_device.h | 2 +- .../net/ethernet/cavium/liquidio/octeon_network.h | 60 ++++- 10 files changed, 528 insertions(+), 452 deletions(-)
Signature · 1 line
2.9.0
PATCH v2 1/6 liquidio: Moved common function if_cfg_callback to lio_core.c
From: Intiyaz Basha <[email protected]>
Moved common function if_cfg_callback to lio_core.c and renamed it to lio_if_cfg_callback.
--- drivers/net/ethernet/cavium/liquidio/lio_core.c | 32 ++++++++++++++++++++ drivers/net/ethernet/cavium/liquidio/lio_main.c | 35 +--------------------- drivers/net/ethernet/cavium/liquidio/lio_vf_main.c | 34 +-------------------- .../net/ethernet/cavium/liquidio/octeon_network.h | 4 +++ 4 files changed, 38 insertions(+), 67 deletions(-)
drivers/net/ethernet/cavium/liquidio/lio_core.c +32 -0
@@ -29,6 +29,38 @@/* OOM task polling interval */ #define LIO_OOM_POLL_INTERVAL_MS 250 +/** +* \brief Callback for getting interface configuration +* @param status status of request +* @param buf pointer to resp structure +*/ +void lio_if_cfg_callback (struct octeon_device *oct, +u32 status __attribute__((unused)),void *buf) +{ +struct octeon_soft_command *sc = (struct octeon_soft_command *)buf; +struct liquidio_if_cfg_context *ctx; +struct liquidio_if_cfg_resp *resp; + + resp = (struct liquidio_if_cfg_resp *)sc->virtrptr; + ctx = (struct liquidio_if_cfg_context *)sc->ctxptr; + + oct =lio_get_device (ctx->octeon_id); +if (resp->status) +dev_err (&oct->pci_dev->dev,"nic if cfg instruction failed. Status: %llx\n" , +CVM_CAST64 (resp->status)); +WRITE_ONCE (ctx->cond,1 ); + +snprintf (oct->fw_info.liquidio_firmware_version,32 ,"%s" , + resp->cfg_info.liquidio_firmware_version); + +/* This barrier is required to be sure that the response has been +* written fully before waking up the handler +*/ +wmb (); + +wake_up_interruptible (&ctx->wc); +} +int liquidio_set_feature (struct net_device *netdev,int cmd,u16 param1) {struct lio *lio =GET_LIO (netdev);
drivers/net/ethernet/cavium/liquidio/lio_main.c +1 -34
@@ -1942,39 +1942,6 @@ static int load_firmware(struct octeon_device *oct) }/** -* \brief Callback for getting interface configuration -* @param status status of request -* @param buf pointer to resp structure -*/ -static void if_cfg_callback (struct octeon_device *oct, -u32 status __attribute__((unused)), -void *buf) -{ -struct octeon_soft_command *sc = (struct octeon_soft_command *)buf; -struct liquidio_if_cfg_resp *resp; -struct liquidio_if_cfg_context *ctx; - - resp = (struct liquidio_if_cfg_resp *)sc->virtrptr; - ctx = (struct liquidio_if_cfg_context *)sc->ctxptr; - - oct =lio_get_device (ctx->octeon_id); -if (resp->status) -dev_err (&oct->pci_dev->dev,"nic if cfg instruction failed. Status: 0x%llx (0x%08x)\n" , -CVM_CAST64 (resp->status), status); -WRITE_ONCE (ctx->cond,1 ); - -snprintf (oct->fw_info.liquidio_firmware_version,32 ,"%s" , - resp->cfg_info.liquidio_firmware_version); - -/* This barrier is required to be sure that the response has been -* written fully before waking up the handler -*/ -wmb (); - -wake_up_interruptible (&ctx->wc); -} - -/** * \brief Poll routine for checking transmit queue status * @param work work_struct data structure */
@@ -3556,7 +3523,7 @@ static int setup_nic_devices(struct octeon_device *octeon_dev)OPCODE_NIC_IF_CFG ,0 , if_cfg.u64, 0); - sc->callback = if_cfg_callback; + sc->callback = lio_if_cfg_callback; sc->callback_arg = sc; sc->wait_time =3000 ;
drivers/net/ethernet/cavium/liquidio/lio_vf_main.c +1 -33
@@ -1059,38 +1059,6 @@ static void free_netsgbuf_with_resp(void *buf) }/** -* \brief Callback for getting interface configuration -* @param status status of request -* @param buf pointer to resp structure -*/ -static void if_cfg_callback (struct octeon_device *oct, -u32 status __attribute__((unused)),void *buf) -{ -struct octeon_soft_command *sc = (struct octeon_soft_command *)buf; -struct liquidio_if_cfg_context *ctx; -struct liquidio_if_cfg_resp *resp; - - resp = (struct liquidio_if_cfg_resp *)sc->virtrptr; - ctx = (struct liquidio_if_cfg_context *)sc->ctxptr; - - oct =lio_get_device (ctx->octeon_id); -if (resp->status) -dev_err (&oct->pci_dev->dev,"nic if cfg instruction failed. Status: %llx\n" , -CVM_CAST64 (resp->status)); -WRITE_ONCE (ctx->cond,1 ); - -snprintf (oct->fw_info.liquidio_firmware_version,32 ,"%s" , - resp->cfg_info.liquidio_firmware_version); - -/* This barrier is required to be sure that the response has been -* written fully before waking up the handler -*/ -wmb (); - -wake_up_interruptible (&ctx->wc); -} - -/** * \brief Net device open for LiquidIO * @param netdev network device */
@@ -2156,7 +2124,7 @@ static int setup_nic_devices(struct octeon_device *octeon_dev)OPCODE_NIC_IF_CFG ,0 , if_cfg.u64, 0); - sc->callback = if_cfg_callback; + sc->callback = lio_if_cfg_callback; sc->callback_arg = sc; sc->wait_time =5000 ;
drivers/net/ethernet/cavium/liquidio/octeon_network.h +4 -0
@@ -197,6 +197,10 @@ int lio_wait_for_clean_oq(struct octeon_device *oct);*/ void liquidio_set_ethtool_ops (struct net_device *netdev); +void lio_if_cfg_callback (struct octeon_device *oct, +u32 status __attribute__((unused)), +void *buf); +/** * \brief Net device change_mtu * @param netdev network device
Signature · 1 line
2.9.0
PATCH v2 2/6 liquidio: Moved common function list_delete_head to octeon_network.h
In reply to Felix ManlunasFrom: Intiyaz Basha <[email protected]>
Moved common function list_delete_head to octeon_network.h and renamed it to lio_list_delete_head
--- drivers/net/ethernet/cavium/liquidio/lio_main.c | 23 ++------------------ drivers/net/ethernet/cavium/liquidio/lio_vf_main.c | 25 +++------------------- .../net/ethernet/cavium/liquidio/octeon_network.h | 19 ++++++++++++++++ 3 files changed, 24 insertions(+), 43 deletions(-)
drivers/net/ethernet/cavium/liquidio/lio_main.c +2 -21
@@ -542,25 +542,6 @@ static inline int check_txq_status(struct lio *lio) }/** -* Remove the node at the head of the list. The list would be empty at -* the end of this call if there are no more nodes in the list. -*/ -static inline struct list_head *list_delete_head (struct list_head *root) -{ -struct list_head *node; - -if ((root->prev == root) && (root->next == root)) - node =NULL ; -else - node = root->next; - -if (node) -list_del (node); - -return node; -} - -/** * \brief Delete gather lists * @param lio per-network private data */
@@ -578,7 +559,7 @@ static void delete_glists(struct lio *lio)for (i =0 ; i < lio->linfo.num_txpciq; i++) {do { g = (struct octnic_gather *) -list_delete_head (&lio->glist[i]); +lio_list_delete_head (&lio->glist[i]);if (g)kfree (g); }while (g);
@@ -2570,7 +2551,7 @@ static int liquidio_xmit(struct sk_buff *skb, struct net_device *netdev)spin_lock (&lio->glist_lock[q_idx]); g = (struct octnic_gather *) -list_delete_head (&lio->glist[q_idx]); +lio_list_delete_head (&lio->glist[q_idx]);spin_unlock (&lio->glist_lock[q_idx]);if (!g) {
drivers/net/ethernet/cavium/liquidio/lio_vf_main.c +3 -22
@@ -285,25 +285,6 @@ static struct pci_driver liquidio_vf_pci_driver = { };/** -* Remove the node at the head of the list. The list would be empty at -* the end of this call if there are no more nodes in the list. -*/ -static struct list_head *list_delete_head (struct list_head *root) -{ -struct list_head *node; - -if ((root->prev == root) && (root->next == root)) - node =NULL ; -else - node = root->next; - -if (node) -list_del (node); - -return node; -} - -/** * \brief Delete gather lists * @param lio per-network private data */
@@ -321,7 +302,7 @@ static void delete_glists(struct lio *lio)for (i =0 ; i < lio->linfo.num_txpciq; i++) {do { g = (struct octnic_gather *) -list_delete_head (&lio->glist[i]); +lio_list_delete_head (&lio->glist[i]);kfree (g); }while (g);
@@ -1629,8 +1610,8 @@ static int liquidio_xmit(struct sk_buff *skb, struct net_device *netdev)int i, frags;spin_lock (&lio->glist_lock[q_idx]); - g = (struct octnic_gather *)list_delete_head ( - &lio->glist[q_idx]); + g = (struct octnic_gather *) +lio_list_delete_head (&lio->glist[q_idx]);spin_unlock (&lio->glist_lock[q_idx]);if (!g) {
drivers/net/ethernet/cavium/liquidio/octeon_network.h +19 -0
@@ -563,4 +563,23 @@ static inline int skb_iq(struct lio *lio, struct sk_buff *skb) return skb->queue_mapping % lio->linfo.num_txpciq; } +/** +* Remove the node at the head of the list. The list would be empty at +* the end of this call if there are no more nodes in the list. +*/ +static inline struct list_head *lio_list_delete_head (struct list_head *root) +{ +struct list_head *node; + +if (root->prev == root && root->next == root) + node =NULL ; +else + node = root->next; + +if (node) +list_del (node); + +return node; +} +#endif
Signature · 1 line
2.9.0
PATCH v2 3/6 liquidio: Moved common function delete_glists to lio_core.c
In reply to Felix ManlunasFrom: Intiyaz Basha <[email protected]>
Moved common function delete_glists to lio_core.c and renamed it to lio_delete_glists
--- drivers/net/ethernet/cavium/liquidio/lio_core.c | 41 ++++++++++++++++++ drivers/net/ethernet/cavium/liquidio/lio_main.c | 50 ++-------------------- drivers/net/ethernet/cavium/liquidio/lio_vf_main.c | 49 ++------------------- .../net/ethernet/cavium/liquidio/octeon_network.h | 2 + 4 files changed, 51 insertions(+), 91 deletions(-)
drivers/net/ethernet/cavium/liquidio/lio_core.c +41 -0
@@ -61,6 +61,47 @@ void lio_if_cfg_callback(struct octeon_device *oct,wake_up_interruptible (&ctx->wc); } +/** +* \brief Delete gather lists +* @param lio per-network private data +*/ +void lio_delete_glists (struct lio *lio) +{ +struct octnic_gather *g; +int i; + +kfree (lio->glist_lock); + lio->glist_lock =NULL ; + +if (!lio->glist) +return ; + +for (i =0 ; i < lio->linfo.num_txpciq; i++) { +do { + g = (struct octnic_gather *) +lio_list_delete_head (&lio->glist[i]); +kfree (g); + }while (g); + +if (lio->glists_virt_base && lio->glists_virt_base[i] && + lio->glists_dma_base && lio->glists_dma_base[i]) { +lio_dma_free (lio->oct_dev, + lio->glist_entry_size * lio->tx_qsize, + lio->glists_virt_base[i], + lio->glists_dma_base[i]); + } + } + +kfree (lio->glists_virt_base); + lio->glists_virt_base =NULL ; + +kfree (lio->glists_dma_base); + lio->glists_dma_base =NULL ; + +kfree (lio->glist); + lio->glist =NULL ; +} +int liquidio_set_feature (struct net_device *netdev,int cmd,u16 param1) {struct lio *lio =GET_LIO (netdev);
drivers/net/ethernet/cavium/liquidio/lio_main.c +4 -46
80 lines not on this page · raw message
drivers/net/ethernet/cavium/liquidio/lio_vf_main.c +4 -45
79 lines not on this page · raw message
drivers/net/ethernet/cavium/liquidio/octeon_network.h +2 -0
@@ -201,6 +201,8 @@ void lio_if_cfg_callback(struct octeon_device *oct, u32 status __attribute__((unused)), void *buf); +void lio_delete_glists (struct lio *lio); +/** * \brief Net device change_mtu * @param netdev network device
Signature · 1 line
2.9.0
PATCH v2 4/6 liquidio: Moved common definition octnic_gather to octeon_network.h
In reply to Felix ManlunasFrom: Intiyaz Basha <[email protected]>
Moving common definition octnic_gather to octeon_network.h
--- drivers/net/ethernet/cavium/liquidio/lio_main.c | 21 --------------------- drivers/net/ethernet/cavium/liquidio/lio_vf_main.c | 18 ------------------ .../net/ethernet/cavium/liquidio/octeon_network.h | 21 +++++++++++++++++++++ 3 files changed, 21 insertions(+), 39 deletions(-)
drivers/net/ethernet/cavium/liquidio/lio_main.c +0 -21
@@ -144,27 +144,6 @@ union tx_info {#define OCTNIC_GSO_MAX_SIZE \ (CN23XX_DEFAULT_INPUT_JABBER - OCTNIC_GSO_MAX_HEADER_SIZE) -/** Structure of a node in list of gather components maintained by -* NIC driver for each network device. -*/ -struct octnic_gather { -/** List manipulation. Next and prev pointers. */ -struct list_head list; - -/** Size of the gather component at sg in bytes. */ -int sg_size; - -/** Number of bytes that sg was adjusted to make it 8B-aligned. */ -int adjust; - -/** Gather component that can accommodate max sized fragment list -* received from the IP layer. -*/ -struct octeon_sg_entry *sg; - -dma_addr_t sg_dma_ptr; -}; -struct handshake {struct completion init;struct completion started;
drivers/net/ethernet/cavium/liquidio/lio_vf_main.c +0 -18
@@ -75,24 +75,6 @@ union tx_info {#define OCTNIC_GSO_MAX_SIZE \ (CN23XX_DEFAULT_INPUT_JABBER - OCTNIC_GSO_MAX_HEADER_SIZE) -struct octnic_gather { -/* List manipulation. Next and prev pointers. */ -struct list_head list; - -/* Size of the gather component at sg in bytes. */ -int sg_size; - -/* Number of bytes that sg was adjusted to make it 8B-aligned. */ -int adjust; - -/* Gather component that can accommodate max sized fragment list -* received from the IP layer. -*/ -struct octeon_sg_entry *sg; - -dma_addr_t sg_dma_ptr; -}; -static int liquidio_vf_probe (struct pci_dev *pdev,const struct pci_device_id *ent);static void liquidio_vf_remove (struct pci_dev *pdev);
drivers/net/ethernet/cavium/liquidio/octeon_network.h +21 -0
@@ -47,6 +47,27 @@ struct liquidio_if_cfg_resp {u64 status; }; +/* Structure of a node in list of gather components maintained by +* NIC driver for each network device. +*/ +struct octnic_gather { +/* List manipulation. Next and prev pointers. */ +struct list_head list; + +/* Size of the gather component at sg in bytes. */ +int sg_size; + +/* Number of bytes that sg was adjusted to make it 8B-aligned. */ +int adjust; + +/* Gather component that can accommodate max sized fragment list +* received from the IP layer. +*/ +struct octeon_sg_entry *sg; + +dma_addr_t sg_dma_ptr; +}; +struct oct_nic_stats_resp {u64 rh;struct oct_link_stats stats;
Signature · 1 line
2.9.0
PATCH v2 5/6 liquidio: Moved common function setup_glists to lio_core.c
In reply to Felix ManlunasFrom: Intiyaz Basha <[email protected]>
Moved common function setup_glists to lio_core.c and reamed it to lio_setup_glists
--- drivers/net/ethernet/cavium/liquidio/lio_core.c | 83 +++++++++++++++++++++ drivers/net/ethernet/cavium/liquidio/lio_main.c | 85 +--------------------- drivers/net/ethernet/cavium/liquidio/lio_vf_main.c | 80 +------------------- .../net/ethernet/cavium/liquidio/octeon_network.h | 2 + 4 files changed, 87 insertions(+), 163 deletions(-)
drivers/net/ethernet/cavium/liquidio/lio_core.c +83 -0
@@ -29,6 +29,8 @@/* OOM task polling interval */ #define LIO_OOM_POLL_INTERVAL_MS 250 +#define OCTNIC_MAX_SG MAX_SKB_FRAGS +/** * \brief Callback for getting interface configuration * @param status status of request
@@ -102,6 +104,87 @@ void lio_delete_glists(struct lio *lio) lio->glist =NULL ; } +/** +* \brief Setup gather lists +* @param lio per-network private data +*/ +int lio_setup_glists (struct octeon_device *oct,struct lio *lio,int num_iqs) +{ +struct octnic_gather *g; +int i, j; + + lio->glist_lock = +kcalloc (num_iqs,sizeof (*lio->glist_lock),GFP_KERNEL ); +if (!lio->glist_lock) +return -ENOMEM ; + + lio->glist = +kcalloc (num_iqs,sizeof (*lio->glist),GFP_KERNEL ); +if (!lio->glist) { +kfree (lio->glist_lock); + lio->glist_lock =NULL ; +return -ENOMEM ; + } + + lio->glist_entry_size = +ROUNDUP8 ((ROUNDUP4 (OCTNIC_MAX_SG ) >>2 ) *OCT_SG_ENTRY_SIZE ); + +/* allocate memory to store virtual and dma base address of +* per glist consistent memory +*/ + lio->glists_virt_base =kcalloc (num_iqs,sizeof (*lio->glists_virt_base), +GFP_KERNEL ); + lio->glists_dma_base =kcalloc (num_iqs,sizeof (*lio->glists_dma_base), +GFP_KERNEL ); + +if (!lio->glists_virt_base || !lio->glists_dma_base) { +lio_delete_glists (lio); +return -ENOMEM ; + } + +for (i =0 ; i < num_iqs; i++) { +int numa_node =dev_to_node (&oct->pci_dev->dev); + +spin_lock_init (&lio->glist_lock[i]); + +INIT_LIST_HEAD (&lio->glist[i]); + + lio->glists_virt_base[i] = +lio_dma_alloc (oct, + lio->glist_entry_size * lio->tx_qsize, + &lio->glists_dma_base[i]); + +if (!lio->glists_virt_base[i]) { +lio_delete_glists (lio); +return -ENOMEM ; + } + +for (j =0 ; j < lio->tx_qsize; j++) { + g =kzalloc_node (sizeof (*g),GFP_KERNEL , + numa_node); +if (!g) + g =kzalloc (sizeof (*g),GFP_KERNEL ); +if (!g) +break ; + + g->sg = lio->glists_virt_base[i] + + (j * lio->glist_entry_size); + + g->sg_dma_ptr = lio->glists_dma_base[i] + + (j * lio->glist_entry_size); + +list_add_tail (&g->list, &lio->glist[i]); + } + +if (j != lio->tx_qsize) { +lio_delete_glists (lio); +return -ENOMEM ; + } + } + +return 0 ; +} +int liquidio_set_feature (struct net_device *netdev,int cmd,u16 param1) {struct lio *lio =GET_LIO (netdev);
drivers/net/ethernet/cavium/liquidio/lio_main.c +1 -84
103 lines not on this page · raw message
drivers/net/ethernet/cavium/liquidio/lio_vf_main.c +1 -79
98 lines not on this page · raw message
drivers/net/ethernet/cavium/liquidio/octeon_network.h +2 -0
@@ -224,6 +224,8 @@ void lio_if_cfg_callback(struct octeon_device *oct,void lio_delete_glists (struct lio *lio); +int lio_setup_glists (struct octeon_device *oct,struct lio *lio,int num_qs); +/** * \brief Net device change_mtu * @param netdev network device
Signature · 1 line
2.9.0
PATCH v2 6/6 liquidio: enhanced ethtool --set-channels feature
In reply to Felix ManlunasFrom: Intiyaz Basha <[email protected]>
Enhancing driver to accept max supported queues for ethtool --set-channels
--- .../ethernet/cavium/liquidio/cn23xx_pf_device.c | 6 +- .../ethernet/cavium/liquidio/cn23xx_pf_device.h | 2 + drivers/net/ethernet/cavium/liquidio/lio_core.c | 4 +- drivers/net/ethernet/cavium/liquidio/lio_ethtool.c | 263 +++++++++++++++++++-- drivers/net/ethernet/cavium/liquidio/lio_main.c | 64 +++-- drivers/net/ethernet/cavium/liquidio/lio_vf_main.c | 8 +- .../net/ethernet/cavium/liquidio/liquidio_common.h | 1 + .../net/ethernet/cavium/liquidio/octeon_device.c | 12 +- .../net/ethernet/cavium/liquidio/octeon_device.h | 2 +- .../net/ethernet/cavium/liquidio/octeon_network.h | 12 +- 10 files changed, 316 insertions(+), 58 deletions(-)
drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c +3 -3
@@ -1245,7 +1245,7 @@ static void cn23xx_setup_reg_address(struct octeon_device *oct)CN23XX_SLI_MAC_PF_INT_ENB64 (oct->pcie_port, oct->pf_num); } -static int cn23xx_sriov_config (struct octeon_device *oct) +int cn23xx_sriov_config (struct octeon_device *oct) {struct octeon_cn23xx_pf *cn23xx = (struct octeon_cn23xx_pf *)oct->chip;u32 max_rings, total_rings, max_vfs, rings_per_vf;
@@ -1269,8 +1269,8 @@ static int cn23xx_sriov_config(struct octeon_device *oct)break ; } -if (max_rings <=num_present_cpus ()) - num_pf_rings =1 ; +if (oct->sriov_info.num_pf_rings) + num_pf_rings = oct->sriov_info.num_pf_rings;else num_pf_rings =num_present_cpus ();
drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.h +2 -0
@@ -61,6 +61,8 @@ u32 cn23xx_pf_get_oq_ticks(struct octeon_device *oct, u32 time_intr_in_us);void cn23xx_dump_pf_initialized_regs (struct octeon_device *oct); +int cn23xx_sriov_config (struct octeon_device *oct); +int cn23xx_fw_loaded (struct octeon_device *oct); void cn23xx_tell_vf_its_macaddr_changed(struct octeon_device *oct, int vfidx,
drivers/net/ethernet/cavium/liquidio/lio_core.c +2 -2
@@ -78,7 +78,7 @@ void lio_delete_glists(struct lio *lio)if (!lio->glist)return ; -for (i =0 ; i < lio->linfo.num_txpciq; i++) { +for (i =0 ; i < lio->oct_dev->num_iqs; i++) { do { g = (struct octnic_gather *) lio_list_delete_head(&lio->glist[i]);
@@ -1036,8 +1036,8 @@ int octeon_setup_interrupt(struct octeon_device *oct, u32 num_ioqs)int num_ioq_vectors;int irqret, err; - oct->num_msix_irqs = num_ioqs;if (oct->msix_on) { + oct->num_msix_irqs = num_ioqs;if (OCTEON_CN23XX_PF (oct)) { num_interrupts =MAX_IOQ_INTERRUPTS_PER_PF +1 ;
drivers/net/ethernet/cavium/liquidio/lio_ethtool.c +245 -18
334 lines not on this page · raw message
drivers/net/ethernet/cavium/liquidio/lio_main.c +47 -17
141 lines not on this page · raw message
drivers/net/ethernet/cavium/liquidio/lio_vf_main.c +4 -4
@@ -849,7 +849,7 @@ static void free_netsgbuf(void *buf) i++; } - iq =skb_iq (lio, skb); + iq =skb_iq (lio->oct_dev, skb);spin_lock (&lio->glist_lock[iq]);list_add_tail (&g->list, &lio->glist[iq]);
@@ -893,7 +893,7 @@ static void free_netsgbuf_with_resp(void *buf) i++; } - iq =skb_iq (lio, skb); + iq =skb_iq (lio->oct_dev, skb);spin_lock (&lio->glist_lock[iq]);list_add_tail (&g->list, &lio->glist[iq]);
@@ -1392,7 +1392,7 @@ static int liquidio_xmit(struct sk_buff *skb, struct net_device *netdev) lio =GET_LIO (netdev); oct = lio->oct_dev; - q_idx =skb_iq (lio, skb); + q_idx =skb_iq (lio->oct_dev, skb); tag = q_idx; iq_no = lio->linfo.txpciq[q_idx].s.q_no;
@@ -2324,7 +2324,7 @@ static int octeon_device_init(struct octeon_device *oct) }atomic_set (&oct->status,OCT_DEV_MBOX_SETUP_DONE ); -if (octeon_allocate_ioq_vector (oct)) { +if (octeon_allocate_ioq_vector (oct, oct->sriov_info.rings_per_vf)) {dev_err (&oct->pci_dev->dev,"ioq vector allocation failed\n" );return 1 ; }
drivers/net/ethernet/cavium/liquidio/liquidio_common.h +1 -0
@@ -84,6 +84,7 @@ enum octeon_tag_type {#define OPCODE_NIC_IF_CFG 0x09#define OPCODE_NIC_VF_DRV_NOTICE 0x0A#define OPCODE_NIC_INTRMOD_PARAMS 0x0B +#define OPCODE_NIC_QCOUNT_UPDATE 0x12#define OPCODE_NIC_SET_TRUSTED_VF 0x13#define OPCODE_NIC_SYNC_OCTEON_TIME 0x14#define VF_DRV_LOADED 1
drivers/net/ethernet/cavium/liquidio/octeon_device.c +4 -8
@@ -824,23 +824,18 @@ int octeon_deregister_device(struct octeon_device *oct) }int -octeon_allocate_ioq_vector (struct octeon_device *oct) +octeon_allocate_ioq_vector (struct octeon_device *oct,u32 num_ioqs) { -int i, num_ioqs =0 ;struct octeon_ioq_vector *ioq_vector;int cpu_num;int size; - -if (OCTEON_CN23XX_PF (oct)) - num_ioqs = oct->sriov_info.num_pf_rings; -else if (OCTEON_CN23XX_VF (oct)) - num_ioqs = oct->sriov_info.rings_per_vf; +int i; size =sizeof (struct octeon_ioq_vector ) * num_ioqs; oct->ioq_vector =vzalloc (size);if (!oct->ioq_vector) -return 1 ; +return -1 ;for (i =0 ; i < num_ioqs; i++) { ioq_vector = &oct->ioq_vector[i]; ioq_vector->oct_dev = oct;
@@ -856,6 +851,7 @@ octeon_allocate_ioq_vector(struct octeon_device *oct)else ioq_vector->ioq_num = i; } +return 0 ; }
drivers/net/ethernet/cavium/liquidio/octeon_device.h +1 -1
@@ -867,7 +867,7 @@ void *oct_get_config_info(struct octeon_device *oct, u16 card_type);struct octeon_config *octeon_get_conf (struct octeon_device *oct);void octeon_free_ioq_vector (struct octeon_device *oct); -int octeon_allocate_ioq_vector (struct octeon_device *oct); +int octeon_allocate_ioq_vector (struct octeon_device *oct,u32 num_ioqs);void lio_enable_irq (struct octeon_droq *droq,struct octeon_instr_queue *iq);/* LiquidIO driver pivate flags */
drivers/net/ethernet/cavium/liquidio/octeon_network.h +7 -5
@@ -47,6 +47,8 @@ struct liquidio_if_cfg_resp {u64 status; }; +#define LIO_IFCFG_WAIT_TIME 3000/* In milli seconds */ +/* Structure of a node in list of gather components maintained by * NIC driver for each network device. */
@@ -544,7 +546,7 @@ static inline void stop_txqs(struct net_device *netdev) {int i; -for (i =0 ; i < netdev->num_tx_queues; i++) +for (i =0 ; i < netdev->real_num_tx_queues; i++)netif_stop_subqueue (netdev, i); }
@@ -557,7 +559,7 @@ static inline void wake_txqs(struct net_device *netdev)struct lio *lio =GET_LIO (netdev);int i, qno; -for (i =0 ; i < netdev->num_tx_queues; i++) { +for (i =0 ; i < netdev->real_num_tx_queues; i++) { qno = lio->linfo.txpciq[i % lio->oct_dev->num_iqs].s.q_no;if (__netif_subqueue_stopped (netdev, i)) {
@@ -578,14 +580,14 @@ static inline void start_txqs(struct net_device *netdev)int i;if (lio->linfo.link.s.link_up) { -for (i =0 ; i < netdev->num_tx_queues; i++) +for (i =0 ; i < netdev->real_num_tx_queues; i++)netif_start_subqueue (netdev, i); } } -static inline int skb_iq (struct lio *lio,struct sk_buff *skb) +static inline int skb_iq (struct octeon_device *oct,struct sk_buff *skb) { -return skb->queue_mapping % lio->linfo.num_txpciq; +return skb->queue_mapping % oct->num_iqs; }/**
Signature · 1 line
2.9.0
David Miller
maintainerFrom: Felix Manlunas <[email protected]>
Date: Fri, 27 Apr 2018 23:32:04 -0700
Quoted 12 lines
From: Intiyaz Basha <[email protected]>
For the ethtool --set-channels feature, the liquidio driver currently accepts max combined value as the queue count configured during driver load time, where max combined count is the total count of input and output queues. This limitation is applicable only when SR-IOV is enabled, that is, when VFs are created for PF. If SR-IOV is not enabled, the driver can configure max supported (64) queues.
This series of patches are for enhancing driver to accept max supported queues for ethtool --set-channels.
Quoted 11 lines
Changes in V2:
Only patch #6 was changed to fix these Sparse warnings reported by kbuild test robot:
lio_ethtool.c:848:5: warning: symbol 'lio_23xx_reconfigure_queue_count'
was not declared. Should it be static?
lio_ethtool.c:877:22: warning: incorrect type in assignment (different
base types)
lio_ethtool.c:878:22: warning: incorrect type in assignment (different
base types)
lio_ethtool.c:879:22: warning: incorrect type in assignment (different
base types)
Series applied, thank you.