$ sudo /opt/netronome/bin/nfp-hwinfo -n 0nfp.interface=pci.0.0nfp.model=0x60120010nfp.serial=00:15:4d:12:11:05board.exec=bootloader.binuart.baud=115200preinit.setup.version=nfp-bsp-6000-b0 (59bbe8b39e4d)pcie0.type=epboard.setup.version=nfp-bsp-6000-b0 (59bbe8b39e4d)vpd=ee2:0:0x50:0x0assembly.model=starfighter1assembly.partno=AMDA0058-0012assembly.revision=05assembly.serial=15350050assembly.vendor=SMAchip.serial=xxxxxxxxxxxxxxddr0.spd=ee2:0:0x50:0xf00ddr1.spd=ee2:0:0x50:0xf00ddr2.spd=ee2:0:0x50:0xf00ddr3.spd=ee2:0:0x50:0xf00ddr4.spd=noneddr5.spd=noneemu2.type=cacheethm.mac=00:15:4d:12:11:05eth.mac=00:15:4d:12:11:06eth.macs=8ddr.speed=1866chip.model=NFP6012chip.revision=B0core.speed=1000me.speed=1200arm.speed=600chip.model.device=0x6200aa20chip.identifier=0x4679d005aachip.model.hard=0x0chip.model.soft=0x60120058chip.route=0xe51dffc8chip.island=0x3007f37003332mem.setup.version=nfp-bsp-6000-b0 (59bbe8b39e4d)
$ sudo /opt/netronome/bin/nfp-phymod -n 0phy0: NBI0.0(4) "0" QSFP conn:No separable [40GBASE-CR4] "Fiberstore" "Q-4SPC03" "A7841600002" oui:0x93a type:0x28 len:3m active:0 cc:0 eth0: NBI0.0(1) "0.0" 00:15:4d:12:11:06 10G Down Bootable Link Fault: RX_BASE RX_BLOCK eth2: NBI0.1(1) "0.1" 00:15:4d:12:11:08 10G Down Link Fault: RX_BASE RX_BLOCK RX_DISABLE eth3: NBI0.2(1) "0.2" 00:15:4d:12:11:09 10G Up eth4: NBI0.3(1) "0.3" 00:15:4d:12:11:0a 10G Upphy1: NBI0.4(4) "1" QSFP conn:No separable [40GBASE-CR4] "Fiberstore" "Q-4SPC03" "A7841600003" oui:0x93a type:0x28 len:3m active:0 cc:0 eth1: NBI0.4(1) "1.0" 00:15:4d:12:11:07 10G Down Link Fault: RX_BASE RX_BLOCK eth5: NBI0.5(1) "1.1" 00:15:4d:12:11:0b 10G Down Link Fault: RX_BASE RX_BLOCK RX_DISABLE eth6: NBI0.6(1) "1.2" 00:15:4d:12:11:0c 10G Up eth7: NBI0.7(1) "1.3" 00:15:4d:12:11:0d 10G Up
int main(void) { __gpr struct pkt_ms_info msi; __addr40 char *pbuf; __xread struct nbi_meta_catamaran nbi_meta; __xread struct nbi_meta_pkt_info *pi = &nbi_meta.pkt_info;
__gpr enum PKT_CTM_SIZE ctm_buf_size; __xread pkt_status_t pkt_status; __gpr int in_port, out_port, pkt_off;
__mem struct pkt_hdr *pkt_hdr;
// test code execution on MEs WRITE_MAILBOX_2(0xa);
for (;;) { /* Receive a packet */ pkt_nbi_recv(&nbi_meta, sizeof(nbi_meta)); in_port = MAC_TO_PORT(nbi_meta.port); pbuf = pkt_ctm_ptr40(pi->isl, pi->pnum, 0); pkt_hdr = pkt_ctm_ptr40(pi->isl, pi->pnum, PKT_NBI_OFFSET);
WRITE_MAILBOX_0(READ_MAILBOX_0()+1); // packet-counter WRITE_MAILBOX_1(0xf0 | in_port); // write receiving port
/* Send the packet */
/* Write the MAC egress CMD and adjust offset and len accordingly */ pkt_off = PKT_NBI_OFFSET + MAC_PREPEND_BYTES; pkt_mac_egress_cmd_write(pbuf, pkt_off, 1, 1);
pkt_off -= 4; msi = pkt_msd_write(pbuf, pkt_off);
pkt_nbi_send(pi->isl, pi->pnum, &msi, pi->len - MAC_PREPEND_BYTES + 4, NBI, PORT_TO_TMQ(out_port), nbi_meta.seqr, nbi_meta.seq, PKT_CTM_SIZE_256); }
return 0;}
Non-qualified Direct Attach Copper - Fiberstore Q-4SPC03 Using: 3m_GENERIC 3m
#define MAC_CHAN_PER_PORT 8#define TMQ_PER_PORT (MAC_CHAN_PER_PORT * 8)
#define MAC_TO_PORT(x) (x / MAC_CHAN_PER_PORT)#define PORT_TO_TMQ(x) (x * TMQ_PER_PORT)
correction: I didn't adapt the untagged_chan value. See the attached file.
Now I get mappings of 3,2,7,6 for 4 connected cables. I'll do more tests later...
I saw you got similar error:Non-qualified Direct Attach Copper - OEM SFP-H10GB-CU3M Using: 3m_GENERIC 3m
"cluster0": {
"start_q":0,
"end_q":31,
"q_enable":true,
"q_drop_enable":true,
"q_size":16, <--- why 16 and not 32 ???
Is 12x10GE correct? The breakout cable provides only 8x10GE ports or is it just the old filename?
I want to implement packet broadcasting, e.g. ARP Requests. P4 provided instructions for cloning. I could not find micro-c functions that handle cloning. Am I required to generate a packet for each output port separately and copy the packet-data to each one or is there a more convenient solution?
Second question: What is the exact purpose of PKT_NBI_OFFSET = 64?
thanks for the code, works fine.
Is there a way to set the size of the MU buffer or what's the limit?