Skip to content

Commit

Permalink
fix for af_pkt
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Du <[email protected]>
  • Loading branch information
frankdjx committed Oct 9, 2023
1 parent 3fe2053 commit 56d1f21
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/src/mt_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ struct mt_tx_queue {
#define MT_DRV_F_USE_KERNEL_CTL (MTL_BIT64(4))
/* no priv for the mbuf in the rx queue */
#define MT_DRV_F_RX_POOL_COMMON (MTL_BIT64(5))
/* no rx flow, for MTL_PMD_DPDK_AF_PACKET and MTL_PMD_DPDK_AF_PACKET */
/* no rx flow, for MTL_PMD_DPDK_AF_PACKET and MTL_PMD_KERNEL_SOCKET */
#define MT_DRV_F_RX_NO_FLOW (MTL_BIT64(6))
/* mcast control in data path, for MTL_PMD_KERNEL_SOCKET */
#define MT_DRV_F_MCAST_IN_DP (MTL_BIT64(7))
Expand Down
6 changes: 3 additions & 3 deletions lib/src/mt_ptp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,7 @@ static int ptp_init(struct mtl_main_impl* impl, struct mt_ptp_impl* ptp,
memcpy(&id[3], &magic, 2);
memcpy(&id[5], &mac.addr_bytes[3], 3);
our_port_id->port_number = htons(port_id); // now always
// ptp_print_port_id(port_id, our_port_id);
ptp_print_port_id(port_id, our_port_id);

rte_memcpy(ip, mt_sip_addr(impl, port), MTL_IP_ADDR_LEN);

Expand Down Expand Up @@ -1146,7 +1146,7 @@ static int ptp_init(struct mtl_main_impl* impl, struct mt_ptp_impl* ptp,

inet_pton(AF_INET, "224.0.1.129", ptp->mcast_group_addr);

if (mt_has_cni(impl, port)) {
if (mt_has_cni(impl, port) && !mt_drv_kernel_based(impl, port)) {
/* join mcast only if cni path, no cni use socket which has mcast in the data path */
ret = mt_mcast_join(impl, mt_ip_to_u32(ptp->mcast_group_addr), port);
if (ret < 0) {
Expand Down Expand Up @@ -1213,7 +1213,7 @@ static int ptp_uinit(struct mtl_main_impl* impl, struct mt_ptp_impl* ptp) {

if (!ptp->active) return 0;

if (mt_has_cni(impl, port)) {
if (mt_has_cni(impl, port) && !mt_drv_kernel_based(impl, port)) {
mt_mcast_l2_leave(impl, &ptp_l2_multicast_eaddr, port);
mt_mcast_leave(impl, mt_ip_to_u32(ptp->mcast_group_addr), port);
}
Expand Down

0 comments on commit 56d1f21

Please sign in to comment.