X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fpcap%2Frte_eth_pcap.c;h=8736010f0dcac3a4ba06f0ed55dd4f5388d53392;hb=15dfc1ecb39f921cac3c5d61e77cd51fa3c1eb23;hp=a015a9d48b6bb35c1209d76176b1322a7d794106;hpb=323e7b667f18376c60351282950b28d4d0cc6165;p=dpdk.git diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c index a015a9d48b..8736010f0d 100644 --- a/drivers/net/pcap/rte_eth_pcap.c +++ b/drivers/net/pcap/rte_eth_pcap.c @@ -39,6 +39,7 @@ static unsigned char tx_pcap_data[RTE_ETH_PCAP_SNAPLEN]; static struct timeval start_time; static uint64_t start_cycles; static uint64_t hz; +static uint8_t iface_idx; struct queue_stat { volatile unsigned long pkts; @@ -66,6 +67,7 @@ struct pcap_tx_queue { struct pmd_internals { struct pcap_rx_queue rx_queue[RTE_PMD_PCAP_MAX_QUEUES]; struct pcap_tx_queue tx_queue[RTE_PMD_PCAP_MAX_QUEUES]; + struct ether_addr eth_addr; int if_index; int single_iface; }; @@ -90,10 +92,6 @@ static const char *valid_arguments[] = { NULL }; -static struct ether_addr eth_addr = { - .addr_bytes = { 0, 0, 0, 0x1, 0x2, 0x3 } -}; - static struct rte_eth_link pmd_link = { .link_speed = ETH_SPEED_NUM_10G, .link_duplex = ETH_LINK_FULL_DUPLEX, @@ -888,11 +886,19 @@ pmd_init_internals(struct rte_vdev_device *vdev, * - and point eth_dev structure to new eth_dev_data structure */ *internals = (*eth_dev)->data->dev_private; + /* + * Interface MAC = 02:70:63:61:70: + * derived from: 'locally administered':'p':'c':'a':'p':'iface_idx' + * where the middle 4 characters are converted to hex. + */ + (*internals)->eth_addr = (struct ether_addr) { + .addr_bytes = { 0x02, 0x70, 0x63, 0x61, 0x70, iface_idx++ } + }; data = (*eth_dev)->data; data->nb_rx_queues = (uint16_t)nb_rx_queues; data->nb_tx_queues = (uint16_t)nb_tx_queues; data->dev_link = pmd_link; - data->mac_addrs = ð_addr; + data->mac_addrs = &(*internals)->eth_addr; /* * NOTE: we'll replace the data element, of originally allocated