Commit 2408022e authored by David S. Miller's avatar David S. Miller

Merge branch 'liqudio-VF-data-path'

Raghu Vatsavayi says:

====================
liquidio VF data path

Following is V3 patch series that adds support for VF
data path related features. It also has following changes
related to previous comments:
1) Remove unnecessary "void *" casting.
2) Remove inline for functions and let gcc decide.

Please apply patches in following order as some of them
depend on earlier patches.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 13bfff25 9217c3cf
...@@ -529,6 +529,26 @@ static u64 cn23xx_vf_msix_interrupt_handler(void *dev) ...@@ -529,6 +529,26 @@ static u64 cn23xx_vf_msix_interrupt_handler(void *dev)
return ret; return ret;
} }
static u32 cn23xx_update_read_index(struct octeon_instr_queue *iq)
{
u32 pkt_in_done = readl(iq->inst_cnt_reg);
u32 last_done;
u32 new_idx;
last_done = pkt_in_done - iq->pkt_in_done;
iq->pkt_in_done = pkt_in_done;
/* Modulo of the new index with the IQ size will give us
* the new index. The iq->reset_instr_cnt is always zero for
* cn23xx, so no extra adjustments are needed.
*/
new_idx = (iq->octeon_read_index +
(u32)(last_done & CN23XX_PKT_IN_DONE_CNT_MASK)) %
iq->max_count;
return new_idx;
}
static void cn23xx_enable_vf_interrupt(struct octeon_device *oct, u8 intr_flag) static void cn23xx_enable_vf_interrupt(struct octeon_device *oct, u8 intr_flag)
{ {
struct octeon_cn23xx_vf *cn23xx = (struct octeon_cn23xx_vf *)oct->chip; struct octeon_cn23xx_vf *cn23xx = (struct octeon_cn23xx_vf *)oct->chip;
...@@ -660,6 +680,7 @@ int cn23xx_setup_octeon_vf_device(struct octeon_device *oct) ...@@ -660,6 +680,7 @@ int cn23xx_setup_octeon_vf_device(struct octeon_device *oct)
oct->fn_list.msix_interrupt_handler = cn23xx_vf_msix_interrupt_handler; oct->fn_list.msix_interrupt_handler = cn23xx_vf_msix_interrupt_handler;
oct->fn_list.setup_device_regs = cn23xx_setup_vf_device_regs; oct->fn_list.setup_device_regs = cn23xx_setup_vf_device_regs;
oct->fn_list.update_iq_read_idx = cn23xx_update_read_index;
oct->fn_list.enable_interrupt = cn23xx_enable_vf_interrupt; oct->fn_list.enable_interrupt = cn23xx_enable_vf_interrupt;
oct->fn_list.disable_interrupt = cn23xx_disable_vf_interrupt; oct->fn_list.disable_interrupt = cn23xx_disable_vf_interrupt;
......
...@@ -212,6 +212,7 @@ static inline void add_sg_size(struct octeon_sg_entry *sg_entry, ...@@ -212,6 +212,7 @@ static inline void add_sg_size(struct octeon_sg_entry *sg_entry,
#define OCTNET_CMD_ID_ACTIVE 0x1a #define OCTNET_CMD_ID_ACTIVE 0x1a
#define OCTNET_CMD_SET_UC_LIST 0x1b
#define OCTNET_CMD_SET_VF_LINKSTATE 0x1c #define OCTNET_CMD_SET_VF_LINKSTATE 0x1c
#define OCTNET_CMD_VXLAN_PORT_ADD 0x0 #define OCTNET_CMD_VXLAN_PORT_ADD 0x0
#define OCTNET_CMD_VXLAN_PORT_DEL 0x1 #define OCTNET_CMD_VXLAN_PORT_DEL 0x1
......
...@@ -1221,6 +1221,9 @@ struct octeon_config *octeon_get_conf(struct octeon_device *oct) ...@@ -1221,6 +1221,9 @@ struct octeon_config *octeon_get_conf(struct octeon_device *oct)
} else if (OCTEON_CN23XX_PF(oct)) { } else if (OCTEON_CN23XX_PF(oct)) {
default_oct_conf = (struct octeon_config *) default_oct_conf = (struct octeon_config *)
(CHIP_CONF(oct, cn23xx_pf)); (CHIP_CONF(oct, cn23xx_pf));
} else if (OCTEON_CN23XX_VF(oct)) {
default_oct_conf = (struct octeon_config *)
(CHIP_CONF(oct, cn23xx_vf));
} }
return default_oct_conf; return default_oct_conf;
} }
...@@ -1371,7 +1374,7 @@ void lio_enable_irq(struct octeon_droq *droq, struct octeon_instr_queue *iq) ...@@ -1371,7 +1374,7 @@ void lio_enable_irq(struct octeon_droq *droq, struct octeon_instr_queue *iq)
/*write resend. Writing RESEND in SLI_PKTX_CNTS should be enough /*write resend. Writing RESEND in SLI_PKTX_CNTS should be enough
*to trigger tx interrupts as well, if they are pending. *to trigger tx interrupts as well, if they are pending.
*/ */
if (oct && OCTEON_CN23XX_PF(oct)) { if (oct && (OCTEON_CN23XX_PF(oct) || OCTEON_CN23XX_VF(oct))) {
if (droq) if (droq)
writeq(CN23XX_INTR_RESEND, droq->pkts_sent_reg); writeq(CN23XX_INTR_RESEND, droq->pkts_sent_reg);
/*we race with firmrware here. read and write the IN_DONE_CNTS*/ /*we race with firmrware here. read and write the IN_DONE_CNTS*/
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "cn66xx_regs.h" #include "cn66xx_regs.h"
#include "cn66xx_device.h" #include "cn66xx_device.h"
#include "cn23xx_pf_device.h" #include "cn23xx_pf_device.h"
#include "cn23xx_vf_device.h"
struct niclist { struct niclist {
struct list_head list; struct list_head list;
...@@ -259,6 +260,11 @@ int octeon_init_droq(struct octeon_device *oct, ...@@ -259,6 +260,11 @@ int octeon_init_droq(struct octeon_device *oct,
} else if (OCTEON_CN23XX_PF(oct)) { } else if (OCTEON_CN23XX_PF(oct)) {
struct octeon_config *conf23 = CHIP_CONF(oct, cn23xx_pf); struct octeon_config *conf23 = CHIP_CONF(oct, cn23xx_pf);
c_pkts_per_intr = (u32)CFG_GET_OQ_PKTS_PER_INTR(conf23);
c_refill_threshold = (u32)CFG_GET_OQ_REFILL_THRESHOLD(conf23);
} else if (OCTEON_CN23XX_VF(oct)) {
struct octeon_config *conf23 = CHIP_CONF(oct, cn23xx_vf);
c_pkts_per_intr = (u32)CFG_GET_OQ_PKTS_PER_INTR(conf23); c_pkts_per_intr = (u32)CFG_GET_OQ_PKTS_PER_INTR(conf23);
c_refill_threshold = (u32)CFG_GET_OQ_REFILL_THRESHOLD(conf23); c_refill_threshold = (u32)CFG_GET_OQ_REFILL_THRESHOLD(conf23);
} else { } else {
...@@ -889,6 +895,10 @@ octeon_process_droq_poll_cmd(struct octeon_device *oct, u32 q_no, int cmd, ...@@ -889,6 +895,10 @@ octeon_process_droq_poll_cmd(struct octeon_device *oct, u32 q_no, int cmd,
lio_enable_irq(oct->droq[q_no], oct->instr_queue[q_no]); lio_enable_irq(oct->droq[q_no], oct->instr_queue[q_no]);
} }
break; break;
case OCTEON_CN23XX_VF_VID:
lio_enable_irq(oct->droq[q_no], oct->instr_queue[q_no]);
break;
} }
return 0; return 0;
} }
......
...@@ -123,6 +123,7 @@ struct lio { ...@@ -123,6 +123,7 @@ struct lio {
/* work queue for link status */ /* work queue for link status */
struct cavium_wq link_status_wq; struct cavium_wq link_status_wq;
int netdev_uc_count;
}; };
#define LIO_SIZE (sizeof(struct lio)) #define LIO_SIZE (sizeof(struct lio))
......
...@@ -394,7 +394,7 @@ lio_process_iq_request_list(struct octeon_device *oct, ...@@ -394,7 +394,7 @@ lio_process_iq_request_list(struct octeon_device *oct,
case REQTYPE_SOFT_COMMAND: case REQTYPE_SOFT_COMMAND:
sc = buf; sc = buf;
if (OCTEON_CN23XX_PF(oct)) if (OCTEON_CN23XX_PF(oct) || OCTEON_CN23XX_VF(oct))
irh = (struct octeon_instr_irh *) irh = (struct octeon_instr_irh *)
&sc->cmd.cmd3.irh; &sc->cmd.cmd3.irh;
else else
...@@ -607,7 +607,7 @@ octeon_prepare_soft_command(struct octeon_device *oct, ...@@ -607,7 +607,7 @@ octeon_prepare_soft_command(struct octeon_device *oct,
oct_cfg = octeon_get_conf(oct); oct_cfg = octeon_get_conf(oct);
if (OCTEON_CN23XX_PF(oct)) { if (OCTEON_CN23XX_PF(oct) || OCTEON_CN23XX_VF(oct)) {
ih3 = (struct octeon_instr_ih3 *)&sc->cmd.cmd3.ih3; ih3 = (struct octeon_instr_ih3 *)&sc->cmd.cmd3.ih3;
ih3->pkind = oct->instr_queue[sc->iq_no]->txpciq.s.pkind; ih3->pkind = oct->instr_queue[sc->iq_no]->txpciq.s.pkind;
...@@ -700,7 +700,7 @@ int octeon_send_soft_command(struct octeon_device *oct, ...@@ -700,7 +700,7 @@ int octeon_send_soft_command(struct octeon_device *oct,
struct octeon_instr_irh *irh; struct octeon_instr_irh *irh;
u32 len; u32 len;
if (OCTEON_CN23XX_PF(oct)) { if (OCTEON_CN23XX_PF(oct) || OCTEON_CN23XX_VF(oct)) {
ih3 = (struct octeon_instr_ih3 *)&sc->cmd.cmd3.ih3; ih3 = (struct octeon_instr_ih3 *)&sc->cmd.cmd3.ih3;
if (ih3->dlengsz) { if (ih3->dlengsz) {
WARN_ON(!sc->dmadptr); WARN_ON(!sc->dmadptr);
......
...@@ -84,7 +84,8 @@ int lio_process_ordered_list(struct octeon_device *octeon_dev, ...@@ -84,7 +84,8 @@ int lio_process_ordered_list(struct octeon_device *octeon_dev,
sc = (struct octeon_soft_command *)ordered_sc_list-> sc = (struct octeon_soft_command *)ordered_sc_list->
head.next; head.next;
if (OCTEON_CN23XX_PF(octeon_dev)) { if (OCTEON_CN23XX_PF(octeon_dev) ||
OCTEON_CN23XX_VF(octeon_dev)) {
rdp = (struct octeon_instr_rdp *)&sc->cmd.cmd3.rdp; rdp = (struct octeon_instr_rdp *)&sc->cmd.cmd3.rdp;
rptr = sc->cmd.cmd3.rptr; rptr = sc->cmd.cmd3.rptr;
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment